Skip to content
Snippets Groups Projects
Commit 9df59533 authored by Kumar Gala's avatar Kumar Gala Committed by Andrew Fleming-AFLEMING
Browse files

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: default avatarKumar Gala <galak@kernel.crashing.org>
Acked-by: default avatarAndy Fleming <afleming@freescale.com>
parent aed461af
No related branches found
No related tags found
No related merge requests found
...@@ -132,6 +132,12 @@ void config_8560_ioports (volatile ccsr_cpm_t * cpm) ...@@ -132,6 +132,12 @@ void config_8560_ioports (volatile ccsr_cpm_t * cpm)
/* We run cpu_init_early_f in AS = 1 */ /* We run cpu_init_early_f in AS = 1 */
void cpu_init_early_f(void) 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, set_tlb(0, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
1, 0, BOOKE_PAGESZ_4K, 0); 1, 0, BOOKE_PAGESZ_4K, 0);
...@@ -153,12 +159,6 @@ void cpu_init_early_f(void) ...@@ -153,12 +159,6 @@ void cpu_init_early_f(void)
} }
#endif #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(); init_laws();
invalidate_tlb(0); invalidate_tlb(0);
init_tlbs(); init_tlbs();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment