Rock960[A/B/C] kernel patch for supporting some USB GbE

      Comments Off on Rock960[A/B/C] kernel patch for supporting some USB GbE

Here’s my kernel patch for Rock960[A/B/C] board based on git – “stable-4.4-rk3399-linux-v2.1x” branch patch for support or modified for :

  • Governor for performance.
  • Supporting latest version of Realtek r8152/3 USB 3.0 GbE ( merged version of “9” )
  • Supporting latest version of Cypress GX3 USB 3.0 GbE
  • Supporting latest version of Microchip LAN7800 USB 3.0 GbE ( version 1.0.5.4.4.1.0 )

Preparation

Refer to base build environments here : https://rageworx.info/?p=1610

Kernel

Case #1 : Using rockchip linux kernel.

Move your original kernel directory with mv kernel kernel_origin.
Then you can clone a repository from here: https://github.com/rockchip-linux/kernel
Then switch branch to “stable-4.4-rk3399-linux-v2.1x” in kernel directory

$ cd kernel; git checkout "stable-4.4-rk3399-linux-v2.1x"

-update-
This kernel branch provides improved functions for MIPI-CSI2, and some stabilities.

Case #2: Using Rock960 kernel

Or Just use Rockchip’s kernel when it back up with cp -rf kernel kernel_backup.

Download a patch

Download “Rock960[A/B/C] kernel statble-4.4-rk3399-linux-v2.1x patch #1”

kernel_patch.zip – Downloaded 2552 times – 82.44 KB

Modify patch for your condition

You can changes patch contents what you needed.

Apply patch

copy patch file into “kernel” directory and, do this in shell.

$ patch -p < kernel.patch

Copy device trees

Rockchip linux not contains Rock960 board devices tree.
Copy two dts files from my zip file, or your original kernel.

dts may place here: ${your kernel}/arch/arm64/boot/dts/rockchip.

Copy cyusb3610.* to usb network driver path.

Copy cyusb3610.h and c file into ${your kernel}/drivers/net/usb.

Known issue

  • Realtek R8152/3 USB 3.0 GbE makes network be unexpected status when system board power down or while reboot.
  • Recommend to unplug RJ45 from adapter or, turn off power supply for USB 3.0 HUB if you got each selective power button or switch.
  • STILL Rockchip linux kernel has many bug in ISP with MIPI CSI2 cameras – when it solved Rockchip ?
    My testing new camera cannot streaming on with this kernel.
    – Update – Improved kernel provides much better performance and stabilities in ISP.

Performance

  • Tested with iperf3 at GbE router, and each performance depends on your network.
    • r8152 : around 950~960Mbps.
    • Cypress GX3 : around 800~850Mbps.
    • Microchip LAN7800 : around 800~850Mbps.

Build

Building kernel is same as Rock960’s method.
Use build/mk-kernel.sh rock960xx script.

Replacing flashed kernel

When kernel compilation completed as well, you can see “boot.img” in “out” directory.
Flash boot.img with mask-rom mode, or with dd in Rock960 board.

$ sudo rkdeveloptool db ${your maskrom bootloader}
$ sudo rkdeveloptool wlx boot out/boot.img
$ sudo rkdeveloptool rd

– or –

$ sudo dd if=boot.img of=/dev/mmcblk1p4 conv=sync status=progress
$ sync; sudo reboot

You can see new kernel will be loaded with USB-tty debugging log, or dmesg in LXterminal.