summaryrefslogtreecommitdiff
path: root/arch/arm/lib
diff options
context:
space:
mode:
authorIgor Grinberg <grinberg@compulab.co.il>2011-08-16 23:48:23 +0000
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2011-09-03 22:40:46 +0200
commit15c2e2c0ea64a0ab10b6765e2b0ab46d99d9ac34 (patch)
treeac25b47aa971f5c10c51d4bb653b513a306fe893 /arch/arm/lib
parentb2b8f98f885c61f64aacaeb8fc4d247fbb3ae8cd (diff)
downloadu-boot-imx-15c2e2c0ea64a0ab10b6765e2b0ab46d99d9ac34.zip
u-boot-imx-15c2e2c0ea64a0ab10b6765e2b0ab46d99d9ac34.tar.gz
u-boot-imx-15c2e2c0ea64a0ab10b6765e2b0ab46d99d9ac34.tar.bz2
arm: fix bd pointer dereference prior initialization
gd->bd pointer has been used prior been initialized. Move the relevant code after the initialization. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/board.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 646cf45..c899839 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -275,10 +275,6 @@ void board_init_f(ulong bootflag)
gd->mon_len = _bss_end_ofs;
-#ifdef CONFIG_MACH_TYPE
- gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */
-#endif
-
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
if ((*init_fnc_ptr)() != 0) {
hang ();
@@ -376,6 +372,11 @@ void board_init_f(ulong bootflag)
gd->bd = bd;
debug("Reserving %zu Bytes for Board Info at: %08lx\n",
sizeof (bd_t), addr_sp);
+
+#ifdef CONFIG_MACH_TYPE
+ gd->bd->bi_arch_number = CONFIG_MACH_TYPE; /* board id for Linux */
+#endif
+
addr_sp -= sizeof (gd_t);
id = (gd_t *) addr_sp;
debug("Reserving %zu Bytes for Global Data at: %08lx\n",