Skip to contentSkip to conversation

Add support for the Rockchip RV1106 and RV1103

PATCH Superseded Simon Glass 6 participants 15 messages Jul 14 – Jul 22

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add support for the Rockchip RV1106 and RV1103

This series adds initial support for the Rockchip RV1106, a Cortex-A7 SoC aimed at IP cameras, and its RV1103 package variant, together with the Luckfox Pico Mini B, a small and widely available RV1103 board.

The series follows the structure of the recently merged RV1103B support. The clock driver is ported from the vendor kernel and is the work of Elaine Zhang. As with the RV1103B, no resets are exposed yet and the CPU pvtpll is initialised but not calibrated.

Following feedback on v1, several parts have been split out into separate series: the pinctrl driver and binding, and the serial, watchdog and iio bindings, are submitted separately to their maintainers. The mmc binding is already applied for mmc-next. This series carries the clock support, the GRF compatibles and the devicetrees, which depend on the clock binding header.

The devicetrees cover the devices needed for a basic system: UARTs, SD/eMMC, the SPI flash controller, SARADC, watchdog, GPIO and pinctrl.

This v2 is re-tested on the Luckfox Pico Mini B: the kernel boots to the rootfs wait with a working console on UART2, timers, pinctrl and GPIO, and an SD card running at high speed. It builds with W=1 without warnings and dt_binding_check and dtbs_check are clean.

Changes in v2:
- Renumber the clock IDs to be continuous, starting from 0
- Provide the MMC phase clocks from the CRU rather than a grf-cru
- Mention the MMC phase clocks in the rockchip,grf description
- Provide the MMC phase clocks from the CRU via an auxiliary GRF regmap rather than from a separate grf-cru clock provider
- Drop the grf-cru clock-controller child and use the syscon-only group for the main GRF, since the CRU now provides the MMC phase clocks
- Use a single gpio-ioc compatible for the per-bank IOC blocks in place of the ioc and pmuioc regions
- Take the MMC drive and sample phase clocks from the CRU and drop the grf-cru node
- Give each GPIO bank a syscon for its own IOC block, referenced by a rockchip,grf phandle in the bank node
- Add gpio aliases, which the pin controller and gpio drivers use to identify the bank; the rv1103 removes the gpio2 alias
- Split the series by subsystem: pinctrl, serial, watchdog and iio are now submitted separately
- Drop patch 'dt-bindings: mmc: rockchip-dw-mshc: Add RV1106 compatible', which is applied for mmc-next

Simon Glass (6):
dt-bindings: clock: rockchip: Add RV1106 CRU support
clk: rockchip: Add clock controller for the RV1106
dt-bindings: soc: rockchip: grf: Add RV1106 compatibles
ARM: dts: rockchip: Add support for RV1106 and RV1103
dt-bindings: arm: rockchip: Add Luckfox Pico Mini B
ARM: dts: rockchip: Add Luckfox Pico Mini B

 .../devicetree/bindings/arm/rockchip.yaml     |    5 +
 .../bindings/clock/rockchip,rv1106-cru.yaml   |   60 +
 .../devicetree/bindings/soc/rockchip/grf.yaml |    2 +
 arch/arm/boot/dts/rockchip/Makefile           |    1 +
 .../rockchip/rv1103-luckfox-pico-mini-b.dts   |   93 ++
 arch/arm/boot/dts/rockchip/rv1103.dtsi        |   16 +
 .../arm/boot/dts/rockchip/rv1106-pinctrl.dtsi | 1398 +++++++++++++++++
 arch/arm/boot/dts/rockchip/rv1106.dtsi        |  321 ++++
 drivers/clk/rockchip/Kconfig                  |    7 +
 drivers/clk/rockchip/Makefile                 |    1 +
 drivers/clk/rockchip/clk-rv1106.c             | 1100 +++++++++++++
 .../dt-bindings/clock/rockchip,rv1106-cru.h   |  300 ++++
 12 files changed, 3304 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/rockchip,rv1106-cru.yaml
 create mode 100644 arch/arm/boot/dts/rockchip/rv1103-luckfox-pico-mini-b.dts
 create mode 100644 arch/arm/boot/dts/rockchip/rv1103.dtsi
 create mode 100644 arch/arm/boot/dts/rockchip/rv1106-pinctrl.dtsi
 create mode 100644 arch/arm/boot/dts/rockchip/rv1106.dtsi
 create mode 100644 drivers/clk/rockchip/clk-rv1106.c
 create mode 100644 include/dt-bindings/clock/rockchip,rv1106-cru.h

