* 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
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 @@
 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 @@
 		*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 @@
 static void
 output_data(int dev, ulong *sect_buf, int words)
 {
+#ifndef CONFIG_BMS2003
 	ushort	*dbuf;
 	volatile ushort	*pbuf;
 
@@ -861,6 +877,25 @@
 		__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 @@
 static void
 input_data(int dev, ulong *sect_buf, int words)
 {
+#ifndef CONFIG_BMS2003
 	ushort	*dbuf;
 	volatile ushort	*pbuf;
 
@@ -885,6 +921,25 @@
 		__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
 output_data_shorts(int dev, ushort *sect_buf, int shorts)
 {
+#ifndef CONFIG_BMS2003
 	ushort	*dbuf;
 	volatile ushort	*pbuf;
 
@@ -1418,11 +1474,26 @@
 		__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 @@
 		__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__ */