Add support for the Rockchip RV1106 and RV1103
Subsystems (3)
v3 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 v3 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 v3:
- Add IDs for the internal clocks, so that anonymous branches cannot overwrite the APLL entry in the clock array
- Register the CRU as a platform driver, like the RK3528
- Give the internal clocks real IDs so that they cannot overwrite the APLL entry in the clock array
- Drop the pre-mux write of the alternate divider, which overwrites the safe divider calculated by the CPU clock framework, and the post-mux write, which duplicates the framework's own clean-up
- Add CLK_SET_RATE_PARENT to clk_vicap_m1_frac, matching m0
- Use a separate compatible for each GPIO IOC block, since their register layouts differ
- Use the per-bank IOC compatibles
- Place the entry with the other Luckfox boards, in alphabetical order
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 | 6 + 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 | 1099 +++++++++++++ .../dt-bindings/clock/rockchip,rv1106-cru.h | 306 ++++ 12 files changed, 3313 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: fc02acf6ac0ccde0c805c2daa9148683cdd01ba8
branch: rv1106a3
Signature · 1 line
2.43.0
PATCH v3 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 v3:
- Add IDs for the internal clocks, so that anonymous branches cannot overwrite the APLL entry in the clock array
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 | 306 ++++++++++++++++++ 2 files changed, 366 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
@@ -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 +306 -0
306 lines not on this page · raw message
Signature · 1 line
2.43.0
PATCH v3 2/6 clk: rockchip: Add clock controller for the RV1106
In reply to Simon GlassAdd 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 v3:
- Register the CRU as a platform driver, like the RK3528
- Give the internal clocks real IDs so that they cannot overwrite the APLL entry in the clock array
- Drop the pre-mux write of the alternate divider, which overwrites the safe divider calculated by the CPU clock framework, and the post-mux write, which duplicates the framework's own clean-up
- Add CLK_SET_RATE_PARENT to clk_vicap_m1_frac, matching m0
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 | 1099 +++++++++++++++++++++++++++++ 3 files changed, 1107 insertions(+) create mode 100644 drivers/clk/rockchip/clk-rv1106.c
drivers/clk/rockchip/Kconfig +7 -0
@@ -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
@@ -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 +1099 -0
1,099 lines not on this page · raw message
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH v3 2/6] clk: rockchip: Add clock controller for the RV1106
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] Register configuration overlap between `CLK_RTC_32K` and `CLK_I2C1` multiplexers. - [High] Missing…
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Register configuration overlap between CLK_RTC_32K and CLK_I2C1 multiplexers.
- [High] Missing reset controller implementation.
--
--- Patch [2]: [PATCH v3 2/6] clk: rockchip: Add clock controller for the RV1106 --- commit fb3401adaaf1111eb7763ba91184635eca1fea67
Author: Simon Glass <[email protected]>
clk: rockchip: Add clock controller for the RV1106
Add the clock and reset controller driver for the Rockchip RV1106, based on the vendor kernel from the Luckfox Pico SDK.
Quoted 6 lines
drivers/clk/rockchip/clk-rv1106.c new file +0
-0@@ -0,0 +1,1099 @@
[ ... ]
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 );
[ ... ]
drivers/clk/rockchip/clk-rv1106.c line 752
Quoted 4 lines
drivers/clk/rockchip/clk-rv1106.c new file +4
-0+GATE (PCLK_I2C1 ,"pclk_i2c1" ,"pclk_pmu_root" ,0 , +RV1106_PMUCLKGATE_CON (0 ),3 ,GFLAGS ), + COMPOSITE_NODIV(CLK_I2C1, "clk_i2c1", mux_200m_100m_24m_32k_p, 0, + RV1106_PMUCLKSEL_CON(0), 6, 2, MFLAGS,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Severity: High]
Does this code introduce a regression by assigning the same configuration bits for both the RTC_32K and I2C1 clocks?
The multiplexer for clk_rtc32k_pmu_fracmux is defined at RV1106_PMUCLKSEL_CON(0) shift 6 width 2. Here in rv1106_clk_branches, CLK_I2C1 is defined at the exact same register, shift, and width.
Will reparenting or setting the rate for one of these clocks inadvertently overwrite the configuration of the other?
[ ... ]
Quoted 11 lines
drivers/clk/rockchip/clk-rv1106.c new file +11
-0+/* +* 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) +dev_err (dev,"failed to add grf: %d\n" , ret); +else + rockchip_clk_register_branches(ctx,
drivers/clk/rockchip/clk-rv1106.c line 1085
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); + +return 0 ; +}
[Severity: High]
Does this driver omit the reset controller registration?
The commit message states that this patch adds the clock and reset controller driver, but rockchip_register_softrst() is not called in clk_rv1106_probe(). Will this regression cause peripheral drivers on this SoC to fail to probe with -ENOENT or -EPROBE_DEFER if they request a reset from this CRU node in their devicetree?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
PATCH v3 3/6 dt-bindings: soc: rockchip: grf: Add RV1106 compatibles
In reply to Simon GlassAdd 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 v3:
- Use a separate compatible for each GPIO IOC block, since their register layouts differ
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 | 6 ++++++ 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/soc/rockchip/grf.yaml +6 -0
@@ -64,6 +64,12 @@ properties: - rockchip,rk3588-vo1-grf - rockchip,rk3588-vop-grf - rockchip,rv1103b-ioc + - rockchip,rv1106-gpio0-ioc + - rockchip,rv1106-gpio1-ioc + - rockchip,rv1106-gpio2-ioc + - rockchip,rv1106-gpio3-ioc + - rockchip,rv1106-gpio4-ioc + - rockchip,rv1106-grf - rockchip,rv1108-usbgrf - const: syscon - items:
Signature · 1 line
2.43.0
Re: [PATCH v3 3/6] dt-bindings: soc: rockchip: grf: Add RV1106 compatibles
Quoted 6 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.Signed-off-by Simon Glass <[email protected]>---
Best regards,
Krzysztof
Re: [PATCH v3 3/6] dt-bindings: soc: rockchip: grf: Add RV1106 compatibles
In reply to Simon GlassTested on custom PCB with RV1106G2.
Comparing with the V2 series, GPIO now works without any issues.
Regards,
Vladislav
_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
PATCH v3 4/6 ARM: dts: rockchip: Add support for RV1106 and RV1103
In reply to Simon GlassAdd 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 v3:
- Use the per-bank IOC compatibles
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
@@ -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
[email protected]
AI reviewRe: [PATCH v3 4/6] ARM: dts: rockchip: Add support for RV1106 and RV1103
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [High] Deleting the `&gpio2` node causes a kernel panic when reading pinctrl debugfs because the…
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Deleting the &gpio2 node causes a kernel panic when reading pinctrl debugfs because the statically registered pins reference a missing bank node.
- [High] Schema violation and hardware misconfiguration by injecting rockchip,grf into gpio-bank nodes and assigning a dummy global GRF.
- [Low] The unit-address of the gic node does not match the first address in its reg property.
--
--- Patch [4]: [PATCH v3 4/6] ARM: dts: rockchip: Add support for RV1106 and RV1103 --- commit 2a704554f0ba16f51aa70ddcf7fa1a4a81337f55
Author: Simon Glass <[email protected]>
ARM: dts: rockchip: Add support for RV1106 and RV1103
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] https://github.com/LuckfoxTECH/luckfox-pico
Quoted 12 lines
arch/arm/boot/dts/rockchip/rv1103.dtsi new file +6
-0@@ -0,0 +1,16 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2022 Rockchip Electronics Co., Ltd. + */ + +#include "rv1106.dtsi"
arch/arm/boot/dts/rockchip/rv1103.dtsi line 16
Quoted 10 lines
arch/arm/boot/dts/rockchip/rv1103.dtsi new file +10
-0+ +/ { + compatible = "rockchip,rv1103"; + + aliases { + /delete-property/ gpio2; + }; +}; + +/delete-node/ &gpio2;
[Severity: High]
Does deleting the gpio2 node cause a kernel panic when reading pinctrl debugfs?
The Rockchip pinctrl driver registers pins statically based on the SoC variant. Because the node is deleted, the pinctrl driver cannot retrieve the per-bank rockchip,grf regmap, leaving it NULL or ERR_PTR.
When /sys/kernel/debug/pinctrl/pinctrl-rockchip/pinconf-pins iterates over all statically registered pins and calls rockchip_pinconf_get(), would passing this uninitialized regmap to regmap_read() trigger a kernel panic?
Should this use status = "disabled" instead to safely disable the bank?
[ ... ]
Quoted 5 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +0
-0
[ ... ]
arch/arm/boot/dts/rockchip/rv1106.dtsi line 62
Quoted 3 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +3
-0+ pinctrl: pinctrl { + compatible = "rockchip,rv1106-pinctrl"; + rockchip,grf = <&gpio1_ioc>;
[Severity: High]
Does assigning gpio1_ioc as the global GRF cause the generic pinctrl-rockchip driver to incorrectly route pull/drive configurations for all banks (0, 2, 3, 4) to gpio1_ioc?
To satisfy the rockchip,pinctrl.yaml requirement for a global rockchip,grf on the parent node, gpio1_ioc is assigned here. This instructs the generic driver to use it as info->regmap_base for all banks, which could result in silent failures and register corruption.
Quoted 5 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +5
-0+ #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]
Does injecting rockchip,grf into the gpio-bank nodes violate the Devicetree schema?
The rockchip,gpio-bank.yaml schema has additionalProperties: false and does not define rockchip,grf. Adding it here would trigger a dtbs_check error.
[ ... ]
Quoted 4 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +4
-0+ soc { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>;
arch/arm/boot/dts/rockchip/rv1106.dtsi line 146
Quoted 10 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +10
-0+ ranges; + + grf: syscon@ff000000 { + compatible = "rockchip,rv1106-grf", "syscon"; + reg = <0xff000000 0x68000>; + }; + + gic: interrupt-controller@ff1f0000 { + compatible = "arm,gic-400"; + reg = <0xff1f1000 0x1000>,
[Severity: Low]
Does the unit-address in the node name mismatch the first address in the reg property?
The node is named interrupt-controller@ff1f0000, but the first address in its reg block is 0xff1f1000. This violates the Devicetree specification which requires the unit-address to strictly match the first reg address, causing a dtc warning.
Could this be renamed to interrupt-controller@ff1f1000?
Quoted 3 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +3
-0+ <0xff1f2000 0x2000>, + <0xff1f4000 0x2000>, + <0xff1f6000 0x2000>;
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
Re: [PATCH v3 4/6] ARM: dts: rockchip: Add support for RV1106 and RV1103
In reply to Simon GlassTested on custom PCB with RV1106G2.
Comparing with the V2 series, GPIO now works without any issues.
Regards,
Vladislav
Re: [PATCH v3 4/6] ARM: dts: rockchip: Add support for RV1106 and RV1103
In reply to Simon GlassHi Simon,
Quoted 52 lines · 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
Signed-off-by Simon Glass <[email protected]>---
Changes in v3:
- Use the per-bank IOC compatiblesChanges 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 aliasarch/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.dtsiarch/arm/boot/dts/rockchip/rv1103.dtsi new file +16
-0@@ -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;
[snip]
Quoted 70 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +64
-0@@ -0,0 +1,321 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2022 Rockchip Electronics Co., Ltd. + */ + +#include <dt-bindings/clock/rockchip,rv1106-cru.h> +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/interrupt-controller/irq.h> +#include <dt-bindings/pinctrl/rockchip.h> + +/ { + #address-cells = <1>; + #size-cells = <1>; + + compatible = "rockchip,rv1106"; + + interrupt-parent = <&gic>; + + aliases { + gpio0 = &gpio0; + gpio1 = &gpio1; + gpio2 = &gpio2; + gpio3 = &gpio3; + gpio4 = &gpio4; + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu0: cpu@f00 { + device_type = "cpu"; + compatible = "arm,cortex-a7"; + reg = <0xf00>; + clocks = <&cru ARMCLK>; + }; + }; + + arm-pmu { + compatible = "arm,cortex-a7-pmu"; + interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>; + interrupt-affinity = <&cpu0>; + }; + + timer { + compatible = "arm,armv7-timer"; + clock-frequency = <24000000>; + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_HIGH)>, + <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_HIGH)>; + }; + + xin24m: oscillator { + compatible = "fixed-clock"; + clock-frequency = <24000000>; + clock-output-names = "xin24m"; + #clock-cells = <0>; + }; + + pinctrl: pinctrl { + compatible = "rockchip,rv1106-pinctrl"; + rockchip,grf = <&gpio1_ioc>; + #address-cells = <1>; + #size-cells = <1>;
arch/arm/boot/dts/rockchip/rv1106.dtsi line 74
Quoted 10 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +10
-0+ ranges; + + gpio0: gpio@ff380000 { + 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>;
This is incorrect hw description, only pins A0-A6 are used from gpio0.
arch/arm/boot/dts/rockchip/rv1106.dtsi line 87
Quoted 13 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +13
-0+ interrupt-controller; + #interrupt-cells = <2>; + rockchip,grf = <&gpio0_ioc>; + }; + + gpio1: gpio@ff530000 { + compatible = "rockchip,gpio-bank"; + reg = <0xff530000 0x100>; + interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO1>, <&cru DBCLK_GPIO1>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 32 32>;
Same here, only pins A0-A4, B0-B3, C0-C7 and D0-D3 are used from gpio1.
arch/arm/boot/dts/rockchip/rv1106.dtsi line 100
Quoted 13 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +13
-0+ interrupt-controller; + #interrupt-cells = <2>; + rockchip,grf = <&gpio1_ioc>; + }; + + gpio2: gpio@ff540000 { + compatible = "rockchip,gpio-bank"; + reg = <0xff540000 0x100>; + interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO2>, <&cru DBCLK_GPIO2>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 64 32>;
And here, only pins A0-A7 and B0-B1 are used from gpio2.
arch/arm/boot/dts/rockchip/rv1106.dtsi line 113
Quoted 13 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +13
-0+ interrupt-controller; + #interrupt-cells = <2>; + rockchip,grf = <&gpio2_ioc>; + }; + + gpio3: gpio@ff550000 { + compatible = "rockchip,gpio-bank"; + reg = <0xff550000 0x100>; + interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO3>, <&cru DBCLK_GPIO3>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 96 32>;
And here, only pins A1-A7, B0-B7, C0-C7 and D0-D3 from gpio3.
arch/arm/boot/dts/rockchip/rv1106.dtsi line 126
Quoted 13 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +13
-0+ interrupt-controller; + #interrupt-cells = <2>; + rockchip,grf = <&gpio3_ioc>; + }; + + gpio4: gpio@ff560000 { + compatible = "rockchip,gpio-bank"; + reg = <0xff560000 0x100>; + interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru PCLK_GPIO4>, <&cru DBCLK_GPIO4>; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&pinctrl 0 128 32>;
And here, only pins A1-A7, B0-B1 and C0-C1 from gpio4.
Quoted 5 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +5
-0+ interrupt-controller; + #interrupt-cells = <2>; + rockchip,grf = <&gpio4_ioc>; + }; + };
arch/arm/boot/dts/rockchip/rv1106.dtsi line 141
Quoted 10 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +10
-0+ + soc { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + grf: syscon@ff000000 { + compatible = "rockchip,rv1106-grf", "syscon"; + reg = <0xff000000 0x68000>;
If we decide to describe all GRFs as a single block, maybe add a comment with names and base address of each individual GRF being grouped here?
PERI_GRF 0xFF000000
VENC_GRF 0xFF010000
NPU_GRF 0xFF018000
PMU_GRF 0xFF020000
DDR_GRF 0xFF030000
CORE_GRF 0xFF040000
VI_GRF 0xFF050000
VO_GRF 0xFF060000
Quoted 25 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +25
-0+ }; + + gic: interrupt-controller@ff1f0000 { + compatible = "arm,gic-400"; + reg = <0xff1f1000 0x1000>, + <0xff1f2000 0x2000>, + <0xff1f4000 0x2000>, + <0xff1f6000 0x2000>; + interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(1) | IRQ_TYPE_LEVEL_HIGH)>; + interrupt-controller; + #interrupt-cells = <3>; + #address-cells = <0>; + }; + + gpio0_ioc: syscon@ff388000 { + compatible = "rockchip,rv1106-gpio0-ioc", "syscon"; + reg = <0xff388000 0x8000>; + }; + + cru: clock-controller@ff3a0000 { + compatible = "rockchip,rv1106-cru"; + reg = <0xff3a0000 0x20000>; + clocks = <&xin24m>; + clock-names = "xin24m"; + rockchip,grf = <&grf>;
arch/arm/boot/dts/rockchip/rv1106.dtsi line 176
Quoted 10 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +10
-0+ #clock-cells = <1>; + #reset-cells = <1>; + }; + + saradc: adc@ff3c0000 { + compatible = "rockchip,rv1106-saradc", "rockchip,rk3588-saradc"; + reg = <0xff3c0000 0x100>; + interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru CLK_SARADC>, <&cru PCLK_SARADC>; + clock-names = "saradc", "apb_pclk";
Should probably add default pinctrl here.
Quoted 106 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +106
-0+ #io-channel-cells = <1>; + status = "disabled"; + }; + + uart0: serial@ff4a0000 { + compatible = "rockchip,rv1106-uart", "snps,dw-apb-uart"; + reg = <0xff4a0000 0x100>; + interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&cru SCLK_UART0>, <&cru PCLK_UART0>; + clock-names = "baudclk", "apb_pclk"; + status = "disabled"; + }; + + uart1: serial@ff4b0000 { + compatible = "rockchip,rv1106-uart", "snps,dw-apb-uart"; + reg = <0xff4b0000 0x100>; + interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&cru SCLK_UART1>, <&cru PCLK_UART1>; + clock-names = "baudclk", "apb_pclk"; + status = "disabled"; + }; + + uart2: serial@ff4c0000 { + compatible = "rockchip,rv1106-uart", "snps,dw-apb-uart"; + reg = <0xff4c0000 0x100>; + interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&cru SCLK_UART2>, <&cru PCLK_UART2>; + clock-names = "baudclk", "apb_pclk"; + status = "disabled"; + }; + + uart3: serial@ff4d0000 { + compatible = "rockchip,rv1106-uart", "snps,dw-apb-uart"; + reg = <0xff4d0000 0x100>; + interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&cru SCLK_UART3>, <&cru PCLK_UART3>; + clock-names = "baudclk", "apb_pclk"; + status = "disabled"; + }; + + uart4: serial@ff4e0000 { + compatible = "rockchip,rv1106-uart", "snps,dw-apb-uart"; + reg = <0xff4e0000 0x100>; + interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&cru SCLK_UART4>, <&cru PCLK_UART4>; + clock-names = "baudclk", "apb_pclk"; + status = "disabled"; + }; + + uart5: serial@ff4f0000 { + compatible = "rockchip,rv1106-uart", "snps,dw-apb-uart"; + reg = <0xff4f0000 0x100>; + interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>; + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&cru SCLK_UART5>, <&cru PCLK_UART5>; + clock-names = "baudclk", "apb_pclk"; + status = "disabled"; + }; + + gpio1_ioc: syscon@ff538000 { + compatible = "rockchip,rv1106-gpio1-ioc", "syscon"; + reg = <0xff538000 0x8000>; + }; + + gpio2_ioc: syscon@ff548000 { + compatible = "rockchip,rv1106-gpio2-ioc", "syscon"; + reg = <0xff548000 0x8000>; + }; + + gpio3_ioc: syscon@ff558000 { + compatible = "rockchip,rv1106-gpio3-ioc", "syscon"; + reg = <0xff558000 0x8000>; + }; + + gpio4_ioc: syscon@ff568000 { + compatible = "rockchip,rv1106-gpio4-ioc", "syscon"; + reg = <0xff568000 0x8000>; + }; + + wdt: watchdog@ff5a0000 { + compatible = "rockchip,rv1106-wdt", "snps,dw-wdt"; + reg = <0xff5a0000 0x100>; + interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru TCLK_WDT_NS>, <&cru PCLK_WDT_NS>; + clock-names = "tclk", "pclk"; + status = "disabled"; + }; + + system_sram: sram@ff6c0000 { + compatible = "mmio-sram"; + reg = <0xff6c0000 0x40000>; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 0xff6c0000 0x40000>; + };
arch/arm/boot/dts/rockchip/rv1106.dtsi line 292
Quoted 10 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +10
-0+ + emmc: mmc@ffa90000 { + compatible = "rockchip,rv1106-dw-mshc", "rockchip,rk3288-dw-mshc"; + reg = <0xffa90000 0x4000>; + interrupts = <GIC_SPI 48 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_EMMC>, <&cru CCLK_SRC_EMMC>, + <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; + fifo-depth = <0x100>; + max-frequency = <200000000>;
Suggest you add default pinctrl here.
arch/arm/boot/dts/rockchip/rv1106.dtsi line 304
Quoted 12 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +12
-0+ status = "disabled"; + }; + + sdmmc: mmc@ffaa0000 { + compatible = "rockchip,rv1106-dw-mshc", "rockchip,rk3288-dw-mshc"; + reg = <0xffaa0000 0x4000>; + interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru HCLK_SDMMC>, <&cru CCLK_SRC_SDMMC>, + <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; + fifo-depth = <0x100>; + max-frequency = <200000000>;
Same here.
arch/arm/boot/dts/rockchip/rv1106.dtsi line 313
Quoted 9 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +9
-0+ status = "disabled"; + }; + + sfc: spi@ffac0000 { + compatible = "rockchip,sfc"; + reg = <0xffac0000 0x4000>; + interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru SCLK_SFC>, <&cru HCLK_SFC>; + clock-names = "clk_sfc", "hclk_sfc";
And here.
Regards,
Jonas
Quoted 8 lines
arch/arm/boot/dts/rockchip/rv1106.dtsi new file +8
-0+ #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + }; + }; +}; + +#include "rv1106-pinctrl.dtsi"
PATCH v3 5/6 dt-bindings: arm: rockchip: Add Luckfox Pico Mini B
In reply to Simon GlassAdd 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.
---
Changes in v3:
- Place the entry with the other Luckfox boards, in alphabetical order
Documentation/devicetree/bindings/arm/rockchip.yaml | 5 +++++ 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/arm/rockchip.yaml +5 -0
@@ -791,6 +791,11 @@ properties: - const: luckfox,core3576 - const: rockchip,rk3576 + - description: Luckfox Pico Mini B + items: + - const: luckfox,pico-mini-b + - const: rockchip,rv1103 + - description: Lunzn FastRhino R66S / R68S items: - enum:
Signature · 1 line
2.43.0
Re: [PATCH v3 5/6] dt-bindings: arm: rockchip: Add Luckfox Pico Mini B
Quoted 5 lines · 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.
Signed-off-by Simon Glass <[email protected]>---
Best regards,
Krzysztof
PATCH v3 6/6 ARM: dts: rockchip: Add Luckfox Pico Mini B
In reply to Simon GlassAdd 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
@@ -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
Re: (subset) [PATCH v3 0/6] Add support for the Rockchip RV1106 and RV1103
In reply to Simon GlassQuoted 10 lines · Simon Glass
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.
[...]
Applied, thanks!
[1/6] dt-bindings: clock: rockchip: Add RV1106 CRU support
commit: 713e4d54ff7369b8118f91e98a008220d60b2a5f
[2/6] clk: rockchip: Add clock controller for the RV1106
commit: b520d056f2619972ad09ced2985b534bba4f9599Best regards,
Signature · 6 lines
Heiko Stuebner <[email protected]> _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
Hi Simon,
Heiko took the clock patches from this series in August, and your RV1106 pinctrl series is in too, but I couldn't find a v4 of the rest (the GRF compatibles, the dtsi and the Mini B) or a reply to Jonas's review of patch 4. Are you planning a v4?
I'd like to help get it in. I have a Luckfox Pico Plus (RV1103: the Mini B's SoC and SPI NAND, plus Ethernet) running mainline 7.3.7, with U-Boot from your U-Boot series, booting from the NAND. Its device tree started from Ondrej Jirman's, so I can't offer a Tested-by for your dtsi yet; booting the board on v3 is my next step.
One thing we hit that applies to your dtsi as well: the timer node lists only PPIs 13 and 14. Without the virtual timer, a 32-bit kernel not in hyp mode takes the physical counter (CNTPCT) for its clocksource, while the vDSO reads the virtual one (CNTVCT), and the boot firmware here leaves CNTVOFF nonzero: on our board user space's clock ran about 146 s from the kernel's. Listing PPIs 11 and 10 as well, as the other Cortex-A7 Rockchip SoCs do, fixed it.
If you don't have time for a v4, would you mind if I carried the remaining patches on, keeping your authorship, with Jonas's review and the timer addressed? Either way I'm happy to test and review.
Thanks,
Weihong