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>
This commit is contained in:
Patrick Georgi 2024-02-17 21:09:13 +01:00
parent 6270e74025
commit 7691e96ab1
3 changed files with 8 additions and 8 deletions

View File

@ -230,8 +230,8 @@ out:
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;

View File

@ -57,7 +57,7 @@ static struct param {
*/
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 @@ static struct param {
*/
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 @@ int main(int argc, char **argv)
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 @@ int main(int argc, char **argv)
}
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);

View File

@ -178,8 +178,8 @@ int parse_bzImage_to_payload(const struct buffer *input,
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,