]> git.sur5r.net Git - u-boot/blobdiff - common/cmd_ide.c
[PATCH] I2C: Add support for multiple I2C busses for RTC & DTT
[u-boot] / common / cmd_ide.c
index e185c95b26d6ce7bfc6bab5ea526ba8d6a55a2d6..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")
@@ -417,8 +421,8 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
                SHOW_BOOT_PROGRESS (-1);
                return 1;
        }
-       if ((strncmp(info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) &&
-           (strncmp(info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) {
+       if ((strncmp((char *)info.type, BOOT_PART_TYPE, sizeof(info.type)) != 0) &&
+           (strncmp((char *)info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)) {
                printf ("\n** Invalid partition type \"%.32s\""
                        " (expect \"" BOOT_PART_TYPE "\")\n",
                        info.type);
@@ -450,7 +454,7 @@ int do_diskboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        checksum = ntohl(hdr->ih_hcrc);
        hdr->ih_hcrc = 0;
 
-       if (crc32 (0, (char *)hdr, sizeof(image_header_t)) != checksum) {
+       if (crc32 (0, (uchar *)hdr, sizeof(image_header_t)) != checksum) {
                puts ("\n** Bad Header Checksum **\n");
                SHOW_BOOT_PROGRESS (-2);
                return 1;
@@ -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
@@ -871,15 +874,20 @@ input_swap_data(int dev, ulong *sect_buf, int words)
                        dbuf+=1;
                }
        }
-#else  
+#else
        volatile ushort *pbuf = (ushort *)(ATA_CURR_BASE(dev)+ATA_DATA_REG);
        ushort  *dbuf = (ushort *)sect_buf;
 
        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
 }