Skip to contentSkip to conversation

Ethernet via USB on Sinlinx SinA33

U-Boot Quentin Schulz 2 participants 8 messages Mar 25, 2016 – Apr 11, 2016

lore
Share & tools
lore
#0 lore raw

Hi,

I am trying to get Ethernet to work through the USB port of the Sinlinx SinA33 on U-Boot to use TFTP to get the kernel and dtb files.

However, I am getting 'data abort' when using dhcp or tftp after adding:
#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX

to include/configs/sunxi-common.h and checking CONFIG_USB_EHCI_HCD as told in the documentation [1]

I tested this configuration with the C.H.I.P. and it is working well.

Steps to reproduce:

1) Add the following lines to include/configs/sunxi-common.h:

#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX

2) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- Sinlinx_SinA33_defconfig
3) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
4) Check CONFIG_USB_EHCI_HC and save configuration
5) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j$(nproc)
6) Prepare SDCard:
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
7) Boot the board and run dhcp or tftp
8) Get 'data abort' and board gets reset (ethact is also not defined)

The log file is attached.

Thank you,

Quentin

[1] https://github.com/lentinj/u-boot/blob/master/doc/README.usb#L132
-------------- next part --------------
U-Boot SPL 2016.01-dirty (Mar 25 2016 - 17:54:10)
DRAM: 1024 MiB
Trying to boot from MMC

U-Boot 2016.01-dirty (Mar 25 2016 - 17:54:10 +0100) Allwinner Technology

CPU:   Allwinner A33 (SUN8I)
DRAM:  1 GiB
MMC:   SUNXI SD/MMC: 0

*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0

scanning bus 0 for devices...
Warning: asix_eth MAC addresses don't match:
Address in SROM is 00:80:8e:8a:95:1b
Address in environment is 02:44:08:0d:8d:1a
2 USB Device(s) found
Hit any key to stop autoboot: 0
=> print ipaddr
## Error: "ipaddr" not defined
=> dhcp
BOOTP broadcast 1
DHCP client bound to address 192.168.1.43 (217 ms)
*** Warning: no boot file name; using 'C0A8012B.img'
Using asix_eth device
TFTP from server 0.0.0.0; our IP address is 192.168.1.43; sending through gateway 192.168.1.1 Filename 'C0A8012B.img'.
Load address: 0x42000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
data abort

pc : [<7ef7be3c>]          lr : [<7efb107c>]

reloc pc : [<4a015e3c>] lr : [<4a04b07c>]
sp : 7af41150 ip : 0d084402 fp : 7af4aa70
r10: 00000000 r9 : 7af45ee8 r8 : 0000000a
r7 : 00000000 r6 : 7af57040 r5 : 7af56ff8 r4 : 7efb1084
r3 : 7af56f88 r2 : 00000000 r1 : 000000b8 r0 : ffc2003d
Flags: NzCv IRQs off FIQs off Mode SVC_32
Resetting CPU ...

resetting ...

#1 lore raw

Hi,

Quoted 5 lines · Quentin Schulz

Hi,

I am trying to get Ethernet to work through the USB port of the Sinlinx SinA33 on U-Boot to use TFTP to get the kernel and dtb files.

Quoted 8 lines

However, I am getting 'data abort' when using dhcp or tftp after adding:
#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX

to include/configs/sunxi-common.h and checking CONFIG_USB_EHCI_HCD as told in the documentation [1]

I tested this configuration with the C.H.I.P. and it is working well.

Are you perhaps building u-boot with gcc6 ? There are some known issues when building u-boot with gcc-6, which look pretty much like this.

Is the ethernet adapter connected to a regular usb host port, or to the otg port ?

Regards,

Hans

Quoted 25 lines

Steps to reproduce:

1) Add the following lines to include/configs/sunxi-common.h:

#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX

2) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- Sinlinx_SinA33_defconfig
3) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
4) Check CONFIG_USB_EHCI_HC and save configuration
5) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j$(nproc)
6) Prepare SDCard:
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
7) Boot the board and run dhcp or tftp
8) Get 'data abort' and board gets reset (ethact is also not defined)

The log file is attached.

Thank you,

Quentin

[1] https://github.com/lentinj/u-boot/blob/master/doc/README.usb#L132

