[PATCH] board: rockchip: Add support for Rock Pi S

Angelo Compagnucci angelo at amarulasolutions.com
Tue Nov 15 09:55:15 CET 2022


Add support for the Radxa Rock Pi S RK3308 SBC.

Signed-off-by: Angelo Compagnucci <angelo at amarulasolutions.com>
---
 arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi |  21 ++++
 arch/arm/dts/rk3308-rock-pi-s.dts         | 115 ++++++++++++++++++++++
 arch/arm/mach-rockchip/rk3308/Kconfig     |   5 +
 board/radxa/rock-pi-s/Kconfig             |  15 +++
 board/radxa/rock-pi-s/MAINTAINERS         |   8 ++
 board/radxa/rock-pi-s/Makefile            |   7 ++
 board/radxa/rock-pi-s/rock-pi-s.c         |   6 ++
 configs/rock-pi-s-rk3308_defconfig        |  88 +++++++++++++++++
 doc/README.rockchip                       |   7 ++
 include/configs/rock-pi-s.h               |  15 +++
 include/configs/rock-pi-s_rk3308.h        |  15 +++
 11 files changed, 302 insertions(+)
 create mode 100644 arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi
 create mode 100644 arch/arm/dts/rk3308-rock-pi-s.dts
 create mode 100644 board/radxa/rock-pi-s/Kconfig
 create mode 100644 board/radxa/rock-pi-s/MAINTAINERS
 create mode 100644 board/radxa/rock-pi-s/Makefile
 create mode 100644 board/radxa/rock-pi-s/rock-pi-s.c
 create mode 100644 configs/rock-pi-s-rk3308_defconfig
 create mode 100644 include/configs/rock-pi-s.h
 create mode 100644 include/configs/rock-pi-s_rk3308.h

