Re: [PATCHv2 1/2] USB: EHCI: Support controllers with big endian capability regs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 03, 2011 at 08:09:03PM +0200, Jan Andersson wrote:
> On 03/05/11 19:08, Greg KH wrote:
> > On Sat, Apr 30, 2011 at 11:56:25AM +0200, Jan Andersson wrote:
> >> The two first HC capability registers (CAPLENGTH and HCIVERSION)
> >> are defined as one 8-bit and one 16-bit register. Most HC
> >> implementations have selected to treat these registers as part
> >> of a 32-bit register, giving the same layout for both big and
> >> small endian systems.
> >>
> >> This patch adds a new quirk, big_endian_capbase, to support
> >> controllers with big endian register interfaces that treat
> >> HCIVERSION and CAPLENGTH as individual registers.
> >>
> >> Signed-off-by: Jan Andersson <jan@xxxxxxxxxxx>
> >> Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> >> ---
> >> This solution has previously been discussed on linux-usb [1] where
> >> Alan Stern described the problem better:
> >>
> >> As an example for the sake of argument, let's suppose that CAPLENGTH is
> >> 0x03 and HCIVERSION is 0x67.  If the controller is in little-endian mode,
> >> this means that the memory-mapped registers will contain the following
> >> bytes (starting from offset 0): 0x03 0x00 0x07 0x06.  Any CPU, whether
> >> little-endian or big-endian, using ehci_readl() would obtain 0x06070003,
> >> and the macros would then yield the correct values.
> >>
> >> Now suppose the controller is in big-endian mode.  The memory-mapped
> >> registers will contain the bytes: 0x03 0x00 0x06 0x07.  Any CPU, whether
> >> little-endian or big-endian, using ehci_readl() would obtain 0x03000607,
> >> which of course doesn't work with the HC_LENGTH and HC_VERSION macros
> >>
> >> [1] http://marc.info/?l=linux-usb&m=126421978732228&w=2
> >>
> >> Changes for V2:
> >> * Add acked-by AS
> >> * Fixup prefixes in patch description
> >> * Fix build error in early/ehci-dbgp.c after comment from Greg KH
> > 
> > Nope, I still get the following build error:
> > 
> >   CC      drivers/usb/early/ehci-dbgp.o
> > drivers/usb/early/ehci-dbgp.c: In function âearly_dbgp_initâ:
> > drivers/usb/early/ehci-dbgp.c:895:2: error: implicit declaration of function âehci_big_endian_capbaseâ
> > drivers/usb/early/ehci-dbgp.c:895:26: error: âehciâ undeclared (first use in this function)
> > drivers/usb/early/ehci-dbgp.c:895:26: note: each undeclared identifier is reported only once for each function it appears in
> > make[3]: *** [drivers/usb/early/ehci-dbgp.o] Error 1
> > 
> > 
> > Care to try again?
> > 
> 
> Yes, sloppiness on my part. I suppose the best solution is to define a
> local variant of HC_LENGTH in ehci-dbgp.c since the ehci struct is not
> available. I will send a new version. Apologies for wasting your time.

Ok, that one worked, thanks for the quick response, I appreciate it.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux