rockchip: add Radxa ROCK 2A/F support
Some checks failed
OpenWrt-CI / Build OpenWrt Firmware (push) Has been cancelled

Signed-off-by: coolsnowwolf@gmail.com

Hardware
--------
RockChip RK3528 ARM64 (4 cores)
1/2/4GB LPDDR4 RAM
1x LED (state)
1x Reset button
0/8/16/32/64GB eMMC on-board
Micro-SD Slot
PCIe FPC connector
3x USB 2.0 Port
HDMI/AV OUT
USB Type-C 5V Power

ROCK 2A:
+ 3.5mm audio out
+ 1000 Base-T
+ SYS LED
+ USB 3.0 Port (conflicts with PCIe)

Installation
------------
Uncompress the OpenWrt sysupgrade and write it to a micro SD card or
internal eMMC using dd.
This commit is contained in:
coolsnowwolf
2025-12-05 15:20:30 +08:00
parent dc762900bd
commit 4cd4eb78f2
5 changed files with 407 additions and 0 deletions

View File

@@ -209,6 +209,8 @@ define U-Boot/radxa-e20c-rk3528
$(U-Boot/rk3528/Default)
NAME:=Radxa E20C
BUILD_DEVICES:= \
radxa_rock-2a \
radxa_rock-2f \
radxa_e20c \
radxa_e24c
endef

View File