---
base-commit: 3b029c035b34bbc693405ddf759f0e9b920c27f1
branch: rv1106a2

Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/6 dt-bindings: clock: rockchip: Add RV1106 CRU support

Add the clock binding header and schema for the Rockchip RV1106 clock and reset unit. The clock IDs are numbered continuously from 0, in the same way as the RV1103B. The header also covers the MMC drive and sample phase clocks, which the CRU provides using control registers in the GRF region.

The RV1103 is a package variant of the RV1106 and uses the same CRU.

---

Changes in v2:
- Renumber the clock IDs to be continuous, starting from 0
- Provide the MMC phase clocks from the CRU rather than a grf-cru
- Mention the MMC phase clocks in the rockchip,grf description

 .../bindings/clock/rockchip,rv1106-cru.yaml   |  60 ++++
 .../dt-bindings/clock/rockchip,rv1106-cru.h   | 300 ++++++++++++++++++
 2 files changed, 360 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/rockchip,rv1106-cru.yaml
 create mode 100644 include/dt-bindings/clock/rockchip,rv1106-cru.h
Documentation/devicetree/bindings/clock/rockchip,rv1106-cru.yaml new file +60 -0
new file mode 100644
index 000000000000..b99dce9ff935
@@ -0,0 +1,60 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/rockchip,rv1106-cru.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Rockchip RV1106 Clock and Reset Unit
+
+maintainers:
+  - Simon Glass <[email protected]>
+  - Heiko Stuebner <[email protected]>
+
+description:
+  The RV1106 clock controller generates the clock and also implements a
+  reset controller for SoC peripherals.
+
+properties:
+  compatible:
+    const: rockchip,rv1106-cru
+
+  reg:
+    maxItems: 1
+
+  "#clock-cells":
+    const: 1
+
+  "#reset-cells":
+    const: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: xin24m
+
+  rockchip,grf:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Phandle to the syscon managing the "general register files" (GRF).
+      If missing, pll rates are not changeable due to the missing pll
+      lock status, and the MMC drive and sample phase clocks, whose
+      control registers live in the GRF region, are not registered.
+
+required:
+  - compatible
+  - reg
+  - "#clock-cells"
+  - "#reset-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    clock-controller@ff3b0000 {
+      compatible = "rockchip,rv1106-cru";
+      reg = <0xff3b0000 0x20000>;
+      rockchip,grf = <&grf>;
+      #clock-cells = <1>;
+      #reset-cells = <1>;
+    };
include/dt-bindings/clock/rockchip,rv1106-cru.h new file +300 -0

300 lines not on this page · raw message

Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v2 1/6] dt-bindings: clock: rockchip: Add RV1106 CRU support

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The dt-bindings header defines clock IDs but omits all reset macros (e.g., SRST_*), despite the…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The dt-bindings header defines clock IDs but omits all reset macros (e.g., SRST_*), despite the YAML schema explicitly requiring #reset-cells. --

--- Patch [1]: [PATCH v2 1/6] dt-bindings: clock: rockchip: Add RV1106 CRU support --- commit 6d501c2edd443b968951f83a3746f9eddc260735
Author: Simon Glass <[email protected]>

dt-bindings: clock: rockchip: Add RV1106 CRU support

This commit adds the clock binding header and schema for the Rockchip RV1106 clock and reset unit. The RV1103 package variant also uses this same CRU.

Quoted 5 lines
Documentation/devicetree/bindings/clock/rockchip,rv1106-cru.yaml new file +0 -0
new file mode 100644
index 0000000000000..b99dce9ff9356

[ ... ]

Quoted 5 lines
Documentation/devicetree/bindings/clock/rockchip,rv1106-cru.yaml new file +5 -0
+required:
+  - compatible
+  - reg
+  - "#clock-cells"
+  - "#reset-cells"

[ ... ]

Quoted 5 lines
include/dt-bindings/clock/rockchip,rv1106-cru.h new file +0 -0
new file mode 100644
index 0000000000000..6b13e98b8d549

[ ... ]

include/dt-bindings/clock/rockchip,rv1106-cru.h line 300

Quoted 9 lines
include/dt-bindings/clock/rockchip,rv1106-cru.h new file +9 -0
+/* mmc phase clocks */
+#define SCLK_EMMC_DRV		278
+#define SCLK_EMMC_SAMPLE	279
+#define SCLK_SDMMC_DRV		280
+#define SCLK_SDMMC_SAMPLE	281
+#define SCLK_SDIO_DRV		282
+#define SCLK_SDIO_SAMPLE	283
+
+#endif

