diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chromeos/boot_kernel.c | 17 | ||||
-rw-r--r-- | lib/chromeos/fdt_decode.c | 12 |
2 files changed, 16 insertions, 13 deletions
diff --git a/lib/chromeos/boot_kernel.c b/lib/chromeos/boot_kernel.c index 4fb08ee67b..2012bea6f3 100644 --- a/lib/chromeos/boot_kernel.c +++ b/lib/chromeos/boot_kernel.c @@ -200,17 +200,6 @@ static int update_cmdline(char *src, int devnum, int partnum, uint8_t *guid, return 0; } -/* TODO Copy from tegra2-common.h so that coreboot can be built */ -#ifndef QUOTE -/* - * QUOTE(m) will evaluate to a string version of the value of the macro m - * passed in. The extra level of indirection here is to first evaluate the - * macro m before applying the quoting operator. - */ -#define QUOTE_(m) #m -#define QUOTE(m) QUOTE_(m) -#endif - int boot_kernel(VbSelectAndLoadKernelParams *kparams, crossystem_data_t *cdata) { /* sizeof(CHROMEOS_BOOTARGS) reserves extra 1 byte */ @@ -223,9 +212,11 @@ int boot_kernel(VbSelectAndLoadKernelParams *kparams, crossystem_data_t *cdata) struct boot_params *params; #else /* Chrome OS kernel has to be loaded at fixed location */ - char *argv[] = { "bootm", QUOTE(CHROMEOS_KERNEL_LOADADDR) }; + char address[20]; + char *argv[] = { "bootm", address }; + + sprintf(address, "%p", kparams->kernel_buffer); #endif - assert(kparams->kernel_buffer == (void *)CHROMEOS_KERNEL_LOADADDR); strcpy(cmdline_buf, CHROMEOS_BOOTARGS); diff --git a/lib/chromeos/fdt_decode.c b/lib/chromeos/fdt_decode.c index 9c42364209..203b10605e 100644 --- a/lib/chromeos/fdt_decode.c +++ b/lib/chromeos/fdt_decode.c @@ -13,6 +13,7 @@ #include <chromeos/common.h> #include <chromeos/fdt_decode.h> #include <chromeos/fmap.h> +#include <fdt_decode.h> #include <linux/string.h> #define PREFIX "chromeos/fdt_decode: " @@ -150,3 +151,14 @@ int fdt_decode_chromeos_config_has_prop(const void *blob, const char *name) return fdt_get_property(blob, nodeoffset, name, &len) != NULL; } + +void *fdt_decode_chromeos_alloc_region(const void *blob, + const char *prop_name, size_t *size) +{ + int node = fdt_path_offset(blob, "/chromeos-config"); + + if (node < 0) + return NULL; + + return fdt_decode_alloc_region(blob, node, prop_name, size); +} |