* Some code cleanup
[oweals/u-boot.git] / board / m5272c3 / m5272c3.c
index 91ec9a12d769b452ae96cb861e69fd5ef11ad449..0dfeaf24f5915594c79e16537296a84c10a34157 100644 (file)
  */
 
 #include <common.h>
+#include <asm/m5272.h>
+#include <asm/immap_5272.h>
 
-int checkboard (void)
-{
-       puts ("MOTOROLA MCF5272C3 Evaluation Board\n");
+
+int checkboard (void) {
+       puts ("Board: ");
+       puts("MOTOROLA MCF5272C3 EVB\n");
        return 0;
-}
+       };
+
+long int initdram (int board_type) {
+       volatile sdramctrl_t * sdp = (sdramctrl_t *)(CFG_MBAR + MCFSIM_SDCR);
+
+       sdp->sdram_sdtr = 0xf539;
+       sdp->sdram_sdcr = 0x4211;
+
+       /* Dummy write to start SDRAM */
+       *((volatile unsigned long *)0) = 0;
+
+       return CFG_SDRAM_SIZE * 1024 * 1024;
+       };
+
+int testdram (void) {
+       /* TODO: XXX XXX XXX */
+       printf ("DRAM test not implemented!\n");
 
-long int initdram (int board_type)
-{
-       return 0x400000;
+       return (0);
 }