From 816b7f95f069b8d7ac435c52239a441e071f2867 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 12 Jul 2023 19:13:44 +0800 Subject: [PATCH] rockchip: add Rock 5B support Hardware -------- RockChip RK3588 ARM64 (8 cores) 4/8/16GB LPDDR4X RAM 2500 Base-T (PCIe, rtl8125b) RGB LED 8/16/32/64/128GB eMMC on-board Micro-SD Slot USB 2.0 Port Headphone USB PD 2.0 12/15/20V Install -------- Uncompress the OpenWrt sysupgrade and write it to a micro SD card or internal eMMC using dd. Signed-off-by: Tianling Shen --- target/linux/rockchip/image/armv8.mk | 10 ++++ ...-rockchip-use-system-LED-for-OpenWrt.patch | 54 +++++++++++++++++++ ...-dts-rockchip-rk3588-rock5b-add-USB2.patch | 12 +---- ...-rock-5b-add-PCIe-network-controller.patch | 4 +- ...hip-enable-hwrng-for-rockchip-boards.patch | 13 +++++ 5 files changed, 81 insertions(+), 12 deletions(-) diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index c83eef1b31..783b6a2136 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -141,6 +141,16 @@ define Device/pine64_rockpro64 endef TARGET_DEVICES += pine64_rockpro64 +define Device/radxa_rock-5b + DEVICE_VENDOR := Radxa + DEVICE_MODEL := ROCK 5B + SOC := rk3588 + UBOOT_DEVICE_NAME := rock5b-rk3588 + BOOT_FLOW := pine64-img + DEVICE_PACKAGES := kmod-r8125 +endef +TARGET_DEVICES += radxa_rock-5b + define Device/radxa_rock-pi-4a DEVICE_VENDOR := Radxa DEVICE_MODEL := ROCK Pi 4A diff --git a/target/linux/rockchip/patches-6.1/100-rockchip-use-system-LED-for-OpenWrt.patch b/target/linux/rockchip/patches-6.1/100-rockchip-use-system-LED-for-OpenWrt.patch index 899453eb65..d9288b4470 100644 --- a/target/linux/rockchip/patches-6.1/100-rockchip-use-system-LED-for-OpenWrt.patch +++ b/target/linux/rockchip/patches-6.1/100-rockchip-use-system-LED-for-OpenWrt.patch @@ -269,3 +269,57 @@ Signed-off-by: David Bauer }; chosen: chosen { +--- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +@@ -3,6 +3,8 @@ + /dts-v1/; + + #include ++#include ++#include + #include "rk3588.dtsi" + + / { +@@ -12,6 +14,11 @@ + aliases { + mmc0 = &sdhci; + serial2 = &uart2; ++ ++ led-boot = &status_led; ++ led-failsafe = &status_led; ++ led-running = &status_led; ++ led-upgrade = &status_led; + }; + + chosen { +@@ -43,6 +50,17 @@ + #cooling-cells = <2>; + }; + ++ gpio-leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&status_led_pin>; ++ ++ status_led: led-status { ++ gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; ++ label = "blue:status"; ++ }; ++ }; ++ + vcc5v0_sys: vcc5v0-sys-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_sys"; +@@ -196,6 +214,12 @@ + }; + }; + ++ gpio-leds { ++ status_led_pin: led-status-pin { ++ rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; ++ }; ++ }; ++ + sound { + hp_detect: hp-detect { + rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>; diff --git a/target/linux/rockchip/patches-6.1/112-03-arm64-dts-rockchip-rk3588-rock5b-add-USB2.patch b/target/linux/rockchip/patches-6.1/112-03-arm64-dts-rockchip-rk3588-rock5b-add-USB2.patch index 8f87f633c6..3dcf0a3280 100644 --- a/target/linux/rockchip/patches-6.1/112-03-arm64-dts-rockchip-rk3588-rock5b-add-USB2.patch +++ b/target/linux/rockchip/patches-6.1/112-03-arm64-dts-rockchip-rk3588-rock5b-add-USB2.patch @@ -17,15 +17,7 @@ Signed-off-by: Sebastian Reichel --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts -@@ -3,6 +3,7 @@ - /dts-v1/; - - #include -+#include - #include "rk3588.dtsi" - - / { -@@ -61,6 +62,20 @@ +@@ -79,6 +79,20 @@ regulator-max-microvolt = <1100000>; vin-supply = <&vcc5v0_sys>; }; @@ -46,7 +38,7 @@ Signed-off-by: Sebastian Reichel }; &cpu_b0 { -@@ -565,3 +580,46 @@ +@@ -589,3 +603,46 @@ pinctrl-0 = <&uart2m0_xfer>; status = "okay"; }; diff --git a/target/linux/rockchip/patches-6.1/115-03-arm64-dts-rockchip-rock-5b-add-PCIe-network-controller.patch b/target/linux/rockchip/patches-6.1/115-03-arm64-dts-rockchip-rock-5b-add-PCIe-network-controller.patch index 8f076820d7..d5603b78b3 100644 --- a/target/linux/rockchip/patches-6.1/115-03-arm64-dts-rockchip-rock-5b-add-PCIe-network-controller.patch +++ b/target/linux/rockchip/patches-6.1/115-03-arm64-dts-rockchip-rock-5b-add-PCIe-network-controller.patch @@ -13,7 +13,7 @@ Signed-off-by: Sebastian Reichel --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts -@@ -63,6 +63,15 @@ +@@ -80,6 +80,15 @@ vin-supply = <&vcc5v0_sys>; }; @@ -29,7 +29,7 @@ Signed-off-by: Sebastian Reichel vcc5v0_host: vcc5v0-host-regulator { compatible = "regulator-fixed"; regulator-name = "vcc5v0_host"; -@@ -623,3 +632,14 @@ +@@ -646,3 +655,14 @@ }; }; }; diff --git a/target/linux/rockchip/patches-6.1/801-07-arm64-dts-rockchip-enable-hwrng-for-rockchip-boards.patch b/target/linux/rockchip/patches-6.1/801-07-arm64-dts-rockchip-enable-hwrng-for-rockchip-boards.patch index c6b5f282c0..21c552b790 100644 --- a/target/linux/rockchip/patches-6.1/801-07-arm64-dts-rockchip-enable-hwrng-for-rockchip-boards.patch +++ b/target/linux/rockchip/patches-6.1/801-07-arm64-dts-rockchip-enable-hwrng-for-rockchip-boards.patch @@ -37,3 +37,16 @@ &saradc { vref-supply = <&vcca_1v8>; status = "okay"; +--- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +@@ -254,6 +254,10 @@ + status = "okay"; + }; + ++&rng { ++ status = "okay"; ++}; ++ + &saradc { + vref-supply = <&avcc_1v8_s0>; + status = "okay";