From: Andrea della Porta <andrea.porta@suse.com>
To: linus.walleij@linaro.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, florian.fainelli@broadcom.com,
wahrenst@gmx.net, linux-gpio@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
iivanov@suse.de, svarbanov@suse.de, mbrugger@suse.com,
Jonathan Bell <jonathan@raspberrypi.com>,
Phil Elwell <phil@raspberrypi.com>
Cc: Andrea della Porta <andrea.porta@suse.com>
Subject: [PATCH v4 0/3] Add pin control driver for BCM2712 SoC
Date: Thu, 28 Aug 2025 14:47:37 +0200 [thread overview]
Message-ID: <cover.1756372805.git.andrea.porta@suse.com> (raw)
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
next reply other threads:[~2025-08-28 12:45 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-28 12:47 Andrea della Porta [this message]
2025-08-28 12:47 ` [PATCH v4 1/3] dt-bindings: pinctrl: Add support for Broadcom STB pin controller Andrea della Porta
2025-08-29 17:59 ` Rob Herring
2025-09-01 8:43 ` Andrea della Porta
2025-09-04 18:58 ` Linus Walleij
2025-09-05 8:36 ` Andrea della Porta
2025-08-28 12:47 ` [PATCH v4 2/3] pinctrl: bcm: Add STB family pin controller driver Andrea della Porta
2025-08-28 21:14 ` Linus Walleij
2025-09-01 8:21 ` Linus Walleij
2025-09-01 8:39 ` Andrea della Porta
2025-09-01 15:51 ` Florian Fainelli
2025-09-04 19:06 ` Linus Walleij
2025-09-04 19:15 ` Florian Fainelli
2025-09-05 8:35 ` Andrea della Porta
2025-08-28 12:47 ` [PATCH v4 3/3] arm64: defconfig: Enable BCM2712 on-chip " Andrea della Porta
2025-08-28 17:19 ` Florian Fainelli
2025-08-29 8:48 ` Andrea della Porta
2025-09-04 21:02 ` Florian Fainelli
2025-09-03 6:58 ` [PATCH v4 0/3] Add pin control driver for BCM2712 SoC Linus Walleij
2025-09-03 8:00 ` Andrea della Porta
2025-09-04 19:17 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1756372805.git.andrea.porta@suse.com \
--to=andrea.porta@suse.com \
--cc=catalin.marinas@arm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=florian.fainelli@broadcom.com \
--cc=iivanov@suse.de \
--cc=jonathan@raspberrypi.com \
--cc=krzk+dt@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=mbrugger@suse.com \
--cc=phil@raspberrypi.com \
--cc=robh@kernel.org \
--cc=svarbanov@suse.de \
--cc=wahrenst@gmx.net \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).