diff options
author | Wolfgang Denk <wd@pollux.(none)> | 2005-09-25 16:22:14 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@pollux.(none)> | 2005-09-25 16:22:14 +0200 |
commit | 0148e8cb4337a2c65a5ed539d0e7b87f2e099329 (patch) | |
tree | 91341269c2eb3bd6356e608d8f9a5b910180fe2e /board/integratorap/integratorap.c | |
parent | 389db1f113cbc0f81f2a7311fa4114c749c81595 (diff) |
Update multicore CM9XX support for Integrator AP to allow booting from flash
Patch by Jean-Paul Saman, 8 Feb 2005
Diffstat (limited to 'board/integratorap/integratorap.c')
-rw-r--r-- | board/integratorap/integratorap.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/board/integratorap/integratorap.c b/board/integratorap/integratorap.c index 31bd1d48e..ff074ca3b 100644 --- a/board/integratorap/integratorap.c +++ b/board/integratorap/integratorap.c @@ -75,6 +75,11 @@ int board_init (void) gd->flags = 0; +#ifdef CONFIG_CM_REMAP +extern void cm_remap(void); + cm_remap(); /* remaps writeable memory to 0x00000000 */ +#endif + icache_enable (); flash__init (); @@ -475,6 +480,38 @@ void ether__init (void) ******************************/ int dram_init (void) { + DECLARE_GLOBAL_DATA_PTR; + + gd->bd->bi_dram[0].start = PHYS_SDRAM_1; + gd->bd->bi_dram[0].size = PHYS_SDRAM_1_SIZE; + +#ifdef CONFIG_CM_SPD_DETECT + { +extern void dram_query(void); + unsigned long cm_reg_sdram; + unsigned long sdram_shift; + + dram_query(); /* Assembler accesses to CM registers */ + /* Queries the SPD values */ + + /* Obtain the SDRAM size from the CM SDRAM register */ + + cm_reg_sdram = *(volatile ulong *)(CM_BASE + OS_SDRAM); + /* Register SDRAM size + * + * 0xXXXXXXbbb000bb 16 MB + * 0xXXXXXXbbb001bb 32 MB + * 0xXXXXXXbbb010bb 64 MB + * 0xXXXXXXbbb011bb 128 MB + * 0xXXXXXXbbb100bb 256 MB + * + */ + sdram_shift = ((cm_reg_sdram & 0x0000001C)/4)%4; + gd->bd->bi_dram[0].size = 0x01000000 << sdram_shift; + + } +#endif /* CM_SPD_DETECT */ + return 0; } |