On Thu, 26 May 2016, Martin Townsend wrote:

> I tried hacking in the relevant code straight into the OHCI platform driver
>     res_mem = platform_get_resource(dev, IORESOURCE_MEM, 1);
>     if (res_mem == NULL) {
>         dev_err(&dev->dev, "no resource definition for memory\n");
>         err = -ENOENT;
>         goto err_power;
>     }
> 
>     if (!request_mem_region(res_mem->start, resource_size(res_mem),
> dev->name)) {
>         dev_err(&dev->dev, "request_mem_region failed\n");
>         err = -EBUSY;
>         goto err_power;
>     }
> 
>     /*
>      * Use SH7760 Shared Memory
>      */
>     if (!dma_declare_coherent_memory(&dev->dev, res_mem->start,
>                      res_mem->start - res_mem->parent->start,
>                      resource_size(res_mem),
>                      DMA_MEMORY_MAP |
>                      DMA_MEMORY_EXCLUSIVE)) {
>         dev_err(&dev->dev, "cannot declare coherent memory\n");
>         err = -ENXIO;
>         goto err_power;
>     }
> and setting the HCD_MEMORY_LOCAL flag in the HC driver.

Did you do this correctly?  That is, in the correct driver?

> and I get the following error

...
> [    1.510000] usb 1-1: new full-speed USB device number 2 using ohci-platform
> [    1.690000] usb 1-1: device descriptor read/64, error -12
> [    1.980000] usb 1-1: device descriptor read/64, error -12
> [    2.270000] usb 1-1: new full-speed USB device number 3 using ohci-platform
> [    2.450000] usb 1-1: device descriptor read/64, error -12
> [    2.740000] usb 1-1: device descriptor read/64, error -12
> [    3.030000] usb 1-1: new full-speed USB device number 4 using ohci-platform
> [    3.450000] usb 1-1: device not accepting address 4, error -12
> [    3.630000] usb 1-1: new full-speed USB device number 5 using ohci-platform
> [    4.050000] usb 1-1: device not accepting address 5, error -12
> [    4.050000] usb usb1-port1: unable to enumerate USB device

-12 is -ENOMEM on your system?

...
> which looks good. Anyone have an idea as to what's wrong or what the
> error messages mean.  I have nothing plugged into the USB ports.

Nothing plugged into the USB ports?  Then why does the system think 
something is plugged in?  It sounds like the driver is not accessing 
the right registers.

>  Also
> any ideas on where to start with debugging this would be appreciated.

What do you see in /sys/kernel/debug/usb/ohci/*/registers?

Alan Stern

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

Reply via email to