Sebastian Andrzej Siewior wrote:
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.
The expansion bus of IXP42X allows 32-bit read access to 16-bit devices,
but disallows 32-bit write access. Writes should be 16-bit. My
implementation
of readl() and writel() just reflects the datasheet requirements. Since
scratch
register test and reading of chip ID work, I believe they are implemented
correctly. I was also able to fix the problem I reported earlier by
adding udelay(1)
after writel(). But now I have another one:
nxp-isp1760 nxp-isp1760: NXP ISP1760 USB Host Controller
nxp-isp1760 nxp-isp1760: new USB bus registered, assigned bus number 1
ISP1760: HW_MODE_CTL reg is 0x0, hwmode is 0x0
nxp-isp1760 nxp-isp1760: bus width: 16, oc: digital
nxp-isp1760 nxp-isp1760: irq 25, io mem 0x56000000
nxp-isp1760 nxp-isp1760: USB ISP 1761 HW rev. 1 started
usb usb1: Product: NXP ISP1760 USB Host Controller
usb usb1: Manufacturer: Linux 2.6.29-rc2 isp1760-hcd
usb usb1: SerialNumber: nxp-isp1760
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
port 1 high speed
usb 1-1: new high speed USB device using nxp-isp1760 and address 2
Reloading ptd c70a53c0/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
Reloading ptd c70a5380/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
Reloading ptd c70a53c0/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
port 1 high speed
usb 1-1: device descriptor read/64, error -110
Reloading ptd c70a5380/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
Reloading ptd c70a53c0/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
Reloading ptd c70a5380/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
port 1 high speed
usb 1-1: device descriptor read/64, error -110
port 1 high speed
usb 1-1: new high speed USB device using nxp-isp1760 and address 3
Reloading ptd c70a53c0/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
Reloading ptd c70a5380/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
Reloading ptd c70a53c0/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
port 1 high speed
usb 1-1: device descriptor read/64, error -110
Reloading ptd c70a5380/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
Reloading ptd c70a53c0/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
Reloading ptd c70a5380/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
port 1 high speed
usb 1-1: device descriptor read/64, error -110
port 1 high speed
usb 1-1: new high speed USB device using nxp-isp1760 and address 4
Reloading ptd c70a53c0/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
Reloading ptd c70a53a0/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
usb 1-1: device not accepting address 4, error -110
port 1 high speed
usb 1-1: new high speed USB device using nxp-isp1760 and address 5
Reloading ptd c70a53c0/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
Reloading ptd c70a53a0/c000b240... qh c77f43bc readed: 64 of 8 done:
00000000 cur: 00000001
usb 1-1: device not accepting address 5, error -110
This happens when no device is plugged in. I see 16 USB interrupts in
/proc/interrupts, and after
that point no more USB interrupts arrive, even if I plug disk on key
(I've tried several, to both ports).
Any ideas what can be the problem ?
Thanks.
Felix.
--
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