]> git.sur5r.net Git - u-boot/blobdiff - common/cmd_ide.c
Merge with /home/hs/TQ/u-boot-dev
[u-boot] / common / cmd_ide.c
index 6663dea2f4af9d734016f56ffa5152dab76a7e02..a4155029a7b8ddb7755619056af7c5c29a1e0ef7 100644 (file)
@@ -49,7 +49,7 @@
 #include <asm/io.h>
 #ifdef __MIPS__
 /* Macros depend on this variable */
-static unsigned long mips_io_port_base = 0;
+unsigned long mips_io_port_base = 0;
 #endif
 #endif
 
@@ -60,6 +60,10 @@ static unsigned long mips_io_port_base = 0;
 # define SHOW_BOOT_PROGRESS(arg)
 #endif
 
+#ifdef CONFIG_IDE_8xx_DIRECT
+DECLARE_GLOBAL_DATA_PTR;
+#endif
+
 #ifdef __PPC__
 # define EIEIO         __asm__ volatile ("eieio")
 # define SYNC          __asm__ volatile ("sync")
@@ -498,7 +502,6 @@ void ide_init (void)
 {
 
 #ifdef CONFIG_IDE_8xx_DIRECT
-       DECLARE_GLOBAL_DATA_PTR;
        volatile immap_t *immr = (immap_t *)CFG_IMMR;
        volatile pcmconf8xx_t *pcmp = &(immr->im_pcmcia);
 #endif
@@ -852,7 +855,7 @@ output_data_short(int dev, ulong *sect_buf, int words)
 
 /* We only need to swap data if we are running on a big endian cpu. */
 /* But Au1x00 cpu:s already swaps data in big endian mode! */
-#if defined(__LITTLE_ENDIAN) || defined(CONFIG_AU1X00)
+#if defined(__LITTLE_ENDIAN) || ( defined(CONFIG_AU1X00) && !defined(CONFIG_GTH2) )
 #define input_swap_data(x,y,z) input_data(x,y,z)
 #else
 static void
@@ -878,8 +881,13 @@ input_swap_data(int dev, ulong *sect_buf, int words)
        debug("in input swap data base for read is %lx\n", (unsigned long) pbuf);
 
        while (words--) {
+#ifdef __MIPS__
+               *dbuf++ = swab16p((u16*)pbuf);
+               *dbuf++ = swab16p((u16*)pbuf);
+#else
                *dbuf++ = ld_le16(pbuf);
                *dbuf++ = ld_le16(pbuf);
+#endif /* !MIPS */
        }
 #endif
 }