diff --git a/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi b/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi
new file mode 100644
index 0000000000..b6f18824ba
--- /dev/null
+++ b/arch/arm/dts/rk3308-rock-pi-s-u-boot.dtsi
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2022 Angelo Compagnucci <angelo at amarulasolutions.com>
+ */
+#include "rk3308-u-boot.dtsi"
+
+/ {
+	chosen {
+		u-boot,spl-boot-order = "same-as-spl", &sdmmc, &emmc;
+	};
+};
+
+&uart0 {
+	u-boot,dm-pre-reloc;
+	clock-frequency = <24000000>;
+	status = "okay";
+};
+
+&sdmmc {
+	u-boot,dm-pre-reloc;
+};
diff --git a/arch/arm/dts/rk3308-rock-pi-s.dts b/arch/arm/dts/rk3308-rock-pi-s.dts
new file mode 100644
index 0000000000..5880fec8fe
--- /dev/null
+++ b/arch/arm/dts/rk3308-rock-pi-s.dts
@@ -0,0 +1,115 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2022 Angelo Compagnucci <angelo at amarulasolutions.com>
+ */
+
+/dts-v1/;
+#include "rk3308.dtsi"
+
+/ {
+	model = "Radxa ROCK Pi S";
+	compatible = "radxa,rockpis", "rockchip,rk3308";
+
+	aliases {
+		mmc0 = &emmc;
+		mmc1 = &sdmmc;
+	};
+
+	chosen {
+		stdout-path = "serial0:1500000n8";
+	};
+
+	vcc_1v8: vcc-1v8 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_1v8";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_io>;
+	};
+
+	vcc_io: vcc-io {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_io";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vcc5v0_sys>;
+	};
+
+	vcc_ddr: vcc-ddr {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_ddr";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <1500000>;
+		regulator-max-microvolt = <1500000>;
+		vin-supply = <&vcc5v0_sys>;
+	};
+
+	vcc5v0_sys: vcc5v0-sys {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc5v0_sys";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+	};
+
+	vdd_core: vdd-core {
+		compatible = "pwm-regulator";
+		pwms = <&pwm0 0 5000 1>;
+		pwm-supply = <&vcc5v0_sys>;
+		regulator-name = "vdd_core";
+		regulator-min-microvolt = <827000>;
+		regulator-max-microvolt = <1340000>;
+		regulator-init-microvolt = <1015000>;
+		regulator-settling-time-up-us = <250>;
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+};
+
+&cpu0 {
+	cpu-supply = <&vdd_core>;
+};
+
+&emmc {
+	bus-width = <4>;
+	cap-mmc-highspeed;
+	mmc-hs200-1_8v;
+	non-removable;
+	vmmc-supply = <&vcc_io>;
+	status = "okay";
+};
+
+&mac {
+	clock_in_out = "output";
+	phy-supply = <&vcc_io>;
+	snps,reset-gpio = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
+	snps,reset-active-low;
+	snps,reset-delays-us = <0 50000 50000>;
+	status = "okay";
+};
+
+&i2c1 {
+	status = "okay";
+};
+
+&pwm0 {
+	status = "okay";
+	pinctrl-0 = <&pwm0_pin_pull_down>;
+};
+
+&saradc {
+	vref-supply = <&vcc_1v8>;
+	status = "okay";
+};
+
+&sdmmc {
+	cap-sd-highspeed;
+	status = "okay";
+};
diff --git a/arch/arm/mach-rockchip/rk3308/Kconfig b/arch/arm/mach-rockchip/rk3308/Kconfig
index 194353e4cd..8ca696181b 100644
--- a/arch/arm/mach-rockchip/rk3308/Kconfig
+++ b/arch/arm/mach-rockchip/rk3308/Kconfig
@@ -8,6 +8,10 @@ config TARGET_ROC_RK3308_CC
        bool "Firefly roc-rk3308-cc"
 	select BOARD_LATE_INIT
 
+config TARGET_ROCK_PI_S
+       bool "Radxa Rock PI S"
+	select BOARD_LATE_INIT
+
 config ROCKCHIP_BOOT_MODE_REG
 	default 0xff000500
 
@@ -25,5 +29,6 @@ config SPL_SERIAL
 
 source "board/rockchip/evb_rk3308/Kconfig"
 source "board/firefly/firefly-rk3308/Kconfig"
+source "board/radxa/rock-pi-s/Kconfig"
 
 endif
diff --git a/board/radxa/rock-pi-s/Kconfig b/board/radxa/rock-pi-s/Kconfig
new file mode 100644
index 0000000000..de5b71a66b
--- /dev/null
+++ b/board/radxa/rock-pi-s/Kconfig
@@ -0,0 +1,15 @@
+if TARGET_ROCK_PI_S
+
+config SYS_BOARD
+	default "rock-pi-s"
+
+config SYS_VENDOR
+	default "radxa"
+
+config SYS_CONFIG_NAME
+	default "rock-pi-s"
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+	def_bool y
+
+endif
diff --git a/board/radxa/rock-pi-s/MAINTAINERS b/board/radxa/rock-pi-s/MAINTAINERS
new file mode 100644
index 0000000000..f139dbceaf
--- /dev/null
+++ b/board/radxa/rock-pi-s/MAINTAINERS
@@ -0,0 +1,8 @@
+FIREFLY
+M:	Angelo Compagnucci <angelo at amarulasolutions.com>
+S:	Maintained
+F:	arch/arm/dts/rk3288-rock-pi-s.dts
+F:	arch/arm/dts/rk3288-rock-pi-s-u-boot.dtsi
+F:	board/radxa/rock-pi-s
+F:	include/configs/rock-pi-s_rk3308.h
+F:	configs/rock-pi-s-rk3308_defconfig
diff --git a/board/radxa/rock-pi-s/Makefile b/board/radxa/rock-pi-s/Makefile
new file mode 100644
index 0000000000..8d2b5ad36e
--- /dev/null
+++ b/board/radxa/rock-pi-s/Makefile
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2022 Angelo Compagnucci <angelo at amarulasolutions.com>
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y	+= rock-pi-s.o
diff --git a/board/radxa/rock-pi-s/rock-pi-s.c b/board/radxa/rock-pi-s/rock-pi-s.c
new file mode 100644
index 0000000000..cbd4ab4f32
--- /dev/null
+++ b/board/radxa/rock-pi-s/rock-pi-s.c
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+# (C) Copyright 2022 Angelo Compagnucci <angelo at amarulasolutions.com>
+ */
+
+#include <common.h>
diff --git a/configs/rock-pi-s-rk3308_defconfig b/configs/rock-pi-s-rk3308_defconfig
new file mode 100644
index 0000000000..2cbcf90839
--- /dev/null
+++ b/configs/rock-pi-s-rk3308_defconfig
@@ -0,0 +1,88 @@
+CONFIG_ARM=y
+CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_TEXT_BASE=0x00600000
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_SPL_LIBCOMMON_SUPPORT=y
+CONFIG_SPL_LIBGENERIC_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="rk3308-rock-pi-s"
+CONFIG_ROCKCHIP_RK3308=y
+CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0x0
+CONFIG_SPL_DRIVERS_MISC=y
+CONFIG_TARGET_ROCK_PI_S=y
+CONFIG_SPL_STACK_R_ADDR=0xc00000
+CONFIG_DEBUG_UART_BASE=0xFF0A0000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SYS_LOAD_ADDR=0xc00800
+CONFIG_DEBUG_UART=y
+CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x800000
+CONFIG_ANDROID_BOOT_IMAGE=y
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_BOOTDELAY=0
+CONFIG_SYS_CONSOLE_INFO_QUIET=y
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_SPL_MAX_SIZE=0x20000
+CONFIG_SPL_PAD_TO=0x7f8000
+CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
+CONFIG_SPL_BSS_START_ADDR=0x400000
+CONFIG_SPL_BSS_MAX_SIZE=0x2000
+# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
+CONFIG_SPL_STACK=0x400000
+CONFIG_SPL_STACK_R=y
+# CONFIG_CMD_BDI is not set
+# CONFIG_CMD_CONSOLE is not set
+# CONFIG_CMD_ELF is not set
+# CONFIG_CMD_IMI is not set
+# CONFIG_CMD_XIMG is not set
+CONFIG_CMD_GPT=y
+# CONFIG_CMD_LOADB is not set
+# CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
+# CONFIG_CMD_ITEST is not set
+# CONFIG_CMD_SETEXPR is not set
+# CONFIG_CMD_SLEEP is not set
+# CONFIG_DOS_PARTITION is not set
+# CONFIG_ISO_PARTITION is not set
+CONFIG_EFI_PARTITION_ENTRIES_NUMBERS=64
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_LIVE=y
+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_CLK=y
+# CONFIG_USB_FUNCTION_FASTBOOT is not set
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_SYS_I2C_ROCKCHIP=y
+CONFIG_SUPPORT_EMMC_RPMB=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_GMAC_ROCKCHIP=y
+CONFIG_PHY=y
+CONFIG_PINCTRL=y
+CONFIG_REGULATOR_PWM=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_PWM_ROCKCHIP=y
+CONFIG_RAM=y
+CONFIG_DM_RESET=y
+CONFIG_BAUDRATE=1500000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_DEBUG_UART_SKIP_INIT=y
+CONFIG_SYSRESET=y
+CONFIG_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_DWC2=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DWC2_OTG=y
+CONFIG_USB_GADGET_DOWNLOAD=y
+CONFIG_SPL_TINY_MEMSET=y
+CONFIG_LZO=y
+CONFIG_ERRNO_STR=y
+# CONFIG_EFI_LOADER is not set
diff --git a/doc/README.rockchip b/doc/README.rockchip
index 52b5140eca..b60eb80c39 100644
--- a/doc/README.rockchip
+++ b/doc/README.rockchip
@@ -46,7 +46,14 @@ Building
      => export BL31=/path/to/rkbin/bin/rk33/rk3308_bl31_v2.22.elf
      => make roc-cc-rk3308_defconfig
      => make CROSS_COMPILE=aarch64-linux-gnu- all
+
+   - idbloader for roc-cc-rk3308
      => ./tools/mkimage -n rk3308 -T rksd -d /path/to/rkbin/bin/rk33/rk3308_ddr_589MHz_uart2_m0_v1.26.bin idbloader.img
+
+   - idbloader for rock-pi-s-rk3308
+     => ./tools/mkimage -n rk3308 -T rksd -d /path/to/rkbin/bin/rk33/rk3308_ddr_589MHz_uart0_m0_v1.26.bin idbloader.img
+
+   - Finalize idbloader
      => cat spl/u-boot-spl.bin  >> idbloader.img
 
 3. To build RK3399 board:
diff --git a/include/configs/rock-pi-s.h b/include/configs/rock-pi-s.h
new file mode 100644
index 0000000000..0273e751ce
--- /dev/null
+++ b/include/configs/rock-pi-s.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * (C) Copyright 2018 Rockchip Electronics Co., Ltd
+ */
+
+#ifndef __EVB_RK3308_H
+#define __EVB_RK3308_H
+
+#include <configs/rk3308_common.h>
+
+#define ROCKCHIP_DEVICE_SETTINGS \
+			"stdout=serial,vidconsole\0" \
+			"stderr=serial,vidconsole\0"
+
+#endif
diff --git a/include/configs/rock-pi-s_rk3308.h b/include/configs/rock-pi-s_rk3308.h
new file mode 100644
index 0000000000..0273e751ce
--- /dev/null
+++ b/include/configs/rock-pi-s_rk3308.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * (C) Copyright 2018 Rockchip Electronics Co., Ltd
+ */
+
+#ifndef __EVB_RK3308_H
+#define __EVB_RK3308_H
+
+#include <configs/rk3308_common.h>
+
+#define ROCKCHIP_DEVICE_SETTINGS \
+			"stdout=serial,vidconsole\0" \
+			"stderr=serial,vidconsole\0"
+
+#endif
-- 
2.25.1



More information about the U-Boot mailing list