]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/cpu/armv7/omap4/board.c
omap4: automatic sdram detection
[u-boot] / arch / arm / cpu / armv7 / omap4 / board.c
index 09861a99f588fba829e9d011403e676828c561b8..786c239794d00e340cc709d529a19a14a958396f 100644 (file)
@@ -32,6 +32,7 @@
 #include <asm/arch/cpu.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/sizes.h>
+#include <asm/arch/emif.h>
 #include "omap4_mux_data.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -154,6 +155,7 @@ void s_init(void)
        init_omap4_revision();
        watchdog_init();
        set_mux_conf_regs();
+       prcm_init();
 }
 
 /*
@@ -188,17 +190,17 @@ void watchdog_init(void)
  * This is needed because the size of memory installed may be
  * different on different versions of the board
  */
-u32 sdram_size(void)
+u32 omap4_sdram_size(void)
 {
        u32 section, i, total_size = 0, size, addr;
        for (i = 0; i < 4; i++) {
-               section = __raw_readl(DMM_LISA_MAP_BASE + i*4);
-               addr = section & DMM_LISA_MAP_SYS_ADDR_MASK;
+               section = __raw_readl(OMAP44XX_DMM_LISA_MAP_BASE + i*4);
+               addr = section & OMAP44XX_SYS_ADDR_MASK;
                /* See if the address is valid */
                if ((addr >= OMAP44XX_DRAM_ADDR_SPACE_START) &&
                    (addr < OMAP44XX_DRAM_ADDR_SPACE_END)) {
-                       size    = ((section & DMM_LISA_MAP_SYS_SIZE_MASK) >>
-                                   DMM_LISA_MAP_SYS_SIZE_SHIFT);
+                       size    = ((section & OMAP44XX_SYS_SIZE_MASK) >>
+                                  OMAP44XX_SYS_SIZE_SHIFT);
                        size    = 1 << size;
                        size    *= SZ_16M;
                        total_size += size;
@@ -214,8 +216,8 @@ u32 sdram_size(void)
  */
 int dram_init(void)
 {
-
-       gd->ram_size = sdram_size();
+       sdram_init();
+       gd->ram_size = omap4_sdram_size();
 
        return 0;
 }