[Severity: Low]
Since the YAML schema explicitly mandates "#reset-cells", should this header also include the corresponding reset macro definitions (e.g., SRST_*)?

Without these macros, device tree nodes consuming a reset from the RV1106 CRU will be forced to hardcode numeric reset indices instead of using readable names.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer Reviewed-by on v2 1/6
#3 lore raw

Re: [PATCH v2 1/6] dt-bindings: clock: rockchip: Add RV1106 CRU support

In reply to Simon Glass
Quoted 16 lines · Simon Glass

Add the clock binding header and schema for the Rockchip RV1106 clock and reset unit. The clock IDs are numbered continuously from 0, in the same way as the RV1103B. The header also covers the MMC drive and sample phase clocks, which the CRU provides using control registers in the GRF region.

The RV1103 is a package variant of the RV1106 and uses the same CRU.

---

Changes in v2:
- Renumber the clock IDs to be continuous, starting from 0
- Provide the MMC phase clocks from the CRU rather than a grf-cru
- Mention the MMC phase clocks in the rockchip,grf description

Quoted 6 lines
 .../bindings/clock/rockchip,rv1106-cru.yaml   |  60 ++++
 .../dt-bindings/clock/rockchip,rv1106-cru.h   | 300 ++++++++++++++++++
 2 files changed, 360 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/rockchip,rv1106-cru.yaml
 create mode 100644 include/dt-bindings/clock/rockchip,rv1106-cru.h
#4 lore raw

PATCH v2 2/6 clk: rockchip: Add clock controller for the RV1106

In reply to Simon Glass

Add the clock and reset controller driver for the Rockchip RV1106, based on the vendor kernel from the Luckfox Pico SDK [1] at commit 824b817f8 (a Linux 5.10.160 kernel tree), adapted to the upstream clock framework.

The MMC drive and sample phase clocks have their control registers in the GRF region. The CRU provides these clocks itself, using the syscon referenced by the rockchip,grf property as an auxiliary regmap, in the same way as the RK3528.

The RV1103 is a package variant of the RV1106 and uses the same CRU.

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

---

Changes in v2:
- Provide the MMC phase clocks from the CRU via an auxiliary GRF regmap rather than from a separate grf-cru clock provider

 drivers/clk/rockchip/Kconfig      |    7 +
 drivers/clk/rockchip/Makefile     |    1 +
 drivers/clk/rockchip/clk-rv1106.c | 1100 +++++++++++++++++++++++++++++
 3 files changed, 1108 insertions(+)
 create mode 100644 drivers/clk/rockchip/clk-rv1106.c
drivers/clk/rockchip/Kconfig +7 -0
index 85133498f013..4b55f48d72c2 100644
@@ -23,6 +23,13 @@ config CLK_RV1103B
 	help
 	  Build the driver for RV1103B Clock Driver.
 
+config CLK_RV1106
+	bool "Rockchip RV1106 clock controller support"
+	depends on ARM || COMPILE_TEST
+	default y
+	help
+	  Build the driver for RV1106 Clock Driver.
+
 config CLK_RV110X
 	bool "Rockchip RV110x clock controller support"
 	depends on ARM || COMPILE_TEST
drivers/clk/rockchip/Makefile +1 -0
index 7c984ee006c6..554b7eb83dc9 100644
@@ -19,6 +19,7 @@ clk-rockchip-$(CONFIG_RESET_CONTROLLER) += softrst.o
 
 obj-$(CONFIG_CLK_PX30)          += clk-px30.o
 obj-$(CONFIG_CLK_RV1103B)	+= clk-rv1103b.o
+obj-$(CONFIG_CLK_RV1106)	+= clk-rv1106.o
 obj-$(CONFIG_CLK_RV110X)        += clk-rv1108.o
 obj-$(CONFIG_CLK_RV1126)        += clk-rv1126.o
 obj-$(CONFIG_CLK_RV1126B)	+= clk-rv1126b.o rst-rv1126b.o
drivers/clk/rockchip/clk-rv1106.c new file +1100 -0

1,100 lines not on this page · raw message

Signature · 1 line
2.43.0
#5 lore raw

