PINE64
openwrt for the rock64 - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: ROCK64 (https://forum.pine64.org/forumdisplay.php?fid=85)
+--- Forum: Linux on Rock64 (https://forum.pine64.org/forumdisplay.php?fid=88)
+--- Thread: openwrt for the rock64 (/showthread.php?tid=11012)

Pages: 1 2 3


RE: openwrt for the rock64 - gechu - 05-15-2021

(05-14-2021, 11:16 PM)helpmerock Wrote: Hi Wilson,
How to install this? There are three files - which file to use in Etcher?

rootfs - file - no boot partition <- a message in Eatcher
The other two files - rock64 does not boot.
Go for the sysupgrade with ext. The other sysupgrade would also work, but that filesystem is generally targeted for constrained devices


RE: openwrt for the rock64 - helpmerock - 05-16-2021

(05-15-2021, 02:20 PM)gechu Wrote:
(05-14-2021, 11:16 PM)helpmerock Wrote: Hi Wilson,
How to install this? There are three files - which file to use in Etcher?

rootfs - file - no boot partition <- a message in Eatcher
The other two files - rock64 does not boot.
Go for the sysupgrade with ext. The other sysupgrade would also work, but that filesystem is generally targeted for constrained devices
Thanks, Gechu,
I will try with an alternate image burner & post the result


RE: openwrt for the rock64 - helpmerock - 05-21-2021

used :openwrt-rockchip-armv8-pine64_rock64-ext4-sysupgrade.img.gz - extracted & burn image using Win32DiskImager - worked.

Booted & web interface on 192.168.1.1 - was conflicting with the existing router.

In setting changed OpenWrt to 192.168.2.1 & good to go.

Thanks Wilson & Gechu


RE: openwrt for the rock64 - stamasd - 05-22-2021

Thank you, it works. Unfortunately, there aren't compiled modules for some very popular USB wifi adapters. In particular, I use MT7601AN and RTL8811AU. Do you think it's possible to compile support for those? I know they are well supported in mainline kernels, and both work fine in the Armbian version for Rock64.
Thanks!


RE: openwrt for the rock64 - stamasd - 05-23-2021

Alternately, an even better solution @wilsonYan would be to have access to your toolchain/SDK, this way we could compile our own modules and packages without pestering you. Even a patch against the openwrt tree would work because I could then generate my own toolchain (I've done it frequently). Any help much appreciated.


RE: openwrt for the rock64 - wilsonYan - 06-28-2021

Hello,

https://yadi.sk/d/TfX6-MYy3RTf5h?w=1

I've updated the build again, this one is more plain but hopefully more stable, unfortunately for the r8156 it's defaulting to the in-tree cdc_ncm driver and openwrt doesn't have the easy way of copying the udev rule file over. I hear you guys, i'll put the patches out. It's just that they aren't very clean.


Have a go enabling threading perhaps, some drivers seem to allow it e.g:

echo 1 > /sys/class/net/eth0/threaded
echo 1 > /sys/class/net/eth1/threaded


Also note that when initially setting up interfaces you may need to reboot for everything to take effect. It seems like the ongoing persistent problem is when you try to use two usb nics off the usb3.0 port, especially if you are bridging / bridging vlans etc.


RE: openwrt for the rock64 - wilsonYan - 09-22-2021

for anyone interested these are the basic kernel patches:
the change to the ethernet node could probably go upstream

Code:
diff --git a/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts b/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
index 95ab6928cfd4..13385bf3daa6 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
@@ -45,7 +45,8 @@ vcc_host_5v: vcc-host-5v-regulator {

    vcc_host1_5v: vcc_otg_5v: vcc-host1-5v-regulator {
        compatible = "regulator-fixed";
-        gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>;
+        enable-active-high;
+        gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
        pinctrl-names = "default";
        pinctrl-0 = <&usb20_host_drv>;
        regulator-name = "vcc_host1_5v";
@@ -87,7 +88,8 @@ standby_led: led-1 {
    sound {
        compatible = "audio-graph-card";
        label = "rockchip,rk3328";
-        dais = <&i2s1_p0
+        dais = <&i2s0_p0
+            &i2s1_p0
            &spdif_p0>;
    };

@@ -161,12 +163,30 @@ &gmac2io {

&hdmi {
    status = "okay";
+
+    port@0 {
+        hdmi_p0_0: endpoint {
+            remote-endpoint = <&i2s0_p0_0>;
+        };
+    };
};

&hdmiphy {
    status = "okay";
};

+&i2s0 {
+    status = "okay";
+
+    i2s0_p0: port {
+        i2s0_p0_0: endpoint {
+            dai-format = "i2s";
+            mclk-fs = <256>;
+            remote-endpoint = <&hdmi_p0_0>;
+        };
+    };
+};
+
&i2c1 {
    status = "okay";

@@ -365,6 +385,9 @@ &tsadc {

&uart2 {
    status = "okay";
+
+    /delete-property/ dmas;
+    /delete-property/ dma-names;
};

&u2phy {
@@ -397,6 +420,15 @@ &usb_host0_ohci {
    status = "okay";
};

+&usbdrd3 {
+    status = "okay";
+};
+
+&usbdrd_dwc3 {
+    dr_mode = "host";
+    status = "okay";
+};
+
&vop {
    status = "okay";
};

Code:
diff --git a/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts b/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
index 13385bf3daa6..7711efd856a8 100644
--- a/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts
@@ -148,17 +148,30 @@ &gmac2io {
    assigned-clocks = <&cru SCLK_MAC2IO>, <&cru SCLK_MAC2IO_EXT>;
    assigned-clock-parents = <&gmac_clkin>, <&gmac_clkin>;
    clock_in_out = "input";
-    phy-supply = <&vcc_io>;
+    phy-handle = <&rtl8211f>;
    phy-mode = "rgmii";
-    pinctrl-names = "default";
+    phy-supply = <&vcc_io>;
    pinctrl-0 = <&rgmiim1_pins>;
-    snps,force_thresh_dma_mode;
-    snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
-    snps,reset-active-low;
-    snps,reset-delays-us = <0 10000 50000>;
-    tx_delay = <0x24>;
+    pinctrl-names = "default";
+    snps,aal;
    rx_delay = <0x18>;
+    tx_delay = <0x24>;
    status = "okay";
+
+    mdio {
+        compatible = "snps,dwmac-mdio";
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        rtl8211f: ethernet-phy@1 {
+            reg = <1>;
+            pinctrl-0 = <&eth_phy_reset_pin>;
+            pinctrl-names = "default";
+            reset-assert-us = <10000>;
+            reset-deassert-us = <50000>;
+            reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
+        };
+    };
};

&hdmi {
@@ -323,6 +336,12 @@ &io_domains {
};

&pinctrl {
+    gmac2io {
+        eth_phy_reset_pin: eth-phy-reset-pin {
+            rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
+        };
+    };
+
    ir {
        ir_int: ir-int {
            rockchip,pins = <2 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;

Hello again ! I've recently put together a new build.

CHANGES OF NOTE:

* Latest glibc / 5.10 kernel / openwrt packages
* Reworked the ethernet node in the DTS file ! (no more weird load problem and network restarts are possible without issue !)
* Led functionality is now enabled and configurable from GUI
* Small change copied from ayufan for power.
Small xhci change lifted from git.kernel.org


DOWNLOAD LINKS:

EXT4 Filesystem:
https://disk.yandex.com/d/K4d4knF7iBqkHw

SQUASHFS Filesystem:
https://disk.yandex.com/d/IG8mO4kMOPetwQ

TODO: 

* Release the patches I have that make this build  (see above post for the main kernel patches)
* Possibly get sound and display working
* Possibly add more packages/support for things like qos

OUTSTANDING:

* Asix ax88179 adapter is still unreliable for me  when plugged directly into the usb3 port. It appears to be much better when plugged into a usb3 hub (I haven't been able to crash it yet though i'm not sure this driver has ever been reliable when using bridging vendor or no vendor)

* I've switched the realtek r8152 driver to the vendor driver. The rtl8156 (2.5gbps) may stil be unreliable or only operate in 1gbps mode though.


RE: openwrt for the rock64 - wilsonYan - 09-22-2021

I've just done one last update to latest mainline because it had a mac80211 update.
Sorry to people that already downloaded from the old links the above post has been edited to contain the latest links.


RE: openwrt for the rock64 - helpmerock - 11-26-2021

@wilsonYan ,  How to update this:

Details for package kmod-usb-net-rtl8152
Version: 5.10.80-1
Size: ~29.4 KB installed
Dependencies:
kernel VERSION INCOMPATIBLE
librt INSTALLED
libpthread INSTALLED
libgcc1 INSTALLED
kmod-usb-net INSTALLED
kmod-mii INSTALLED
kmod-usb-core INSTALLED
kmod-nls-base INSTALLED
kmod-crypto-hash INSTALLED
Description
Kernel module for USB-to-Ethernet Realtek 8152 USB2.0/3.0 convertors

The installed version of package kernel is not compatible, require 5.10.80-1-e591d70d… while 5.10.67-1-b9373165… is installed.


RE: openwrt for the rock64 - CanadianBacon - 12-20-2021

(11-26-2021, 08:01 PM)helpmerock Wrote: @wilsonYan ,  How to update this:

Details for package kmod-usb-net-rtl8152
Version: 5.10.80-1
Size: ~29.4 KB installed
Dependencies:
kernel VERSION INCOMPATIBLE
librt INSTALLED
libpthread INSTALLED
libgcc1 INSTALLED
kmod-usb-net INSTALLED
kmod-mii INSTALLED
kmod-usb-core INSTALLED
kmod-nls-base INSTALLED
kmod-crypto-hash INSTALLED
Description
Kernel module for USB-to-Ethernet Realtek 8152 USB2.0/3.0 convertors

The installed version of package kernel is not compatible, require 5.10.80-1-e591d70d… while 5.10.67-1-b9373165… is installed.

Hiya, there is a semi-active fork of openwrt at https://github.com/lucize/openwrt/tree/rk3328 which supports building for the rock64.

I recently rebased it on openwrt/master so my fork is more up to date and should support up-to-date packages.
https://github.com/CanadianBaconBoi/openwrt/tree/rk3328

Here it is in the Target Profile screen.
[Image: 2PniRYy.png]