Patches by Lars Munch, 12 Jul 2004:
[oweals/u-boot.git] / board / at91rm9200dk / at91rm9200dk.c
index ffd9687bf4c50303de313b779ebf1c51d96d1c40..606ea488162f9f24fc1d7816cb247124354723aa 100644 (file)
@@ -66,7 +66,7 @@ int dram_init (void)
  * The NAND lives in the CS2* space
  */
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
-extern void nand_probe (ulong physadr);
+extern ulong nand_probe (ulong physadr);
 
 #define AT91_SMARTMEDIA_BASE 0x40000000        /* physical address to access memory on NCS3 */
 void nand_init (void)
@@ -102,11 +102,17 @@ void nand_init (void)
        *AT91C_PIOB_PER = AT91C_PIO_PB1;        /* enable direct output enable */
        *AT91C_PIOB_ODR = AT91C_PIO_PB1;        /* disable output */
 
+       /* PIOB and PIOC clock enabling */
+       *AT91C_PMC_PCER = 1 << AT91C_ID_PIOB;
+       *AT91C_PMC_PCER = 1 << AT91C_ID_PIOC;
+
        if (*AT91C_PIOB_PDSR & AT91C_PIO_PB1)
-               printf ("No ");
-       printf ("SmartMedia card inserted\n");
+               printf ("  No SmartMedia card inserted\n");
+#ifdef DEBUG
+       printf ("  SmartMedia card inserted\n");
 
        printf ("Probing at 0x%.8x\n", AT91_SMARTMEDIA_BASE);
-       nand_probe (AT91_SMARTMEDIA_BASE);
+#endif
+       printf ("%4lu MB\n", nand_probe(AT91_SMARTMEDIA_BASE) >> 20);
 }
 #endif