Re: [PATCH v2 2/6] clk: rockchip: Add clock controller for the RV1106

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider: - [High] The `RV1106_CPUCLK_RATE` macro unconditionally overwrites the dynamically calculated safe…

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] The RV1106_CPUCLK_RATE macro unconditionally overwrites the dynamically calculated safe intermediate CPU divider during frequency transitions, causing CPU crashes.
- [High] The exported PLL_APLL clock is silently overwritten by anonymous clock branches due to a dummy ID collision.
- [High] Register collision between CLK_RTC_32K and CLK_I2C1 multiplexers.
- [Medium] CLK_VICAP_M1_FRAC is missing the CLK_SET_RATE_PARENT flag.
--

--- Patch [2]: [PATCH v2 2/6] clk: rockchip: Add clock controller for the RV1106 --- commit f23e8ffe0002c99e81093bf229093ffef3a65c00
Author: Simon Glass <[email protected]>

clk: rockchip: Add clock controller for the RV1106

The patch adds the clock and reset controller driver for the Rockchip RV1106, based on the vendor kernel adapted to the upstream clock framework. It also provides the MMC drive and sample phase clocks from the CRU via an auxiliary GRF regmap.

Quoted 6 lines
drivers/clk/rockchip/clk-rv1106.c new file +0 -0
new file mode 100644
index 0000000000000..cb21f32c8a26b
@@ -0,0 +1,1100 @@

[ ... ]

drivers/clk/rockchip/clk-rv1106.c line 196

