Merge branch '080116_at91cap9' of git://linux-arm.org/u-boot-armdev
[kernel/u-boot.git] / board / pcs440ep / pcs440ep.c
index 0e34a76..96adbc9 100644 (file)
@@ -30,6 +30,7 @@
 #include <spd_sdram.h>
 #include <status_led.h>
 #include <sha1.h>
+#include <asm/io.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -174,7 +175,7 @@ int board_early_init_f(void)
         *-------------------------------------------------------------------*/
        mfsdr(sdr_pci0, reg);
        mtsdr(sdr_pci0, 0x80000000 | reg);      /* PCI arbiter enabled */
-       mtsdr(sdr_pfc0, 0x00000100);    /* Pin function: enable GPIO49-63 */
+       mtsdr(sdr_pfc0, 0x00000000);    /* Pin function: enable GPIO49-63 */
        mtsdr(sdr_pfc1, 0x00048000);    /* Pin function: UART0 has 4 pins, select IRQ5 */
 
        return 0;
@@ -238,7 +239,13 @@ void load_sernum_ethaddr (void)
        }
        /* Env doesnt exist -> hang */
        status_led_blink ();
-       hang ();
+       /* here we do this "handy" because we have no interrupts
+          at this time */
+       puts ("### EEPROM ERROR ### Please RESET the board ###\n");
+       for (;;) {
+               __led_toggle (12);
+               udelay (100000);
+       }
        return;
 }
 
@@ -416,7 +423,13 @@ static void pcs440ep_checksha1 (void)
        if ((cs_test = getenv ("cs_test")) == NULL) {
                /* Env doesnt exist -> hang */
                status_led_blink ();
-               hang ();
+               /* here we do this "handy" because we have no interrupts
+                  at this time */
+               puts ("### SHA1 ERROR ### Please RESET the board ###\n");
+               for (;;) {
+                       __led_toggle (2);
+                       udelay (100000);
+               }
        }
 
        if (strncmp (cs_test, "off", 3) == 0) {
@@ -517,7 +530,7 @@ void spd_ddr_init_hang (void)
        status_led_set (1, STATUS_LED_ON);
        /* we cannot use hang() because we are still running from
           Flash, and so the status_led driver is not initialized */
-       puts ("### ERROR ### Please RESET the board ###\n");
+       puts ("### SDRAM ERROR ### Please RESET the board ###\n");
        for (;;) {
                __led_toggle (4);
                udelay (100000);
@@ -855,6 +868,29 @@ U_BOOT_CMD(
 );
 #endif
 
+#if defined (CONFIG_CMD_IDE)
+/* These addresses need to be shifted one place to the left
+ * ( bus per_addr 20 -30 is connectsd on CF bus A10-A0)
+ * These values are shifted
+ */
+extern ulong *ide_bus_offset;
+void inline ide_outb(int dev, int port, unsigned char val)
+{
+       debug ("ide_outb (dev= %d, port= 0x%x, val= 0x%02x) : @ 0x%08lx\n",
+               dev, port, val, (ATA_CURR_BASE(dev)+port));
+
+       out_be16((u16 *)(ATA_CURR_BASE(dev)+(port << 1)), val);
+}
+unsigned char inline ide_inb(int dev, int port)
+{
+       uchar val;
+       val = in_be16((u16 *)(ATA_CURR_BASE(dev)+(port << 1)));
+       debug ("ide_inb (dev= %d, port= 0x%x) : @ 0x%08lx -> 0x%02x\n",
+               dev, port, (ATA_CURR_BASE(dev)+port), val);
+       return (val);
+}
+#endif
+
 #ifdef CONFIG_IDE_PREINIT
 int ide_preinit (void)
 {
@@ -867,7 +903,7 @@ int ide_preinit (void)
 }
 #endif
 
-#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
+#if defined (CONFIG_CMD_IDE) && defined (CONFIG_IDE_RESET)
 void ide_set_reset (int idereset)
 {
        debug ("ide_reset(%d)\n", idereset);
@@ -878,4 +914,4 @@ void ide_set_reset (int idereset)
        }
        udelay (10000);
 }
-#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
+#endif /* defined (CONFIG_CMD_IDE) && defined (CONFIG_IDE_RESET) */