summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2011-08-09 09:43:40 -0700
committerSimon Glass <sjg@chromium.org>2011-08-29 10:59:32 -0700
commitb5330c3bc3e2d2240a1d79c6b084d3de0e199d95 (patch)
tree620bf00129f4ee3cc8759941de2280389ee57329 /common
parentf8dbba10ee02dd18c09d52f94c945e3201a4805b (diff)
Enable OF_CONTROL for Alex.
This change makes the Alex u-boot use configuration settings coming from the device tree supplied by coreboot through the coreboot table. The device tree now includes the necessary console configuration information. Code is added to retrieve the device tree pointer from the coreboot table, the appropriate coreboot structures and tag values are being duplicated in arch/i386/include/asm/ic/coreboot/tables.h. The pointer to the FDT is added to the global data structure, it is initialized as soon as it is retrieved from the coreboot table. For some reason placing the global data structure anywhere but in the .data segment causes the system to crash. This phenomenon will be investigated shortly, this commit is an intermediate step to get the device tree handover used by other coreboot/u-boot contributors. Core retrieving the device tree from CBFS is not needed anymore and gets removed. BUG=chrome-os-partner:5248 TEST=manual . build the new image and program it on Alex . restart the target, observe the console output The target boots all the way to u-boot prompt. Change-Id: I087cf70362ede0873be37fa5a98aa66a0b979d8f Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: http://gerrit.chromium.org/gerrit/6132 Reviewed-by: Stefan Reinauer <reinauer@google.com>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_vboot_twostop.c7
-rw-r--r--common/fdt_decode.c2
-rw-r--r--common/main.c4
3 files changed, 5 insertions, 8 deletions
diff --git a/common/cmd_vboot_twostop.c b/common/cmd_vboot_twostop.c
index 44a30b615a..7f1db7b8a2 100644
--- a/common/cmd_vboot_twostop.c
+++ b/common/cmd_vboot_twostop.c
@@ -149,7 +149,7 @@ twostop_init_cparams(struct twostop_fmap *fmap, void *gbb,
return 0;
}
-#ifdef CONFIG_OF_CONTROL
+#if defined(CONFIG_OF_CONTROL) && defined(CONFIG_TEGRA2)
static uintptr_t
get_current_sp(void)
{
@@ -163,7 +163,7 @@ get_current_sp(void)
static void
wipe_unused_memory(crossystem_data_t *cdata, VbCommonParams *cparams)
{
-#ifdef CONFIG_OF_CONTROL
+#if defined(CONFIG_OF_CONTROL) && defined(CONFIG_TEGRA2)
int fb_size, lcd_line_length;
memory_wipe_t wipe;
struct fdt_memory config;
@@ -194,9 +194,6 @@ wipe_unused_memory(crossystem_data_t *cdata, VbCommonParams *cparams)
(uintptr_t)gd->fb_base + fb_size);
memory_wipe_execute(&wipe);
-#else
- printf("wipe_unused_memory depends on fdt_decode_memory which"
- " isn't configured\n");
#endif
}
diff --git a/common/fdt_decode.c b/common/fdt_decode.c
index 666f36d309..147ef45e04 100644
--- a/common/fdt_decode.c
+++ b/common/fdt_decode.c
@@ -285,7 +285,7 @@ int fdt_decode_uart_console(const void *blob, struct fdt_uart *uart,
uart->compat = fdt_decode_lookup(blob, node);
/* Calculate divisor if required */
- if (uart->divisor == -1)
+ if ((uart->divisor == -1) && (uart->clock_freq != -1))
fdt_decode_uart_calc_divisor(uart);
return 0;
}
diff --git a/common/main.c b/common/main.c
index 2f9302dbba..6e45d39a4a 100644
--- a/common/main.c
+++ b/common/main.c
@@ -285,8 +285,8 @@ static __inline__ int abortboot(int bootdelay)
* printing the error message to console.
*/
-#ifdef CONFIG_OF_CONTROL
-
+#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0) && \
+ defined(CONFIG_OF_CONTROL)
static void secure_boot_cmd(char *cmd)
{
cmd_tbl_t *cmdtp;