* Felix Radensky | 2009-01-20 10:02:47 [+0200]: >Hi, Hi, >I'm trying to use utilize ISP1761 USB 2.0 controller on >a custom platform based on Intel IXP420 CPU (big endian). > >I'm using vanilla 2.6.29-rc2, with patches to add generic >platform device support to ISP160 driver. The ISP1761BE >is connected 16-bit, the IRQ line is level, active low. > >The driver passes scratch register test, but fails in isp1760_run(), >when calling > >handshake(priv, hcd->regs + HC_USBCMD, CMD_RUN, CMD_RUN, > 250 * 1000); > >Below is the relevant output from the driver: > >nxp-isp1760 nxp-isp1760: NXP ISP1760 USB Host Controller >nxp-isp1760 nxp-isp1760: new USB bus registered, assigned bus number 1 >nxp-isp1760 nxp-isp1760: bus width: 16, oc: digital >nxp-isp1760 nxp-isp1760: irq 25, io mem 0x56000000 >nxp-isp1760 nxp-isp1760: startup error -110 >nxp-isp1760 nxp-isp1760: USB bus 1 deregistered >nxp-isp1760: probe of nxp-isp1760 failed with error -110 > >This IXP420 processor is unable to access 16-bit device using native >readl() and writel(), so I had to implement my own versions and replace >all uses of readl(), writel(), __raw_readl() and __raw_writel() by custom >ones, which look like this: > >static inline unsigned long ixp4xx_readl(unsigned long addr) >{ > unsigned long val; > val = *(unsigned long *)addr; > > return (((val & 0xffff) << 16) | ((val & 0xffff0000) >> 16)); >} > >static inline void ixp4xx_writel(unsigned long data, unsigned long addr) >{ > *(unsigned short *)(addr) = (data) & 0xffff; > *(unsigned short *)(addr + 2) = (data >> 16) & 0xffff; >} > >Any help is solving this problem is much appreciated. readl() / writel() perform a 32bit access in little endian order on every arch. Image data is 0x11223344. writel would put as | 0x44 0x33 0x22 0x11 in memory. Your variant would do | 0x33 0x44 0x11 0x22 and this should be written to the bus unless you swap them for some reason. Your read seems to do the same swap but doing a 32bit access. The other people which have the chip wired via a 16bit bus seem to be happy just to set the ISP1760_FLAG_BUS_WIDTH_16. Could you try to write 32bit in one go? If this works than you have probabbly just strange endianess. >Thanks a lot in advance. > >Felix Radensky >Embedded Solutions Ltd. Sebastian -- 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