Skip to contentSkip to conversation

rockchip: Add support for the RV1103B, RV1103 and RV1106

PATCH Superseded Simon Glass 2 participants 21 messages Jul 7 – Jul 9

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

v3 cover rockchip: Add support for the RV1103B, RV1103 and RV1106

This series adds support for three small Rockchip camera SoCs and two boards which use them.

The first eight patches are Fabio Estevam's series adding the RV1103B and the Onion Omega4 board, updated here to address the review comments on v2: the board patch is split into SoC and board patches, the devicetree files move into the patches where they belong and the pinctrl driver uses regmap_update_bits() throughout. All credit for this work goes to Fabio. The devicetree concern raised in the v2 review is also resolved now: the devicetree files carried here are the versions merged in Linux v7.1, verbatim, and can be dropped once the next dts/upstream sync brings them in.

The remaining patches add the RV1106 and its RV1103 package variant, following the same structure as the RV1103B patches, together with the Luckfox Pico Mini B board. These SoCs have no mainline Linux support yet, so their devicetrees are local for now. The clock and pinctrl drivers are ported from the Rockchip vendor tree and are the work of Elaine Zhang and Ye Zhang. The final patch makes the maskrom-mode RAM-boot images work on 32-bit boards without OP-TEE, which both of these boards rely on.

Tested on the Luckfox Pico Mini B: U-Boot runs from RAM over the USB maskrom path and both the SPI NAND and a microSD card are usable. THe board is running in my lab.

Changes in v3:
- Move the board devicetrees to the board patch and the SoC u-boot.dtsi to the SoC patch (Jonas)
- Use the devicetree files as merged in Linux v7.1
- Use regmap_update_bits() in all the remaining places (Jonas)
- Align continuation lines with the open parenthesis (checkpatch)
- Use CONFIG_IS_ENABLED() to guard the set_parent operation, matching clk_rk3588.c, since plain IS_ENABLED() needs the CONFIG_ prefix
- Guard the spi-nand checks with SPI_NAND_LOAD so that boards without SPI NAND support do not grow in size
- New patch, split out from the board patch (Jonas)
- Include the SoC u-boot.dtsi here (Jonas)
- Match the pmu-grf compatible used by the devicetree merged in Linux v7.1
- Split out the SoC support into its own patch (Jonas)
- Move the board devicetree files into this patch (Jonas)
- Add the board to the list in the Rockchip documentation
- Extend the MAINTAINERS entry to cover all the RV1103B files
- Use the board devicetree files as merged in Linux v7.1 and switch the default devicetree to rv1103b-omega4-evb

Changes in v2:
- Use the devicetrees submitted to upstream Linux
- Use the original author from Rockchip's vendor U-Boot tree
- Use regmap_update_bits()
- Remove unneeded blank lines
- Remove unneeded logging functions
- Use the original author from Rockchip's vendor U-Boot tree
- Use RV1103B rather than RV1103, which is the correct SoC name

Elaine Zhang (1):
clk: rockchip: Add RV1103B clock driver

Fabio Estevam (5):
ARM: dts: Add the RV1103B devicetree files
rockchip: spl-boot-order: Add SPI NAND support
spl: Add SPI NAND support via MTD in SPL
rockchip: rv1103b: Add SoC support
omega4-rv1103b: Add the initial support

Simon Glass (7):
tools: rkcommon: Add RV1106 support
pinctrl: rockchip: Add RV1106 support
ARM: dts: Add the RV1103/RV1106 devicetree files
clk: rockchip: Add RV1106 clock driver
rockchip: rv1106: Add SoC support
luckfox-pico: Add the initial support
rockchip: Support legacy images when booting from RAM

Xuhui Lin (1):
tools: rkcommon: Add RV1103B support

Ye Zhang (1):
pinctrl: rockchip: Add RV1103B support

 .../rv1103-luckfox-pico-mini-b-u-boot.dtsi    |   10 +
 arch/arm/dts/rv1103-luckfox-pico-mini-b.dts   |   85 ++
 arch/arm/dts/rv1103.dtsi                      |   16 +
 arch/arm/dts/rv1103b-omega4-evb-u-boot.dtsi   |   10 +
 arch/arm/dts/rv1103b-omega4-evb.dts           |   63 +
 arch/arm/dts/rv1103b-omega4.dtsi              |  147 ++
 arch/arm/dts/rv1103b-pinctrl.dtsi             |  816 ++++++++++
 arch/arm/dts/rv1103b-u-boot.dtsi              |    4 +
 arch/arm/dts/rv1103b.dtsi                     |  239 +++
 arch/arm/dts/rv1106-pinctrl.dtsi              | 1102 ++++++++++++++
 arch/arm/dts/rv1106-u-boot.dtsi               |    4 +
 arch/arm/dts/rv1106.dtsi                      |  328 ++++
 .../include/asm/arch-rockchip/cru_rv1103b.h   |  266 ++++
 .../include/asm/arch-rockchip/cru_rv1106.h    |  305 ++++
 .../include/asm/arch-rockchip/grf_rv1103b.h   |   31 +
 arch/arm/include/asm/arch-rv1103b/boot0.h     |   11 +
 arch/arm/include/asm/arch-rv1106/boot0.h      |   11 +
 arch/arm/mach-rockchip/Kconfig                |   28 +
 arch/arm/mach-rockchip/Makefile               |    2 +
 arch/arm/mach-rockchip/rv1103b/Kconfig        |   22 +
 arch/arm/mach-rockchip/rv1103b/Makefile       |   12 +
 arch/arm/mach-rockchip/rv1103b/boot0.h        |    5 +
 arch/arm/mach-rockchip/rv1103b/clk_rv1103b.c  |   32 +
 arch/arm/mach-rockchip/rv1103b/rv1103b.c      |  133 ++
 .../mach-rockchip/rv1103b/syscon_rv1103b.c    |   19 +
 arch/arm/mach-rockchip/rv1106/Kconfig         |   28 +
 arch/arm/mach-rockchip/rv1106/Makefile        |   12 +
 arch/arm/mach-rockchip/rv1106/clk_rv1106.c    |   31 +
 arch/arm/mach-rockchip/rv1106/rv1106.c        |  118 ++
 arch/arm/mach-rockchip/rv1106/syscon_rv1106.c |   19 +
 arch/arm/mach-rockchip/spl-boot-order.c       |   12 +-
 arch/arm/mach-rockchip/spl.c                  |   53 +-
 board/luckfox/pico/Kconfig                    |   12 +
 board/luckfox/pico/MAINTAINERS                |    6 +
 board/luckfox/pico/Makefile                   |    7 +
 board/luckfox/pico/pico.c                     |   19 +
 board/luckfox/pico/pico.env                   |    4 +
 board/onion/omega4_rv1103b/Kconfig            |   12 +
 board/onion/omega4_rv1103b/MAINTAINERS        |   15 +
 board/onion/omega4_rv1103b/Makefile           |    7 +
 board/onion/omega4_rv1103b/omega4_rv1103b.c   |   19 +
 board/onion/omega4_rv1103b/omega4_rv1103b.env |    5 +
 common/spl/Kconfig                            |   10 +-
 common/spl/Makefile                           |    1 +
 common/spl/spl_spi_nand.c                     |   82 +
 configs/luckfox-pico-mini-b-rv1103_defconfig  |   79 +
 configs/omega4-rv1103b_defconfig              |   82 +
 doc/board/index.rst                           |    2 +
 doc/board/luckfox/index.rst                   |    9 +
 doc/board/luckfox/luckfox-pico.rst            |   71 +
 doc/board/onion/index.rst                     |    9 +
 doc/board/onion/omega4-rv1103b.rst            |   56 +
 doc/board/rockchip/rockchip.rst               |    7 +
 drivers/clk/rockchip/Makefile                 |    2 +
 drivers/clk/rockchip/clk_rv1103b.c            | 1068 +++++++++++++
 drivers/clk/rockchip/clk_rv1106.c             | 1319 +++++++++++++++++
 drivers/mtd/Makefile                          |    1 +
 drivers/mtd/nand/Makefile                     |   13 +-
 drivers/pinctrl/rockchip/Makefile             |    2 +
 drivers/pinctrl/rockchip/pinctrl-rv1103b.c    |  402 +++++
 drivers/pinctrl/rockchip/pinctrl-rv1106.c     |  320 ++++
 include/configs/luckfox_pico.h                |   11 +
 include/configs/omega4_rv1103b.h              |   11 +
 include/configs/rv1103b_common.h              |   14 +
 include/configs/rv1106_common.h               |   13 +
 .../dt-bindings/clock/rockchip,rv1103b-cru.h  |  220 +++
 include/dt-bindings/clock/rv1106-cru.h        |  572 +++++++
 tools/rkcommon.c                              |    2 +
 68 files changed, 8436 insertions(+), 22 deletions(-)
 create mode 100644 arch/arm/dts/rv1103-luckfox-pico-mini-b-u-boot.dtsi
 create mode 100644 arch/arm/dts/rv1103-luckfox-pico-mini-b.dts
 create mode 100644 arch/arm/dts/rv1103.dtsi
 create mode 100644 arch/arm/dts/rv1103b-omega4-evb-u-boot.dtsi
 create mode 100644 arch/arm/dts/rv1103b-omega4-evb.dts
 create mode 100644 arch/arm/dts/rv1103b-omega4.dtsi
 create mode 100644 arch/arm/dts/rv1103b-pinctrl.dtsi
 create mode 100644 arch/arm/dts/rv1103b-u-boot.dtsi
 create mode 100644 arch/arm/dts/rv1103b.dtsi
 create mode 100644 arch/arm/dts/rv1106-pinctrl.dtsi
 create mode 100644 arch/arm/dts/rv1106-u-boot.dtsi
 create mode 100644 arch/arm/dts/rv1106.dtsi
 create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rv1103b.h
 create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rv1106.h
 create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rv1103b.h
 create mode 100644 arch/arm/include/asm/arch-rv1103b/boot0.h
 create mode 100644 arch/arm/include/asm/arch-rv1106/boot0.h
 create mode 100644 arch/arm/mach-rockchip/rv1103b/Kconfig
 create mode 100644 arch/arm/mach-rockchip/rv1103b/Makefile
 create mode 100644 arch/arm/mach-rockchip/rv1103b/boot0.h
 create mode 100644 arch/arm/mach-rockchip/rv1103b/clk_rv1103b.c
 create mode 100644 arch/arm/mach-rockchip/rv1103b/rv1103b.c
 create mode 100644 arch/arm/mach-rockchip/rv1103b/syscon_rv1103b.c
 create mode 100644 arch/arm/mach-rockchip/rv1106/Kconfig
 create mode 100644 arch/arm/mach-rockchip/rv1106/Makefile
 create mode 100644 arch/arm/mach-rockchip/rv1106/clk_rv1106.c
 create mode 100644 arch/arm/mach-rockchip/rv1106/rv1106.c
 create mode 100644 arch/arm/mach-rockchip/rv1106/syscon_rv1106.c
 create mode 100644 board/luckfox/pico/Kconfig
 create mode 100644 board/luckfox/pico/MAINTAINERS
 create mode 100644 board/luckfox/pico/Makefile
 create mode 100644 board/luckfox/pico/pico.c
 create mode 100644 board/luckfox/pico/pico.env
 create mode 100644 board/onion/omega4_rv1103b/Kconfig
 create mode 100644 board/onion/omega4_rv1103b/MAINTAINERS
 create mode 100644 board/onion/omega4_rv1103b/Makefile
 create mode 100644 board/onion/omega4_rv1103b/omega4_rv1103b.c
 create mode 100644 board/onion/omega4_rv1103b/omega4_rv1103b.env
 create mode 100644 common/spl/spl_spi_nand.c
 create mode 100644 configs/luckfox-pico-mini-b-rv1103_defconfig
 create mode 100644 configs/omega4-rv1103b_defconfig
 create mode 100644 doc/board/luckfox/index.rst
 create mode 100644 doc/board/luckfox/luckfox-pico.rst
 create mode 100644 doc/board/onion/index.rst
 create mode 100644 doc/board/onion/omega4-rv1103b.rst
 create mode 100644 drivers/clk/rockchip/clk_rv1103b.c
 create mode 100644 drivers/clk/rockchip/clk_rv1106.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rv1103b.c
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rv1106.c
 create mode 100644 include/configs/luckfox_pico.h
 create mode 100644 include/configs/omega4_rv1103b.h
 create mode 100644 include/configs/rv1103b_common.h
 create mode 100644 include/configs/rv1106_common.h
 create mode 100644 include/dt-bindings/clock/rockchip,rv1103b-cru.h
 create mode 100644 include/dt-bindings/clock/rv1106-cru.h

---
base-commit: ee5d46b45ec0c63f8f9dd1e816e0dac3452ccc3d
branch: rocka-us3

Signature · 1 line
2.43.0
#1 lore raw

PATCH v3 1/15 ARM: dts: Add the RV1103B devicetree files

From: Fabio Estevam <[email protected]>

Add the RV1103B SoC devicetree files, taken verbatim from Linux v7.1, where the RV1103B support is merged.

Once U-Boot's dts/upstream subtree is updated to v7.1-dts, the OF_UPSTREAM mechanism can be enabled and these files dropped.

---

Changes in v3:
- Move the board devicetrees to the board patch and the SoC u-boot.dtsi to the SoC patch (Jonas)
- Use the devicetree files as merged in Linux v7.1

Changes in v2:
- Use the devicetrees submitted to upstream Linux

 arch/arm/dts/rv1103b-pinctrl.dtsi             | 816 ++++++++++++++++++
 arch/arm/dts/rv1103b.dtsi                     | 239 +++++
 .../dt-bindings/clock/rockchip,rv1103b-cru.h  | 220 +++++
 3 files changed, 1275 insertions(+)
 create mode 100644 arch/arm/dts/rv1103b-pinctrl.dtsi
 create mode 100644 arch/arm/dts/rv1103b.dtsi
 create mode 100644 include/dt-bindings/clock/rockchip,rv1103b-cru.h
