Skip to contentSkip to conversation

ide arm support rev 1

PATCH New michael 1 participant 1 message Feb 12, 2008

lore
Share & tools
lore

michael

author
#0 lore raw

PATCH 1/1 ide arm support rev 1

Add ide support to the arm cpu. Tested on little endian machine. Include #define __io in config board file.

---

common/cmd_ide.c +14 -0
index c38be4f..e507c15 100644
@@ -934,7 +934,14 @@ output_data(int dev, ulong *sect_buf, int words)
 static void
 output_data(int dev, ulong *sect_buf, int words)
 {
+#ifndef __ARM__
        outsw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, words<<1);
+#else
+       int i;
+       u16 *buf = (u16 *) sect_buf;
+       for (i = 0; i < (words << 1); i++, buf++)
+               outw(ATA_CURR_BASE(dev) + ATA_DATA_REG, buf);
+#endif
 }
 #endif /* __PPC__ */
 
@@ -992,7 +999,14 @@ input_data(int dev, ulong *sect_buf, int words)
 static void
 input_data(int dev, ulong *sect_buf, int words)
 {
+#ifndef __ARM__
        insw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, words << 1);
+#else
+       int i;
+       volatile u16 *buf = (u16 *) sect_buf;
+       for(i = 0; i < (words << 1); i++, buf++)
+               *buf = inw(ATA_CURR_BASE(dev) + ATA_DATA_REG);
+#endif
 }
 
 #endif /* __PPC__ */
lib_arm/board.c +0 -0
index 7e7a282..ddf4d5f 100644
@@ -435,6 +435,12 @@ extern void dm644x_eth_set_mac_addr (const u_int8_t 
*addr);
        reset_phy();

#endif
#endif
+
+#if defined(CONFIG_CMD_IDE)
+ puts("IDE: ");
+ ide_init();
+#endif
+