X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fcmd_ide.c;h=a4155029a7b8ddb7755619056af7c5c29a1e0ef7;hb=bc5556d62b6ebe6cb4302aebec9e7bbf1affd2ea;hp=6663dea2f4af9d734016f56ffa5152dab76a7e02;hpb=ea1fba136a4778b8f55e6b94a76a548cfad9f522;p=u-boot diff --git a/common/cmd_ide.c b/common/cmd_ide.c index 6663dea2f4..a4155029a7 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -49,7 +49,7 @@ #include #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 }