No USB on g20 EK board with def at91 kernel

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

ghofman
Location: Vancouver, BC, Canada
Posts: 26
Joined: Sun May 20, 2007 5:11 am

No USB on g20 EK board with def at91 kernel

Fri Dec 08, 2017 12:29 am

Hello,

Like many, our company is finally taking the plunge in moving from a 3.6.9 kernel with no DTS to the latest (4.9.52-linux4sam_5.7-dirty ). Our boards are very similar to the G20 EK boards, with the addition of an FPGPA and removal of a lot of I/O we dont use. In general, we can get a bootable kernel by changing only the RMII mac --> MII Mac and partitioning our NAND flash according to our RFS.

I am unable to get USB to work on either our boards or the G20 EK kit. We have it working fine with our 3.6.9 kernels. I was expecting USB to work if I compiled the default (master branch) kernel with default DTS files for the g20 EK kit. So basically all I do is:

make -j10 ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- LOCALVERSION= at91_dt_defconfig
make -j10 ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- LOCALVERSION= dtbs
make -j10 ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- LOCALVERSION= zImage

I do have to modify the default .config for our appended DTS & enable JFFS2. The DTS file /at91sam9g20ek_common.dtsi is only modified for the NAND flash partition.

I append the dts and create a uImage using the ./scripts/mkuboot.sh. We have a very old version of uboot (1.3.4). System boots fine to RFS (created from Debian Wheezy).

When I insert any kind of USB device (and I tried many) I get:

usb 1-2: new full-speed USB device number 2 using at91_ohci
usb 1-2: device descriptor read/64, error -62
usb 1-2: device descriptor read/64, error -62
usb 1-2: new full-speed USB device number 3 using at91_ohci
usb 1-2: device descriptor read/64, error -62
usb 1-2: device descriptor read/64, error -62
usb 1-2: new full-speed USB device number 4 using at91_ohci
usb 1-2: device not accepting address 4, error -62
usb 1-2: new full-speed USB device number 5 using at91_ohci
usb 1-2: device not accepting address 5, error -62
usb usb1-port2: unable to enumerate USB device

which I believe are timeouts. I see the same behaviour on our G20 designs, which has lots of USB options & drivers turned on.

Should the default Atmel kernel with the EK board not have working USB ? What I am missing here ? My best guess is that the USB DTS definition is incomplete...perhaps a missing clock source or something.

I note the section (in arch/arm/boot/dts/at91sam9260.dtsi) reads:

usb0: ohci@500000 {
compatible = "atmel,at91rm9200-ohci", "usb-ohci";
reg = <0x00500000 0x100000>;
interrupts = <20 IRQ_TYPE_LEVEL_HIGH 2>;
clocks = <&ohci_clk>, <&ohci_clk>, <&uhpck>;
clock-names = "ohci_clk", "hclk", "uhpck";
status = "disabled";

but the binding documentation recommends:

usb0: ohci@00500000 {
compatible = "atmel,at91rm9200-ohci", "usb-ohci";
reg = <0x00500000 0x100000>;
clocks = <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
clock-names = "ohci_clk", "hclk", "uhpck";
interrupts = <20 4>;
num-ports = <2>;
};

Note that the top level dts file reads:

usb0: ohci@500000 {
num-ports = <2>;
status = "okay";
};

so it should be enabled.

lsusb gives: Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Any thoughts ? What should be trying ?

Much appreciated

Gertjan
ghofman
Location: Vancouver, BC, Canada
Posts: 26
Joined: Sun May 20, 2007 5:11 am

Re: No USB on g20 EK board with def at91 kernel

Fri Dec 08, 2017 7:58 pm

Update:

I tried branches 4.1 and 4.4, all with no changes to except to NAND partition and making sure appended DTS is turned on. All test on the G20 Evaluation Kit board.

linux-4.1-at91 works as expected, USB devices are recognized
linux-4.4-at91 does not and even lsusb just hangs.

This makes me think default USB support hasn't worked by since at least 4.4. If any one has any bi-section tips, please let me know.

Also (but unrelated), with 4.4 reboot fails (hangs at 'restarting'). Noticed the same thing with 4.9, but seem fixable by increasing the wait in the reset function.
blue_z
Location: USA
Posts: 1721
Joined: Thu Apr 19, 2007 10:15 pm

Re: No USB on g20 EK board with def at91 kernel

Sat Dec 09, 2017 1:19 am

ghofman wrote:When I insert any kind of USB device (and I tried many) I get:
The salient part of the syslog is probably the initialization of the host controllers.
A `sdiff` of 4.1 versus 4.4 boot logs should make incongruous lines more obvious.

ghofman wrote:My best guess is that the USB DTS definition is incomplete...perhaps a missing clock source or something.
Describe the problem's symptoms, not your guesses.

Have you enabled USB debugging (i.e. rebuild the two Atmel USB host drivers with `#define DEBUG`)?

Regards
ghofman
Location: Vancouver, BC, Canada
Posts: 26
Joined: Sun May 20, 2007 5:11 am

Re: No USB on g20 EK board with def at91 kernel

Thu Dec 14, 2017 3:19 am

Took me a while to get any further testing done.
First of all I had made a mistake. I can in fact see USB devices with the 4.4 version, but not with the 4.9 tag.

In any case, comparing the 4.1 v 4.4 v 4.9 boot messages, the only difference related to USB is that in 4.1 and 4.4 I see

at91_ohci 500000.ohci: irq 37, io mem 0x00500000

but in 4.9

at91_ohci 500000.ohci: irq 33, io mem 0x00500000

(interrupt number on two additional serials are also different, by the same shift of 4).

Looking at at91sam9260.dtsi I see the usb0 section:

usb0: ohci@500000 {
compatible = "atmel,at91rm9200-ohci", "usb-ohci";
reg = <0x00500000 0x100000>;
interrupts = <20 IRQ_TYPE_LEVEL_HIGH 2>;
clocks = <&ohci_clk>, <&ohci_clk>, <&uhpck>;
clock-names = "ohci_clk", "hclk", "uhpck";
status = "disabled";
};

(this is unchanged after 4.4)
I am not sure how 0x20 maps onto irq 37 (or 33 for that matter, unless there is an offset of 1 somewhere).
I am not familiar with the AIC controller and how these are assigned. But why the difference ? And does it matter ?
I will enable DEBUG next.
sirdan
Posts: 26
Joined: Thu Jun 25, 2009 4:19 pm

Re: No USB on g20 EK board with def at91 kernel

Mon Sep 24, 2018 8:11 am

Hello Ghofman,

Did you find a solution to the USB problem? We are seeing the same issue.

Thanks,
Dan.

Return to “LINUX”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest