From 4fa99eb575d56552ae9a1252f56e0475e3848d53 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 22 Aug 2011 08:15:25 -0600 Subject: 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 Reviewed-by: Che-Liang Chiou Reviewed-by: Anton Staaf --- lib/chromeos/boot_kernel.c | 17 ++++------------- lib/chromeos/fdt_decode.c | 12 ++++++++++++ 2 files changed, 16 insertions(+), 13 deletions(-) (limited to 'lib') 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 #include #include +#include #include #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); +} -- cgit v1.2.3