Quoted 11 lines
drivers/clk/rockchip/clk-rv1106.c new file +11 -0
+#define RV1106_CPUCLK_RATE(_prate, _aclk_core, _pclk_dbg, _is_pvtpll)	\
+{									\
+	.prate = _prate,						\
+	.divs = {							\
+		RV1106_CLKSEL0(_aclk_core),				\
+		RV1106_CLKSEL1(_pclk_dbg),				\
+	},								\
+	.pre_muxs = {							\
+		RV1106_CLKSEL3(1),					\
+		RV1106_CLKSEL2(2),					\
+	},								\

[Severity: High]
Does this hardcoded array overwrite the safe intermediate divider calculated by the generic CPU clock framework during frequency scaling?

The core clock framework calculates a safe intermediate divider and writes it to RV1106_CORECLKSEL_CON(0) bits 4:0, as configured in rv1106_cpuclk_data:

	.core_reg[0] = RV1106_CORECLKSEL_CON(0),
	.div_core_shift[0] = 0,
	.div_core_mask[0] = 0x1f,

By unconditionally applying RV1106_CLKSEL3(1) in the pre_muxs array, could it overwrite this dynamically calculated divider and potentially cause instability during CPU frequency transitions?

[ ... ]

drivers/clk/rockchip/clk-rv1106.c line 304

Quoted 3 lines
drivers/clk/rockchip/clk-rv1106.c new file +3 -0
+static struct rockchip_clk_branch rv1106_rtc32k_pmu_fracmux __initdata =
+	MUX(CLK_RTC_32K, "clk_rtc_32k", clk_rtc32k_pmu_p, CLK_SET_RATE_PARENT | CLK_SET_RATE_NO_REPARENT,
+			RV1106_PMUCLKSEL_CON(0), 6, 2, MFLAGS);

[Severity: High]
Are clk_rtc_32k and clk_i2c1 sharing the same register bitfield?

This multiplexer is defined using bits 6:7 of RV1106_PMUCLKSEL_CON(0). However, later in rv1106_clk_branches, CLK_I2C1 is defined using the exact same bits:

	COMPOSITE_NODIV(CLK_I2C1, "clk_i2c1", mux_200m_100m_24m_32k_p, 0,
			RV1106_PMUCLKSEL_CON(0), 6, 2, MFLAGS,

Could modifying the parent of one clock inadvertently corrupt the configuration of the other?

[ ... ]

drivers/clk/rockchip/clk-rv1106.c line 359

Quoted 6 lines
drivers/clk/rockchip/clk-rv1106.c new file +6 -0
+static struct rockchip_clk_branch rv1106_clk_branches[] __initdata = {
+
+	FACTOR(0, "xin_osc0_half", "xin24m", 0, 1, 2),
+
+	/* PD_CORE */
+	GATE(CLK_PVTM_CORE, "clk_pvtm_core", "xin24m", 0,

[Severity: High]
Will these anonymous branches using ID 0 silently overwrite the PLL_APLL clock in the provider's clock array?

Since PLL_APLL corresponds to ID 0 in the DT bindings, it gets registered first at ctx->clk_data.clks[0]. Since rockchip_clk_set_lookup() doesn't ignore ID 0, do these dummy IDs cause device tree consumers of the APLL clock to receive an incorrect internal anonymous clock instead?

[ ... ]

drivers/clk/rockchip/clk-rv1106.c line 520

Quoted 7 lines
drivers/clk/rockchip/clk-rv1106.c new file +7 -0
+	COMPOSITE(CLK_VICAP_M1_SRC, "clk_vicap_m1_src", mux_gpll_cpll_p, 0,
+			RV1106_CLKSEL_CON(31), 7, 1, MFLAGS, 2, 5, DFLAGS,
+			RV1106_CLKGATE_CON(3), 13, GFLAGS),
+	COMPOSITE_FRACMUX(CLK_VICAP_M1_FRAC, "clk_vicap_m1_frac", "clk_vicap_m1_src", 0,
+			RV1106_CLKSEL_CON(32), 0,
+			RV1106_CLKGATE_CON(3), 14, GFLAGS,
+			&rv1106_clk_vicap_m1_fracmux),

[Severity: Medium]
Should CLK_VICAP_M1_FRAC pass the CLK_SET_RATE_PARENT flag instead of 0?

Its sibling CLK_VICAP_M0_FRAC uses CLK_SET_RATE_PARENT to allow rate changes to propagate up to the integer divider. Without this flag, will the clock framework fail to adjust the parent divider when a rate change is requested?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#6 lore raw

Re: [PATCH v2 2/6] clk: rockchip: Add clock controller for the RV1106

In reply to Simon Glass

Hi Simon,

Quoted 50 lines · Simon Glass
drivers/clk/rockchip/clk-rv1106.c new file +50 -0
+static void __init rv1106_clk_init(struct device_node *np)
+{
+	struct rockchip_clk_provider *ctx;
+	unsigned long clk_nr;
+	void __iomem *reg_base;
+	int ret;
+
+	clk_nr = rockchip_clk_find_max_clk_id(rv1106_clk_branches,
+					      ARRAY_SIZE(rv1106_clk_branches)) + 1;
+	clk_nr = max(clk_nr,
+		     rockchip_clk_find_max_clk_id(rv1106_grf_clk_branches,
+					ARRAY_SIZE(rv1106_grf_clk_branches)) + 1);
+	reg_base = of_iomap(np, 0);
+	if (!reg_base) {
+		pr_err("%s: could not map cru region\n", __func__);
+		return;
+	}
+
+	ctx = rockchip_clk_init(np, reg_base, clk_nr);
+	if (IS_ERR(ctx)) {
+		pr_err("%s: rockchip clk init failed\n", __func__);
+		iounmap(reg_base);
+		return;
+	}
+
+	rv1106_pvtpll_init(ctx);
+
+	rockchip_clk_register_plls(ctx, rv1106_pll_clks,
+				   ARRAY_SIZE(rv1106_pll_clks),
+				   RV1106_GRF_SOC_STATUS0);
+
+	rockchip_clk_register_armclk(ctx, ARMCLK, "armclk",
+				     mux_armclk_p, ARRAY_SIZE(mux_armclk_p),
+				     &rv1106_cpuclk_data, rv1106_cpuclk_rates,
+				     ARRAY_SIZE(rv1106_cpuclk_rates));
+
+	rockchip_clk_register_branches(ctx, rv1106_clk_branches,
+				       ARRAY_SIZE(rv1106_clk_branches));
+
+	/*
+	 * The MMC drive and sample phase clocks have their control
+	 * registers in the GRF region, so they can only be provided when
+	 * the rockchip,grf property points at a valid syscon.
+	 */
+	if (!IS_ERR(ctx->grf)) {
+		ret = rockchip_clk_add_grf(ctx, ctx->grf, grf_type_sys);
+		if (ret)
+			pr_err("%s: failed to add grf: %d\n", __func__, ret);
+		else
+			rockchip_clk_register_branches(ctx,

drivers/clk/rockchip/clk-rv1106.c line 1100

Quoted 10 lines
drivers/clk/rockchip/clk-rv1106.c new file +10 -0
+					rv1106_grf_clk_branches,
+					ARRAY_SIZE(rv1106_grf_clk_branches));
+	}
+
+	rockchip_register_restart_notifier(ctx, RV1106_GLB_SRST_FST, NULL);
+
+	rockchip_clk_of_add_provider(np, ctx);
+}
+
+CLK_OF_DECLARE(rv1106_cru, "rockchip,rv1106-cru", rv1106_clk_init);

Can this be registered as a platform driver similar to drivers/clk/rockchip/clk-rk3528.c ?

Brian

#7 lore raw

PATCH v2 3/6 dt-bindings: soc: rockchip: grf: Add RV1106 compatibles

In reply to Simon Glass

Add the compatibles for the general register files of the Rockchip
RV1106: the main GRF, and the per-bank GPIO IOC blocks used by the pin controller.

---

Changes in v2:
- Drop the grf-cru clock-controller child and use the syscon-only group for the main GRF, since the CRU now provides the MMC phase clocks
- Use a single gpio-ioc compatible for the per-bank IOC blocks in place of the ioc and pmuioc regions

 Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +2 -0
index 2cc43742b8e3..fd9235ac1334 100644
@@ -64,6 +64,8 @@ properties:
               - rockchip,rk3588-vo1-grf
               - rockchip,rk3588-vop-grf
               - rockchip,rv1103b-ioc
+              - rockchip,rv1106-gpio-ioc
+              - rockchip,rv1106-grf
               - rockchip,rv1108-usbgrf
           - const: syscon
       - items:
Signature · 1 line
2.43.0
#8 lore raw

Re: [PATCH v2 3/6] dt-bindings: soc: rockchip: grf: Add RV1106 compatibles

Quoted 22 lines · Simon Glass

Add the compatibles for the general register files of the Rockchip
RV1106: the main GRF, and the per-bank GPIO IOC blocks used by the pin controller.

---

Changes in v2:
- Drop the grf-cru clock-controller child and use the syscon-only group for the main GRF, since the CRU now provides the MMC phase clocks
- Use a single gpio-ioc compatible for the per-bank IOC blocks in place of the ioc and pmuioc regions

 Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +0 -0
index 2cc43742b8e3..fd9235ac1334 100644

Documentation/devicetree/bindings/soc/rockchip/grf.yaml properties: · line 67

Quoted 4 lines
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +1 -0
@@ -64,6 +64,8 @@ properties:
               - rockchip,rk3588-vo1-grf
               - rockchip,rk3588-vop-grf
               - rockchip,rv1103b-ioc
+              - rockchip,rv1106-gpio-ioc

And this also answers my previous email (pinctrl/gpio bank): you have one GPIO IOC, not multiple ones, although commit msg tells different story. Confusing. The compatible here defines register layout (see writing bindings - it is explicitly documented there) so do you have one device or multiple with the same register layout?

Best regards,
Krzysztof

maintainer
#9 lore raw

Re: [PATCH v2 3/6] dt-bindings: soc: rockchip: grf: Add RV1106 compatibles

Hi Krzysztof,

Am Dienstag, 21. Juli 2026, 10:16:33 Mitteleuropäische Sommerzeit schrieb Krzysztof Kozlowski:

Quoted 18 lines · Simon Glass
Quoted 17 lines

Add the compatibles for the general register files of the Rockchip
RV1106: the main GRF, and the per-bank GPIO IOC blocks used by the pin controller.

---

Changes in v2:
- Drop the grf-cru clock-controller child and use the syscon-only group for the main GRF, since the CRU now provides the MMC phase clocks
- Use a single gpio-ioc compatible for the per-bank IOC blocks in place of the ioc and pmuioc regions

 Documentation/devicetree/bindings/soc/rockchip/grf.yaml | 2 ++
 1 file changed, 2 insertions(+)
Quoted 15 lines

Documentation/devicetree/bindings/soc/rockchip/grf.yaml properties: · line 67

Quoted 9 lines
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +1 -0
index 2cc43742b8e3..fd9235ac1334 100644
@@ -64,6 +64,8 @@ properties:
               - rockchip,rk3588-vo1-grf
               - rockchip,rk3588-vop-grf
               - rockchip,rv1103b-ioc
+              - rockchip,rv1106-gpio-ioc

And this also answers my previous email (pinctrl/gpio bank): you have one GPIO IOC, not multiple ones, although commit msg tells different story. Confusing. The compatible here defines register layout (see writing bindings - it is explicitly documented there) so do you have one device or multiple with the same register layout?

It's actually option 3 ;-) .

The TRM describes separate General-Register-Files

	GPIO0 - the actual GPIO controller -  0xFF380000
GPIO0_IOC - 0xFF388000  (pinconfig)
	[ bunch of other devices like the video encoder ]
	GPIO1 - 0xFF530000
GPIO1_IOC - 0xFF538000
	...
GPIO2_IOC - 0xFF548000 
	...
GPIO3_IOC - 0xFF558000
	...

GPIO4_IOC - 0xFF568000

But their register-layouts are definitly not identical. For example in GPIO0_IOC there is one register controlling Schmitt Triggers at offset 0x58, ( GPIO0_IOC_GPIO0A_IE_SMT ) - because only the first 8 pins have those, while in GPIO1_IOC, 4 SMT register start at 0x280.

So they do need separate compatibles, per your comment.

Heiko

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

#10 lore raw

PATCH v2 4/6 ARM: dts: rockchip: Add support for RV1106 and RV1103

In reply to Simon Glass

Add the devicetree files for the Rockchip RV1106, a Cortex-A7 SoC aimed at IP cameras, and its RV1103 package variant, which has fewer pins and no GPIO2 bank. The pinctrl data comes from the vendor kernel in the Luckfox Pico SDK [1] at commit 824b817f8 (a Linux 5.10.160 kernel tree).

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

---

Changes in v2:
- Take the MMC drive and sample phase clocks from the CRU and drop the grf-cru node
- Give each GPIO bank a syscon for its own IOC block, referenced by a rockchip,grf phandle in the bank node
- Add gpio aliases, which the pin controller and gpio drivers use to identify the bank; the rv1103 removes the gpio2 alias

 arch/arm/boot/dts/rockchip/rv1103.dtsi        |   16 +
 .../arm/boot/dts/rockchip/rv1106-pinctrl.dtsi | 1398 +++++++++++++++++
 arch/arm/boot/dts/rockchip/rv1106.dtsi        |  321 ++++
 3 files changed, 1735 insertions(+)
 create mode 100644 arch/arm/boot/dts/rockchip/rv1103.dtsi
 create mode 100644 arch/arm/boot/dts/rockchip/rv1106-pinctrl.dtsi
 create mode 100644 arch/arm/boot/dts/rockchip/rv1106.dtsi
arch/arm/boot/dts/rockchip/rv1103.dtsi new file +16 -0
new file mode 100644
index 000000000000..025fde5bf09c
@@ -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/boot/dts/rockchip/rv1106-pinctrl.dtsi new file +1398 -0

1,398 lines not on this page · raw message

arch/arm/boot/dts/rockchip/rv1106.dtsi new file +321 -0

321 lines not on this page · raw message

Signature · 1 line
2.43.0
#11 lore raw

Re: [PATCH v2 4/6] ARM: dts: rockchip: Add support for RV1106 and RV1103

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] The DT defines distributed IOC blocks for each GPIO bank via `rockchip,grf` properties, which…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The DT defines distributed IOC blocks for each GPIO bank via rockchip,grf properties, which violates the upstream dt-binding schema and causes register corruption due to driver mismatch.
- [Medium] The device tree relies on the 'rockchip,rv1106-pinctrl' compatible string, which is entirely unsupported by the upstream pinctrl-rockchip driver and violates the dt-binding schema. --

--- Patch [4]: [PATCH v2 4/6] ARM: dts: rockchip: Add support for RV1106 and RV1103 --- commit e0d1bbbfe5826e8f7c17c9a0008a5c218538f589
Author: Simon Glass <[email protected]>

ARM: dts: rockchip: Add support for RV1106 and RV1103

Add the devicetree files for the Rockchip RV1106 and its RV1103 package variant. The pinctrl data comes from the vendor kernel in the Luckfox Pico SDK.

Quoted 6 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +0 -0
new file mode 100644
index 0000000000000..7b2e6142a103f
@@ -0,0 +1,321 @@

[ ... ]

arch/arm/boot/dts/rockchip/rv1106.dtsi line 61

Quoted 2 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +2 -0
+	pinctrl: pinctrl {
+		compatible = "rockchip,rv1106-pinctrl";

[Severity: Medium]
Does this compatible string have accompanying dt-binding schema and driver support? The 'rockchip,rv1106-pinctrl' string appears to be missing from the upstream device tree schema and pinctrl driver, which could cause dtbs_check validation failures and prevent the driver from probing.

Quoted 6 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +6 -0
+		rockchip,grf = <&gpio1_ioc>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges;
+
+		gpio0: gpio@ff380000 {

arch/arm/boot/dts/rockchip/rv1106.dtsi line 77

Quoted 10 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +10 -0
+			compatible = "rockchip,gpio-bank";
+			reg = <0xff380000 0x100>;
+			interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cru PCLK_PMU_GPIO0>, <&cru DBCLK_PMU_GPIO0>;
+			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-ranges = <&pinctrl 0 0 32>;
+			interrupt-controller;
+			#interrupt-cells = <2>;
+			rockchip,grf = <&gpio0_ioc>;

[Severity: High]
Will the upstream pinctrl-rockchip driver parse these bank-specific syscons properly? The upstream driver typically only parses the parent pinctrl node's rockchip,grf property.

Could this cause register corruption when configuring pins? Since the parent pinctrl node points to gpio1_ioc, the driver might use gpio1_ioc for all banks. This would silently overwrite gpio1_ioc registers when attempting to configure pins for other banks like gpio0 or gpio2.

Also, does adding the rockchip,grf property to the gpio-bank child nodes violate the rockchip,gpio-bank.yaml schema which forbids additional properties?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
#12 lore raw

PATCH v2 5/6 dt-bindings: arm: rockchip: Add Luckfox Pico Mini B

In reply to Simon Glass

Add the compatible for the Luckfox Pico Mini B, a small board using the Rockchip RV1103 with 64MB of in-package DDR2 and a 128MB SPI NAND.

---

(no changes since v1)

 Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +5 -0
index 1a9dde18626d..711029ee78af 100644
@@ -813,6 +813,11 @@ properties:
           - const: netxeon,r89
           - const: rockchip,rk3288
 
+      - description: Luckfox Pico Mini B
+        items:
+          - const: luckfox,pico-mini-b
+          - const: rockchip,rv1103
+
       - description: Onion Omega4 Evaluation board
         items:
           - const: onion,omega4-evb
Signature · 1 line
2.43.0
#13 lore raw

Re: [PATCH v2 5/6] dt-bindings: arm: rockchip: Add Luckfox Pico Mini B

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The compatible string block for 'Luckfox Pico Mini B' is inserted out of alphabetical order. --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The compatible string block for 'Luckfox Pico Mini B' is inserted out of alphabetical order. --

--- Patch [5]: [PATCH v2 5/6] dt-bindings: arm: rockchip: Add Luckfox Pico Mini B --- commit 61521ad6f3be156c0a561b23d28c5db096f06212
Author: Simon Glass <[email protected]>

dt-bindings: arm: rockchip: Add Luckfox Pico Mini B

This commit adds the device tree binding compatible strings for the Luckfox Pico Mini B board, which is based on the Rockchip RV1103 SoC.

Documentation/devicetree/bindings/arm/rockchip.yaml properties: · line 820

Quoted 13 lines
Documentation/devicetree/bindings/arm/rockchip.yaml +5 -0
index 1a9dde18626d0..711029ee78af2 100644
@@ -813,6 +813,11 @@ properties:
           - const: netxeon,r89
           - const: rockchip,rk3288
 
+      - description: Luckfox Pico Mini B
+        items:
+          - const: luckfox,pico-mini-b
+          - const: rockchip,rv1103
+

[Severity: Low]
This isn't a bug, but is this new block inserted out of alphabetical order?

The file generally maintains entries alphabetically by vendor prefix. Should this luckfox entry be placed alongside the other luckfox entries higher up in the file, rather than here between netxeon and onion?

Quoted 3 lines
Documentation/devicetree/bindings/arm/rockchip.yaml +0 -0
       - description: Onion Omega4 Evaluation board
         items:
           - const: onion,omega4-evb
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
#14 lore raw

PATCH v2 6/6 ARM: dts: rockchip: Add Luckfox Pico Mini B

In reply to Simon Glass

Add the devicetree for the Luckfox Pico Mini B, a small board using the Rockchip RV1103 with 64MB of in-package DDR2, a 128MB Winbond SPI NAND and a microSD slot. The console is on UART2.

---

(no changes since v1)

 arch/arm/boot/dts/rockchip/Makefile           |  1 +
 .../rockchip/rv1103-luckfox-pico-mini-b.dts   | 93 +++++++++++++++++++
 2 files changed, 94 insertions(+)
 create mode 100644 arch/arm/boot/dts/rockchip/rv1103-luckfox-pico-mini-b.dts
arch/arm/boot/dts/rockchip/Makefile +1 -0
index d0154fd7ff24..62a2ed96dd9b 100644
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 dtb-$(CONFIG_ARCH_ROCKCHIP) += \
+	rv1103-luckfox-pico-mini-b.dtb \
 	rv1103b-omega4-evb.dtb \
 	rv1108-elgin-r1.dtb \
 	rv1108-evb.dtb \
arch/arm/boot/dts/rockchip/rv1103-luckfox-pico-mini-b.dts new file +93 -0

93 lines not on this page · raw message

Signature · 1 line
2.43.0