diff options
author | Simon Glass <sjg@chromium.org> | 2011-08-22 08:15:25 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-09-19 13:45:37 -0700 |
commit | 4fa99eb575d56552ae9a1252f56e0475e3848d53 (patch) | |
tree | 3a1cf082c7de319eb2383583d958cbf2ca4aac2d /lib | |
parent | 2c49ec7f1be4ec51c39747805897f78626134470 (diff) |
fdt: Move Chrome OS memory areas to fdt
This moves the last remaining hard-coded CONFIG to the fdt.
BUG=chromium-os:17062
TEST=build for Seaboard
Change-Id: Ic152ce12a0f87211e4cc98eef15601f0703137b1
Reviewed-on: http://gerrit.chromium.org/gerrit/7642
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Anton Staaf <robotboy@chromium.org>
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 4fb08ee67b1..2012bea6f33 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 9c42364209b..203b10605ea 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); +} |