#2 lore raw

Hi,

Quoted 12 lines · Hans de Goede

Hi,

Quoted 9 lines · Quentin Schulz

Hi,

I am trying to get Ethernet to work through the USB port of the Sinlinx SinA33 on U-Boot to use TFTP to get the kernel and dtb files.

However, I am getting 'data abort' when using dhcp or tftp after adding:
#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX

Quoted 7 lines
Quoted 4 lines

to include/configs/sunxi-common.h and checking CONFIG_USB_EHCI_HCD as told in the documentation [1]

I tested this configuration with the C.H.I.P. and it is working well.

Are you perhaps building u-boot with gcc6 ? There are some known issues when building u-boot with gcc-6, which look pretty much like this.

No, I'm building with gcc-5:

$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Ubuntu 5.2.1-22ubuntu1) 5.2.1 20151010
Quoted 2 lines

Is the ethernet adapter connected to a regular usb host port, or to the otg port ?

The Ethernet adapter is connected to the regular USB host port.

Regards,

Quentin

Quoted 25 lines
Quoted 25 lines

Steps to reproduce:

1) Add the following lines to include/configs/sunxi-common.h:

#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX

2) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- Sinlinx_SinA33_defconfig
3) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
4) Check CONFIG_USB_EHCI_HC and save configuration
5) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j$(nproc)
6) Prepare SDCard:
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
7) Boot the board and run dhcp or tftp
8) Get 'data abort' and board gets reset (ethact is also not defined)

The log file is attached.

Thank you,

Quentin

[1] https://github.com/lentinj/u-boot/blob/master/doc/README.usb#L132

#3 lore raw

Hi,

Quoted 23 lines · Quentin Schulz

Hi,

Quoted 12 lines · Hans de Goede

Hi,

Quoted 9 lines · Quentin Schulz

Hi,

I am trying to get Ethernet to work through the USB port of the Sinlinx SinA33 on U-Boot to use TFTP to get the kernel and dtb files.

However, I am getting 'data abort' when using dhcp or tftp after adding:
#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX

Quoted 7 lines
Quoted 4 lines

to include/configs/sunxi-common.h and checking CONFIG_USB_EHCI_HCD as told in the documentation [1]

I tested this configuration with the C.H.I.P. and it is working well.

Are you perhaps building u-boot with gcc6 ? There are some known issues when building u-boot with gcc-6, which look pretty much like this.

Quoted 8 lines

No, I'm building with gcc-5:

$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Ubuntu 5.2.1-22ubuntu1) 5.2.1 20151010
Quoted 2 lines

Is the ethernet adapter connected to a regular usb host port, or to the otg port ?

The Ethernet adapter is connected to the regular USB host port.

Hmm, then maybe we are missing some cache flusing somewhere in the ehci code?

Otherwise I would not know what the issue might be.

Regards,

Hans

#4 lore raw
In reply to Quentin Schulz

Hi,

Quoted 23 lines · Quentin Schulz

Hi,

Quoted 12 lines · Hans de Goede

Hi,

Quoted 9 lines · Quentin Schulz

Hi,

I am trying to get Ethernet to work through the USB port of the Sinlinx SinA33 on U-Boot to use TFTP to get the kernel and dtb files.

However, I am getting 'data abort' when using dhcp or tftp after adding:
#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX

Quoted 7 lines
Quoted 4 lines

to include/configs/sunxi-common.h and checking CONFIG_USB_EHCI_HCD as told in the documentation [1]

I tested this configuration with the C.H.I.P. and it is working well.

Are you perhaps building u-boot with gcc6 ? There are some known issues when building u-boot with gcc-6, which look pretty much like this.

Quoted 8 lines

No, I'm building with gcc-5:

$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Ubuntu 5.2.1-22ubuntu1) 5.2.1 20151010
Quoted 2 lines

Is the ethernet adapter connected to a regular usb host port, or to the otg port ?

The Ethernet adapter is connected to the regular USB host port.

So I've been debugging some armv7 cache issues lately and I've come up with the following fix:

https://patchwork.ozlabs.org/patch/605967/

This might very will fix your issue too. If not we're likely missing some cache flushing / invalidation in the usb driver for your usb host controller.

Regards,

