From dd4bbf675c4bd13cc0cee9913344b5b999fe218b Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 14 Aug 2022 06:53:39 +0000 Subject: [PATCH 1/5] rockchip: add FriendlyElec NanoPi R5S support --- .../rockchip/armv8/base-files/etc/board.d/01_leds | 5 +++++ .../base-files/etc/hotplug.d/net/40-net-smp-affinity | 5 +++++ target/linux/rockchip/image/armv8.mk | 10 ++++++++++ 3 files changed, 20 insertions(+) diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds index f61b0899f00ab2..c11c7e2434f6db 100755 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds @@ -27,6 +27,11 @@ sharevdi,guangmiao-g4c) firefly,rk3568-roc-pc) ucidef_set_led_timer "health" "health" "firefly:yellow:user" "200" "800" ;; +friendlyelec,nanopi-r5s) + ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0" + ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "eth1" + ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth2" + ;; esac board_config_flush diff --git a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity index 7577d1cf4f2a7c..50eac11e598ec6 100644 --- a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity +++ b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity @@ -48,5 +48,10 @@ firefly,rk3568-roc-pc) set_interface_core 2 "eth0" set_interface_core 4 "eth1" ;; +friendlyelec,nanopi-r5s + set_interface_core 0 "eth0" + set_interface_core 2 "eth1" + set_interface_core 4 "eth2" + ;; esac diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index f7567dea3f4851..797a654e790b8b 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -91,6 +91,16 @@ define Device/friendlyarm_nanopi-r4se endef TARGET_DEVICES += friendlyarm_nanopi-r4se +define Device/friendlyelec_nanopi-r5s + DEVICE_VENDOR := FriendlyARM + DEVICE_MODEL := NanoPi R5S + SOC := rk3568 + UBOOT_DEVICE_NAME := nanopi-r5s-rk3568 + IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r5s | pine64-img | gzip | append-metadata + DEVICE_PACKAGES := kmod-r8125 +endef +TARGET_DEVICES += friendlyelec_nanopi-r5s + define Device/pine64_rockpro64 DEVICE_VENDOR := Pine64 DEVICE_MODEL := RockPro64 From c2f62b177926e5ccd2ebee098a2757deafa0a484 Mon Sep 17 00:00:00 2001 From: littoy <103546957+littoy@users.noreply.github.com> Date: Sun, 14 Aug 2022 16:37:26 +0800 Subject: [PATCH 2/5] rockchip: set rockchip_setup_macs for NanoPi R5S Co-authored-by: fishg <1423545+fishg@users.noreply.github.com> --- target/linux/rockchip/armv8/base-files/etc/board.d/02_network | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network index 16530cea3bde2e..edd4eb51699c51 100755 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network @@ -53,6 +53,7 @@ rockchip_setup_macs() friendlyarm,nanopi-r2c|\ friendlyarm,nanopi-r2s|\ sharevdi,guangmiao-g4c|\ + friendlyelec,nanopi-r5s|\ firefly,rk3568-roc-pc) wan_mac=$(nanopi_r2s_generate_mac) lan_mac=$(macaddr_add "$wan_mac" +1) From 1c9fcd0a667070887a16421e7eac2df3bf86ca7b Mon Sep 17 00:00:00 2001 From: aakkll <94471752+aakkll@users.noreply.github.com> Date: Sun, 14 Aug 2022 23:33:10 +0800 Subject: [PATCH 3/5] kernel: refresh 5.15 patch (#9944) Signed-off-by: aakkll <94471752+aakkll@users.noreply.github.com> Signed-off-by: aakkll <94471752+aakkll@users.noreply.github.com> --- .../208-rockchip-rk3399-add-support-for-GuangMiao-G4C.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/rockchip/patches-5.15/208-rockchip-rk3399-add-support-for-GuangMiao-G4C.patch b/target/linux/rockchip/patches-5.15/208-rockchip-rk3399-add-support-for-GuangMiao-G4C.patch index a0160f927ae324..5927938028261e 100644 --- a/target/linux/rockchip/patches-5.15/208-rockchip-rk3399-add-support-for-GuangMiao-G4C.patch +++ b/target/linux/rockchip/patches-5.15/208-rockchip-rk3399-add-support-for-GuangMiao-G4C.patch @@ -1,6 +1,6 @@ --- a/arch/arm64/boot/dts/rockchip/Makefile +++ b/arch/arm64/boot/dts/rockchip/Makefile -@@ -33,6 +33,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gr +@@ -35,6 +35,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gr dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gru-kevin.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gru-scarlet-inx.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gru-scarlet-kd.dtb From 347559c17affde62dc93c95cc1e67135f3b14acc Mon Sep 17 00:00:00 2001 From: aakkll <94471752+aakkll@users.noreply.github.com> Date: Sun, 14 Aug 2022 23:35:01 +0800 Subject: [PATCH 4/5] kernel: refresh 5.19 patch (#9943) Signed-off-by: aakkll <94471752+aakkll@users.noreply.github.com> Signed-off-by: aakkll <94471752+aakkll@users.noreply.github.com> --- ...s-rockchip-add-hardware-random-number-genera.patch | 8 ++++---- .../patches-5.19/0105-nanopi-r4s-sd-signalling.patch | 2 +- ...0800-rockchip-snps-pcie3-update-fw-when-init.patch | 11 +++-------- .../patches-5.19/0900-arm-boot-add-dts-files.patch | 3 ++- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/target/linux/rockchip/patches-5.19/0057-arm64-dts-rockchip-add-hardware-random-number-genera.patch b/target/linux/rockchip/patches-5.19/0057-arm64-dts-rockchip-add-hardware-random-number-genera.patch index 5e47bc23e7f8f5..6c0b158495a628 100644 --- a/target/linux/rockchip/patches-5.19/0057-arm64-dts-rockchip-add-hardware-random-number-genera.patch +++ b/target/linux/rockchip/patches-5.19/0057-arm64-dts-rockchip-add-hardware-random-number-genera.patch @@ -31,7 +31,7 @@ Signed-off-by: wevsty reg = <0x0 0xff100000 0x0 0x1000>; --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -@@ -1937,6 +1937,16 @@ +@@ -2042,6 +2042,16 @@ }; }; @@ -48,9 +48,9 @@ Signed-off-by: wevsty gpu: gpu@ff9a0000 { compatible = "rockchip,rk3399-mali", "arm,mali-t860"; reg = <0x0 0xff9a0000 0x0 0x10000>; ---- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi 2022-08-09 00:09:02.289032224 +0800 -+++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi 2022-08-09 00:11:01.829992919 +0800 -@@ -89,6 +89,16 @@ +--- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi +@@ -211,6 +211,16 @@ }; }; diff --git a/target/linux/rockchip/patches-5.19/0105-nanopi-r4s-sd-signalling.patch b/target/linux/rockchip/patches-5.19/0105-nanopi-r4s-sd-signalling.patch index 3065687291983d..a04c14b70a72fd 100644 --- a/target/linux/rockchip/patches-5.19/0105-nanopi-r4s-sd-signalling.patch +++ b/target/linux/rockchip/patches-5.19/0105-nanopi-r4s-sd-signalling.patch @@ -12,7 +12,7 @@ Signed-off-by: David Bauer --- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts -@@ -137,6 +137,11 @@ +@@ -121,6 +121,11 @@ status = "disabled"; }; diff --git a/target/linux/rockchip/patches-5.19/0800-rockchip-snps-pcie3-update-fw-when-init.patch b/target/linux/rockchip/patches-5.19/0800-rockchip-snps-pcie3-update-fw-when-init.patch index d87ffda239d876..bfc2d73ab0a850 100644 --- a/target/linux/rockchip/patches-5.19/0800-rockchip-snps-pcie3-update-fw-when-init.patch +++ b/target/linux/rockchip/patches-5.19/0800-rockchip-snps-pcie3-update-fw-when-init.patch @@ -11,9 +11,6 @@ Signed-off-by: jensen 2 files changed, 8220 insertions(+), 9 deletions(-) create mode 100644 drivers/phy/rockchip/p3phy.fw -diff --git a/drivers/phy/rockchip/p3phy.fw b/drivers/phy/rockchip/p3phy.fw -new file mode 100644 -index 0000000000000..301c42837ad94 --- /dev/null +++ b/drivers/phy/rockchip/p3phy.fw @@ -0,0 +1,8192 @@ @@ -8209,8 +8206,6 @@ index 0000000000000..301c42837ad94 +0x0000, +0x0000, +0x0000 -diff --git a/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c b/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c -index bb5fed0c03caf..53c4890f7391d 100644 --- a/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c +++ b/drivers/phy/rockchip/phy-rockchip-snps-pcie3.c @@ -20,6 +20,7 @@ @@ -8221,7 +8216,7 @@ index bb5fed0c03caf..53c4890f7391d 100644 #define GRF_PCIE30PHY_CON6 0x18 #define GRF_PCIE30PHY_CON9 0x24 #define GRF_PCIE30PHY_STATUS0 0x80 -@@ -61,6 +62,10 @@ +@@ -61,6 +62,10 @@ struct rockchip_p3phy_ops { int (*phy_init)(struct rockchip_p3phy_priv *priv); }; @@ -8232,7 +8227,7 @@ index bb5fed0c03caf..53c4890f7391d 100644 static int rockchip_p3phy_set_mode(struct phy *phy, enum phy_mode mode, int submode) { struct rockchip_p3phy_priv *priv = phy_get_drvdata(phy); -@@ -86,6 +91,7 @@ +@@ -86,6 +91,7 @@ static int rockchip_p3phy_rk3568_init(st struct phy *phy = priv->phy; bool bifurcation = false; int ret; @@ -8240,7 +8235,7 @@ index bb5fed0c03caf..53c4890f7391d 100644 u32 reg; /* Deassert PCIe PMA output clamp mode */ -@@ -110,16 +116,35 @@ +@@ -110,16 +116,35 @@ static int rockchip_p3phy_rk3568_init(st (0xf << 16) & ~RK3568_BIFURCATION_LANE_0_1); } diff --git a/target/linux/rockchip/patches-5.19/0900-arm-boot-add-dts-files.patch b/target/linux/rockchip/patches-5.19/0900-arm-boot-add-dts-files.patch index 62d6b449f3de40..1f8da04c05b6bd 100644 --- a/target/linux/rockchip/patches-5.19/0900-arm-boot-add-dts-files.patch +++ b/target/linux/rockchip/patches-5.19/0900-arm-boot-add-dts-files.patch @@ -32,10 +32,11 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinebook-pro.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb -@@ -65,4 +65,6 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-ro +@@ -66,5 +75,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-ro dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-soquartz-cm4.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bpi-r2-pro.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb1-v10.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-r66s.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-station-p2.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-nanopi-r5s.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-rock-3a.dtb From 9a166932f34a8eb241a536bdf19fed131835acff Mon Sep 17 00:00:00 2001 From: lean Date: Mon, 15 Aug 2022 02:36:59 +0800 Subject: [PATCH 5/5] mac80211: add rt2x00 5.19 kernel support --- .../rt2x00/999-backport-to-linux-5.18.patch | 21 +++++++++++++++++++ target/linux/rockchip/armv8/config-5.19 | 3 --- 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 package/kernel/mac80211/patches/rt2x00/999-backport-to-linux-5.18.patch diff --git a/package/kernel/mac80211/patches/rt2x00/999-backport-to-linux-5.18.patch b/package/kernel/mac80211/patches/rt2x00/999-backport-to-linux-5.18.patch new file mode 100644 index 00000000000000..57043a280d2396 --- /dev/null +++ b/package/kernel/mac80211/patches/rt2x00/999-backport-to-linux-5.18.patch @@ -0,0 +1,21 @@ +--- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c ++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +@@ -586,10 +586,18 @@ static void rt2x00usb_assign_endpoint(struct data_queue *queue, + + if (queue->qid == QID_RX) { + pipe = usb_rcvbulkpipe(usb_dev, queue->usb_endpoint); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,19,0) + queue->usb_maxpacket = usb_maxpacket(usb_dev, pipe, 0); ++#else ++ queue->usb_maxpacket = usb_maxpacket(usb_dev, pipe); ++#endif + } else { + pipe = usb_sndbulkpipe(usb_dev, queue->usb_endpoint); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,19,0) + queue->usb_maxpacket = usb_maxpacket(usb_dev, pipe, 1); ++#else ++ queue->usb_maxpacket = usb_maxpacket(usb_dev, pipe); ++#endif + } + + if (!queue->usb_maxpacket) diff --git a/target/linux/rockchip/armv8/config-5.19 b/target/linux/rockchip/armv8/config-5.19 index e15fef802dbc48..319f59cb0550d8 100644 --- a/target/linux/rockchip/armv8/config-5.19 +++ b/target/linux/rockchip/armv8/config-5.19 @@ -367,9 +367,6 @@ CONFIG_I2C_CHARDEV=y CONFIG_I2C_COMPAT=y CONFIG_I2C_HELPER_AUTO=y CONFIG_I2C_RK3X=y -CONFIG_IGB=y -CONFIG_IGB_HWMON=y -CONFIG_IGC=y CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 CONFIG_INDIRECT_PIO=y CONFIG_INPUT=y