diff --git a/utility/dump_kernel_config.c b/utility/dump_kernel_config.c index 7a769af734..b01aedb872 100644 --- a/utility/dump_kernel_config.c +++ b/utility/dump_kernel_config.c @@ -38,6 +38,10 @@ uint8_t* find_kernel_config(uint8_t* blob, uint64_t blob_size, return NULL; } + /* Read body_load_address from preamble if no kernel_body_load_address */ + if (kernel_body_load_address == CROS_NO_ENTRY_ADDR) + kernel_body_load_address = preamble->body_load_address; + /* The x86 kernels have a pointer to the kernel commandline in the zeropage * table, but that's irrelevant for ARM. Both types keep the config blob in * the same place, so just go find it. */ diff --git a/utility/dump_kernel_config_main.c b/utility/dump_kernel_config_main.c index 7b8f237f36..ed77f87978 100644 --- a/utility/dump_kernel_config_main.c +++ b/utility/dump_kernel_config_main.c @@ -39,7 +39,7 @@ int main(int argc, char* argv[]) { size_t blob_size; char* infile = NULL; uint8_t *config = NULL; - uint64_t kernel_body_load_address = CROS_32BIT_ENTRY_ADDR; + uint64_t kernel_body_load_address = CROS_NO_ENTRY_ADDR; int parse_error = 0; char *e; int i; diff --git a/utility/include/kernel_blob.h b/utility/include/kernel_blob.h index e8f813eb0c..5784542ead 100644 --- a/utility/include/kernel_blob.h +++ b/utility/include/kernel_blob.h @@ -17,6 +17,9 @@ // Alignment of various chunks within the kernel blob #define CROS_ALIGN 4096 +// Sentinel RAM address indicating that no entry address is specified +#define CROS_NO_ENTRY_ADDR (~0) + // RAM address where the 32-bit kernel expects to be started #define CROS_32BIT_ENTRY_ADDR 0x100000