summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-11-24 10:29:26 -0600
committerAndrew Fleming-AFLEMING <afleming@freescale.com>2008-12-04 03:15:43 -0600
commit9df59533f77de2829b4b66e5b7620e04edaa391c (patch)
treef14c08ad8a9aa09a1d6421e83d83f4c9a1202979 /cpu
parentaed461af81012a398a205e9be67ab37667491838 (diff)
downloadu-boot-9df59533f77de2829b4b66e5b7620e04edaa391c.tar.gz
u-boot-9df59533f77de2829b4b66e5b7620e04edaa391c.tar.bz2
u-boot-9df59533f77de2829b4b66e5b7620e04edaa391c.zip
85xx: init gd as early as possible
Moved up the initialization of GD so C code like set_tlb() can use gd->flags to determine if we've relocated or not in the future. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Andy Fleming <afleming@freescale.com>
Diffstat (limited to 'cpu')
-rw-r--r--cpu/mpc85xx/cpu_init.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/cpu/mpc85xx/cpu_init.c b/cpu/mpc85xx/cpu_init.c
index 2d86547c20..0b7c609715 100644
--- a/cpu/mpc85xx/cpu_init.c
+++ b/cpu/mpc85xx/cpu_init.c
@@ -132,6 +132,12 @@ void config_8560_ioports (volatile ccsr_cpm_t * cpm)
/* We run cpu_init_early_f in AS = 1 */
void cpu_init_early_f(void)
{
+ /* Pointer is writable since we allocated a register for it */
+ gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
+
+ /* Clear initial global data */
+ memset ((void *) gd, 0, sizeof (gd_t));
+
set_tlb(0, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
1, 0, BOOKE_PAGESZ_4K, 0);
@@ -153,12 +159,6 @@ void cpu_init_early_f(void)
}
#endif
- /* Pointer is writable since we allocated a register for it */
- gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET);
-
- /* Clear initial global data */
- memset ((void *) gd, 0, sizeof (gd_t));
-
init_laws();
invalidate_tlb(0);
init_tlbs();