@@ -0,0 +1,295 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/dts-v1/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/pinctrl/rockchip.h>
#include <dt-bindings/pwm/pwm.h>
#include "rk3528.dtsi"
/ {
aliases {
i2c1 = &i2c1;
mmc0 = &sdhci;
mmc1 = &sdmmc;
serial0 = &uart0;
};
chosen {
stdout-path = "serial0:1500000n8";
};
adc-keys {
compatible = "adc-keys";
io-channels = <&saradc 0>;
io-channel-names = "buttons";
keyup-threshold-microvolt = <1800000>;
poll-interval = <100>;
button-maskrom {
label = "MASKROM";
linux,code = <KEY_SETUP>;
press-threshold-microvolt = <0>;
};
};
leds: leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&state_led_b>;
led-0 {
color = <LED_COLOR_ID_BLUE>;
default-state = "on";
function = LED_FUNCTION_HEARTBEAT;
gpios = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
};
};
vdd_0v9: regulator-0v9-vdd {
compatible = "regulator-fixed";
regulator-name = "vdd_0v9";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <900000>;
regulator-max-microvolt = <900000>;
vin-supply = <&vcc5v0_sys>;
};
vcc_ddr: regulator-1v1-vcc-ddr {
compatible = "regulator-fixed";
regulator-name = "vcc_ddr";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1100000>;
vin-supply = <&vcc5v0_sys>;
};
vcc_1v8: regulator-1v8-vcc {
compatible = "regulator-fixed";
regulator-name = "vcc_1v8";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
vin-supply = <&vcc_3v3>;
};
vcc_3v3: regulator-3v3-vcc {
compatible = "regulator-fixed";
regulator-name = "vcc_3v3";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
vin-supply = <&vcc5v0_sys>;
};
vcc_wifi: regulator-3v3-vcc-wifi {
compatible = "regulator-fixed";
enable-active-high;
gpios = <&gpio4 RK_PA4 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&usb_wifi_pwr>;
regulator-name = "vcc_wifi";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
vin-supply = <&vcc_3v3>;
};
vcc5v0_sys: regulator-5v0-vcc-sys {
compatible = "regulator-fixed";
regulator-name = "vcc5v0_sys";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
};
vcc5v0_usb20: regulator-5v0-vcc-usb20 {
compatible = "regulator-fixed";
enable-active-high;
gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&usb_host_en>;
regulator-name = "vcc5v0_usb20";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
vin-supply = <&vcc5v0_sys>;
};
vccio_sd: regulator-vccio-sd {
compatible = "regulator-gpio";
gpios = <&gpio1 RK_PC1 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&sdmmc_vol_ctrl_h>;
regulator-name = "vccio_sd";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
states = <1800000 0x0>, <3300000 0x1>;
vin-supply = <&vcc5v0_sys>;
};
vdd_arm: regulator-vdd-arm {
compatible = "pwm-regulator";
pwms = <&pwm1 0 5000 PWM_POLARITY_INVERTED>;
pwm-supply = <&vcc5v0_sys>;
regulator-name = "vdd_arm";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <746000>;
regulator-max-microvolt = <1201000>;
regulator-settling-time-up-us = <250>;
};
vdd_logic: regulator-vdd-logic {
compatible = "pwm-regulator";
pwms = <&pwm2 0 5000 PWM_POLARITY_INVERTED>;
pwm-supply = <&vcc5v0_sys>;
regulator-name = "vdd_logic";
regulator-always-on;
regulator-boot-on;
regulator-min-microvolt = <705000>;
regulator-max-microvolt = <1006000>;
regulator-settling-time-up-us = <250>;
};
rfkill {
compatible = "rfkill-gpio";
label = "rfkill-wlan";
pinctrl-names = "default";
pinctrl-0 = <&wifi_reg_on_h>;
radio-type = "wlan";
shutdown-gpios = <&gpio1 RK_PA6 GPIO_ACTIVE_HIGH>;
};
};
&cpu0 {
cpu-supply = <&vdd_arm>;
};
&cpu1 {
cpu-supply = <&vdd_arm>;
};
&cpu2 {
cpu-supply = <&vdd_arm>;
};
&cpu3 {
cpu-supply = <&vdd_arm>;
};
&gpu {
mali-supply = <&vdd_logic>;
status = "okay";
};
&i2c1 {
pinctrl-names = "default";
pinctrl-0 = <&i2c1m0_xfer>;
status = "okay";
eeprom@50 {
compatible = "belling,bl24c16a", "atmel,24c16";
reg = <0x50>;
pagesize = <16>;
read-only;
vcc-supply = <&vcc_3v3>;
};
};
&pinctrl {
bluetooth {
bt_wake_host_h: bt-wake-host-h {
rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
};
host_wake_bt_h: host-wake-bt-h {
rockchip,pins = <1 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
leds {
state_led_b: state-led-b {
rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
sdmmc {
sdmmc_vol_ctrl_h: sdmmc-vol-ctrl-h {
rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
usb {
usb_host_en: usb-host-en {
rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
wifi {
usb_wifi_pwr: usb-wifi-pwr {
rockchip,pins = <4 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
};
wifi_reg_on_h: wifi-reg-on-h {
rockchip,pins = <1 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
};
wifi_wake_host_h: wifi-wake-host-h {
rockchip,pins = <1 RK_PA7 RK_FUNC_GPIO &pcfg_pull_down>;
};
};
};
&pwm1 {
pinctrl-names = "default";
pinctrl-0 = <&pwm1m0_pins>;
status = "okay";
};
&pwm2 {
pinctrl-names = "default";
pinctrl-0 = <&pwm2m0_pins>;
status = "okay";
};
&saradc {
vref-supply = <&vcc_1v8>;
status = "okay";
};
&sdhci {
bus-width = <8>;
cap-mmc-highspeed;
mmc-hs200-1_8v;
no-sd;
no-sdio;
non-removable;
vmmc-supply = <&vcc_3v3>;
vqmmc-supply = <&vcc_1v8>;
status = "okay";
};
&sdmmc {
bus-width = <4>;
cap-mmc-highspeed;
cap-sd-highspeed;
disable-wp;
max-frequency = <100000000>;
sd-uhs-sdr104;
vmmc-supply = <&vcc_3v3>;
vqmmc-supply = <&vccio_sd>;
status = "okay";
};
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0m0_xfer>;
status = "okay";
};

View File

@@ -0,0 +1,82 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/dts-v1/;
#include "rk3528-rock-2.dtsi"
/ {
model = "Radxa ROCK 2A";
compatible = "radxa,rock-2a", "rockchip,rk3528";
aliases {
ethernet0 = &gmac1;
};
vcc5v0_usb30_otg: regulator-5v0-vcc-usb30-otg {
compatible = "regulator-fixed";
enable-active-high;
gpios = <&gpio1 RK_PC3 GPIO_ACTIVE_HIGH>;
pinctrl-names = "default";
pinctrl-0 = <&usb_otg_en>;
regulator-name = "vcc5v0_usb30_otg";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
vin-supply = <&vcc5v0_sys>;
};
};
&gmac1 {
clock_in_out = "output";
phy-handle = <&rgmii_phy>;
phy-mode = "rgmii-id";
phy-supply = <&vcc_3v3>;
pinctrl-names = "default";
pinctrl-0 = <&rgmii_miim>, <&rgmii_tx_bus2>, <&rgmii_rx_bus2>,
<&rgmii_rgmii_clk>, <&rgmii_rgmii_bus>;
status = "okay";
};
&leds {
pinctrl-names = "default";
pinctrl-0 = <&state_led_b>, <&sys_led_g>;
led-1 {
color = <LED_COLOR_ID_GREEN>;
default-state = "on";
function = LED_FUNCTION_STATUS;
gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_LOW>;
linux,default-trigger = "default-on";
};
};
&mdio1 {
rgmii_phy: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
reg = <0x1>;
pinctrl-names = "default";
pinctrl-0 = <&gmac1_rstn_l>;
reset-assert-us = <20000>;
reset-deassert-us = <100000>;
reset-gpios = <&gpio4 RK_PC2 GPIO_ACTIVE_LOW>;
};
};
&pinctrl {
ethernet {
gmac1_rstn_l: gmac1-rstn-l {
rockchip,pins = <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
leds {
sys_led_g: sys-led-g {
rockchip,pins = <3 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
usb {
usb_otg_en: usb-otg-en {
rockchip,pins = <1 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
};

View File

@@ -0,0 +1,10 @@
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/dts-v1/;
#include "rk3528-rock-2.dtsi"
/ {
model = "Radxa ROCK 2F";
compatible = "radxa,rock-2f", "rockchip,rk3528";
};

View File

@@ -466,6 +466,24 @@ define Device/radxa_e54c
endef
TARGET_DEVICES += radxa_e54c
define Device/radxa_rock-2a
DEVICE_VENDOR := Radxa
DEVICE_MODEL := ROCK 2A
SOC := rk3528
UBOOT_DEVICE_NAME := radxa-e20c-rk3528
IMAGE/sysupgrade.img.gz := boot-common | boot-script rk3528 | pine64-img | gzip | append-metadata
endef
TARGET_DEVICES += radxa_rock-2a
define Device/radxa_rock-2f
DEVICE_VENDOR := Radxa
DEVICE_MODEL := ROCK 2F
SOC := rk3528
UBOOT_DEVICE_NAME := radxa-e20c-rk3528
IMAGE/sysupgrade.img.gz := boot-common | boot-script rk3528 | pine64-img | gzip | append-metadata
endef
TARGET_DEVICES += radxa_rock-2f
define Device/radxa_rock-3a
DEVICE_VENDOR := Radxa
DEVICE_MODEL := ROCK 3A