From d9118ca1c2ccde17495dec507f2f641fd9a2f8b5 Mon Sep 17 00:00:00 2001 From: Nicolai Buchwitz Date: Tue, 28 Jul 2026 22:20:21 +0200 Subject: [PATCH 1/3] arm64: dts: rp1: Mux SPI chip-select pins as GPIO The spi0 and spi8 CS groups mux their pins to the peripheral function while the pins are actually driven via cs-gpios. Under strict pinmux the overlapping function and GPIO claims are rejected and the SPI host fails to probe. Mux them as GPIO to match how they are used. Signed-off-by: Nicolai Buchwitz --- arch/arm64/boot/dts/broadcom/rp1.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/broadcom/rp1.dtsi b/arch/arm64/boot/dts/broadcom/rp1.dtsi index 8847c32e1019f9..4c2a06cb85e86c 100644 --- a/arch/arm64/boot/dts/broadcom/rp1.dtsi +++ b/arch/arm64/boot/dts/broadcom/rp1.dtsi @@ -930,7 +930,7 @@ }; rp1_spi0_cs_gpio7: rp1_spi0_cs_gpio7 { - function = "spi0"; + function = "gpio"; pins = "gpio7", "gpio8"; bias-pull-up; }; @@ -984,7 +984,7 @@ }; rp1_spi8_cs_gpio52: rp1_spi8_cs_gpio52 { - function = "spi0"; + function = "gpio"; pins = "gpio52", "gpio53"; bias-pull-up; }; From 98ef53ce9bb0203a59eb3946c94a0254e9f3f820 Mon Sep 17 00:00:00 2001 From: Nicolai Buchwitz Date: Sun, 26 Jul 2026 00:33:55 +0200 Subject: [PATCH 2/3] pinctrl: rp1: enable strict pinmux mode Pins claimed for a peripheral function can be taken over through the GPIO chardev, which rewrites FUNCSEL. On Pi 5 reading the USB overcurrent pin this way trips the overcurrent latch and disables all USB ports, and requesting GPIO 42 as output cuts VBUS entirely. Enable strict pinmux so GPIO requests on function pins are rejected. Implement function_is_gpio so pins muxed as GPIO, including hogs and legacy brcm,function maps, stay requestable. This matches the BCM2712 pinctrl-brcmstb driver. Link: https://github.com/raspberrypi/linux/issues/5870 Signed-off-by: Nicolai Buchwitz --- drivers/pinctrl/pinctrl-rp1.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/pinctrl/pinctrl-rp1.c b/drivers/pinctrl/pinctrl-rp1.c index 7e8f5f600ea495..60143d876ecf86 100644 --- a/drivers/pinctrl/pinctrl-rp1.c +++ b/drivers/pinctrl/pinctrl-rp1.c @@ -1333,6 +1333,12 @@ static int rp1_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, return 0; } +static bool rp1_pmx_function_is_gpio(struct pinctrl_dev *pctldev, + unsigned int selector) +{ + return selector == func_gpio; +} + static const struct pinmux_ops rp1_pmx_ops = { .free = rp1_pmx_free, .get_functions_count = rp1_pmx_get_functions_count, @@ -1341,6 +1347,8 @@ static const struct pinmux_ops rp1_pmx_ops = { .set_mux = rp1_pmx_set, .gpio_disable_free = rp1_pmx_gpio_disable_free, .gpio_set_direction = rp1_pmx_gpio_set_direction, + .function_is_gpio = rp1_pmx_function_is_gpio, + .strict = true, }; static void rp1_pull_config_set(struct rp1_pin_info *pin, unsigned int arg) From f0d34ae7f110278876830ca1ffeb7284308b79f2 Mon Sep 17 00:00:00 2001 From: Nicolai Buchwitz Date: Sat, 25 Jul 2026 23:46:32 +0200 Subject: [PATCH 3/3] pinctrl: rp1: Fix node leak and mapping check in probe Drop the leaked rp1_node reference and test of_iomap() for NULL instead of IS_ERR(), which never matches its return value. Fixes: df868dcd8b11 ("pinctrl: Reinstate the downstream pinctrl-rp1 driver") Signed-off-by: Nicolai Buchwitz --- drivers/pinctrl/pinctrl-rp1.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/pinctrl-rp1.c b/drivers/pinctrl/pinctrl-rp1.c index 60143d876ecf86..e26835a4e478fa 100644 --- a/drivers/pinctrl/pinctrl-rp1.c +++ b/drivers/pinctrl/pinctrl-rp1.c @@ -1612,11 +1612,10 @@ static int rp1_pinctrl_probe(struct platform_device *pdev) else if (pace_pin_updates && of_device_is_compatible(rp1_node->parent, "brcm,bcm2712-pcie")) { pc->dummy_base = of_iomap(rp1_node->parent, 0); - if (IS_ERR(pc->dummy_base)) { + if (!pc->dummy_base) dev_warn(&pdev->dev, "could not map bcm2712 root complex registers\n"); - pc->dummy_base = NULL; - } } + of_node_put(rp1_node); for (i = 0; i < RP1_NUM_BANKS; i++) { const struct rp1_iobank_desc *bank = &rp1_iobanks[i];