Re: [PATCH 3/3] pinctrl: rockchip: add support for RK3308B SoC

From: Dmitry Yashin

Date: Tue Jul 21 2026 - 11:01:07 EST



On 7/17/26 12:59, Hugo VALTIER wrote:
> The RK3308B is a revision of the RK3308 including different iomux
> register layout.
> Several pins (GPIO2_A2, GPIO2_A3, GPIO2_C0, GPIO3_B2, GPIO3_B3)
> have 3-bit mux fields in new GRF registers (SOC_CON13 at 0x608 and
> SOC_CON15 at 0x610) that override the standard 2-bit fields.
> I believe the bootloader sets the sel_src_ctrl bits to activate these
> new registers, which causes the kernel's writes to the old 2-bit iomux
> registers to be silently ignored.
>
> Without this patch, SPI1, I2C3, and other peripherals that depend on
> these pins are completely non-functional on my RK3308B boards.
>
> Detect the SoC variant at runtime by reading the chip_id register at GRF
> offset 0x800 (0xcea = RK3308, 0x3308/0x3308c = RK3308B), as requested
> by reviewers of the earlier series.
> When RK3308B is detected, swap in the correct mux_recalced and mux_route
> tables and write the sel_src_ctrl bits to ensure the 3-bit mux registers
> are active.
>
> This is a rework of Dmitry Yashin's series [1] which used a separate
> device tree compatible string ("rockchip,rk3308b-pinctrl") to
> distinguish the variants.
> Reviewers Luca Ceresoli and Heiko Stuebner agreed that runtime detection
> was preferable since boards are manufactured with both RK3308 and RK3308B
> using the same device tree.
>
> Jonas Karlman implemented runtime detection based on the GRF_CHIP_ID
> register [2]. Reviewers asked for more changes (constifying some
> arrays), but the series was never resubmitted and was dropped.
>
> I run this patch on my Rock Pi S boards, the newer ones I've got in
> 2024 use the RK3308B. And thanks to runtime detection we should still
> be compatible with older devices (but I couldn't test on RK3308 as I
> don't have any).
>
> [1] https://lore.kernel.org/all/20240515121634.23945-1-dmt.yashin@xxxxxxxxx/
> [2] https://lore.kernel.org/all/20240604141020.21725-1-dmt.yashin@xxxxxxxxx/
>
> Signed-off-by: Hugo VALTIER <hugo@xxxxxxxxxxx>
> ---

Hi Hugo.

Thanks for re-sending the series!
Applied patches to multiple boards and it fixes pinmux
issues for rk3308b-s based boards too (since the approach
kept the same as in v3 series)

Tested-by: Dmitry Yashin <dmt.yashin@xxxxxxxxx>

--
Dmt-Y