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

Hugo VALTIER posted 3 patches 1 week ago
drivers/pinctrl/pinctrl-rockchip.c | 266 ++++++++++++++++++++++++++---
drivers/pinctrl/pinctrl-rockchip.h |   5 +-
2 files changed, 250 insertions(+), 21 deletions(-)
[PATCH 0/3] pinctrl: rockchip: add support for RK3308B SoC
Posted by Hugo VALTIER 1 week ago
The RK3308B is a silicon revision of the RK3308 with a different iomux
register layout: several pins (GPIO2_A2, GPIO2_A3, GPIO2_C0, GPIO3_B2,
GPIO3_B3) gained 3-bit mux fields in new GRF registers that override
the original 2-bit fields. I believe the bootloader enables the new
registers via the sel_src_ctrl bits, after which the kernel's writes
to the old iomux registers are silently ignored. Whatever the exact
mechanism, on RK3308B boards (e.g. current Radxa ROCK Pi S revisions)
SPI1, I2C3 and other peripherals on the affected pins are
non-functional without this series.

This is a continuation of Dmitry Yashin's series from 2024 [1], which
was never resubmitted after review and got dropped. Following the
reviewers' feedback on that series:

- the separate "rockchip,rk3308b-pinctrl" DT compatible is gone;
  the variant is detected at runtime from the GRF chip_id register,
  as suggested by Luca Ceresoli and Heiko Stuebner and prototyped by
  Jonas Karlman [2], so the same DT works on both variants (boards
  ship with either chip)
- the mux_recalced/mux_route tables are constified (patch 1)

Patch 2 is a small refactor so the SoC-specific init can swap the mux
tables before the per-bank masks are computed.

Tested on ROCK Pi S boards with RK3308B silicon, where this fixes
previously dead SPI1. I don't have original-RK3308 hardware, so that
path is compile-tested only; the tables used for RK3308 are unchanged.

[1] https://lore.kernel.org/all/20240515121634.23945-1-dmt.yashin@gmail.com/
[2] https://lore.kernel.org/all/20240604141020.21725-1-dmt.yashin@gmail.com/

Hugo VALTIER (3):
  pinctrl: rockchip: constify mux recalced and route data arrays
  pinctrl: rockchip: extract iomux_recalced_routes_init()
  pinctrl: rockchip: add support for RK3308B SoC

 drivers/pinctrl/pinctrl-rockchip.c | 266 ++++++++++++++++++++++++++---
 drivers/pinctrl/pinctrl-rockchip.h |   5 +-
 2 files changed, 250 insertions(+), 21 deletions(-)


base-commit: a13c140cc289c0b7b3770bce5b3ad42ab35074aa
-- 
2.55.0
Re: [PATCH 0/3] pinctrl: rockchip: add support for RK3308B SoC
Posted by Linus Walleij 7 hours ago
On Fri, Jul 17, 2026 at 9:59 AM Hugo VALTIER <hugo@ahdrone.com> wrote:

> The RK3308B is a silicon revision of the RK3308 with a different iomux
> register layout: several pins (GPIO2_A2, GPIO2_A3, GPIO2_C0, GPIO3_B2,
> GPIO3_B3) gained 3-bit mux fields in new GRF registers that override
> the original 2-bit fields. I believe the bootloader enables the new
> registers via the sel_src_ctrl bits, after which the kernel's writes
> to the old iomux registers are silently ignored. Whatever the exact
> mechanism, on RK3308B boards (e.g. current Radxa ROCK Pi S revisions)
> SPI1, I2C3 and other peripherals on the affected pins are
> non-functional without this series.
>
> This is a continuation of Dmitry Yashin's series from 2024 [1], which
> was never resubmitted after review and got dropped. Following the

No reactions for a week so patches applied.

Any remaining snags can likely be fixed with follow-up patches.

Yours,
Linus Walleij