Hans

Quoted 31 lines

Regards,

Quentin

Quoted 25 lines
Quoted 25 lines

Steps to reproduce:

1) Add the following lines to include/configs/sunxi-common.h:

#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX

2) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- Sinlinx_SinA33_defconfig
3) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
4) Check CONFIG_USB_EHCI_HC and save configuration
5) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j$(nproc)
6) Prepare SDCard:
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
7) Boot the board and run dhcp or tftp
8) Get 'data abort' and board gets reset (ethact is also not defined)

The log file is attached.

Thank you,

Quentin

[1] https://github.com/lentinj/u-boot/blob/master/doc/README.usb#L132

#5 lore raw

Hi,

Quoted 41 lines · Hans de Goede

Hi,

Quoted 24 lines · Quentin Schulz

Hi,

Quoted 13 lines · Hans de Goede

Hi,

Quoted 10 lines · Quentin Schulz

Hi,

I am trying to get Ethernet to work through the USB port of the Sinlinx SinA33 on U-Boot to use TFTP to get the kernel and dtb files.

However, I am getting 'data abort' when using dhcp or tftp after adding:
#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX

Quoted 7 lines
Quoted 4 lines

to include/configs/sunxi-common.h and checking CONFIG_USB_EHCI_HCD as told in the documentation [1]

I tested this configuration with the C.H.I.P. and it is working well.

Are you perhaps building u-boot with gcc6 ? There are some known issues when building u-boot with gcc-6, which look pretty much like this.

Quoted 8 lines

No, I'm building with gcc-5:

$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Ubuntu 5.2.1-22ubuntu1) 5.2.1 20151010
Quoted 2 lines

Is the ethernet adapter connected to a regular usb host port, or to the otg port ?

The Ethernet adapter is connected to the regular USB host port.

So I've been debugging some armv7 cache issues lately and I've come up with the following fix:

https://patchwork.ozlabs.org/patch/605967/

Quoted 7 lines

This might very will fix your issue too. If not we're likely missing some cache flushing / invalidation in the usb driver for your usb host controller.

Regards,

Hans

I actually tried uboot-sunxi repository (and then checked out on merge commit in master for this repository) and it is working as expected: I get Ethernet over USB.

I tested with master (43d3fb5c0609a76409e7859a2a5800670c7b5bd2) and I first get a reset of the board when starting USB (before I can enter U-Boot command line) and then after the reboot, U-Boot hangs on starting USB (still before the command line).

I did a git bisect on master and it returned this commit:
http://git.denx.de/?p=u-boot.git;a=commit;h=3f9f8a5b83f8aec40c9f4ee496046a695e333c45

Tell me if I can help in any way.

Regards,

Quentin

Quoted 31 lines
Quoted 31 lines

Regards,

Quentin

Quoted 25 lines
Quoted 25 lines

Steps to reproduce:

1) Add the following lines to include/configs/sunxi-common.h:

#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX

2) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- Sinlinx_SinA33_defconfig
3) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
4) Check CONFIG_USB_EHCI_HC and save configuration
5) make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j$(nproc)
6) Prepare SDCard:
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX bs=1024 seek=8
7) Boot the board and run dhcp or tftp
8) Get 'data abort' and board gets reset (ethact is also not defined)

The log file is attached.

Thank you,

Quentin

[1] https://github.com/lentinj/u-boot/blob/master/doc/README.usb#L132

#6 lore raw

Hi,

Quoted 56 lines · Quentin Schulz

Hi,

Quoted 41 lines · Hans de Goede

Hi,

Quoted 24 lines · Quentin Schulz

Hi,

Quoted 13 lines · Hans de Goede

Hi,

Quoted 10 lines · Quentin Schulz

Hi,

I am trying to get Ethernet to work through the USB port of the Sinlinx SinA33 on U-Boot to use TFTP to get the kernel and dtb files.

However, I am getting 'data abort' when using dhcp or tftp after adding:
#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX

Quoted 7 lines
Quoted 4 lines

to include/configs/sunxi-common.h and checking CONFIG_USB_EHCI_HCD as told in the documentation [1]

I tested this configuration with the C.H.I.P. and it is working well.

Are you perhaps building u-boot with gcc6 ? There are some known issues when building u-boot with gcc-6, which look pretty much like this.

