| Submitter | Pavel Herrmann |
|---|---|
| Date | Oct. 7, 2012, 3:56 p.m. |
| Message ID | <1349625374-12391-9-git-send-email-morpheus.ibis@gmail.com> |
| Download | mbox | patch |
| Permalink | /patch/189852/ |
| State | Changes Requested |
| Delegated to: | Tom Rini |
| Headers | show |
Comments
On Sun, Oct 07, 2012 at 05:56:12PM +0200, Pavel Herrmann wrote: > Move special case of ide_swap_read() for AU1X00 SoC into SoC-specific > directory. > > Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com> Two problems: > diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_ide.c b/arch/mips/cpu/mips32/au1x00/au1x00_ide.c [snip] > +#ifndef CONFIG_GTH2 /* GTH2 board behaves as it should */ > +void ide_input_swap_data(int dev, ulong *sect_buf, int words) > +{ > + ide_input_data(dev, sect_buf, words); > +} > + > diff --git a/common/cmd_ide.c b/common/cmd_ide.c That won't compile :) Second, re-base on top of next where the gth2 board is gone, this will make things simpiler.
On Monday 08 of October 2012 16:38:46 Tom Rini wrote: > On Sun, Oct 07, 2012 at 05:56:12PM +0200, Pavel Herrmann wrote: > > Move special case of ide_swap_read() for AU1X00 SoC into SoC-specific > > directory. > > > > Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com> > > Two problems: > > diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_ide.c > > b/arch/mips/cpu/mips32/au1x00/au1x00_ide.c > [snip] > > > +#ifndef CONFIG_GTH2 /* GTH2 board behaves as it should */ > > +void ide_input_swap_data(int dev, ulong *sect_buf, int words) > > +{ > > + ide_input_data(dev, sect_buf, words); > > +} > > + > > diff --git a/common/cmd_ide.c b/common/cmd_ide.c > > That won't compile :) sorry, my bad, i only compile tested on ppc, this is missing a header and endif > Second, re-base on top of next where the gth2 board is gone, this will > make things simpiler. done, will send V2 after MAKEALL -a powerpc finishes, just to be sure cheers Pavel Herrmann
Patch
diff --git a/arch/mips/cpu/mips32/au1x00/Makefile b/arch/mips/cpu/mips32/au1x00/Makefile index dc58475..b9f895d 100644 --- a/arch/mips/cpu/mips32/au1x00/Makefile +++ b/arch/mips/cpu/mips32/au1x00/Makefile @@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(SOC).o -COBJS = au1x00_eth.o au1x00_serial.o au1x00_usb_ohci.o +COBJS = au1x00_eth.o au1x00_serial.o au1x00_usb_ohci.o au1x00_ide.o SRCS := $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(COBJS)) diff --git a/arch/mips/cpu/mips32/au1x00/au1x00_ide.c b/arch/mips/cpu/mips32/au1x00/au1x00_ide.c new file mode 100644 index 0000000..337dd45 --- /dev/null +++ b/arch/mips/cpu/mips32/au1x00/au1x00_ide.c @@ -0,0 +1,33 @@ +/* + * (C) Copyright 2000-2011 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + */ + +#include <ide.h> + +/* AU1X00 swaps data in big-endian mode, enforce little-endian function */ +#ifndef CONFIG_GTH2 /* GTH2 board behaves as it should */ +void ide_input_swap_data(int dev, ulong *sect_buf, int words) +{ + ide_input_data(dev, sect_buf, words); +} + diff --git a/common/cmd_ide.c b/common/cmd_ide.c index 2f3b077..7c8f866 100644 --- a/common/cmd_ide.c +++ b/common/cmd_ide.c @@ -503,9 +503,7 @@ void ide_output_data(int dev, const ulong *sect_buf, int words) __attribute__ ((weak, alias("__ide_output_data"))); /* 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_SOC_AU1X00) && !defined(CONFIG_GTH2)) +#if defined(__LITTLE_ENDIAN) void __ide_input_swap_data(int dev, ulong *sect_buf, int words) { ide_input_data(dev, sect_buf, words); @@ -533,7 +531,7 @@ void __ide_input_swap_data(int dev, ulong *sect_buf, int words) #endif /* !MIPS */ } } -#endif /* __LITTLE_ENDIAN || CONFIG_AU1X00 */ +#endif /* __LITTLE_ENDIAN */ #if defined(CONFIG_IDE_SWAP_IO)
Move special case of ide_swap_read() for AU1X00 SoC into SoC-specific directory. Signed-off-by: Pavel Herrmann <morpheus.ibis@gmail.com> --- arch/mips/cpu/mips32/au1x00/Makefile | 2 +- arch/mips/cpu/mips32/au1x00/au1x00_ide.c | 33 ++++++++++++++++++++++++++++++++ common/cmd_ide.c | 6 ++---- 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 arch/mips/cpu/mips32/au1x00/au1x00_ide.c