arch/arm/dts/rv1103b-pinctrl.dtsi new file +816 -0
new file mode 100644
index 00000000000..15516c38413
@@ -0,0 +1,816 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2026 Rockchip Electronics Co., Ltd.
+ */
+
+#include <dt-bindings/pinctrl/rockchip.h>
+#include <arm64/rockchip/rockchip-pinconf.dtsi>
+
+&pinctrl {
+	cam-clk0 {
+		/omit-if-no-ref/
+		cam_clk0: cam-clk0 {
+			rockchip,pins =
+				/* cam_clk0_out */
+				<1 RK_PB5 1 &pcfg_pull_none>;
+		};
+	};
+
+	cam-clk1 {
+		/omit-if-no-ref/
+		cam_clk1: cam-clk1 {
+			rockchip,pins =
+				/* cam_clk1_out */
+				<1 RK_PB6 1 &pcfg_pull_none>;
+		};
+	};
+
+	cam-spi {
+		/omit-if-no-ref/
+		cam_spi_bus4: cam-spi-bus4 {
+			rockchip,pins =
+				/* cam_spi_d0 */
+				<0 RK_PB5 4 &pcfg_pull_up_drv_level_2>,
+				/* cam_spi_d1 */
+				<0 RK_PB2 4 &pcfg_pull_up_drv_level_2>,
+				/* cam_spi_d2 */
+				<0 RK_PB1 4 &pcfg_pull_up_drv_level_2>,
+				/* cam_spi_d3 */
+				<0 RK_PB0 4 &pcfg_pull_up_drv_level_2>;
+		};
+
+		/omit-if-no-ref/
+		cam_spi_clk: cam-spi-clk {
+			rockchip,pins =
+				/* cam_spi_clk */
+				<0 RK_PB4 4 &pcfg_pull_none>;
+		};
+		/omit-if-no-ref/
+		cam_spi_cs0n: cam-spi-cs0n {
+			rockchip,pins =
+				/* cam_spi_cs0n */
+				<0 RK_PB3 4 &pcfg_pull_none>;
+		};
+	};
+
+	clk {
+		/omit-if-no-ref/
+		clk_32k: clk-32k {
+			rockchip,pins =
+				/* clk_32k */
+				<0 RK_PA0 2 &pcfg_pull_none>;
+		};
+	};
+
+	clk-24m {
+		/omit-if-no-ref/
+		clk_24m_out: clk-24m-out {
+			rockchip,pins =
+				/* clk_24m_out */
+				<0 RK_PA0 3 &pcfg_pull_none>;
+		};
+	};
+
+	cpu {
+		/omit-if-no-ref/
+		cpu: cpu {
+			rockchip,pins =
+				/* cpu_avs */
+				<0 RK_PA1 2 &pcfg_pull_none>;
+		};
+	};
+
+	emmc {
+		/omit-if-no-ref/
+		emmc_bus4: emmc-bus4 {
+			rockchip,pins =
+				/* emmc_d0 */
+				<1 RK_PA1 1 &pcfg_pull_up_drv_level_2>,
+				/* emmc_d1 */
+				<1 RK_PA2 1 &pcfg_pull_up_drv_level_2>,
+				/* emmc_d2 */
+				<1 RK_PA3 1 &pcfg_pull_up_drv_level_2>,
+				/* emmc_d3 */
+				<1 RK_PA0 1 &pcfg_pull_up_drv_level_2>;
+		};
+
+		/omit-if-no-ref/
+		emmc_clk: emmc-clk {
+			rockchip,pins =
+				/* emmc_clk */
+				<1 RK_PA4 1 &pcfg_pull_up_drv_level_2>;
+		};
+
+		/omit-if-no-ref/
+		emmc_cmd: emmc-cmd {
+			rockchip,pins =
+				/* emmc_cmd */
+				<1 RK_PA5 1 &pcfg_pull_up_drv_level_2>;
+		};
+	};
+
+	fspi {
+		/omit-if-no-ref/
+		fspi_bus4: fspi-bus4 {
+			rockchip,pins =
+				/* fspi_d0 */
+				<1 RK_PA1 2 &pcfg_pull_none>,
+				/* fspi_d1 */
+				<1 RK_PA2 2 &pcfg_pull_none>,
+				/* fspi_d2 */
+				<1 RK_PA3 2 &pcfg_pull_none>,
+				/* fspi_d3 */
+				<1 RK_PA0 2 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		fspi_cs0: fspi-cs0 {
+			rockchip,pins =
+				/* fspi_cs0n */
+				<1 RK_PA5 2 &pcfg_pull_up>;
+		};
+
+		/omit-if-no-ref/
+		fspi_clk: fspi-clk {
+			rockchip,pins =
+				/* fspi_clk */
+				<1 RK_PA4 2 &pcfg_pull_none>;
+		};
+	};
+
+	i2c0 {
+		/omit-if-no-ref/
+		i2c0m0_xfer: i2c0m0-xfer {
+			rockchip,pins =
+				/* i2c0_scl_m0 */
+				<0 RK_PA5 3 &pcfg_pull_none_smt>,
+				/* i2c0_sda_m0 */
+				<0 RK_PA6 3 &pcfg_pull_none_smt>;
+		};
+
+		/omit-if-no-ref/
+		i2c0m1_xfer: i2c0m1-xfer {
+			rockchip,pins =
+				/* i2c0_scl_m1 */
+				<1 RK_PB4 5 &pcfg_pull_none_smt>,
+				/* i2c0_sda_m1 */
+				<1 RK_PB3 5 &pcfg_pull_none_smt>;
+		};
+
+		/omit-if-no-ref/
+		i2c0m2_xfer: i2c0m2-xfer {
+			rockchip,pins =
+				/* i2c0_scl_m2 */
+				<1 RK_PB5 2 &pcfg_pull_none_smt>,
+				/* i2c0_sda_m2 */
+				<1 RK_PB6 2 &pcfg_pull_none_smt>;
+		};
+	};
+
+	i2c1 {
+		/omit-if-no-ref/
+		i2c1m0_xfer: i2c1m0-xfer {
+			rockchip,pins =
+				/* i2c1_scl_m0 */
+				<0 RK_PB0 1 &pcfg_pull_none_smt>,
+				/* i2c1_sda_m0 */
+				<0 RK_PB1 1 &pcfg_pull_none_smt>;
+		};
+
+		/omit-if-no-ref/
+		i2c1m1_xfer: i2c1m1-xfer {
+			rockchip,pins =
+				/* i2c1_scl_m1 */
+				<2 RK_PA4 4 &pcfg_pull_none_smt>,
+				/* i2c1_sda_m1 */
+				<2 RK_PA5 4 &pcfg_pull_none_smt>;
+		};
+	};
+
+	i2c2 {
+		/omit-if-no-ref/
+		i2c2m0_xfer: i2c2m0-xfer {
+			rockchip,pins =
+				/* i2c2_scl_m0 */
+				<0 RK_PB2 1 &pcfg_pull_none_smt>,
+				/* i2c2_sda_m0 */
+				<0 RK_PB3 1 &pcfg_pull_none_smt>;
+		};
+
+		/omit-if-no-ref/
+		i2c2m1_xfer: i2c2m1-xfer {
+			rockchip,pins =
+				/* i2c2_scl_m1 */
+				<2 RK_PA6 4 &pcfg_pull_none_smt>,
+				/* i2c2_sda_m1 */
+				<2 RK_PA7 4 &pcfg_pull_none_smt>;
+		};
+	};
+
+	i2c3 {
+		/omit-if-no-ref/
+		i2c3m0_xfer: i2c3m0-xfer {
+			rockchip,pins =
+				/* i2c3_scl_m0 */
+				<0 RK_PB4 1 &pcfg_pull_none_smt>,
+				/* i2c3_sda_m0 */
+				<0 RK_PB5 1 &pcfg_pull_none_smt>;
+		};
+
+		/omit-if-no-ref/
+		i2c3m1_xfer: i2c3m1-xfer {
+			rockchip,pins =
+				/* i2c3_scl_m1 */
+				<2 RK_PB3 4 &pcfg_pull_none_smt>,
+				/* i2c3_sda_m1 */
+				<2 RK_PB2 4 &pcfg_pull_none_smt>;
+		};
+	};
+
+	i2c4 {
+		/omit-if-no-ref/
+		i2c4m0_xfer: i2c4m0-xfer {
+			rockchip,pins =
+				/* i2c4_scl_m0 */
+				<2 RK_PB0 4 &pcfg_pull_none_smt>,
+				/* i2c4_sda_m0 */
+				<2 RK_PB1 4 &pcfg_pull_none_smt>;
+		};
+
+		/omit-if-no-ref/
+		i2c4m1_xfer: i2c4m1-xfer {
+			rockchip,pins =
+				/* i2c4_scl_m1 */
+				<1 RK_PB7 2 &pcfg_pull_none_smt>,
+				/* i2c4_sda_m1 */
+				<1 RK_PC0 2 &pcfg_pull_none_smt>;
+		};
+	};
+
+	jtag {
+		/omit-if-no-ref/
+		jtagm0: jtagm0 {
+			rockchip,pins =
+				/* jtag_tck_m0 */
+				<0 RK_PA5 5 &pcfg_pull_none>,
+				/* jtag_tms_m0 */
+				<0 RK_PA6 5 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		jtagm1: jtagm1 {
+			rockchip,pins =
+				/* jtag_tck_m1 */
+				<0 RK_PB4 3 &pcfg_pull_none>,
+				/* jtag_tms_m1 */
+				<0 RK_PB5 3 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		jtagm2: jtagm2 {
+			rockchip,pins =
+				/* jtag_tck_m2 */
+				<1 RK_PB4 3 &pcfg_pull_none>,
+				/* jtag_tms_m2 */
+				<1 RK_PB3 3 &pcfg_pull_none>;
+		};
+	};
+
+	psram-spi {
+		/omit-if-no-ref/
+		psram_spi_bus4: psram-spi-bus4 {
+			rockchip,pins =
+				/* psram_spi_d0 */
+				<0 RK_PA2 4 &pcfg_pull_none>,
+				/* psram_spi_d1 */
+				<0 RK_PA1 4 &pcfg_pull_none>,
+				/* psram_spi_d2 */
+				<0 RK_PA5 4 &pcfg_pull_none>,
+				/* psram_spi_d3 */
+				<0 RK_PA6 4 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		psram_spi_clk: psram-spi-clk {
+			rockchip,pins =
+				/* psram_spi_clk */
+				<0 RK_PA0 4 &pcfg_pull_none>;
+		};
+		/omit-if-no-ref/
+		psram_spi_cs0n: psram-spi-cs0n {
+			rockchip,pins =
+				/* psram_spi_cs0n */
+				<0 RK_PA4 4 &pcfg_pull_none>;
+		};
+	};
+
+	pwm0 {
+		/omit-if-no-ref/
+		pwm0m0_ch0: pwm0m0-ch0 {
+			rockchip,pins =
+				/* pwm0m0_ch0 */
+				<0 RK_PA1 1 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm0m0_ch1: pwm0m0-ch1 {
+			rockchip,pins =
+				/* pwm0m0_ch1 */
+				<0 RK_PA5 2 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm0m0_ch2: pwm0m0-ch2 {
+			rockchip,pins =
+				/* pwm0m0_ch2 */
+				<0 RK_PA6 2 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm0m0_ch3: pwm0m0-ch3 {
+			rockchip,pins =
+				/* pwm0m0_ch3 */
+				<0 RK_PA2 1 &pcfg_pull_none_drv_level_0>;
+		};
+
+		/omit-if-no-ref/
+		pwm0m1_ch0: pwm0m1-ch0 {
+			rockchip,pins =
+				/* pwm0m1_ch0 */
+				<2 RK_PA0 3 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm0m1_ch1: pwm0m1-ch1 {
+			rockchip,pins =
+				/* pwm0m1_ch1 */
+				<2 RK_PA1 3 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm0m1_ch2: pwm0m1-ch2 {
+			rockchip,pins =
+				/* pwm0m1_ch2 */
+				<2 RK_PA2 3 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm0m1_ch3: pwm0m1-ch3 {
+			rockchip,pins =
+				/* pwm0m1_ch3 */
+				<2 RK_PB0 3 &pcfg_pull_none_drv_level_0>;
+		};
+
+		/omit-if-no-ref/
+		pwm0m2_ch1: pwm0m2-ch1 {
+			rockchip,pins =
+				/* pwm0m2_ch1 */
+				<1 RK_PB7 1 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm0m2_ch2: pwm0m2-ch2 {
+			rockchip,pins =
+				/* pwm0m2_ch2 */
+				<1 RK_PC0 1 &pcfg_pull_none_drv_level_0>;
+		};
+	};
+
+	pwm1 {
+		/omit-if-no-ref/
+		pwm1m0_ch0: pwm1m0-ch0 {
+			rockchip,pins =
+				/* pwm1m0_ch0 */
+				<0 RK_PB0 3 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm1m0_ch1: pwm1m0-ch1 {
+			rockchip,pins =
+				/* pwm1m0_ch1 */
+				<0 RK_PB1 3 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm1m0_ch2: pwm1m0-ch2 {
+			rockchip,pins =
+				/* pwm1m0_ch2 */
+				<0 RK_PB2 3 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm1m0_ch3: pwm1m0-ch3 {
+			rockchip,pins =
+				/* pwm1m0_ch3 */
+				<0 RK_PB3 3 &pcfg_pull_none_drv_level_0>;
+		};
+
+		/omit-if-no-ref/
+		pwm1m1_ch0: pwm1m1-ch0 {
+			rockchip,pins =
+				/* pwm1m1_ch0 */
+				<2 RK_PA3 3 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm1m1_ch1: pwm1m1-ch1 {
+			rockchip,pins =
+				/* pwm1m1_ch1 */
+				<2 RK_PA4 3 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm1m1_ch2: pwm1m1-ch2 {
+			rockchip,pins =
+				/* pwm1m1_ch2 */
+				<2 RK_PA5 3 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm1m1_ch3: pwm1m1-ch3 {
+			rockchip,pins =
+				/* pwm1m1_ch3 */
+				<2 RK_PB1 3 &pcfg_pull_none_drv_level_0>;
+		};
+	};
+
+	pwm2 {
+		/omit-if-no-ref/
+		pwm2m0_ch0: pwm2m0-ch0 {
+			rockchip,pins =
+				/* pwm2m0_ch0 */
+				<1 RK_PB0 4 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm2m0_ch1: pwm2m0-ch1 {
+			rockchip,pins =
+				/* pwm2m0_ch1 */
+				<1 RK_PA7 4 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm2m0_ch2: pwm2m0-ch2 {
+			rockchip,pins =
+				/* pwm2m0_ch2 */
+				<1 RK_PB4 4 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm2m0_ch3: pwm2m0-ch3 {
+			rockchip,pins =
+				/* pwm2m0_ch3 */
+				<1 RK_PB3 4 &pcfg_pull_none_drv_level_0>;
+		};
+
+		/omit-if-no-ref/
+		pwm2m1_ch0: pwm2m1-ch0 {
+			rockchip,pins =
+				/* pwm2m1_ch0 */
+				<2 RK_PA6 3 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm2m1_ch1: pwm2m1-ch1 {
+			rockchip,pins =
+				/* pwm2m1_ch1 */
+				<2 RK_PA7 3 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm2m1_ch2: pwm2m1-ch2 {
+			rockchip,pins =
+				/* pwm2m1_ch2 */
+				<2 RK_PB2 3 &pcfg_pull_none_drv_level_0>;
+		};
+		/omit-if-no-ref/
+		pwm2m1_ch3: pwm2m1-ch3 {
+			rockchip,pins =
+				/* pwm2m1_ch3 */
+				<2 RK_PB3 3 &pcfg_pull_none_drv_level_0>;
+		};
+	};
+
+	pwr {
+		/omit-if-no-ref/
+		pwr: pwr {
+			rockchip,pins =
+				/* pwr_ctrl0 */
+				<0 RK_PA3 1 &pcfg_pull_none>,
+				/* pwr_ctrl1 */
+				<0 RK_PA4 1 &pcfg_pull_none>;
+		};
+	};
+
+	rtc_32k {
+		/omit-if-no-ref/
+		rtc_32k: rtc-32k {
+			rockchip,pins =
+				/* rtc_32k_out */
+				<0 RK_PA0 1 &pcfg_pull_none>;
+		};
+	};
+
+	sai {
+		/omit-if-no-ref/
+		sai: sai {
+			rockchip,pins =
+				/* sai_lrck */
+				<2 RK_PB1 5 &pcfg_pull_none>,
+				/* sai_mclk */
+				<2 RK_PB0 5 &pcfg_pull_none>,
+				/* sai_sclk */
+				<2 RK_PA7 5 &pcfg_pull_none>,
+				/* sai_sdi */
+				<2 RK_PA6 5 &pcfg_pull_none>,
+				/* sai_sdo */
+				<2 RK_PB2 5 &pcfg_pull_none>;
+		};
+	};
+
+	sdmmc0 {
+		/omit-if-no-ref/
+		sdmmc0_bus4: sdmmc0-bus4 {
+			rockchip,pins =
+				/* sdmmc0_d0 */
+				<1 RK_PB0 1 &pcfg_pull_up_drv_level_2>,
+				/* sdmmc0_d1 */
+				<1 RK_PA7 1 &pcfg_pull_up_drv_level_2>,
+				/* sdmmc0_d2 */
+				<1 RK_PB4 1 &pcfg_pull_up_drv_level_2>,
+				/* sdmmc0_d3 */
+				<1 RK_PB3 1 &pcfg_pull_up_drv_level_2>;
+		};
+
+		/omit-if-no-ref/
+		sdmmc0_clk: sdmmc0-clk {
+			rockchip,pins =
+				/* sdmmc0_clk */
+				<1 RK_PB1 1 &pcfg_pull_up_drv_level_2>;
+		};
+
+		/omit-if-no-ref/
+		sdmmc0_cmd: sdmmc0-cmd {
+			rockchip,pins =
+				/* sdmmc0_cmd */
+				<1 RK_PB2 1 &pcfg_pull_up_drv_level_2>;
+		};
+
+		/omit-if-no-ref/
+		sdmmc0_det: sdmmc0-det {
+			rockchip,pins =
+				/* sdmmc0_det */
+				<1 RK_PA6 1 &pcfg_pull_up>;
+		};
+	};
+
+	sdmmc1 {
+		/omit-if-no-ref/
+		sdmmc1_bus4: sdmmc1-bus4 {
+			rockchip,pins =
+				/* sdmmc1_d0 */
+				<2 RK_PA1 1 &pcfg_pull_up_drv_level_2>,
+				/* sdmmc1_d1 */
+				<2 RK_PA0 1 &pcfg_pull_up_drv_level_2>,
+				/* sdmmc1_d2 */
+				<2 RK_PA5 1 &pcfg_pull_up_drv_level_2>,
+				/* sdmmc1_d3 */
+				<2 RK_PA4 1 &pcfg_pull_up_drv_level_2>;
+		};
+
+		/omit-if-no-ref/
+		sdmmc1_clk: sdmmc1-clk {
+			rockchip,pins =
+				/* sdmmc1_clk */
+				<2 RK_PA2 1 &pcfg_pull_up_drv_level_2>;
+		};
+
+		/omit-if-no-ref/
+		sdmmc1_cmd: sdmmc1-cmd {
+			rockchip,pins =
+				/* sdmmc1_cmd */
+				<2 RK_PA3 1 &pcfg_pull_up_drv_level_2>;
+		};
+	};
+
+	spi0 {
+		/omit-if-no-ref/
+		spi0m0_clk: spi0m0-clk {
+			rockchip,pins =
+				/* spi0_clk_m0 */
+				<2 RK_PB0 2 &pcfg_pull_none>,
+				/* spi0_miso_m0 */
+				<2 RK_PB3 2 &pcfg_pull_none>,
+				/* spi0_mosi_m0 */
+				<2 RK_PB1 2 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		spi0m0_cs0: spi0m0-cs0 {
+			rockchip,pins =
+				/* spi0_cs0n_m0 */
+				<2 RK_PB2 2 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		spi0m0_cs1: spi0m0-cs1 {
+			rockchip,pins =
+				/* spi0_cs1n_m0 */
+				<2 RK_PA7 2 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		spi0m1_clk: spi0m1-clk {
+			rockchip,pins =
+				/* spi0_clk_m1 */
+				<2 RK_PA2 5 &pcfg_pull_none>,
+				/* spi0_miso_m1 */
+				<2 RK_PA4 5 &pcfg_pull_none>,
+				/* spi0_mosi_m1 */
+				<2 RK_PA1 5 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		spi0m1_cs0: spi0m1-cs0 {
+			rockchip,pins =
+				/* spi0_cs0n_m1 */
+				<2 RK_PA3 5 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		spi0m1_cs1: spi0m1-cs1 {
+			rockchip,pins =
+				/* spi0_cs1n_m1 */
+				<2 RK_PA0 5 &pcfg_pull_none>;
+		};
+	};
+
+	uart0 {
+		/omit-if-no-ref/
+		uart0m0_xfer: uart0m0-xfer {
+			rockchip,pins =
+				/* uart0_rx_m0 */
+				<0 RK_PA6 1 &pcfg_pull_up>,
+				/* uart0_tx_m0 */
+				<0 RK_PA5 1 &pcfg_pull_up>;
+		};
+
+		/omit-if-no-ref/
+		uart0m1_xfer: uart0m1-xfer {
+			rockchip,pins =
+				/* uart0_rx_m1 */
+				<0 RK_PB5 2 &pcfg_pull_up>,
+				/* uart0_tx_m1 */
+				<0 RK_PB4 2 &pcfg_pull_up>;
+		};
+
+		/omit-if-no-ref/
+		uart0m2_xfer: uart0m2-xfer {
+			rockchip,pins =
+				/* uart0_rx_m2 */
+				<1 RK_PB3 2 &pcfg_pull_up>,
+				/* uart0_tx_m2 */
+				<1 RK_PB4 2 &pcfg_pull_up>;
+		};
+	};
+
+	uart1 {
+		/omit-if-no-ref/
+		uart1m0_xfer: uart1m0-xfer {
+			rockchip,pins =
+				/* uart1_rx_m0 */
+				<0 RK_PB2 2 &pcfg_pull_up>,
+				/* uart1_tx_m0 */
+				<0 RK_PB3 2 &pcfg_pull_up>;
+		};
+
+		/omit-if-no-ref/
+		uart1m0_ctsn: uart1m0-ctsn {
+			rockchip,pins =
+				/* uart1m0_ctsn */
+				<0 RK_PB5 5 &pcfg_pull_none>;
+		};
+		/omit-if-no-ref/
+		uart1m0_rtsn: uart1m0-rtsn {
+			rockchip,pins =
+				/* uart1m0_rtsn */
+				<0 RK_PB4 5 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		uart1m1_xfer: uart1m1-xfer {
+			rockchip,pins =
+				/* uart1_rx_m1 */
+				<1 RK_PA7 2 &pcfg_pull_up>,
+				/* uart1_tx_m1 */
+				<1 RK_PB0 2 &pcfg_pull_up>;
+		};
+
+		/omit-if-no-ref/
+		uart1m1_ctsn: uart1m1-ctsn {
+			rockchip,pins =
+				/* uart1m1_ctsn */
+				<1 RK_PB2 2 &pcfg_pull_none>;
+		};
+		/omit-if-no-ref/
+		uart1m1_rtsn: uart1m1-rtsn {
+			rockchip,pins =
+				/* uart1m1_rtsn */
+				<1 RK_PB1 2 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		uart1m2_xfer: uart1m2-xfer {
+			rockchip,pins =
+				/* uart1_rx_m2 */
+				<2 RK_PA7 1 &pcfg_pull_up>,
+				/* uart1_tx_m2 */
+				<2 RK_PA6 1 &pcfg_pull_up>;
+		};
+
+		/omit-if-no-ref/
+		uart1m2_ctsn: uart1m2-ctsn {
+			rockchip,pins =
+				/* uart1m2_ctsn */
+				<2 RK_PA5 2 &pcfg_pull_none>;
+		};
+		/omit-if-no-ref/
+		uart1m2_rtsn: uart1m2-rtsn {
+			rockchip,pins =
+				/* uart1m2_rtsn */
+				<2 RK_PA4 2 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		uart1m3_xfer: uart1m3-xfer {
+			rockchip,pins =
+				/* uart1_rx_m3 */
+				<2 RK_PA3 2 &pcfg_pull_up>,
+				/* uart1_tx_m3 */
+				<2 RK_PA2 2 &pcfg_pull_up>;
+		};
+
+		/omit-if-no-ref/
+		uart1m3_ctsn: uart1m3-ctsn {
+			rockchip,pins =
+				/* uart1m3_ctsn */
+				<2 RK_PA1 2 &pcfg_pull_none>;
+		};
+		/omit-if-no-ref/
+		uart1m3_rtsn: uart1m3-rtsn {
+			rockchip,pins =
+				/* uart1m3_rtsn */
+				<2 RK_PA0 2 &pcfg_pull_none>;
+		};
+	};
+
+	uart2 {
+		/omit-if-no-ref/
+		uart2m0_xfer: uart2m0-xfer {
+			rockchip,pins =
+				/* uart2_rx_m0 */
+				<0 RK_PB1 2 &pcfg_pull_up>,
+				/* uart2_tx_m0 */
+				<0 RK_PB0 2 &pcfg_pull_up>;
+		};
+
+		/omit-if-no-ref/
+		uart2m0_ctsn: uart2m0-ctsn {
+			rockchip,pins =
+				/* uart2m0_ctsn */
+				<0 RK_PB3 5 &pcfg_pull_none>;
+		};
+		/omit-if-no-ref/
+		uart2m0_rtsn: uart2m0-rtsn {
+			rockchip,pins =
+				/* uart2m0_rtsn */
+				<0 RK_PB2 5 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		uart2m1_xfer: uart2m1-xfer {
+			rockchip,pins =
+				/* uart2_rx_m1 */
+				<2 RK_PB1 1 &pcfg_pull_up>,
+				/* uart2_tx_m1 */
+				<2 RK_PB0 1 &pcfg_pull_up>;
+		};
+
+		/omit-if-no-ref/
+		uart2m1_ctsn: uart2m1-ctsn {
+			rockchip,pins =
+				/* uart2m1_ctsn */
+				<2 RK_PB3 1 &pcfg_pull_none>;
+		};
+		/omit-if-no-ref/
+		uart2m1_rtsn: uart2m1-rtsn {
+			rockchip,pins =
+				/* uart2m1_rtsn */
+				<2 RK_PB2 1 &pcfg_pull_none>;
+		};
+
+		/omit-if-no-ref/
+		uart2m2_xfer: uart2m2-xfer {
+			rockchip,pins =
+				/* uart2_rx_m2 */
+				<1 RK_PB6 3 &pcfg_pull_up>,
+				/* uart2_tx_m2 */
+				<1 RK_PB5 3 &pcfg_pull_up>;
+		};
+
+		/omit-if-no-ref/
+		uart2m2_ctsn: uart2m2-ctsn {
+			rockchip,pins =
+				/* uart2m2_ctsn */
+				<1 RK_PC0 3 &pcfg_pull_none>;
+		};
+		/omit-if-no-ref/
+		uart2m2_rtsn: uart2m2-rtsn {
+			rockchip,pins =
+				/* uart2m2_rtsn */
+				<1 RK_PB7 3 &pcfg_pull_none>;
+		};
+	};
+};
arch/arm/dts/rv1103b.dtsi new file +239 -0

239 lines not on this page · raw message

include/dt-bindings/clock/rockchip,rv1103b-cru.h new file +220 -0

220 lines not on this page · raw message

Signature · 1 line
2.43.0
#2 lore raw

PATCH v3 2/15 pinctrl: rockchip: Add RV1103B support

In reply to Simon Glass

From: Ye Zhang <[email protected]>

Add the pinctrl driver for the RV1103B.

---

Changes in v3:
- Use regmap_update_bits() in all the remaining places (Jonas)
- Align continuation lines with the open parenthesis (checkpatch)

Changes in v2:
- Use the original author from Rockchip's vendor U-Boot tree
- Use regmap_update_bits()
- Remove unneeded blank lines
- Remove unneeded logging functions

 drivers/pinctrl/rockchip/Makefile          |   1 +
 drivers/pinctrl/rockchip/pinctrl-rv1103b.c | 402 +++++++++++++++++++++
 2 files changed, 403 insertions(+)
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rv1103b.c
drivers/pinctrl/rockchip/Makefile +1 -0
index 0405df128df..b7ce6402ea3 100644
@@ -19,5 +19,6 @@ obj-$(CONFIG_ROCKCHIP_RK3528) += pinctrl-rk3528.o
 obj-$(CONFIG_ROCKCHIP_RK3568) += pinctrl-rk3568.o
 obj-$(CONFIG_ROCKCHIP_RK3576) += pinctrl-rk3576.o
 obj-$(CONFIG_ROCKCHIP_RK3588) += pinctrl-rk3588.o
+obj-$(CONFIG_ROCKCHIP_RV1103B) += pinctrl-rv1103b.o
 obj-$(CONFIG_ROCKCHIP_RV1108) += pinctrl-rv1108.o
 obj-$(CONFIG_ROCKCHIP_RV1126) += pinctrl-rv1126.o
drivers/pinctrl/rockchip/pinctrl-rv1103b.c new file +402 -0

402 lines not on this page · raw message

Signature · 1 line
2.43.0
#3 lore raw

PATCH v3 3/15 clk: rockchip: Add RV1103B clock driver

In reply to Simon Glass

From: Elaine Zhang <[email protected]>

Add the basic clock driver for the RV1103B.

---

Changes in v3:
- Use CONFIG_IS_ENABLED() to guard the set_parent operation, matching clk_rk3588.c, since plain IS_ENABLED() needs the CONFIG_ prefix

Changes in v2:
- Use the original author from Rockchip's vendor U-Boot tree

 .../include/asm/arch-rockchip/cru_rv1103b.h   |  266 ++++
 .../include/asm/arch-rockchip/grf_rv1103b.h   |   31 +
 drivers/clk/rockchip/Makefile                 |    1 +
 drivers/clk/rockchip/clk_rv1103b.c            | 1068 +++++++++++++++++
 4 files changed, 1366 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rv1103b.h
 create mode 100644 arch/arm/include/asm/arch-rockchip/grf_rv1103b.h
 create mode 100644 drivers/clk/rockchip/clk_rv1103b.c
arch/arm/include/asm/arch-rockchip/cru_rv1103b.h new file +266 -0
new file mode 100644
index 00000000000..fc7aa4dfc0d
@@ -0,0 +1,266 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2024 Rockchip Electronics Co. Ltd.
+ * Author: Elaine Zhang <[email protected]>
+ */
+
+#ifndef _ASM_ARCH_CRU_RV1103B_H
+#define _ASM_ARCH_CRU_RV1103B_H
+
+#define MHz		1000000
+#define KHz		1000
+#define OSC_HZ		(24 * MHz)
+#define RC_OSC_HZ	(125 * MHz)
+
+#define GPLL_HZ		(1188 * MHz)
+
+/* RV1103B pll id */
+enum rv1103b_pll_id {
+	GPLL,
+	PLL_COUNT,
+};
+
+struct rv1103b_clk_info {
+	unsigned long id;
+	char *name;
+	bool is_cru;
+};
+
+struct rv1103b_clk_priv {
+	struct rv1103b_cru *cru;
+	struct rv1103b_grf *grf;
+	ulong gpll_hz;
+	ulong armclk_hz;
+	ulong armclk_enter_hz;
+	ulong armclk_init_hz;
+	bool sync_kernel;
+	bool set_armclk_rate;
+};
+
+struct rv1103b_grf_clk_priv {
+	struct rv1103b_grf *grf;
+};
+
+struct rv1103b_pll {
+	unsigned int con0;
+	unsigned int con1;
+	unsigned int con2;
+	unsigned int con3;
+	unsigned int con4;
+	unsigned int reserved0[3];
+};
+
+struct rv1103b_cru {
+	unsigned int reserved0[192];
+	unsigned int peri_clksel_con[4];
+	unsigned int reserved1[316];
+	unsigned int peri_clkgate_con[12];
+	unsigned int reserved2[116];
+	unsigned int peri_softrst_con[12];
+	unsigned int reserved3[15924];
+	unsigned int vepu_clksel_con[3];
+	unsigned int reserved4[317];
+	unsigned int vepu_clkgate_con[1];
+	unsigned int reserved5[127];
+	unsigned int vepu_softrst_con[1];
+	unsigned int reserved6[15935];
+	unsigned int npu_clksel_con[3];
+	unsigned int reserved7[317];
+	unsigned int npu_clkgate_con[1];
+	unsigned int reserved8[127];
+	unsigned int npu_softrst_con[1];
+	unsigned int reserved9[15935];
+	unsigned int vi_clksel_con[1];
+	unsigned int reserved10[319];
+	unsigned int vi_clkgate_con[3];
+	unsigned int reserved11[125];
+	unsigned int vi_softrst_con[3];
+	unsigned int reserved12[15933];
+	unsigned int core_clksel_con[3];
+	unsigned int reserved13[16381];
+	unsigned int ddr_clksel_con[1];
+	unsigned int reserved14[16207];
+	struct rv1103b_pll pll[2];
+	unsigned int reserved15[128];
+	unsigned int mode;
+	unsigned int reserved16[31];
+	unsigned int clksel_con[42];
+	unsigned int reserved17[278];
+	unsigned int clkgate_con[7];
+	unsigned int reserved18[121];
+	unsigned int softrst_con[1];
+	unsigned int reserved19[127];
+	unsigned int glb_cnt_th;
+	unsigned int glb_rst_st;
+	unsigned int glb_srst_fst;
+	unsigned int glb_srst_snd;
+	unsigned int glb_rst_con;
+	unsigned int reserved20[15803];
+	unsigned int pmu_clksel_con[3];
+	unsigned int reserved21[317];
+	unsigned int pmu_clkgate_con[3];
+	unsigned int reserved22[125];
+	unsigned int pmu_softrst_con[3];
+	unsigned int reserved23[15933];
+	unsigned int pmu1_clksel_con[1];
+	unsigned int reserved24[319];
+	unsigned int pmu1_clkgate_con[2];
+	unsigned int reserved25[126];
+	unsigned int pmu1_softrst_con[2];
+};
+
+check_member(rv1103b_cru, pmu1_softrst_con[1], 0x80a04);
+
+struct pll_rate_table {
+	unsigned long rate;
+	unsigned int fbdiv;
+	unsigned int postdiv1;
+	unsigned int refdiv;
+	unsigned int postdiv2;
+	unsigned int dsmpd;
+	unsigned int frac;
+};
+
+#define RV1103B_TOPCRU_BASE		0x60000
+#define RV1103B_PERICRU_BASE		0x0
+#define RV1103B_VICRU_BASE		0x30000
+#define RV1103B_NPUCRU_BASE		0x20000
+#define RV1103B_CORECRU_BASE		0x40000
+#define RV1103B_VEPUCRU_BASE		0x10000
+#define RV1103B_DDRCRU_BASE		0x50000
+#define RV1103B_SUBDDRCRU_BASE		0x58000
+#define RV1103B_PMUCRU_BASE		0x70000
+#define RV1103B_PMU1CRU_BASE		0x80000
+
+#define RV1103B_CRU_BASE		0x20000000
+
+#define RV1103B_PLL_CON(x)		((x) * 0x4 + RV1103B_TOPCRU_BASE)
+#define RV1103B_MODE_CON		(0x280 + RV1103B_TOPCRU_BASE)
+#define RV1103B_CLKSEL_CON(x)		((x) * 0x4 + 0x300 + RV1103B_TOPCRU_BASE)
+#define RV1103B_SUBDDRMODE_CON		(0x280 + RV1103B_SUBDDRCRU_BASE)
+
+enum {
+	/* CORECRU_CLK_SEL0_CON */
+	CLK_CORE_SRC_SEL_SHIFT		= 1,
+	CLK_CORE_SRC_SEL_MASK		= 0x1 << CLK_CORE_SRC_SEL_SHIFT,
+	CLK_CORE_SRC_SEL_GPLL		= 0,
+	CLK_CORE_SRC_SEL_PVTPLL,
+
+	/* CRU_PERI_CLK_SEL0_CON */
+	CLK_TSADC_TSEN_DIV_SHIFT	= 10,
+	CLK_TSADC_TSEN_DIV_MASK		= 0x1f << CLK_TSADC_TSEN_DIV_SHIFT,
+	CLK_TSADC_DIV_SHIFT		= 4,
+	CLK_TSADC_DIV_MASK		= 0x1f << CLK_TSADC_DIV_SHIFT,
+	PCLK_PERI_DIV_SHIFT		= 0,
+	PCLK_PERI_DIV_MASK		= 0x3 << PCLK_PERI_DIV_SHIFT,
+
+	/* CRU_PERI_CLK_SEL1_CON */
+	CLK_SARADC_DIV_SHIFT		= 0,
+	CLK_SARADC_DIV_MASK		= 0x7 << CLK_SARADC_DIV_SHIFT,
+
+	/* CRU_CLK_SEL5_CON */
+	CLK_UART2_SRC_DIV_SHIFT		= 10,
+	CLK_UART2_SRC_DIV_MASK		= 0x1f << CLK_UART2_SRC_DIV_SHIFT,
+	CLK_UART1_SRC_DIV_SHIFT		= 5,
+	CLK_UART1_SRC_DIV_MASK		= 0x1f << CLK_UART1_SRC_DIV_SHIFT,
+	CLK_UART0_SRC_DIV_SHIFT		= 0,
+	CLK_UART0_SRC_DIV_MASK		= 0x1f << CLK_UART0_SRC_DIV_SHIFT,
+
+	/* CRU_CLK_SEL10_CON */
+	CLK_UART_FRAC_NUMERATOR_SHIFT	= 16,
+	CLK_UART_FRAC_NUMERATOR_MASK	= 0xffff << 16,
+	CLK_UART_FRAC_DENOMINATOR_SHIFT	= 0,
+	CLK_UART_FRAC_DENOMINATOR_MASK	= 0xffff,
+
+	/* CRU_CLK_SEL31_CON */
+	CLK_EMMC_SEL_SHIFT		= 15,
+	CLK_EMMC_SEL_MASK		= 0x1 << CLK_EMMC_SEL_SHIFT,
+	ACLK_PERI_SEL_SHIFT		= 10,
+	ACLK_PERI_SEL_MASK		= 0x3 << ACLK_PERI_SEL_SHIFT,
+	ACLK_PERI_SEL_600M		= 0,
+	ACLK_PERI_SEL_480M,
+	ACLK_PERI_SEL_400M,
+	LSCLK_PERI_SEL_SHIFT		= 9,
+	LSCLK_PERI_SEL_MASK		= 0x1 << LSCLK_PERI_SEL_SHIFT,
+	LSCLK_PERI_SEL_300M		= 0,
+	LSCLK_PERI_SEL_200M,
+	CLK_EMMC_DIV_SHIFT		= 0,
+	CLK_EMMC_DIV_MASK		= 0xff << CLK_EMMC_DIV_SHIFT,
+
+	/* CRU_CLK_SEL32_CON */
+	CLK_SDMMC_SEL_SHIFT		= 15,
+	CLK_SDMMC_SEL_MASK		= 0x1 << CLK_SDMMC_SEL_SHIFT,
+	CLK_MMC_SEL_GPLL		= 0,
+	CLK_MMC_SEL_OSC,
+	CLK_UART2_SEL_SHIFT		= 12,
+	CLK_UART2_SEL_MASK		= 3 << CLK_UART2_SEL_SHIFT,
+	CLK_UART1_SEL_SHIFT		= 10,
+	CLK_UART1_SEL_MASK		= 3 << CLK_UART1_SEL_SHIFT,
+	CLK_UART0_SEL_SHIFT		= 8,
+	CLK_UART0_SEL_MASK		= 3 << CLK_UART0_SEL_SHIFT,
+	CLK_UART_SEL_SRC		= 0,
+	CLK_UART_SEL_FRAC,
+	CLK_UART_SEL_OSC,
+	CLK_SDMMC_DIV_SHIFT		= 0,
+	CLK_SDMMC_DIV_MASK		= 0xff << CLK_SDMMC_DIV_SHIFT,
+
+	/* CRU_CLK_SEL33_CON */
+	CLK_SFC_SEL_SHIFT		= 15,
+	CLK_SFC_SEL_MASK		= 0x1 << CLK_SFC_SEL_SHIFT,
+	CLK_SFC_DIV_SHIFT		= 0,
+	CLK_SFC_DIV_MASK		= 0xff << CLK_SFC_DIV_SHIFT,
+
+	/* CRU_CLK_SEL34_CON */
+	CLK_PWM2_SEL_SHIFT		= 14,
+	CLK_PWM2_SEL_MASK		= 1 << CLK_PWM2_SEL_SHIFT,
+	CLK_PWM1_SEL_SHIFT		= 13,
+	CLK_PWM1_SEL_MASK		= 1 << CLK_PWM1_SEL_SHIFT,
+	CLK_PWM0_SEL_SHIFT		= 12,
+	CLK_PWM0_SEL_MASK		= 1 << CLK_PWM0_SEL_SHIFT,
+	CLK_PWM_SEL_100M		= 0,
+	CLK_PWM_SEL_24M,
+	CLK_SPI0_SEL_SHIFT		= 2,
+	CLK_SPI0_SEL_MASK		= 3 << CLK_SPI0_SEL_SHIFT,
+	CLK_SPI0_SEL_200M		= 0,
+	CLK_SPI0_SEL_100M,
+	CLK_SPI0_SEL_50M,
+	CLK_SPI0_SEL_24M,
+	CLK_I2C1_SEL_SHIFT		= 1,
+	CLK_I2C1_SEL_MASK		= 0x1 << CLK_I2C1_SEL_SHIFT,
+	CLK_I2C0_SEL_SHIFT		= 0,
+	CLK_I2C0_SEL_MASK		= 0x1 << CLK_I2C0_SEL_SHIFT,
+	CLK_I2C_SEL_100M		= 0,
+	CLK_I2C_SEL_24M,
+
+	/* CRU_CLK_SEL35_CON */
+	CLK_PKA_CRYPTO_SEL_SHIFT	= 4,
+	CLK_PKA_CRYPTO_SEL_MASK		= 0x3 << CLK_PKA_CRYPTO_SEL_SHIFT,
+	CLK_CORE_CRYPTO_SEL_SHIFT	= 2,
+	CLK_CORE_CRYPTO_SEL_MASK	= 0x3 << CLK_CORE_CRYPTO_SEL_SHIFT,
+	CLK_CORE_CRYPTO_SEL_300M	= 0,
+	CLK_CORE_CRYPTO_SEL_200M,
+	CLK_CORE_CRYPTO_SEL_100M,
+	DCLK_DECOM_SEL_SHIFT		= 0,
+	DCLK_DECOM_SEL_MASK		= 0x3 << DCLK_DECOM_SEL_SHIFT,
+	DCLK_DECOM_SEL_480M		= 0,
+	DCLK_DECOM_SEL_400M,
+	DCLK_DECOM_SEL_300M,
+
+	/* CRU_CLK_SEL37_CON */
+	CLK_CORE_GPLL_DIV_SHIFT		= 13,
+	CLK_CORE_GPLL_DIV_MASK		= 0x7 << CLK_CORE_GPLL_DIV_SHIFT,
+	CLK_CORE_GPLL_SEL_SHIFT		= 12,
+	CLK_CORE_GPLL_SEL_MASK		= 0x1 << CLK_CORE_GPLL_SEL_SHIFT,
+	CLK_CORE_GPLL_SEL_GPLL		= 0,
+	CLK_CORE_GPLL_SEL_OSC,
+
+	/* CRU_PMU_CLK_SEL2_CON */
+	LSCLK_PMU_SEL_SHIFT		= 4,
+	LSCLK_PMU_SEL_MASK		= 0x1 << LSCLK_PMU_SEL_SHIFT,
+	LSCLK_PMU_SEL_24M		= 0,
+	LSCLK_PMU_SEL_RC_OSC,
+	LSCLK_PMU_DIV_SHIFT		= 0,
+	LSCLK_PMU_DIV_MASK		= 0x3 << LSCLK_PMU_DIV_SHIFT,
+
+};
+#endif
arch/arm/include/asm/arch-rockchip/grf_rv1103b.h new file +31 -0
new file mode 100644
index 00000000000..6bb382a8e07
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier:     GPL-2.0+ */
+
+/*
+ * (C) Copyright 2024 Rockchip Electronics Co., Ltd.
+ */
+
+#ifndef _ASM_ARCH_GRF_RV1103B_H
+#define _ASM_ARCH_GRF_RV1103B_H
+
+#define VEPU_GRF	0x20100000
+#define NPU_GRF		0x20110000
+#define VI_GRF		0x20120000
+#define CPU_GRF		0x20130000
+#define DDR_GRF		0x20140000
+#define SYS_GRF		0x20150000
+#define PMU_GRF		0x20160000
+
+struct rv1103b_grf {
+	u32 reserved0[(SYS_GRF + 0xA0 - VEPU_GRF) / 4];
+	u32 gmac_con0;				/* address offset: 0x00a0 */
+	u32 gmac_clk_con;			/* address offset: 0x00a4 */
+	u32 gmac_st;				/* address offset: 0x00a8 */
+	u32 reserved00ac;			/* address offset: 0x00ac */
+	u32 macphy_con0;			/* address offset: 0x00b0 */
+	u32 macphy_con1;			/* address offset: 0x00b4 */
+	u32 reserved1[(PMU_GRF + 0x10000 - (SYS_GRF + 0xB4)) / 4];
+};
+
+check_member(rv1103b_grf, macphy_con1, SYS_GRF + 0xB4 - VEPU_GRF);
+
+#endif /*  _ASM_ARCH_GRF_RV1103B_H  */
drivers/clk/rockchip/Makefile +1 -0
index 07525c36432..de2635b7475 100644
@@ -20,5 +20,6 @@ obj-$(CONFIG_ROCKCHIP_RK3528) += clk_rk3528.o
 obj-$(CONFIG_ROCKCHIP_RK3568) += clk_rk3568.o
 obj-$(CONFIG_ROCKCHIP_RK3576) += clk_rk3576.o
 obj-$(CONFIG_ROCKCHIP_RK3588) += clk_rk3588.o
+obj-$(CONFIG_ROCKCHIP_RV1103B) += clk_rv1103b.o
 obj-$(CONFIG_ROCKCHIP_RV1108) += clk_rv1108.o
 obj-$(CONFIG_ROCKCHIP_RV1126) += clk_rv1126.o
drivers/clk/rockchip/clk_rv1103b.c new file +1068 -0

1,068 lines not on this page · raw message

Signature · 1 line
2.43.0
#4 lore raw

PATCH v3 4/15 tools: rkcommon: Add RV1103B support

In reply to Simon Glass

From: Xuhui Lin <[email protected]>

Allow rkcommon to generate an image for the RV1103B.

---

(no changes since v1)

 tools/rkcommon.c | 1 +
 1 file changed, 1 insertion(+)
tools/rkcommon.c +1 -0
index b39777fc060..6f25a1cda31 100644
@@ -153,6 +153,7 @@ static struct spl_info spl_infos[] = {
 	{ "rk3568", "RK35", 0x10000 - 0x1000, false, RK_HEADER_V2 },
 	{ "rk3576", "RK35", 0x80000 - 0x1000, false, RK_HEADER_V2 },
 	{ "rk3588", "RK35", 0x100000 - 0x1000, false, RK_HEADER_V2 },
+	{ "rv1103b", "110E", 0x40000 - 0x1000, false, RK_HEADER_V2 },
 	{ "rv1108", "RK11", 0x1800, false, RK_HEADER_V1 },
 	{ "rv1126", "110B", 0x10000 - 0x1000, false, RK_HEADER_V1 },
 };
Signature · 1 line
2.43.0
#5 lore raw

PATCH v3 5/15 rockchip: spl-boot-order: Add SPI NAND support

In reply to Simon Glass

From: Fabio Estevam <[email protected]>

Make spl-boot-order accept booting from SPI NAND as well.

With this change, it is possible to specify spi_nand as the boot medium like this:

u-boot,spl-boot-order = &spi_nand;

---

Changes in v3:
- Guard the spi-nand checks with SPI_NAND_LOAD so that boards without SPI NAND support do not grow in size

 arch/arm/mach-rockchip/spl-boot-order.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
arch/arm/mach-rockchip/spl-boot-order.c +11 -1
index d2dd5e10935..3942dfe6f5c 100644
@@ -4,6 +4,7 @@
  */
 
 #include <dm.h>
+#include <dm/device_compat.h>
 #include <fdt_support.h>
 #include <log.h>
 #include <mmc.h>
@@ -75,6 +76,9 @@ static int spl_node_to_boot_device(int node)
 	 */
 	if (!uclass_find_device_by_of_offset(UCLASS_SPI_FLASH, node, &parent))
 		return BOOT_DEVICE_SPI;
+	if (CONFIG_IS_ENABLED(SPI_NAND_LOAD) &&
+	    !fdt_node_check_compatible(gd->fdt_blob, node, "spi-nand"))
+		return BOOT_DEVICE_SPI;
 
 	if (!uclass_find_device_by_of_offset(UCLASS_UFS, node, &parent))
 		return BOOT_DEVICE_UFS;
@@ -223,8 +227,14 @@ int spl_decode_boot_device(u32 boot_device, char *buf, size_t buflen)
 			}
 
 			ret = uclass_find_device_by_of_offset(UCLASS_SPI_FLASH, node, &dev);
+			if (ret && CONFIG_IS_ENABLED(SPI_NAND_LOAD)) {
+				ret = uclass_find_device_by_of_offset(UCLASS_MTD, node, &dev);
+				if (!ret && !device_is_compatible(dev, "spi-nand"))
+					ret = -ENODEV;
+			}
 			if (ret) {
-				debug("%s: could not find udevice for %s\n", __func__, conf);
+				debug("%s: could not find udevice for %s\n",
+				      __func__, conf);
 				continue;
 			}
 
Signature · 1 line
2.43.0
#6 lore raw

PATCH v3 6/15 spl: Add SPI NAND support via MTD in SPL

In reply to Simon Glass

From: Fabio Estevam <[email protected]>

Add support for booting U-Boot SPL from SPI NAND devices using the MTD subsystem:

- Introduce CONFIG_SPL_SPI_NAND_LOAD to enable SPL loading from SPI NAND flash.
- Implement spl_spi_nand.c as a dedicated SPL loader that reads the FIT image from SPI NAND via MTD.
- Update common/spl/Kconfig and the Makefiles to include the new loader in SPL builds.
- Adjust drivers/mtd/Makefile and drivers/mtd/nand/Makefile to build the necessary SPI NAND MTD objects only when SPL_SPI_NAND_LOAD is enabled, avoiding a size impact on other boards.

This allows boards like the Omega4 RV1103B to boot SPL directly from SPI NAND, keeping the SPL small and avoiding unnecessary inclusion of SPI NOR code.

---

(no changes since v1)

 common/spl/Kconfig        | 10 ++++-
 common/spl/Makefile       |  1 +
 common/spl/spl_spi_nand.c | 82 +++++++++++++++++++++++++++++++++++++++
 drivers/mtd/Makefile      |  1 +
 drivers/mtd/nand/Makefile | 13 ++++++-
 5 files changed, 105 insertions(+), 2 deletions(-)
 create mode 100644 common/spl/spl_spi_nand.c
common/spl/Kconfig +9 -1
index 0618f42c941..0a3b53d0e66 100644
@@ -1576,13 +1576,21 @@ config SPL_SPI_LOAD
 	  Enable support for loading next stage, U-Boot or otherwise, from
 	  SPI NOR in U-Boot SPL.
 
+config SPL_SPI_NAND_LOAD
+	bool "Support loading from SPI NAND flash"
+	depends on SPL
+	depends on MTD && DM_MTD
+	help
+	  Enable support for loading next stage, U-Boot or otherwise, from
+	  SPI NAND in U-Boot SPL.
+
 endif # SPL_SPI_FLASH_SUPPORT
 
 config SYS_SPI_U_BOOT_OFFS
 	hex "address of u-boot payload in SPI flash"
 	default 0x8000 if ARCH_SUNXI
 	default 0x0
-	depends on SPL_SPI_LOAD || SPL_SPI_SUNXI
+	depends on SPL_SPI_LOAD || SPL_SPI_NAND_LOAD || SPL_SPI_SUNXI
 	help
 	  Address within SPI-Flash from where the u-boot payload is fetched
 	  from.
common/spl/Makefile +1 -0
index 9c94e8f143e..e8365b69825 100644
@@ -36,6 +36,7 @@ obj-$(CONFIG_$(PHASE_)NVME) += spl_nvme.o
 obj-$(CONFIG_$(PHASE_)SEMIHOSTING) += spl_semihosting.o
 obj-$(CONFIG_$(PHASE_)DFU) += spl_dfu.o
 obj-$(CONFIG_$(PHASE_)SPI_LOAD) += spl_spi.o
+obj-$(CONFIG_$(PHASE_)SPI_NAND_LOAD) += spl_spi_nand.o
 obj-$(CONFIG_$(PHASE_)RAM_SUPPORT) += spl_ram.o
 obj-$(CONFIG_$(PHASE_)USB_SDP_SUPPORT) += spl_sdp.o
 obj-$(CONFIG_$(PHASE_)UFS_SUPPORT) += spl_ufs.o
common/spl/spl_spi_nand.c new file +82 -0

82 lines not on this page · raw message

drivers/mtd/Makefile +1 -0
index ce05e206073..a12d880a9e9 100644
@@ -34,6 +34,7 @@ else
 ifneq ($(mtd-y),)
 obj-$(CONFIG_SPL_MTD) += mtd.o
 endif
+obj-$(CONFIG_SPL_SPI_NAND_LOAD) += nand/
 obj-$(CONFIG_$(PHASE_)NAND_SUPPORT) += nand/
 obj-$(CONFIG_SPL_ONENAND_SUPPORT) += onenand/
 obj-$(CONFIG_$(PHASE_)SPI_FLASH_SUPPORT) += spi/
drivers/mtd/nand/Makefile +12 -1
index c8169cf7390..7cd2a5f1af9 100644
@@ -1,10 +1,21 @@
 # SPDX-License-Identifier: GPL-2.0+
 
-ifeq ($(CONFIG_XPL_BUILD)$(CONFIG_TPL_BUILD),)
 nandcore-objs := core.o bbt.o
+
+ifeq ($(CONFIG_XPL_BUILD)$(CONFIG_TPL_BUILD),)
+
+# U-Boot proper
 obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o
 obj-$(CONFIG_MTD_RAW_NAND) += raw/
 obj-$(CONFIG_MTD_SPI_NAND) += spi/
+
 else
+
+# SPL / XPL / TPL
+# SPL has no MTD_NAND_CORE symbol, so we must key off SPI NAND usage
+obj-$(CONFIG_SPL_SPI_NAND_LOAD) += nandcore.o
+obj-$(CONFIG_SPL_SPI_NAND_LOAD) += spi/
+
+# raw NAND still follows the normal SPL rule
 obj-$(CONFIG_$(PHASE_)NAND_SUPPORT) += raw/
 endif
Signature · 1 line
2.43.0
#7 lore raw

PATCH v3 7/15 rockchip: rv1103b: Add SoC support

In reply to Simon Glass

From: Fabio Estevam <[email protected]>

The RV1103B is an ARM-based SoC with a single Cortex-A7 32-bit core which integrates NEON and FPU. It contains a built-in NPU for AI related applications.

Add the core SoC support for it: the Kconfig and Makefile entries, the boot0 hook, the SoC init code, the syscon driver and the SPL clock setup.

---

Changes in v3:
- New patch, split out from the board patch (Jonas)
- Include the SoC u-boot.dtsi here (Jonas)
- Match the pmu-grf compatible used by the devicetree merged in Linux v7.1

 arch/arm/dts/rv1103b-u-boot.dtsi              |   4 +
 arch/arm/include/asm/arch-rv1103b/boot0.h     |  11 ++
 arch/arm/mach-rockchip/Kconfig                |  13 ++
 arch/arm/mach-rockchip/Makefile               |   1 +
 arch/arm/mach-rockchip/rv1103b/Kconfig        |  15 ++
 arch/arm/mach-rockchip/rv1103b/Makefile       |  12 ++
 arch/arm/mach-rockchip/rv1103b/boot0.h        |   5 +
 arch/arm/mach-rockchip/rv1103b/clk_rv1103b.c  |  32 +++++
 arch/arm/mach-rockchip/rv1103b/rv1103b.c      | 133 ++++++++++++++++++
 .../mach-rockchip/rv1103b/syscon_rv1103b.c    |  19 +++
 include/configs/rv1103b_common.h              |  14 ++
 11 files changed, 259 insertions(+)
 create mode 100644 arch/arm/dts/rv1103b-u-boot.dtsi
 create mode 100644 arch/arm/include/asm/arch-rv1103b/boot0.h
 create mode 100644 arch/arm/mach-rockchip/rv1103b/Kconfig
 create mode 100644 arch/arm/mach-rockchip/rv1103b/Makefile
 create mode 100644 arch/arm/mach-rockchip/rv1103b/boot0.h
 create mode 100644 arch/arm/mach-rockchip/rv1103b/clk_rv1103b.c
 create mode 100644 arch/arm/mach-rockchip/rv1103b/rv1103b.c
 create mode 100644 arch/arm/mach-rockchip/rv1103b/syscon_rv1103b.c
 create mode 100644 include/configs/rv1103b_common.h
arch/arm/dts/rv1103b-u-boot.dtsi new file +4 -0
new file mode 100644
index 00000000000..3b77dd31152
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier:     GPL-2.0+
+// (C) Copyright 2024 Rockchip Electronics Co., Ltd
+
+#include "rockchip-u-boot.dtsi"
arch/arm/include/asm/arch-rv1103b/boot0.h new file +11 -0
new file mode 100644
index 00000000000..2e78b074ade
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2019 Rockchip Electronics Co., Ltd
+ */
+
+#ifndef __ASM_ARCH_BOOT0_H__
+#define __ASM_ARCH_BOOT0_H__
+
+#include <asm/arch-rockchip/boot0.h>
+
+#endif
arch/arm/mach-rockchip/Kconfig +13 -0
index 1a2e7847c9e..1969c313f47 100644
@@ -532,6 +532,18 @@ config ROCKCHIP_RK3588
 	  SD3.0/MMC4.5, USB OTG 3.0, Type-C, USB 2.0, PCIe 3.0, SATA 3, Ethernet,
 	  SDIO3.0 I2C, UART, SPI, GPIO and PWM.
 
+config ROCKCHIP_RV1103B
+	bool "Support Rockchip RV1103B"
+	select CPU_V7A
+	select SPL_ARMV7_SET_CORTEX_SMPEN
+	select SUPPORT_SPL
+	select SPL
+	imply ROCKCHIP_COMMON_BOARD
+	help
+	  The Rockchip RV1103B is an ARM-based SoC with a single Cortex-A7
+	  32-bit core which integrates NEON and FPU.
+	  It contains a built-in NPU for AI related applications.
+
 config ROCKCHIP_RV1108
 	bool "Support Rockchip RV1108"
 	select CPU_V7A
@@ -795,6 +807,7 @@ source "arch/arm/mach-rockchip/rk3528/Kconfig"
 source "arch/arm/mach-rockchip/rk3568/Kconfig"
 source "arch/arm/mach-rockchip/rk3576/Kconfig"
 source "arch/arm/mach-rockchip/rk3588/Kconfig"
+source "arch/arm/mach-rockchip/rv1103b/Kconfig"
 source "arch/arm/mach-rockchip/rv1108/Kconfig"
 source "arch/arm/mach-rockchip/rv1126/Kconfig"
 
arch/arm/mach-rockchip/Makefile +1 -0
index d3bc0689f89..e09dc44a7ad 100644
@@ -47,6 +47,7 @@ obj-$(CONFIG_ROCKCHIP_RK3528) += rk3528/
 obj-$(CONFIG_ROCKCHIP_RK3568) += rk3568/
 obj-$(CONFIG_ROCKCHIP_RK3576) += rk3576/
 obj-$(CONFIG_ROCKCHIP_RK3588) += rk3588/
+obj-$(CONFIG_ROCKCHIP_RV1103B) += rv1103b/
 obj-$(CONFIG_ROCKCHIP_RV1108) += rv1108/
 obj-$(CONFIG_ROCKCHIP_RV1126) += rv1126/
 
arch/arm/mach-rockchip/rv1103b/Kconfig new file +15 -0
new file mode 100644
index 00000000000..710a86aeb33
@@ -0,0 +1,15 @@
+if ROCKCHIP_RV1103B
+
+config ROCKCHIP_BOOT_MODE_REG
+	default 0x20160200
+
+config ROCKCHIP_STIMER_BASE
+	default 0x20500000
+
+config SYS_SOC
+	default "rv1103b"
+
+config SYS_MALLOC_F_LEN
+	default 0x400
+
+endif
arch/arm/mach-rockchip/rv1103b/Makefile new file +12 -0
new file mode 100644
index 00000000000..2f34853adac
@@ -0,0 +1,12 @@
+#
+# (C) Copyright 2016 Rockchip Electronics Co., Ltd
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y += rv1103b.o
+obj-y += clk_rv1103b.o
+
+ifndef CONFIG_XPL_BUILD
+obj-y += syscon_rv1103b.o
+endif
arch/arm/mach-rockchip/rv1103b/boot0.h new file +5 -0
new file mode 100644
index 00000000000..466ab0e8077
@@ -0,0 +1,5 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/* Dummy boot0.h for RV1103B — SoC does not require special boot0 setup. */
+#ifndef __ASM_ARCH_BOOT0_H__
+#define __ASM_ARCH_BOOT0_H__
+#endif
arch/arm/mach-rockchip/rv1103b/clk_rv1103b.c new file +32 -0
new file mode 100644
index 00000000000..2bcbb08537e
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ * Author: Andy Yan <[email protected]>
+ */
+
+#include <dm.h>
+#include <syscon.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rv1103b.h>
+#include <linux/err.h>
+
+int rockchip_get_clk(struct udevice **devp)
+{
+	return uclass_get_device_by_driver(UCLASS_CLK,
+			DM_DRIVER_GET(clk_rv1103b), devp);
+}
+
+void *rockchip_get_cru(void)
+{
+	struct rv1103b_clk_priv *priv;
+	struct udevice *dev;
+	int ret;
+
+	ret = rockchip_get_clk(&dev);
+	if (ret)
+		return ERR_PTR(ret);
+
+	priv = dev_get_priv(dev);
+
+	return priv->cru;
+}
arch/arm/mach-rockchip/rv1103b/rv1103b.c new file +133 -0

133 lines not on this page · raw message

arch/arm/mach-rockchip/rv1103b/syscon_rv1103b.c new file +19 -0
new file mode 100644
index 00000000000..7c71b1092f3
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ */
+
+#include <dm.h>
+#include <syscon.h>
+#include <asm/arch-rockchip/clock.h>
+
+static const struct udevice_id rv1103b_syscon_ids[] = {
+	{ .compatible = "rockchip,rv1103b-pmu-grf", .data = ROCKCHIP_SYSCON_PMUGRF },
+	{ }
+};
+
+U_BOOT_DRIVER(syscon_rv1103b) = {
+	.name = "rv1103b_syscon",
+	.id = UCLASS_SYSCON,
+	.of_match = rv1103b_syscon_ids,
+};
include/configs/rv1103b_common.h new file +14 -0
new file mode 100644
index 00000000000..8e970d71051
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ */
+#ifndef __CONFIG_RV1103B_COMMON_H
+#define __CONFIG_RV1103B_COMMON_H
+
+#include "rockchip-common.h"
+#include <config_distro_bootcmd.h>
+
+#define CFG_IRAM_BASE			0x210f6000
+#define CFG_SYS_SDRAM_BASE		0x00000000
+
+#endif
Signature · 1 line
2.43.0
#8 lore raw

PATCH v3 8/15 omega4-rv1103b: Add the initial support

In reply to Simon Glass

From: Fabio Estevam <[email protected]>

Add the initial support for Onion's Omega4 RV1103B board, using the board devicetree files as merged in Linux v7.1, which split the board into rv1103b-omega4.dtsi and rv1103b-omega4-evb.dts

It boots from the SPI NAND.

Tested the boot of a 6.6 OpenWRT kernel and also a 6.19-rc8 mainline kernel.

---

Changes in v3:
- Split out the SoC support into its own patch (Jonas)
- Move the board devicetree files into this patch (Jonas)
- Add the board to the list in the Rockchip documentation
- Extend the MAINTAINERS entry to cover all the RV1103B files
- Use the board devicetree files as merged in Linux v7.1 and switch the default devicetree to rv1103b-omega4-evb

Changes in v2:
- Use RV1103B rather than RV1103, which is the correct SoC name

 arch/arm/dts/rv1103b-omega4-evb-u-boot.dtsi   |  10 ++
 arch/arm/dts/rv1103b-omega4-evb.dts           |  63 ++++++++
 arch/arm/dts/rv1103b-omega4.dtsi              | 147 ++++++++++++++++++
 arch/arm/mach-rockchip/rv1103b/Kconfig        |   7 +
 board/onion/omega4_rv1103b/Kconfig            |  12 ++
 board/onion/omega4_rv1103b/MAINTAINERS        |  15 ++
 board/onion/omega4_rv1103b/Makefile           |   7 +
 board/onion/omega4_rv1103b/omega4_rv1103b.c   |  19 +++
 board/onion/omega4_rv1103b/omega4_rv1103b.env |   5 +
 configs/omega4-rv1103b_defconfig              |  82 ++++++++++
 doc/board/index.rst                           |   1 +
 doc/board/onion/index.rst                     |   9 ++
 doc/board/onion/omega4-rv1103b.rst            |  56 +++++++
 doc/board/rockchip/rockchip.rst               |   3 +
 include/configs/omega4_rv1103b.h              |  11 ++
 15 files changed, 447 insertions(+)
 create mode 100644 arch/arm/dts/rv1103b-omega4-evb-u-boot.dtsi
 create mode 100644 arch/arm/dts/rv1103b-omega4-evb.dts
 create mode 100644 arch/arm/dts/rv1103b-omega4.dtsi
 create mode 100644 board/onion/omega4_rv1103b/Kconfig
 create mode 100644 board/onion/omega4_rv1103b/MAINTAINERS
 create mode 100644 board/onion/omega4_rv1103b/Makefile
 create mode 100644 board/onion/omega4_rv1103b/omega4_rv1103b.c
 create mode 100644 board/onion/omega4_rv1103b/omega4_rv1103b.env
 create mode 100644 configs/omega4-rv1103b_defconfig
 create mode 100644 doc/board/onion/index.rst
 create mode 100644 doc/board/onion/omega4-rv1103b.rst
 create mode 100644 include/configs/omega4_rv1103b.h
arch/arm/dts/rv1103b-omega4-evb-u-boot.dtsi new file +10 -0
new file mode 100644
index 00000000000..c7616de1715
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0+
+// (C) Copyright 2024 Rockchip Electronics Co., Ltd
+
+#include "rockchip-u-boot.dtsi"
+
+/ {
+	chosen {
+		u-boot,spl-boot-order = &spi_nand;
+	};
+};
arch/arm/dts/rv1103b-omega4-evb.dts new file +63 -0

63 lines not on this page · raw message

arch/arm/dts/rv1103b-omega4.dtsi new file +147 -0

147 lines not on this page · raw message

arch/arm/mach-rockchip/rv1103b/Kconfig +7 -0
index 710a86aeb33..77699a5180e 100644
@@ -1,5 +1,10 @@
 if ROCKCHIP_RV1103B
 
+config TARGET_OMEGA4_RV1103B
+	bool "OMEGA4_RV1103B"
+	help
+	  Support Onion's Omega4 RV1103B board.
+
 config ROCKCHIP_BOOT_MODE_REG
 	default 0x20160200
 
@@ -12,4 +17,6 @@ config SYS_SOC
 config SYS_MALLOC_F_LEN
 	default 0x400
 
+source "board/onion/omega4_rv1103b/Kconfig"
+
 endif
board/onion/omega4_rv1103b/Kconfig new file +12 -0
new file mode 100644
index 00000000000..43b126c20e9
@@ -0,0 +1,12 @@
+if TARGET_OMEGA4_RV1103B
+
+config SYS_BOARD
+	default "omega4_rv1103b"
+
+config SYS_VENDOR
+	default "onion"
+
+config SYS_CONFIG_NAME
+	default "omega4_rv1103b"
+
+endif
board/onion/omega4_rv1103b/MAINTAINERS new file +15 -0
new file mode 100644
index 00000000000..5ad58118989
@@ -0,0 +1,15 @@
+OMEGA4 RV1103B
+M:	Fabio Estevam <[email protected]>
+S:	Maintained
+F:	arch/arm/dts/rv1103b*
+F:	arch/arm/include/asm/arch-rv1103b/
+F:	arch/arm/include/asm/arch-rockchip/cru_rv1103b.h
+F:	arch/arm/mach-rockchip/rv1103b/
+F:	board/onion/omega4_rv1103b/
+F:	configs/omega4-rv1103b_defconfig
+F:	doc/board/onion/
+F:	drivers/clk/rockchip/clk_rv1103b.c
+F:	drivers/pinctrl/rockchip/pinctrl-rv1103b.c
+F:	include/configs/omega4_rv1103b.h
+F:	include/configs/rv1103b_common.h
+F:	include/dt-bindings/clock/rockchip,rv1103b-cru.h
board/onion/omega4_rv1103b/Makefile new file +7 -0
new file mode 100644
index 00000000000..afa0a7f7a93
@@ -0,0 +1,7 @@
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+# Copyright 2026 Fabio Estevam <[email protected]>
+#
+
+obj-y	+= omega4_rv1103b.o
board/onion/omega4_rv1103b/omega4_rv1103b.c new file +19 -0
new file mode 100644
index 00000000000..9bdec3c396a
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0+
+//
+// Copyright 2026 Fabio Estevam <[email protected]>
+
+#include <asm/global_data.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int dram_init(void)
+{
+	gd->ram_size = SZ_256M;
+
+	return 0;
+}
+
+phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
+{
+	return gd->ram_top;
+}
board/onion/omega4_rv1103b/omega4_rv1103b.env new file +5 -0
new file mode 100644
index 00000000000..7ed232cab91
@@ -0,0 +1,5 @@
+kernel_addr_r=0x00800000
+fdt_addr_r=0x02000000
+ramdisk_addr_r=0x04000000
+bootargs=console=ttyS0,115200 mtdparts=spi1.0:256K(env),1M@256K(idblock),1M(uboot),8M(boot),-(ubi) ro rootwait ubi.mtd=ubi ubi.block=0,rootfs root=/dev/ubiblock0_0 rootfstype=squashfs
+bootcmd=mtd read spi-nand0 0x04000000 0x240000 0x800000;imxtract 0x04000000 kernel 0x00800000; imxtract 0x04000000 fdt 0x02000000; bootz 0x00800000 - 0x02000000
configs/omega4-rv1103b_defconfig new file +82 -0

82 lines not on this page · raw message

doc/board/index.rst +1 -0
index 4103fef8d8f..2454c3598fb 100644
@@ -46,6 +46,7 @@ Board-specific doc
    motorola/index
    nvidia/index
    nxp/index
+   onion/index
    openpiton/index
    ouya/index
    pegatron/index
doc/board/onion/index.rst new file +9 -0
new file mode 100644
index 00000000000..2e106c8b773
@@ -0,0 +1,9 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Onion
+=====
+
+.. toctree::
+   :maxdepth: 2
+
+   omega4-rv1103b
doc/board/onion/omega4-rv1103b.rst new file +56 -0

56 lines not on this page · raw message

doc/board/rockchip/rockchip.rst +3 -0
index a31ee7100b9..2574a1da52c 100644
@@ -180,6 +180,9 @@ List of mainline supported Rockchip boards:
      - Yanyi Tech CoolPi CM5 EVB (coolpi-cm5-evb-rk3588)
      - Yanyi Tech CoolPi CM5 GenBook (coolpi-cm5-genbook-rk3588)
 
+* rv1103b
+     - Onion Omega4 (omega4-rv1103b), see :doc:`../onion/omega4-rv1103b`
+
 * rv1108
      - Rockchip Evb-rv1108 (evb-rv1108)
      - Elgin-R1 (elgin-rv1108)
include/configs/omega4_rv1103b.h new file +11 -0
new file mode 100644
index 00000000000..8430b0b4d09
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <configs/rv1103b_common.h>
+
+#endif
Signature · 1 line
2.43.0
#9 lore raw

PATCH v3 9/15 tools: rkcommon: Add RV1106 support

In reply to Simon Glass

Add rv1106 to the list of supported SoCs. Like the RV1103B, it uses the version-2 image header, for which the 4-byte header tag is unused.

The RV1103 is a package variant of the RV1106 and uses the same boot image format, so this entry covers both

---

(no changes since v1)

 tools/rkcommon.c | 1 +
 1 file changed, 1 insertion(+)
tools/rkcommon.c +1 -0
index 6f25a1cda31..06df57ec72d 100644
@@ -154,6 +154,7 @@ static struct spl_info spl_infos[] = {
 	{ "rk3576", "RK35", 0x80000 - 0x1000, false, RK_HEADER_V2 },
 	{ "rk3588", "RK35", 0x100000 - 0x1000, false, RK_HEADER_V2 },
 	{ "rv1103b", "110E", 0x40000 - 0x1000, false, RK_HEADER_V2 },
+	{ "rv1106", "110C", 0x40000 - 0x1000, false, RK_HEADER_V2 },
 	{ "rv1108", "RK11", 0x1800, false, RK_HEADER_V1 },
 	{ "rv1126", "110B", 0x10000 - 0x1000, false, RK_HEADER_V1 },
 };
Signature · 1 line
2.43.0
#10 lore raw

PATCH v3 10/15 pinctrl: rockchip: Add RV1106 support

In reply to Simon Glass

Add the pinctrl driver for the RV1106, based on the driver in the Rockchip vendor tree, converted to use regmap_update_bits() so that the pin configuration in the devicetree cannot overflow the register fields.

The RV1103 is a package variant of the RV1106 and shares this driver. Unlike most Rockchip SoCs, the GPIO0 IOC block lives in the PMU, so the driver selects the PMU regmap for bank 0

---

(no changes since v1)

 drivers/pinctrl/rockchip/Makefile         |   1 +
 drivers/pinctrl/rockchip/pinctrl-rv1106.c | 320 ++++++++++++++++++++++
 2 files changed, 321 insertions(+)
 create mode 100644 drivers/pinctrl/rockchip/pinctrl-rv1106.c
drivers/pinctrl/rockchip/Makefile +1 -0
index b7ce6402ea3..6d7a2548af5 100644
@@ -20,5 +20,6 @@ obj-$(CONFIG_ROCKCHIP_RK3568) += pinctrl-rk3568.o
 obj-$(CONFIG_ROCKCHIP_RK3576) += pinctrl-rk3576.o
 obj-$(CONFIG_ROCKCHIP_RK3588) += pinctrl-rk3588.o
 obj-$(CONFIG_ROCKCHIP_RV1103B) += pinctrl-rv1103b.o
+obj-$(CONFIG_ROCKCHIP_RV1106) += pinctrl-rv1106.o
 obj-$(CONFIG_ROCKCHIP_RV1108) += pinctrl-rv1108.o
 obj-$(CONFIG_ROCKCHIP_RV1126) += pinctrl-rv1126.o
drivers/pinctrl/rockchip/pinctrl-rv1106.c new file +320 -0

320 lines not on this page · raw message

Signature · 1 line
2.43.0
#11 lore raw

PATCH v3 11/15 ARM: dts: Add the RV1103/RV1106 devicetree files

In reply to Simon Glass

Add the SoC devicetree files for the Rockchip RV1106 and its RV1103 package variant, based on the devicetrees in the Rockchip vendor tree, trimmed to the devices that U-Boot supports.

The files come from the Luckfox Pico SDK [1] at commit 824b817f8:
rv1106-pinctrl.dtsi and the rv1106-cru.h binding header are verbatim copies from its U-Boot tree (2017.09-based, with only the pinconf include path adjusted), rv1106.dtsi is a trimmed version of the same tree's file with the camera, codec and other vendor-only nodes removed, and rv1103.dtsi follows the pattern of the corresponding file in its kernel tree (Linux 5.10.160).

Neither SoC is supported in mainline Linux and no support is in review, so there are no upstream devicetrees to inherit. Once Linux gains RV1106 devicetrees, the OF_UPSTREAM mechanism can be enabled and these files dropped.

[1] https://github.com/LuckfoxTECH/luckfox-pico

---

(no changes since v1)

 arch/arm/dts/rv1103.dtsi               |   16 +
 arch/arm/dts/rv1106-pinctrl.dtsi       | 1102 ++++++++++++++++++++++++
 arch/arm/dts/rv1106.dtsi               |  328 +++++++
 include/dt-bindings/clock/rv1106-cru.h |  572 ++++++++++++
 4 files changed, 2018 insertions(+)
 create mode 100644 arch/arm/dts/rv1103.dtsi
 create mode 100644 arch/arm/dts/rv1106-pinctrl.dtsi
 create mode 100644 arch/arm/dts/rv1106.dtsi
 create mode 100644 include/dt-bindings/clock/rv1106-cru.h
arch/arm/dts/rv1103.dtsi new file +16 -0
new file mode 100644
index 00000000000..025fde5bf09
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2022 Rockchip Electronics Co., Ltd.
+ */
+
+#include "rv1106.dtsi"
+
+/ {
+	compatible = "rockchip,rv1103";
+
+	aliases {
+		/delete-property/ gpio2;
+	};
+};
+
+/delete-node/ &gpio2;
arch/arm/dts/rv1106-pinctrl.dtsi new file +1102 -0

1,102 lines not on this page · raw message

arch/arm/dts/rv1106.dtsi new file +328 -0

328 lines not on this page · raw message

include/dt-bindings/clock/rv1106-cru.h new file +572 -0

572 lines not on this page · raw message

Signature · 1 line
2.43.0
#12 lore raw

PATCH v3 12/15 clk: rockchip: Add RV1106 clock driver

In reply to Simon Glass

Add the clock driver for the RV1106, based on the driver in the Rockchip vendor tree, with the vendor-specific clk-dump and MMC phase-tuning code removed and the driver-model API usage brought up to date.

The RV1103 is a package variant of the RV1106 and shares this driver

---

(no changes since v1)

 .../include/asm/arch-rockchip/cru_rv1106.h    |  305 ++++
 drivers/clk/rockchip/Makefile                 |    1 +
 drivers/clk/rockchip/clk_rv1106.c             | 1319 +++++++++++++++++
 3 files changed, 1625 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rv1106.h
 create mode 100644 drivers/clk/rockchip/clk_rv1106.c
arch/arm/include/asm/arch-rockchip/cru_rv1106.h new file +305 -0
new file mode 100644
index 00000000000..8e3ac228c2b
@@ -0,0 +1,305 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2022 Rockchip Electronics Co. Ltd.
+ * Author: Elaine Zhang <[email protected]>
+ */
+
+#ifndef _ASM_ARCH_CRU_RV1106_H
+#define _ASM_ARCH_CRU_RV1106_H
+
+
+#define MHz		1000000
+#define KHz		1000
+#define OSC_HZ		(24 * MHz)
+
+#define APLL_HZ		(816 * MHz)
+#define GPLL_HZ		(1188 * MHz)
+#define CPLL_HZ		(1000 * MHz)
+
+/* RV1106 pll id */
+enum rv1106_pll_id {
+	APLL,
+	DPLL,
+	CPLL,
+	GPLL,
+	PLL_COUNT,
+};
+
+struct rv1106_clk_info {
+	unsigned long id;
+	char *name;
+	bool is_cru;
+};
+
+struct rv1106_clk_priv {
+	struct rv1106_cru *cru;
+	struct rv1106_grf *grf;
+	ulong gpll_hz;
+	ulong cpll_hz;
+	ulong armclk_hz;
+	ulong armclk_enter_hz;
+	ulong armclk_init_hz;
+	bool sync_kernel;
+	bool set_armclk_rate;
+};
+
+struct rv1106_grf_clk_priv {
+	struct rv1106_grf *grf;
+};
+
+struct rv1106_pll {
+	unsigned int con0;
+	unsigned int con1;
+	unsigned int con2;
+	unsigned int con3;
+	unsigned int con4;
+	unsigned int reserved0[3];
+};
+
+struct rv1106_cru {
+	unsigned int reserved0[192];
+	unsigned int pmu_clksel_con[8];
+	unsigned int reserved1[312];
+	unsigned int pmu_clkgate_con[3];
+	unsigned int reserved2[125];
+	unsigned int pmu_softrst_con[3];
+	unsigned int reserved3[15741];
+	struct rv1106_pll pll[4];
+	unsigned int reserved4[128];
+	unsigned int mode;
+	unsigned int reserved5[31];
+	unsigned int clksel_con[34];
+	unsigned int reserved6[286];
+	unsigned int clkgate_con[4];
+	unsigned int reserved7[124];
+	unsigned int softrst_con[3];
+	unsigned int reserved8[125];
+	unsigned int glb_cnt_th;
+	unsigned int glb_rst_st;
+	unsigned int glb_srst_fst;
+	unsigned int glb_srst_snd;
+	unsigned int glb_rst_con;
+	unsigned int con[2];
+	unsigned int sdmmc_con[2];
+	unsigned int emmc_con[2];
+	unsigned int reserved9[1461];
+	unsigned int peri_clksel_con[12];
+	unsigned int reserved10[308];
+	unsigned int peri_clkgate_con[8];
+	unsigned int reserved11[120];
+	unsigned int peri_softrst_con[8];
+	unsigned int reserved12[1592];
+	unsigned int vi_clksel_con[4];
+	unsigned int reserved13[316];
+	unsigned int vi_clkgate_con[3];
+	unsigned int reserved14[125];
+	unsigned int vi_softrst_con[3];
+	unsigned int reserved15[3645];
+	unsigned int core_clksel_con[5];
+	unsigned int reserved16[2043];
+	unsigned int vepu_clksel_con[2];
+	unsigned int reserved17[318];
+	unsigned int vepu_clkgate_con[3];
+	unsigned int reserved18[125];
+	unsigned int vepu_softrst_con[2];
+	unsigned int reserved19[1598];
+	unsigned int vo_clksel_con[4];
+	unsigned int reserved20[316];
+	unsigned int vo_clkgate_con[3];
+	unsigned int reserved21[125];
+	unsigned int vo_softrst_con[4];
+};
+check_member(rv1106_cru, vo_softrst_con[0], 0x1ca00);
+
+struct pll_rate_table {
+	unsigned long rate;
+	unsigned int fbdiv;
+	unsigned int postdiv1;
+	unsigned int refdiv;
+	unsigned int postdiv2;
+	unsigned int dsmpd;
+	unsigned int frac;
+};
+
+#define RV1106_TOPCRU_BASE		0x10000
+#define RV1106_SUBDDRCRU_BASE		0x1F000
+
+#define RV1106_PLL_CON(x)		((x) * 0x4 + RV1106_TOPCRU_BASE)
+#define RV1106_MODE_CON			(0x280 + RV1106_TOPCRU_BASE)
+#define RV1106_SUBDDRMODE_CON		(0x280 + RV1106_SUBDDRCRU_BASE)
+
+enum {
+	/* CRU_PMU_CLK_SEL0_CON */
+	CLK_I2C1_SEL_SHIFT		= 6,
+	CLK_I2C1_SEL_MASK		= 0x3 << CLK_I2C1_SEL_SHIFT,
+	CLK_I2C1_SEL_200M		= 0,
+	CLK_I2C1_SEL_100M,
+	CLK_I2C1_SEL_24M,
+	CLK_I2C1_SEL_32K,
+	HCLK_PMU_SEL_SHIFT		= 4,
+	HCLK_PMU_SEL_MASK		= 0x3 << HCLK_PMU_SEL_SHIFT,
+	HCLK_PMU_SEL_200M		= 0,
+	HCLK_PMU_SEL_100M,
+	HCLK_PMU_SEL_24M,
+	PCLK_PMU_SEL_SHIFT		= 3,
+	PCLK_PMU_SEL_MASK		= 0x1 << PCLK_PMU_SEL_SHIFT,
+	PCLK_PMU_SEL_100M		= 0,
+	PCLK_PMU_SEL_24M,
+
+	/* CRU_CLK_SEL5_CON */
+	CLK_UART_SRC_SEL_SHIFT		= 5,
+	CLK_UART_SRC_SEL_MASK		= 0x1 << CLK_UART_SRC_SEL_SHIFT,
+	CLK_UART_SRC_SEL_GPLL		= 0,
+	CLK_UART_SRC_SEL_CPLL,
+	CLK_UART_SRC_DIV_SHIFT		= 0,
+	CLK_UART_SRC_DIV_MASK		= 0x1f << CLK_UART_SRC_DIV_SHIFT,
+
+	/* CRU_CLK_SEL6_CON */
+	CLK_UART_FRAC_NUMERATOR_SHIFT	= 16,
+	CLK_UART_FRAC_NUMERATOR_MASK	= 0xffff << 16,
+	CLK_UART_FRAC_DENOMINATOR_SHIFT	= 0,
+	CLK_UART_FRAC_DENOMINATOR_MASK	= 0xffff,
+
+	/* CRU_CLK_SEL7_CON */
+	CLK_UART_SEL_SHIFT		= 0,
+	CLK_UART_SEL_MASK		= 0x3 << CLK_UART_SEL_SHIFT,
+	CLK_UART_SEL_SRC		= 0,
+	CLK_UART_SEL_FRAC,
+	CLK_UART_SEL_XIN24M,
+
+	/* CRU_CLK_SEL23_CON */
+	DCLK_VOP_SEL_SHIFT		= 8,
+	DCLK_VOP_SEL_MASK		= 0x1 << DCLK_VOP_SEL_SHIFT,
+	DCLK_VOP_SEL_GPLL		= 0,
+	DCLK_VOP_SEL_CPLL,
+	DCLK_VOP_DIV_SHIFT		= 3,
+	DCLK_VOP_DIV_MASK		= 0x1f << DCLK_VOP_DIV_SHIFT,
+
+	/* CRU_CLK_SEL24_CON */
+	PCLK_TOP_SEL_SHIFT		= 5,
+	PCLK_TOP_SEL_MASK		= 0x3 << PCLK_TOP_SEL_SHIFT,
+	PCLK_TOP_SEL_100M		= 0,
+	PCLK_TOP_SEL_50M,
+	PCLK_TOP_SEL_24M,
+
+	/* CRU_PERI_CLK_SEL1_CON */
+	CLK_I2C3_SEL_SHIFT		= 14,
+	CLK_I2C3_SEL_MASK		= 0x3 << CLK_I2C3_SEL_SHIFT,
+	CLK_I2C2_SEL_SHIFT		= 12,
+	CLK_I2C2_SEL_MASK		= 0x3 << CLK_I2C2_SEL_SHIFT,
+	CLK_I2C0_SEL_SHIFT		= 8,
+	CLK_I2C0_SEL_MASK		= 0x3 << CLK_I2C0_SEL_SHIFT,
+	CLK_I2C0_SEL_200M		= 0,
+	CLK_I2C0_SEL_100M,
+	CLK_I2C0_SEL_50M,
+	CLK_I2C0_SEL_24M,
+	HCLK_PERI_SEL_SHIFT		= 4,
+	HCLK_PERI_SEL_MASK		= 0x3 << HCLK_PERI_SEL_SHIFT,
+	HCLK_PERI_SEL_200M		= 0,
+	HCLK_PERI_SEL_100M,
+	HCLK_PERI_SEL_50M,
+	HCLK_PERI_SEL_24M,
+	ACLK_PERI_SEL_SHIFT		= 2,
+	ACLK_PERI_SEL_MASK		= 0x3 << ACLK_PERI_SEL_SHIFT,
+	ACLK_PERI_SEL_400M		= 0,
+	ACLK_PERI_SEL_200M,
+	ACLK_PERI_SEL_100M,
+	ACLK_PERI_SEL_24M,
+	PCLK_PERI_SEL_SHIFT		= 0,
+	PCLK_PERI_SEL_MASK		= 0x3 << PCLK_PERI_SEL_SHIFT,
+	PCLK_PERI_SEL_100M		= 0,
+	PCLK_PERI_SEL_50M,
+	PCLK_PERI_SEL_24M,
+
+	/* CRU_PERI_CLK_SEL2_CON */
+	CLK_I2C4_SEL_SHIFT		= 0,
+	CLK_I2C4_SEL_MASK		= 0x3 << CLK_I2C4_SEL_SHIFT,
+
+	/* CRU_PERI_CLK_SEL6_CON */
+	CLK_PWM2_SEL_SHIFT		= 11,
+	CLK_PWM2_SEL_MASK		= 0x3 << CLK_PWM2_SEL_SHIFT,
+	CLK_PWM1_SEL_SHIFT		= 9,
+	CLK_PWM1_SEL_MASK		= 0x3 << CLK_PWM1_SEL_SHIFT,
+	CLK_PWM_SEL_100M		= 0,
+	CLK_PWM_SEL_50M,
+	CLK_PWM_SEL_24M,
+	CLK_PKA_CRYPTO_SEL_SHIFT	= 7,
+	CLK_PKA_CRYPTO_SEL_MASK		= 0x3 << CLK_PKA_CRYPTO_SEL_SHIFT,
+	CLK_CORE_CRYPTO_SEL_SHIFT	= 5,
+	CLK_CORE_CRYPTO_SEL_MASK	= 0x3 << CLK_CORE_CRYPTO_SEL_SHIFT,
+	CLK_CRYPTO_SEL_300M		= 0,
+	CLK_CRYPTO_SEL_200M,
+	CLK_CRYPTO_SEL_100M,
+	CLK_CRYPTO_SEL_24M,
+	CLK_SARADC_DIV_SHIFT		= 0,
+	CLK_SARADC_DIV_MASK		= 0x7 << CLK_SARADC_DIV_SHIFT,
+	CLK_SPI1_SEL_SHIFT		= 3,
+	CLK_SPI1_SEL_MASK		= 0x3 << CLK_SPI1_SEL_SHIFT,
+
+	/* CRU_PERI_CLK_SEL7_CON */
+	DCLK_DECOM_SEL_SHIFT		= 14,
+	DCLK_DECOM_SEL_MASK		= 0x3 << DCLK_DECOM_SEL_SHIFT,
+	DCLK_DECOM_SEL_400M		= 0,
+	DCLK_DECOM_SEL_200M,
+	DCLK_DECOM_SEL_100M,
+	DCLK_DECOM_SEL_24M,
+	CLK_SFC_SEL_SHIFT		= 12,
+	CLK_SFC_SEL_MASK		= 0x3 << CLK_SFC_SEL_SHIFT,
+	CLK_SFC_SEL_500M		= 0,
+	CLK_SFC_SEL_300M,
+	CLK_SFC_SEL_200M,
+	CLK_SFC_SEL_24M,
+	CLK_SFC_DIV_SHIFT		= 7,
+	CLK_SFC_DIV_MASK		= 0x1f << CLK_SFC_DIV_SHIFT,
+	CLK_EMMC_SEL_SHIFT		= 6,
+	CLK_EMMC_SEL_MASK		= 0x1 << CLK_EMMC_SEL_SHIFT,
+	CLK_MMC_SEL_400M		= 0,
+	CLK_MMC_SEL_24M,
+	CLK_EMMC_DIV_SHIFT		= 0,
+	CLK_EMMC_DIV_MASK		= 0x3f << CLK_EMMC_DIV_SHIFT,
+
+	/* CRU_PERI_CLK_SEL9_CON */
+	ACLK_BUS_SEL_SHIFT		= 0,
+	ACLK_BUS_SEL_MASK		= 0x3 << ACLK_BUS_SEL_SHIFT,
+	ACLK_BUS_SEL_300M		= 0,
+	ACLK_BUS_SEL_200M,
+	ACLK_BUS_SEL_100M,
+	ACLK_BUS_SEL_24M,
+
+	/* CRU_PERI_CLK_SEL11_CON */
+	CLK_PWM0_SEL_SHIFT		= 0,
+	CLK_PWM0_SEL_MASK		= 0x3 << CLK_PWM0_SEL_SHIFT,
+
+	/* CRU_VEPU_CLK_SEL0_CON */
+	CLK_SPI0_SEL_SHIFT		= 12,
+	CLK_SPI0_SEL_MASK		= 0x3 << CLK_SPI0_SEL_SHIFT,
+	CLK_SPI0_SEL_200M		= 0,
+	CLK_SPI0_SEL_100M,
+	CLK_SPI0_SEL_50M,
+	CLK_SPI0_SEL_24M,
+
+	/* CRU_CORE_CLK_SEL0_CON */
+	CLK_CORE_DIV_SHIFT		= 0,
+	CLK_CORE_DIV_MASK		= 0x1f << CLK_CORE_DIV_SHIFT,
+
+	/* CRU_VI_CLK_SEL1_CON */
+	CLK_SDMMC_SEL_SHIFT		= 14,
+	CLK_SDMMC_SEL_MASK		= 0x1 << CLK_SDMMC_SEL_SHIFT,
+	CLK_SDMMC_DIV_SHIFT		= 8,
+	CLK_SDMMC_DIV_MASK		= 0x3f << CLK_SDMMC_DIV_SHIFT,
+
+	/* CRU_VO_CLK_SEL1_CON */
+	ACLK_VOP_SEL_SHIFT		= 10,
+	ACLK_VOP_SEL_MASK		= 0x3 << ACLK_VOP_SEL_SHIFT,
+	ACLK_VOP_SEL_300M		= 0,
+	ACLK_VOP_SEL_200M,
+	ACLK_VOP_SEL_100M,
+	ACLK_VOP_SEL_24M,
+
+	/* CRU_VO_CLK_SEL3_CON */
+	CLK_TSADC_TSEN_DIV_SHIFT	= 5,
+	CLK_TSADC_TSEN_DIV_MASK		= 0x1F << CLK_TSADC_TSEN_DIV_SHIFT,
+	CLK_TSADC_DIV_SHIFT		= 0,
+	CLK_TSADC_DIV_MASK		= 0x1F << CLK_TSADC_DIV_SHIFT,
+};
+#endif
drivers/clk/rockchip/Makefile +1 -0
index de2635b7475..d76f7d02634 100644
@@ -21,5 +21,6 @@ obj-$(CONFIG_ROCKCHIP_RK3568) += clk_rk3568.o
 obj-$(CONFIG_ROCKCHIP_RK3576) += clk_rk3576.o
 obj-$(CONFIG_ROCKCHIP_RK3588) += clk_rk3588.o
 obj-$(CONFIG_ROCKCHIP_RV1103B) += clk_rv1103b.o
+obj-$(CONFIG_ROCKCHIP_RV1106) += clk_rv1106.o
 obj-$(CONFIG_ROCKCHIP_RV1108) += clk_rv1108.o
 obj-$(CONFIG_ROCKCHIP_RV1126) += clk_rv1126.o
drivers/clk/rockchip/clk_rv1106.c new file +1319 -0

1,319 lines not on this page · raw message

Signature · 1 line
2.43.0
#13 lore raw

PATCH v3 13/15 rockchip: rv1106: Add SoC support

In reply to Simon Glass

The RV1106 is an ARM-based SoC with a single Cortex-A7 32-bit core which integrates NEON and FPU. It contains a built-in NPU for AI related applications. The RV1103 is a package variant of the RV1106 with fewer pins.

Add the core SoC support for it: the Kconfig and Makefile entries, the boot0 hook, the SoC init code (firewall setup, watchdog release and the pvtpll reboot workaround from the vendor tree), the syscon driver and the SoC u-boot.dtsi

---

(no changes since v1)

 arch/arm/dts/rv1106-u-boot.dtsi               |   4 +
 arch/arm/include/asm/arch-rv1106/boot0.h      |  11 ++
 arch/arm/mach-rockchip/Kconfig                |  15 +++
 arch/arm/mach-rockchip/Makefile               |   1 +
 arch/arm/mach-rockchip/rv1106/Kconfig         |  28 +++++
 arch/arm/mach-rockchip/rv1106/Makefile        |  12 ++
 arch/arm/mach-rockchip/rv1106/clk_rv1106.c    |  31 +++++
 arch/arm/mach-rockchip/rv1106/rv1106.c        | 118 ++++++++++++++++++
 arch/arm/mach-rockchip/rv1106/syscon_rv1106.c |  19 +++
 board/luckfox/pico/Kconfig                    |  12 ++
 include/configs/rv1106_common.h               |  13 ++
 11 files changed, 264 insertions(+)
 create mode 100644 arch/arm/dts/rv1106-u-boot.dtsi
 create mode 100644 arch/arm/include/asm/arch-rv1106/boot0.h
 create mode 100644 arch/arm/mach-rockchip/rv1106/Kconfig
 create mode 100644 arch/arm/mach-rockchip/rv1106/Makefile
 create mode 100644 arch/arm/mach-rockchip/rv1106/clk_rv1106.c
 create mode 100644 arch/arm/mach-rockchip/rv1106/rv1106.c
 create mode 100644 arch/arm/mach-rockchip/rv1106/syscon_rv1106.c
 create mode 100644 board/luckfox/pico/Kconfig
 create mode 100644 include/configs/rv1106_common.h
arch/arm/dts/rv1106-u-boot.dtsi new file +4 -0
new file mode 100644
index 00000000000..fa062c8ee84
@@ -0,0 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
+// (C) Copyright 2022 Rockchip Electronics Co., Ltd
+
+#include "rockchip-u-boot.dtsi"
arch/arm/include/asm/arch-rv1106/boot0.h new file +11 -0
new file mode 100644
index 00000000000..e132eb98116
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2022 Rockchip Electronics Co., Ltd
+ */
+
+#ifndef __ASM_ARCH_BOOT0_H__
+#define __ASM_ARCH_BOOT0_H__
+
+#include <asm/arch-rockchip/boot0.h>
+
+#endif
arch/arm/mach-rockchip/Kconfig +15 -0
index 1969c313f47..5b1032f258b 100644
@@ -544,6 +544,20 @@ config ROCKCHIP_RV1103B
 	  32-bit core which integrates NEON and FPU.
 	  It contains a built-in NPU for AI related applications.
 
+config ROCKCHIP_RV1106
+	bool "Support Rockchip RV1106"
+	select CPU_V7A
+	select SPL_ARMV7_SET_CORTEX_SMPEN
+	select SUPPORT_SPL
+	select SPL
+	imply ROCKCHIP_COMMON_BOARD
+	help
+	  The Rockchip RV1106 is an ARM-based SoC with a single Cortex-A7
+	  32-bit core which integrates NEON and FPU. It contains a built-in
+	  NPU for AI related applications. The RV1103 is a package variant
+	  of the RV1106 with fewer pins and is also supported by this
+	  option.
+
 config ROCKCHIP_RV1108
 	bool "Support Rockchip RV1108"
 	select CPU_V7A
@@ -808,6 +822,7 @@ source "arch/arm/mach-rockchip/rk3568/Kconfig"
 source "arch/arm/mach-rockchip/rk3576/Kconfig"
 source "arch/arm/mach-rockchip/rk3588/Kconfig"
 source "arch/arm/mach-rockchip/rv1103b/Kconfig"
+source "arch/arm/mach-rockchip/rv1106/Kconfig"
 source "arch/arm/mach-rockchip/rv1108/Kconfig"
 source "arch/arm/mach-rockchip/rv1126/Kconfig"
 
arch/arm/mach-rockchip/Makefile +1 -0
index e09dc44a7ad..0d42ddbe678 100644
@@ -48,6 +48,7 @@ obj-$(CONFIG_ROCKCHIP_RK3568) += rk3568/
 obj-$(CONFIG_ROCKCHIP_RK3576) += rk3576/
 obj-$(CONFIG_ROCKCHIP_RK3588) += rk3588/
 obj-$(CONFIG_ROCKCHIP_RV1103B) += rv1103b/
+obj-$(CONFIG_ROCKCHIP_RV1106) += rv1106/
 obj-$(CONFIG_ROCKCHIP_RV1108) += rv1108/
 obj-$(CONFIG_ROCKCHIP_RV1126) += rv1126/
 
arch/arm/mach-rockchip/rv1106/Kconfig new file +28 -0
new file mode 100644
index 00000000000..05eafd96833
@@ -0,0 +1,28 @@
+if ROCKCHIP_RV1106
+
+config TARGET_LUCKFOX_PICO_RV1103
+	bool "LUCKFOX_PICO_RV1103"
+	help
+	  Support Luckfox's Pico series of RV1103 boards, such as the Pico
+	  Mini B. These are small, low-cost boards with 64MB of in-package
+	  DDR2, a microSD slot and a USB-C port used for both power and
+	  maskrom-mode USB download; most I/O is on castellated edge pins.
+	  The Mini B adds a 128MB Winbond SPI NAND, from which it boots.
+	  U-Boot can also run entirely from RAM over USB, with nothing
+	  written to the flash.
+
+config ROCKCHIP_BOOT_MODE_REG
+	default 0xff020200
+
+config ROCKCHIP_STIMER_BASE
+	default 0xff590020
+
+config SYS_SOC
+	default "rv1106"
+
+config SYS_MALLOC_F_LEN
+	default 0x400
+
+source "board/luckfox/pico/Kconfig"
+
+endif
arch/arm/mach-rockchip/rv1106/Makefile new file +12 -0
new file mode 100644
index 00000000000..66aba9fbfe2
@@ -0,0 +1,12 @@
+#
+# (C) Copyright 2022 Rockchip Electronics Co., Ltd
+#
+# SPDX-License-Identifier:     GPL-2.0+
+#
+
+obj-y += rv1106.o
+obj-y += clk_rv1106.o
+
+ifndef CONFIG_XPL_BUILD
+obj-y += syscon_rv1106.o
+endif
arch/arm/mach-rockchip/rv1106/clk_rv1106.c new file +31 -0
new file mode 100644
index 00000000000..86020c45c22
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * (C) Copyright 2022 Rockchip Electronics Co., Ltd
+ */
+
+#include <dm.h>
+#include <syscon.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/cru_rv1106.h>
+#include <linux/err.h>
+
+int rockchip_get_clk(struct udevice **devp)
+{
+	return uclass_get_device_by_driver(UCLASS_CLK,
+			DM_DRIVER_GET(rockchip_rv1106_cru), devp);
+}
+
+void *rockchip_get_cru(void)
+{
+	struct rv1106_clk_priv *priv;
+	struct udevice *dev;
+	int ret;
+
+	ret = rockchip_get_clk(&dev);
+	if (ret)
+		return ERR_PTR(ret);
+
+	priv = dev_get_priv(dev);
+
+	return priv->cru;
+}
arch/arm/mach-rockchip/rv1106/rv1106.c new file +118 -0

118 lines not on this page · raw message

arch/arm/mach-rockchip/rv1106/syscon_rv1106.c new file +19 -0
new file mode 100644
index 00000000000..d669991fbc5
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2022 Rockchip Electronics Co., Ltd
+ */
+
+#include <dm.h>
+#include <syscon.h>
+#include <asm/arch-rockchip/clock.h>
+
+static const struct udevice_id rv1106_syscon_ids[] = {
+	{ .compatible = "rockchip,rv1106-grf", .data = ROCKCHIP_SYSCON_GRF },
+	{ }
+};
+
+U_BOOT_DRIVER(syscon_rv1106) = {
+	.name = "rv1106_syscon",
+	.id = UCLASS_SYSCON,
+	.of_match = rv1106_syscon_ids,
+};
board/luckfox/pico/Kconfig new file +12 -0
new file mode 100644
index 00000000000..62176b3779f
@@ -0,0 +1,12 @@
+if TARGET_LUCKFOX_PICO_RV1103
+
+config SYS_BOARD
+	default "pico"
+
+config SYS_VENDOR
+	default "luckfox"
+
+config SYS_CONFIG_NAME
+	default "luckfox_pico"
+
+endif
include/configs/rv1106_common.h new file +13 -0
new file mode 100644
index 00000000000..1678fe54676
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * (C) Copyright 2022 Rockchip Electronics Co., Ltd
+ */
+#ifndef __CONFIG_RV1106_COMMON_H
+#define __CONFIG_RV1106_COMMON_H
+
+#include "rockchip-common.h"
+
+#define CFG_IRAM_BASE			0xff6c0000
+#define CFG_SYS_SDRAM_BASE		0x00000000
+
+#endif
Signature · 1 line
2.43.0
#14 lore raw

PATCH v3 14/15 luckfox-pico: Add the initial support

In reply to Simon Glass

Add the initial support for the Luckfox Pico Mini B board, which uses the RV1103 with 64MB of in-package DDR2 and a 128MB Winbond SPI NAND.

The board boots from the SPI NAND, or over USB in maskrom mode using the u-boot-rockchip-usb471/usb472 images, in which case U-Boot runs entirely from RAM. The console is on UART2 at 115200 baud

---

(no changes since v1)

 .../rv1103-luckfox-pico-mini-b-u-boot.dtsi    | 10 +++
 arch/arm/dts/rv1103-luckfox-pico-mini-b.dts   | 85 +++++++++++++++++++
 board/luckfox/pico/MAINTAINERS                |  6 ++
 board/luckfox/pico/Makefile                   |  7 ++
 board/luckfox/pico/pico.c                     | 19 +++++
 board/luckfox/pico/pico.env                   |  4 +
 configs/luckfox-pico-mini-b-rv1103_defconfig  | 79 +++++++++++++++++
 doc/board/index.rst                           |  1 +
 doc/board/luckfox/index.rst                   |  9 ++
 doc/board/luckfox/luckfox-pico.rst            | 71 ++++++++++++++++
 doc/board/rockchip/rockchip.rst               |  4 +
 include/configs/luckfox_pico.h                | 11 +++
 12 files changed, 306 insertions(+)
 create mode 100644 arch/arm/dts/rv1103-luckfox-pico-mini-b-u-boot.dtsi
 create mode 100644 arch/arm/dts/rv1103-luckfox-pico-mini-b.dts
 create mode 100644 board/luckfox/pico/MAINTAINERS
 create mode 100644 board/luckfox/pico/Makefile
 create mode 100644 board/luckfox/pico/pico.c
 create mode 100644 board/luckfox/pico/pico.env
 create mode 100644 configs/luckfox-pico-mini-b-rv1103_defconfig
 create mode 100644 doc/board/luckfox/index.rst
 create mode 100644 doc/board/luckfox/luckfox-pico.rst
 create mode 100644 include/configs/luckfox_pico.h
arch/arm/dts/rv1103-luckfox-pico-mini-b-u-boot.dtsi new file +10 -0
new file mode 100644
index 00000000000..968bf1dfa66
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0+
+// (C) Copyright 2026 Simon Glass <[email protected]>
+
+#include "rockchip-u-boot.dtsi"
+
+/ {
+	chosen {
+		u-boot,spl-boot-order = &spi_nand;
+	};
+};
arch/arm/dts/rv1103-luckfox-pico-mini-b.dts new file +85 -0

85 lines not on this page · raw message

board/luckfox/pico/MAINTAINERS new file +6 -0
new file mode 100644
index 00000000000..debf7059cf9
@@ -0,0 +1,6 @@
+LUCKFOX PICO
+M:	Simon Glass <[email protected]>
+S:	Maintained
+F:	board/luckfox/pico
+F:	include/configs/luckfox_pico.h
+F:	configs/luckfox-pico-mini-b-rv1103_defconfig
board/luckfox/pico/Makefile new file +7 -0
new file mode 100644
index 00000000000..4d2f5caff96
@@ -0,0 +1,7 @@
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+# Copyright 2026 Simon Glass <[email protected]>
+#
+
+obj-y	+= pico.o
board/luckfox/pico/pico.c new file +19 -0
new file mode 100644
index 00000000000..a8a471c20f3
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0+
+//
+// Copyright 2026 Simon Glass <[email protected]>
+
+#include <asm/global_data.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int dram_init(void)
+{
+	gd->ram_size = SZ_64M;
+
+	return 0;
+}
+
+phys_addr_t board_get_usable_ram_top(phys_size_t total_size)
+{
+	return gd->ram_top;
+}
board/luckfox/pico/pico.env new file +4 -0
new file mode 100644
index 00000000000..0d954ee4f98
@@ -0,0 +1,4 @@
+kernel_addr_r=0x00800000
+fdt_addr_r=0x02000000
+ramdisk_addr_r=0x03000000
+bootargs=console=ttyS2,115200 mtdparts=spi0.0:256K(env),1M@256K(idblock),1M(uboot),8M(boot),-(ubi) ro rootwait ubi.mtd=ubi ubi.block=0,rootfs root=/dev/ubiblock0_0 rootfstype=squashfs
configs/luckfox-pico-mini-b-rv1103_defconfig new file +79 -0

79 lines not on this page · raw message

doc/board/index.rst +1 -0
index 2454c3598fb..11ec39cf915 100644
@@ -39,6 +39,7 @@ Board-specific doc
    kontron/index
    lenovo/index
    lg/index
+   luckfox/index
    liebherr/index
    mediatek/index
    microchip/index
doc/board/luckfox/index.rst new file +9 -0
new file mode 100644
index 00000000000..66feee84257
@@ -0,0 +1,9 @@
+.. SPDX-License-Identifier: GPL-2.0+
+
+Luckfox
+=======
+
+.. toctree::
+   :maxdepth: 2
+
+   luckfox-pico
doc/board/luckfox/luckfox-pico.rst new file +71 -0

71 lines not on this page · raw message

doc/board/rockchip/rockchip.rst +4 -0
index 2574a1da52c..532a13594fc 100644
@@ -180,6 +180,10 @@ List of mainline supported Rockchip boards:
      - Yanyi Tech CoolPi CM5 EVB (coolpi-cm5-evb-rk3588)
      - Yanyi Tech CoolPi CM5 GenBook (coolpi-cm5-genbook-rk3588)
 
+* rv1103
+     - Luckfox Pico Mini B (luckfox-pico-mini-b-rv1103), see
+       :doc:`../luckfox/luckfox-pico`
+
 * rv1103b
      - Onion Omega4 (omega4-rv1103b), see :doc:`../onion/omega4-rv1103b`
 
include/configs/luckfox_pico.h new file +11 -0
new file mode 100644
index 00000000000..107ab622dd5
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright 2026 Simon Glass <[email protected]>
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include <configs/rv1106_common.h>
+
+#endif
Signature · 1 line
2.43.0
#15 lore raw

PATCH v3 15/15 rockchip: Support legacy images when booting from RAM

In reply to Simon Glass

The ramboot loader used for maskrom-mode USB boot only handles FIT payloads, but the maskrom usb472 image contains a legacy image on 32-bit boards without OP-TEE, since the FIT template requires either TF-A or OP-TEE. Such boards print 'Trying to boot from RAM' and then hang.

Use the binman payload symbols to locate a legacy image placed directly after SPL and load it with spl_load(). This allows boards like the Luckfox Pico Mini and the Omega4 to run U-Boot entirely from RAM in maskrom mode

---

(no changes since v1)

 arch/arm/mach-rockchip/spl.c | 53 +++++++++++++++++++++++-------------
 1 file changed, 34 insertions(+), 19 deletions(-)
arch/arm/mach-rockchip/spl.c +34 -19
index e989c148079..1322fc000b0 100644
@@ -14,6 +14,7 @@
 #include <mapmem.h>
 #include <ram.h>
 #include <spl.h>
+#include <spl_load.h>
 #include <asm/arch-rockchip/bootrom.h>
 #include <asm/arch-rockchip/timer.h>
 #include <asm/global_data.h>
@@ -153,15 +154,14 @@ void spl_board_prepare_for_boot(void)
 	cleanup_before_linux();
 }
 
-#if CONFIG_IS_ENABLED(RAM_DEVICE) && IS_ENABLED(CONFIG_SPL_LOAD_FIT)
+#if CONFIG_IS_ENABLED(RAM_DEVICE)
 binman_sym_declare_optional(ulong, payload, image_pos);
 binman_sym_declare_optional(ulong, payload, size);
 
 static ulong ramboot_load_read(struct spl_load_info *load, ulong sector,
 			       ulong count, void *buf)
 {
-	ulong addr = IF_ENABLED_INT(CONFIG_SPL_LOAD_FIT,
-				    CONFIG_SPL_LOAD_FIT_ADDRESS);
+	ulong addr = (ulong)load->priv;
 
 	memcpy(buf, map_sysmem(addr + sector, 0), count);
 	return count;
@@ -170,29 +170,44 @@ static ulong ramboot_load_read(struct spl_load_info *load, ulong sector,
 static int ramboot_load_image(struct spl_image_info *spl_image,
 			      struct spl_boot_device *bootdev)
 {
-	struct legacy_img_hdr *header;
-	ulong addr = IF_ENABLED_INT(CONFIG_SPL_LOAD_FIT,
-				    CONFIG_SPL_LOAD_FIT_ADDRESS);
 	ulong image_pos = binman_sym(ulong, payload, image_pos);
 	ulong size = binman_sym(ulong, payload, size);
+	struct legacy_img_hdr *header;
+	struct spl_load_info load;
+
+	if (IS_ENABLED(CONFIG_SPL_LOAD_FIT)) {
+		ulong addr = IF_ENABLED_INT(CONFIG_SPL_LOAD_FIT,
+					    CONFIG_SPL_LOAD_FIT_ADDRESS);
+
+		if (addr == CFG_SYS_SDRAM_BASE || addr == CONFIG_SPL_TEXT_BASE)
+			return -ENODEV;
+
+		if (image_pos != BINMAN_SYM_MISSING &&
+		    size != BINMAN_SYM_MISSING) {
+			header = map_sysmem(image_pos, 0);
+			if (image_get_magic(header) == FDT_MAGIC) {
+				memmove(map_sysmem(addr, 0), header, size);
+				memset(header, 0, sizeof(*header));
+			}
+		}
 
-	if (addr == CFG_SYS_SDRAM_BASE || addr == CONFIG_SPL_TEXT_BASE)
-		return -ENODEV;
-
-	if (image_pos != BINMAN_SYM_MISSING && size != BINMAN_SYM_MISSING) {
-		header = map_sysmem(image_pos, 0);
+		header = map_sysmem(addr, 0);
 		if (image_get_magic(header) == FDT_MAGIC) {
-			memmove(map_sysmem(addr, 0), header, size);
-			memset(header, 0, sizeof(*header));
+			spl_load_init(&load, ramboot_load_read,
+				      map_sysmem(addr, 0), 1);
+			return spl_load_simple_fit(spl_image, &load, 0,
+						   header);
 		}
 	}
 
-	header = map_sysmem(addr, 0);
-	if (image_get_magic(header) == FDT_MAGIC) {
-		struct spl_load_info load;
-
-		spl_load_init(&load, ramboot_load_read, NULL, 1);
-		return spl_load_simple_fit(spl_image, &load, 0, header);
+	/* Fall back to a legacy image placed directly after SPL */
+	if (image_pos != BINMAN_SYM_MISSING && size != BINMAN_SYM_MISSING) {
+		header = map_sysmem(image_pos, 0);
+		if (image_get_magic(header) == IH_MAGIC) {
+			spl_load_init(&load, ramboot_load_read,
+				      map_sysmem(image_pos, 0), 1);
+			return spl_load(spl_image, bootdev, &load, size, 0);
+		}
 	}
 
 	return -ENODEV;
Signature · 1 line
2.43.0
#16 lore raw
In reply to Simon Glass
Quoted 22 lines · Simon Glass

This series adds support for three small Rockchip camera SoCs and two boards which use them.

The first eight patches are Fabio Estevam's series adding the RV1103B and the Onion Omega4 board, updated here to address the review comments on v2: the board patch is split into SoC and board patches, the devicetree files move into the patches where they belong and the pinctrl driver uses regmap_update_bits() throughout. All credit for this work goes to Fabio. The devicetree concern raised in the v2 review is also resolved now: the devicetree files carried here are the versions merged in Linux v7.1, verbatim, and can be dropped once the next dts/upstream sync brings them in.

The remaining patches add the RV1106 and its RV1103 package variant, following the same structure as the RV1103B patches, together with the Luckfox Pico Mini B board. These SoCs have no mainline Linux support yet, so their devicetrees are local for now. The clock and pinctrl drivers are ported from the Rockchip vendor tree and are the work of Elaine Zhang and Ye Zhang. The final patch makes the maskrom-mode RAM-boot images work on 32-bit boards without OP-TEE, which both of these boards rely on.

Quoted 3 lines

Tested on the Luckfox Pico Mini B: U-Boot runs from RAM over the USB maskrom path and both the SPI NAND and a microSD card are usable. THe board is running in my lab.

I did ask you not to do this, Simon, as your patches aren't being picked up until we've resolved the status of u-boot.org.

Signature · 1 line
Tom
#17 lore raw

Hi Tom,

Quoted 25 lines · Tom Rini
Quoted 22 lines · Simon Glass

This series adds support for three small Rockchip camera SoCs and two boards which use them.

The first eight patches are Fabio Estevam's series adding the RV1103B and the Onion Omega4 board, updated here to address the review comments on v2: the board patch is split into SoC and board patches, the devicetree files move into the patches where they belong and the pinctrl driver uses regmap_update_bits() throughout. All credit for this work goes to Fabio. The devicetree concern raised in the v2 review is also resolved now: the devicetree files carried here are the versions merged in Linux v7.1, verbatim, and can be dropped once the next dts/upstream sync brings them in.

The remaining patches add the RV1106 and its RV1103 package variant, following the same structure as the RV1103B patches, together with the Luckfox Pico Mini B board. These SoCs have no mainline Linux support yet, so their devicetrees are local for now. The clock and pinctrl drivers are ported from the Rockchip vendor tree and are the work of Elaine Zhang and Ye Zhang. The final patch makes the maskrom-mode RAM-boot images work on 32-bit boards without OP-TEE, which both of these boards rely on.

Quoted 6 lines
Quoted 3 lines

Tested on the Luckfox Pico Mini B: U-Boot runs from RAM over the USB maskrom path and both the SPI NAND and a microSD card are usable. THe board is running in my lab.

I did ask you not to do this, Simon, as your patches aren't being picked up until we've resolved the status of u-boot.org.

I just saw that email Tom...OK, so I should not send any patches at all?

Regards,
Simon

#18 lore raw
Quoted 28 lines · Simon Glass

Hi Tom,

Quoted 25 lines · Tom Rini
Quoted 22 lines · Simon Glass

This series adds support for three small Rockchip camera SoCs and two boards which use them.

The first eight patches are Fabio Estevam's series adding the RV1103B and the Onion Omega4 board, updated here to address the review comments on v2: the board patch is split into SoC and board patches, the devicetree files move into the patches where they belong and the pinctrl driver uses regmap_update_bits() throughout. All credit for this work goes to Fabio. The devicetree concern raised in the v2 review is also resolved now: the devicetree files carried here are the versions merged in Linux v7.1, verbatim, and can be dropped once the next dts/upstream sync brings them in.

The remaining patches add the RV1106 and its RV1103 package variant, following the same structure as the RV1103B patches, together with the Luckfox Pico Mini B board. These SoCs have no mainline Linux support yet, so their devicetrees are local for now. The clock and pinctrl drivers are ported from the Rockchip vendor tree and are the work of Elaine Zhang and Ye Zhang. The final patch makes the maskrom-mode RAM-boot images work on 32-bit boards without OP-TEE, which both of these boards rely on.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Tested on the Luckfox Pico Mini B: U-Boot runs from RAM over the USB maskrom path and both the SPI NAND and a microSD card are usable. THe board is running in my lab.

I did ask you not to do this, Simon, as your patches aren't being picked up until we've resolved the status of u-boot.org.

I just saw that email Tom...OK, so I should not send any patches at all?

As I told you on the community call over two weeks ago now, I'm not comfortable taking your patches until we have resolved the u-boot.org domain transfer. So no, your patches are not being merged.

Signature · 1 line
Tom
#19 lore raw

Hi Tom,

Quoted 34 lines · Tom Rini
Quoted 32 lines · Simon Glass

Hi Tom,

Quoted 29 lines · Tom Rini
Quoted 25 lines · Simon Glass

This series adds support for three small Rockchip camera SoCs and two boards which use them.

The first eight patches are Fabio Estevam's series adding the RV1103B and the Onion Omega4 board, updated here to address the review comments on v2: the board patch is split into SoC and board patches, the devicetree files move into the patches where they belong and the pinctrl driver uses regmap_update_bits() throughout. All credit for this work goes to Fabio. The devicetree concern raised in the v2 review is also resolved now: the devicetree files carried here are the versions merged in Linux v7.1, verbatim, and can be dropped once the next dts/upstream sync brings them in.

The remaining patches add the RV1106 and its RV1103 package variant, following the same structure as the RV1103B patches, together with the Luckfox Pico Mini B board. These SoCs have no mainline Linux support yet, so their devicetrees are local for now. The clock and pinctrl drivers are ported from the Rockchip vendor tree and are the work of Elaine Zhang and Ye Zhang. The final patch makes the maskrom-mode RAM-boot images work on 32-bit boards without OP-TEE, which both of these boards rely on.

Tested on the Luckfox Pico Mini B: U-Boot runs from RAM over the USB maskrom path and both the SPI NAND and a microSD card are usable. THe board is running in my lab.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

I did ask you not to do this, Simon, as your patches aren't being picked up until we've resolved the status of u-boot.org.

I just saw that email Tom...OK, so I should not send any patches at all?

As I told you on the community call over two weeks ago now, I'm not comfortable taking your patches until we have resolved the u-boot.org domain transfer. So no, your patches are not being merged.

Do you mean:

- still send patches, they might be reviewed but will not be merged until we resolve the Concept tree / domain
- stop sending patches completely

Regards,
Simon

#20 lore raw

Dropping everyone else except for the list itself.

Quoted 46 lines · Simon Glass

Hi Tom,

Quoted 34 lines · Tom Rini
Quoted 32 lines · Simon Glass

Hi Tom,

Quoted 29 lines · Tom Rini
Quoted 25 lines · Simon Glass

This series adds support for three small Rockchip camera SoCs and two boards which use them.

The first eight patches are Fabio Estevam's series adding the RV1103B and the Onion Omega4 board, updated here to address the review comments on v2: the board patch is split into SoC and board patches, the devicetree files move into the patches where they belong and the pinctrl driver uses regmap_update_bits() throughout. All credit for this work goes to Fabio. The devicetree concern raised in the v2 review is also resolved now: the devicetree files carried here are the versions merged in Linux v7.1, verbatim, and can be dropped once the next dts/upstream sync brings them in.

The remaining patches add the RV1106 and its RV1103 package variant, following the same structure as the RV1103B patches, together with the Luckfox Pico Mini B board. These SoCs have no mainline Linux support yet, so their devicetrees are local for now. The clock and pinctrl drivers are ported from the Rockchip vendor tree and are the work of Elaine Zhang and Ye Zhang. The final patch makes the maskrom-mode RAM-boot images work on 32-bit boards without OP-TEE, which both of these boards rely on.

Tested on the Luckfox Pico Mini B: U-Boot runs from RAM over the USB maskrom path and both the SPI NAND and a microSD card are usable. THe board is running in my lab.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

I did ask you not to do this, Simon, as your patches aren't being picked up until we've resolved the status of u-boot.org.

I just saw that email Tom...OK, so I should not send any patches at all?

As I told you on the community call over two weeks ago now, I'm not comfortable taking your patches until we have resolved the u-boot.org domain transfer. So no, your patches are not being merged.

Quoted 5 lines

Do you mean:

- still send patches, they might be reviewed but will not be merged until we resolve the Concept tree / domain
- stop sending patches completely

I don't want to start another mega-thread.

I'm unsure what is unclear about "I'm not comfortable taking your patches until we have resolved the u-boot.org domain transfer".

I'm unsure what else I can add here that won't result in another mega-thread.

Signature · 1 line
Tom