From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Fuchs Date: Thu, 11 Jan 2007 16:06:12 +0100 Subject: [U-Boot-Users] reg ISP 1561 integration with u-boot1.1.6 In-Reply-To: <877ivtu003.fsf@denx.de> References: <4ac2955e0701040358u5699f021o163696f8cf70ba4a@mail.gmail.com> <200701111339.01196.matthias.fuchs@esd-electronics.com> <877ivtu003.fsf@denx.de> Message-ID: <200701111606.12878.matthias.fuchs@esd-electronics.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Markus, On Thursday 11 January 2007 15:11, Markus Klotzb?cher wrote: > >> >> IIRC same problem with the 440EP and MPC5200, thats what the extra > >> >> #ifdef in drivers/usb_ohci.c:103 is for. > >> > These are different issues! usb_ohci.c uses readl and writel to access the > >> > controller's registers from the CPU (e.g. ohci.regs). The original code never > >> > swaps here. But a PCI OHCI controller on a PowerPC needs it. The mXX_swap > >> > macros are used to swap data fields in structures that are passed to the host > >> > controller indirectly. > >> > >> I get it. So in the end we have four cases: byte swapping register > >> access or not _and_ byte swapping data or not. Right? Doesn't sound too > >> complicated. > > What about taking some code / macros from the linux kernel (usb/host/ohci.h)? > > It seems that all we need is the CONFIG_USB_OHCI_BIG_ENDIAN define. > > Seems reasonable. So we'll use these for register accesses, and the rest > stays as is doing CPU dependant byteswapping based on the LITTLEENDIAN > define (include/usb.h). Ok? Sounds reasonable to me. We still need a more pretty way to handle the +/- CFG_PCIRAM_BASE. What about some cpu_to_bus/bus_to_cpu macros? Matthias