Re: ISP1761 on IXP420

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

 



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.


If I use the original driver code I get this nice kernel crash:

nxp-isp1760 nxp-isp1760: NXP ISP1760 USB Host Controller
nxp-isp1760 nxp-isp1760: new USB bus registered, assigned bus number 1
Unhandled fault: imprecise external abort (0x416) at 0x40147000
Internal error: : 416 [#1]
Modules linked in: isp1760 usbcore ixp400_eth ixp400(P)
CPU: 0
PC is at isp1760_readl+0x20/0x24 [isp1760]
LR is at isp1760_hc_setup+0x88/0x314 [isp1760]
pc : [<bf120020>]    lr : [<bf1203cc>]    Tainted: P
sp : c7035d00  ip : c7035d00  fp : c7035d24
r10: 00000019  r9 : 000000a0  r8 : c5fa7000
r7 : c7ec40c4  r6 : 00000000  r5 : c7ec4000  r4 : deadbabe
r3 : 00000000  r2 : 00000000  r1 : c8880300  r0 : 00000000
Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  Segment user
Control: 39FF
Table: 05FBC000  DAC: 00000015
Process modprobe (pid: 1358, stack limit = 0xc7034250)

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

--
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