Re: [PATCH 04/12] pinctrl: rockchip: Add RV1106 pinctrl support

From: Jonas Karlman

Date: Sun Jul 12 2026 - 13:59:27 EST


Hi Simon,

On 7/6/2026 9:58 PM, Simon Glass wrote:
> Add pinctrl support for the Rockchip RV1106, taken from the vendor
> kernel in the Luckfox Pico SDK [1] at commit 824b817f8 (a Linux
> 5.10.160 kernel tree). The IOC registers are spread across several
> blocks, addressed through per-bank offsets, with the GPIO0 block in the
> PMU. The drive strength uses the RK3568-style exponential encoding.
>
> The RV1103 is a package variant of the RV1106 with fewer pins and uses
> the same pin controller.
>
> [1] https://github.com/LuckfoxTECH/luckfox-pico
>
> Signed-off-by: Simon Glass <sjg@xxxxxxxxxxxx>
> ---
>
> drivers/pinctrl/pinctrl-rockchip.c | 208 +++++++++++++++++++++++++++++
> drivers/pinctrl/pinctrl-rockchip.h | 1 +
> 2 files changed, 209 insertions(+)
>
> diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
> index 7e0fcd45fd26..f9cbcb955853 100644
> --- a/drivers/pinctrl/pinctrl-rockchip.c
> +++ b/drivers/pinctrl/pinctrl-rockchip.c
> @@ -1725,6 +1725,166 @@ static int rv1103b_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank,
> return 0;
> }
>
> +#define RV1106_DRV_BITS_PER_PIN 8
> +#define RV1106_DRV_PINS_PER_REG 2
> +#define RV1106_DRV_GPIO0_OFFSET 0x10
> +#define RV1106_DRV_GPIO1_OFFSET 0x80
> +#define RV1106_DRV_GPIO2_OFFSET 0x100C0

This, and remaining offsets, should likely be from the related GPIOx IOC
base and not from GPIO1 IOC base.

The regmap_base should likely only cover GPIO1 IOC, else it would cross
boundary into the GPIOx+1 controller regmap space.

See my review comment on pinctrl dt-bindings, we likely need to define
the IOC reg space for each GPIO controller for this SoC and adjust this
driver accordingly.

Possible something like following:

gpio2: gpio@ff540000 {
reg = <0xff540000 0x10c>, <0xff548000 0x8000>;
reg-names = "base", "ioc";
};

or

gpio2: gpio@ff540000 {
reg = <0xff540000 0x10c>;
rockchip,grf = <&gpio2_ioc>;
};

gpio2_ioc: syscon@ff548000 {
reg = <0xff548000 0x8000>;
};

Regards,
Jonas

> +#define RV1106_DRV_GPIO3_OFFSET 0x20100
> +#define RV1106_DRV_GPIO4_OFFSET 0x30020

[snip]