summaryrefslogtreecommitdiff
path: root/common/cmd_ide.c
diff options
context:
space:
mode:
authorwdenk <wdenk>2004-01-04 22:51:12 +0000
committerwdenk <wdenk>2004-01-04 22:51:12 +0000
commita522fa0e7cdddf8204ba43b335f68be6a42159a5 (patch)
tree3ddc0bffbaade1b79b1ff520ad6051b5a9766278 /common/cmd_ide.c
parent180d3f74e4738ee107e269cbb949481075dd789a (diff)
downloadu-boot-imx-a522fa0e7cdddf8204ba43b335f68be6a42159a5.zip
u-boot-imx-a522fa0e7cdddf8204ba43b335f68be6a42159a5.tar.gz
u-boot-imx-a522fa0e7cdddf8204ba43b335f68be6a42159a5.tar.bz2
* Make BMS2003 use a separate config file to avoid #ifdef mess;
add I2C support; add support for DS1337 RTC * Add CompactFlash support for BMS2003 board * Add support for status LED on BMS2003 board
Diffstat (limited to 'common/cmd_ide.c')
-rw-r--r--common/cmd_ide.c85
1 files changed, 85 insertions, 0 deletions
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index 331041c..668d838 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -835,6 +835,7 @@ output_data_short(int dev, ulong *sect_buf, int words)
static void
input_swap_data(int dev, ulong *sect_buf, int words)
{
+#ifndef CONFIG_BMS2003
volatile ushort *pbuf = (ushort *)(ATA_CURR_BASE(dev)+ATA_DATA_REG);
ushort *dbuf = (ushort *)sect_buf;
@@ -842,6 +843,20 @@ input_swap_data(int dev, ulong *sect_buf, int words)
*dbuf++ = ld_le16(pbuf);
*dbuf++ = ld_le16(pbuf);
}
+#else /* CONFIG_BMS2003 */
+ uchar i;
+ volatile uchar *pbuf_even = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_EVEN);
+ volatile uchar *pbuf_odd = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_ODD);
+ ushort *dbuf = (ushort *)sect_buf;
+
+ while (words--) {
+ for (i=0; i<2; i++) {
+ *(((uchar *)(dbuf)) + 1) = *pbuf_even;
+ *(uchar *)dbuf = *pbuf_odd;
+ dbuf+=1;
+ }
+ }
+#endif /* CONFIG_BMS2003 */
}
#endif /* __LITTLE_ENDIAN || CONFIG_AU1X00 */
@@ -850,6 +865,7 @@ input_swap_data(int dev, ulong *sect_buf, int words)
static void
output_data(int dev, ulong *sect_buf, int words)
{
+#ifndef CONFIG_BMS2003
ushort *dbuf;
volatile ushort *pbuf;
@@ -861,6 +877,25 @@ output_data(int dev, ulong *sect_buf, int words)
__asm__ volatile ("eieio");
*pbuf = *dbuf++;
}
+#else /* CONFIG_BMS2003 */
+ uchar *dbuf;
+ volatile uchar *pbuf_even;
+ volatile uchar *pbuf_odd;
+
+ pbuf_even = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_EVEN);
+ pbuf_odd = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_ODD);
+ dbuf = (uchar *)sect_buf;
+ while (words--) {
+ __asm__ volatile ("eieio");
+ *pbuf_even = *dbuf++;
+ __asm__ volatile ("eieio");
+ *pbuf_odd = *dbuf++;
+ __asm__ volatile ("eieio");
+ *pbuf_even = *dbuf++;
+ __asm__ volatile ("eieio");
+ *pbuf_odd = *dbuf++;
+ }
+#endif /* CONFIG_BMS2003 */
}
#else /* ! __PPC__ */
static void
@@ -874,6 +909,7 @@ output_data(int dev, ulong *sect_buf, int words)
static void
input_data(int dev, ulong *sect_buf, int words)
{
+#ifndef CONFIG_BMS2003
ushort *dbuf;
volatile ushort *pbuf;
@@ -885,6 +921,25 @@ input_data(int dev, ulong *sect_buf, int words)
__asm__ volatile ("eieio");
*dbuf++ = *pbuf;
}
+#else /* CONFIG_BMS2003 */
+ uchar *dbuf;
+ volatile uchar *pbuf_even;
+ volatile uchar *pbuf_odd;
+
+ pbuf_even = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_EVEN);
+ pbuf_odd = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_ODD);
+ dbuf = (uchar *)sect_buf;
+ while (words--) {
+ __asm__ volatile ("eieio");
+ *dbuf++ = *pbuf_even;
+ __asm__ volatile ("eieio");
+ *dbuf++ = *pbuf_odd;
+ __asm__ volatile ("eieio");
+ *dbuf++ = *pbuf_even;
+ __asm__ volatile ("eieio");
+ *dbuf++ = *pbuf_odd;
+ }
+#endif /* CONFIG_BMS2003 */
}
#else /* ! __PPC__ */
static void
@@ -1409,6 +1464,7 @@ static void ide_led (uchar led, uchar status)
static void
output_data_shorts(int dev, ushort *sect_buf, int shorts)
{
+#ifndef CONFIG_BMS2003
ushort *dbuf;
volatile ushort *pbuf;
@@ -1418,11 +1474,26 @@ output_data_shorts(int dev, ushort *sect_buf, int shorts)
__asm__ volatile ("eieio");
*pbuf = *dbuf++;
}
+#else /* CONFIG_BMS2003 */
+ uchar *dbuf;
+ volatile uchar *pbuf_even;
+ volatile uchar *pbuf_odd;
+
+ pbuf_even = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_EVEN);
+ pbuf_odd = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_ODD);
+ while (shorts--) {
+ __asm__ volatile ("eieio");
+ *pbuf_even = *dbuf++;
+ __asm__ volatile ("eieio");
+ *pbuf_odd = *dbuf++;
+ }
+#endif /* CONFIG_BMS2003 */
}
static void
input_data_shorts(int dev, ushort *sect_buf, int shorts)
{
+#ifndef CONFIG_BMS2003
ushort *dbuf;
volatile ushort *pbuf;
@@ -1432,6 +1503,20 @@ input_data_shorts(int dev, ushort *sect_buf, int shorts)
__asm__ volatile ("eieio");
*dbuf++ = *pbuf;
}
+#else /* CONFIG_BMS2003 */
+ uchar *dbuf;
+ volatile uchar *pbuf_even;
+ volatile uchar *pbuf_odd;
+
+ pbuf_even = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_EVEN);
+ pbuf_odd = (uchar *)(ATA_CURR_BASE(dev)+ATA_DATA_ODD);
+ while (shorts--) {
+ __asm__ volatile ("eieio");
+ *dbuf++ = *pbuf_even;
+ __asm__ volatile ("eieio");
+ *dbuf++ = *pbuf_odd;
+ }
+#endif /* CONFIG_BMS2003 */
}
#else /* ! __PPC__ */