Solved RTL8153B Gbit interface not loading FreeBSD 13.0 ALPHA2 installed RK3328 board

alfa

Member

Reaction score: 3
Messages: 20

Hi, i have installed FreeBSD 13.0 ALPHA2 ROCK64 on Orange Pi R1 Plus but
RTL8153B is not loading. When i typed ifconfig there is only dwc0 interface(RTL8211E)
and also FreeBSD is recognizing double RTL8211 phy devices so that what is the my problem?
any help would be appreciated
Code:
root@generic:~ # dmesg | grep RTL
rgephy0: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 0 on miibus0
rgephy1: <RTL8169S/8110S/8211 1000BASE-T media interface> PHY 1 on miibus0
Code:
root@generic:~ # dmesg | grep ure0
root@generic:~ #

Code:
root@generic:~ # uname -a
FreeBSD generic 13.0-ALPHA2 FreeBSD 13.0-ALPHA2 #0 c256201-g02611ef8ee9: Fri Jan 22 06:35:39 UTC 2021     [EMAIL]root@releng1.nyi.freebsd.org[/EMAIL]:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC  arm64
regards
 
Last edited by a moderator:
OP
alfa

alfa

Member

Reaction score: 3
Messages: 20

When i tried @ganbold 's FreeBSD image
here is the result:
this time FreeBSD recognized RTL8153b but attaching PHY is failed shown below from logs
so what can be the problem?

Code:
root@generic:~ # usbconfig
ugen0.1: <Synopsys XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.2: <Realtek USB 10/100/1000 LAN> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (72mA)

root@generic:~ # dmesg | grep ure0
ure0 on uhub3
ure0: <Realtek USB 10/100/1000 LAN, class 0/0, rev 3.00/31.00, addr 1> on usbus3
ure0: unknown version 0x0000
ure0: timeout waiting for chip autoload
ure0: timeout waiting for phy to stabilize
ure0: timeout waiting for phy to stabilize
ure0: timeout waiting for phy to stabilize
ure0: MAC assigned randomly
ure0: attaching PHYs failed

root@generic:~ # usbconfig -d ugen3.2 dump_device_desc
ugen3.2: <Realtek USB 10/100/1000 LAN> at usbus3, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (72mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0300
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0009
  idVendor = 0x0bda
  idProduct = 0x8153
  bcdDevice = 0x3100
  iManufacturer = 0x0001  <retrieving string failed>
  iProduct = 0x0002  <retrieving string failed>
  iSerialNumber = 0x0006  <retrieving string failed>
  bNumConfigurations = 0x0002

root@generic:~ # usbconfig -d ugen3.2 dump_all_config_desc | grep -i binterface
      bInterfaceNumber = 0x0000
      bInterfaceClass = 0x00ff  <Vendor specific>
      bInterfaceSubClass = 0x00ff
      bInterfaceProtocol = 0x0000
 
Last edited by a moderator:

guyyur

New Member


Messages: 2

Hi, I got an Orange Pi R1 Plus yesterday and encountered the same problem.
The driver tries to read the chip version and fails with USB_ERR_IOERROR.
I saw some linux posts about issues with the USB 3.0 controller (hangs, unreliable irqs, ...)

If I reset the device (appears as ugen4.2 for me), the chip version is read as 0x6010.
usbconfig -d ugen4.2 reset

This chip version is not supported in FreeBSD 13.0-RC5.
In OpenBSD it was added with this commit:

I saw there is bug report with a patch to add support for RTL8153B, RTL8156, RTL8156B:

I also attempted to port openbsd support for RTL8153B only:

When I run with my patch the card is detected after "usbconfig ... reset" but I get xhci resets when trying to transmit.
So there are more fixes needed (possibly in xhci controller or device tree).

xhci0: Resetting controller
uhub2: at usbus4, port 1, addr 1 (disconnected)
ugen4.2: <Realtek USB 10/100/1000 LAN> at usbus4 (disconnected)
ure0: at uhub2, port 2, addr 1 (disconnected)
 
OP
alfa

alfa

Member

Reaction score: 3
Messages: 20

Szczepan

New Member

Reaction score: 2
Messages: 4

Hi, I got an Orange Pi R1 Plus yesterday and encountered the same problem.
The driver tries to read the chip version and fails with USB_ERR_IOERROR.
I saw some linux posts about issues with the USB 3.0 controller (hangs, unreliable irqs, ...)

If I reset the device (appears as ugen4.2 for me), the chip version is read as 0x6010.
usbconfig -d ugen4.2 reset

This chip version is not supported in FreeBSD 13.0-RC5.
In OpenBSD it was added with this commit:

I saw there is bug report with a patch to add support for RTL8153B, RTL8156, RTL8156B:

I also attempted to port openbsd support for RTL8153B only:

When I run with my patch the card is detected after "usbconfig ... reset" but I get xhci resets when trying to transmit.
So there are more fixes needed (possibly in xhci controller or device tree).

xhci0: Resetting controller
uhub2: at usbus4, port 1, addr 1 (disconnected)
ugen4.2: <Realtek USB 10/100/1000 LAN> at usbus4 (disconnected)
ure0: at uhub2, port 2, addr 1 (disconnected)
Have you tried 13-RELEASE maybe?
Also which image did you use (or you made one based on what)?
 

guyyur

New Member


Messages: 2

Have you tried 13-RELEASE maybe?
Also which image did you use (or you made one based on what)?
I built 13-RELEASE kernel from source with patches for ure driver to support RTL8153B and added r1plus dts files based on linux-orangepi.
I also used a local port based on u-boot-master but with patches for r1 plus based on u-boot-orangepi.

The USB3 controller is not working correctly so the RTL8153B nic is not working.
Either the device tree I used is missing something or the usb3 controller driver needs some changes.

Looks like RK3328 is not supported as well as RK3399,
there is no usb3 listed in rk3328.dtsi in mainline linux
and there is no dts file for the board in mainline u-boot nor in mainline linux tree.
 

Szczepan

New Member

Reaction score: 2
Messages: 4

Hm, those two ethernet are supported under Linux OpenWrt, so dts must be present (at least for NanoPi R2S as I own this board), but the same thing under FreeBSD :)
 

SleepWalker

Member

Reaction score: 36
Messages: 39

Hello everybody!

I managed to create a custom U-boot for the Nano-Pi-R2S.
It allows FreeBSD 14.0-CURRENT to run on Nano-Pi-R2S.
I also have a custom build of FreeBSD 13.0-RELEASE with a fixed if_ure driver.
No dtb files required. FreeBSD gets dtb from U-boot via EFI.

The test image can be downloaded here.
 
Top