Quoted 8 lines

No, I'm building with gcc-5:

$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Ubuntu 5.2.1-22ubuntu1) 5.2.1 20151010
Quoted 2 lines

Is the ethernet adapter connected to a regular usb host port, or to the otg port ?

The Ethernet adapter is connected to the regular USB host port.

So I've been debugging some armv7 cache issues lately and I've come up with the following fix:

https://patchwork.ozlabs.org/patch/605967/

Quoted 7 lines

This might very will fix your issue too. If not we're likely missing some cache flushing / invalidation in the usb driver for your usb host controller.

Regards,

Hans

I actually tried uboot-sunxi repository (and then checked out on merge commit in master for this repository) and it is working as expected: I get Ethernet over USB.

Quoted 7 lines

I tested with master (43d3fb5c0609a76409e7859a2a5800670c7b5bd2) and I first get a reset of the board when starting USB (before I can enter U-Boot command line) and then after the reboot, U-Boot hangs on starting USB (still before the command line).

I did a git bisect on master and it returned this commit:
http://git.denx.de/?p=u-boot.git;a=commit;h=3f9f8a5b83f8aec40c9f4ee496046a695e333c45

Ah, that is fixed by this commit:

http://git.denx.de/?p=u-boot/u-boot-usb.git;a=commitdiff;h=cfb3f1cd0e022711d69ff040884357b8410865ef

A pullreq for which was send this morning, so this should be fixed in master as soon as the u-boot-usb pull-req gets merged.

Regards,

Hans

#7 lore raw

Hi,

Quoted 75 lines · Hans de Goede

Hi,

Quoted 58 lines · Quentin Schulz

Hi,

Quoted 43 lines · Hans de Goede

Hi,

Quoted 26 lines · Quentin Schulz

Hi,

Quoted 14 lines · Hans de Goede

Hi,

Quoted 11 lines · Quentin Schulz

Hi,

I am trying to get Ethernet to work through the USB port of the Sinlinx
SinA33 on U-Boot to use TFTP to get the kernel and dtb files.

However, I am getting 'data abort' when using dhcp or tftp after adding:
#define CONFIG_USB_HOST_ETHER
#define CONFIG_USB_ETHER_ASIX

Quoted 8 lines
Quoted 4 lines

to include/configs/sunxi-common.h and checking CONFIG_USB_EHCI_HCD as told in the documentation [1]

I tested this configuration with the C.H.I.P. and it is working well.

Are you perhaps building u-boot with gcc6 ? There are some known issues
when building u-boot with gcc-6, which look pretty much like this.

Quoted 8 lines

No, I'm building with gcc-5:

$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Ubuntu 5.2.1-22ubuntu1) 5.2.1 20151010
Quoted 2 lines

Is the ethernet adapter connected to a regular usb host port, or to the otg port ?

The Ethernet adapter is connected to the regular USB host port.

So I've been debugging some armv7 cache issues lately and I've come up with the following fix:

https://patchwork.ozlabs.org/patch/605967/

Quoted 7 lines

This might very will fix your issue too. If not we're likely missing some cache flushing / invalidation in the usb driver for your usb host controller.

Regards,

Hans

I actually tried uboot-sunxi repository (and then checked out on merge commit in master for this repository) and it is working as expected: I get Ethernet over USB.

Quoted 8 lines

I tested with master (43d3fb5c0609a76409e7859a2a5800670c7b5bd2) and I first get a reset of the board when starting USB (before I can enter U-Boot command line) and then after the reboot, U-Boot hangs on starting USB (still before the command line).

I did a git bisect on master and it returned this commit:
http://git.denx.de/?p=u-boot.git;a=commit;h=3f9f8a5b83f8aec40c9f4ee496046a695e333c45

Ah, that is fixed by this commit:

http://git.denx.de/?p=u-boot/u-boot-usb.git;a=commitdiff;h=cfb3f1cd0e022711d69ff040884357b8410865ef

Quoted 6 lines

A pullreq for which was send this morning, so this should be fixed in master as soon as the u-boot-usb pull-req gets merged.

Regards,

Hans

Tested with the patch, the issue is solved. Thanks Hans!

Regards,

Quentin