cbfstool: Support 64bit addresses for flat images
SELF has the fields wired up for 64bit, but adding flat images cuts the
upper half.
Change-Id: I3b48b8face921e942fb0e01eace791ad3e1669a0
Signed-off-by: Patrick Georgi <patrick@coreboot.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/80576
Reviewed-by: ron minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/util/cbfstool/cbfs-mkpayload.c b/util/cbfstool/cbfs-mkpayload.c
index 63c81a3..e9bcfba 100644
--- a/util/cbfstool/cbfs-mkpayload.c
+++ b/util/cbfstool/cbfs-mkpayload.c
@@ -230,8 +230,8 @@
int parse_flat_binary_to_payload(const struct buffer *input,
struct buffer *output,
- uint32_t loadaddress,
- uint32_t entrypoint,
+ uint64_t loadaddress,
+ uint64_t entrypoint,
enum cbfs_compression algo)
{
comp_func_ptr compress;
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index e11cfbc..88bf22b 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -57,7 +57,7 @@
*/
long long int baseaddress_input;
uint32_t baseaddress_assigned;
- uint32_t loadaddress;
+ uint64_t loadaddress;
uint32_t headeroffset;
/*
* Input can be negative. It will be transformed to offset from start of region (if
@@ -65,7 +65,7 @@
*/
long long int headeroffset_input;
uint32_t headeroffset_assigned;
- uint32_t entrypoint;
+ uint64_t entrypoint;
uint32_t size;
uint32_t alignment;
uint32_t pagesize;
@@ -2157,7 +2157,7 @@
param.baseaddress_assigned = 1;
break;
case 'l':
- param.loadaddress = strtoul(optarg, &suffix, 0);
+ param.loadaddress = strtoull(optarg, &suffix, 0);
if (!*optarg || (suffix && *suffix)) {
ERROR("Invalid load address '%s'.\n",
optarg);
@@ -2165,7 +2165,7 @@
}
break;
case 'e':
- param.entrypoint = strtoul(optarg, &suffix, 0);
+ param.entrypoint = strtoull(optarg, &suffix, 0);
if (!*optarg || (suffix && *suffix)) {
ERROR("Invalid entry point '%s'.\n",
optarg);
diff --git a/util/cbfstool/common.h b/util/cbfstool/common.h
index d39f8fb..498aae6 100644
--- a/util/cbfstool/common.h
+++ b/util/cbfstool/common.h
@@ -178,8 +178,8 @@
char *cmdline, enum cbfs_compression algo);
int parse_flat_binary_to_payload(const struct buffer *input,
struct buffer *output,
- uint32_t loadaddress,
- uint32_t entrypoint,
+ uint64_t loadaddress,
+ uint64_t entrypoint,
enum cbfs_compression algo);
/* cbfs-mkstage.c */
int parse_elf_to_stage(const struct buffer *input, struct buffer *output,