[PATCH v4 0/3] Add pin control driver for BCM2712 SoC
Andrea della Porta
andrea.porta at suse.com
Thu Aug 28 05:47:37 PDT 2025
Hi,
The following patches add a pin control driver for the BCM2712 SoC.
Device driver is follow up version on what Andrea posted in April [1].
It is based on sources from here [2]. Since its first inception, this
patchset has undergone heavy rework in order to split the driver in a
generic core API useful for several STB pin controller and a specific
implementation for BCM2712 SoC found on RaspberryPi 5.
A separate patchset will add peripheral nodes that rely on the SoC pin
controller to setup and config the pins.
All this have been tested as kernel was directly booted RPi5 via
kernel= config.txt option and cmdline.txt file with following content
(Note I am using Tumbleweed RPi raw images)
$ cat /boot/efi/cmdline.txt
root=/dev/mmcblk0p3 rootwait rw systemd.show_status=1 console=tty ignore_loglevel earlycon console=ttyAMA10,115200
With all these patches Bluetooth and Wifi are working fine (tm) with
firmware files provided by openSUSE Tumbleweed.
All comments and suggestions are welcome!
Happy hacking!
Ivan and Andrea
[1] https://lore.kernel.org/lkml/f6601f73-cb22-4ba3-88c5-241be8421fc3@broadcom.com/
[2] https://github.com/raspberrypi/linux/blob/rpi-6.6.y/drivers/pinctrl/bcm/pinctrl-bcm2712.c
[3] https://lore.kernel.org/lkml/20240605120712.3523290-1-florian.fainelli@broadcom.com/#t
[4] https://lore.kernel.org/all/bfc60a7e-54d2-48a6-a288-4fe76d66507a@gmx.net/
CHANGES in V4:
--- DT BINDINGS ---
- brcm,bcm2712c0-pinctrl.yaml: added blank lines between paragraphs in
descriptions.
- brcm,bcm2712c0-pinctrl.yaml: descriptions are now layout in the same
order everywhere.
--- DRIVER ---
- pinctrl-brcmstb.c: this is now the core driver that will manage the
generic functions of any STB pin controller. The new pinctrl-brcmstb.h
header contains the APIs that can be leveraged by specific implementations.
I've applied quite a conservative approach in determining what is generic
and what is not. It's easier to specialize some generic code when we
need it that the other way around.
- pinctrl-brcmstb.h: new file! Header contains the APIs that can be leveraged
by specific implementations.
- pinctrl-brcmstb-bcm2712.c: new file! The custom implementation for BCM2712
SoC. It specifies the pinsi/functions for this chipset and calls the probe
function from the core driver. Some values are now set from this file
since they are considered chip-specific, e.g. func_mask, func_gpio and
func_names.
- PIN macro renamed to BRCMSTB_PIN.
- enum brcmstb_funcs renamed to bcm2712_funcs.
- avoid wrapping some lines above 80 char containing GPIO declarations for
the sake of readability.
- renamed the chipset specific structs from brcmst_* to bcm2712_*.
- AGPIO_* renamed to AON_GPIO_* and SGPIO_* to AON_SGPIO_*.
- FUNC macro renamed to BRCMSTB_FUNC.
- brcmstb_reg_rd() and brcmstb_reg_wr() have been inlined, substituted by
their inner implementation based on readl/writel.
- spin_lock_* replaced by guards. Asa a result, the flags var definition
is dropped.
- implemented .function_is_gpio() in pinmux_ops. As a result, this driver
is marked as strict.
- used of_device_get_match_data() directly in place of retrieving it through
of_match_node()->data;
- added a comment to better specify the differences between AGPIO and SGPIO.
--- KBUILD ---
- Kconfig.stb: new file! to be included by top level Kconfig to enable
the Broadcom STB specific drivers (e.g. BCM2712 pin controller). Enabled
only if PINCTRL_BRCMSTB is enabled from top level.
- Kconfig: amended to enable the generic support for Broadcom STB pin
controller family. Includes Kconfig.stb.
- Makefile: added pinctrl-brcmstb-bcm2712.o
Andrea della Porta (1):
arm64: defconfig: Enable BCM2712 on-chip pin controller driver
Ivan T. Ivanov (2):
dt-bindings: pinctrl: Add support for Broadcom STB pin controller
pinctrl: bcm: Add STB family pin controller driver
.../pinctrl/brcm,bcm2712c0-pinctrl.yaml | 137 ++++
arch/arm64/configs/defconfig | 2 +
drivers/pinctrl/bcm/Kconfig | 12 +
drivers/pinctrl/bcm/Kconfig.stb | 10 +
drivers/pinctrl/bcm/Makefile | 2 +
drivers/pinctrl/bcm/pinctrl-brcmstb-bcm2712.c | 747 ++++++++++++++++++
drivers/pinctrl/bcm/pinctrl-brcmstb.c | 442 +++++++++++
drivers/pinctrl/bcm/pinctrl-brcmstb.h | 93 +++
8 files changed, 1445 insertions(+)
create mode 100644 Documentation/devicetree/bindings/pinctrl/brcm,bcm2712c0-pinctrl.yaml
create mode 100644 drivers/pinctrl/bcm/Kconfig.stb
create mode 100644 drivers/pinctrl/bcm/pinctrl-brcmstb-bcm2712.c
create mode 100644 drivers/pinctrl/bcm/pinctrl-brcmstb.c
create mode 100644 drivers/pinctrl/bcm/pinctrl-brcmstb.h
--
2.35.3
More information about the linux-arm-kernel
mailing list