gpio: Add Cortina Systems CS75xx GPIO driver
Subsystems (2)
v6 cover gpio: Add Cortina Systems CS75xx GPIO driver
The Cortina Systems CS75xx ("Goldengate G2") SoCs have five banks of 32 GPIO lines, each bank with its own interrupt. This series adds the binding and a driver based on gpio-mmio; level and edge triggers are supported, both edges are emulated by flipping the polarity.
Each pin is either a GPIO line or belongs to a peripheral (NAND, Ethernet, UART, I2C, ...). That choice is made in the global control block, which is not part of the GPIO controller: as discussed on v1 [1], the driver does not touch the pin mux and leaves it as the boot loader set it up, until there is a pin controller driver for that block. Testing the reset button on the Securifi Almond+ requires selecting GPIO37 in the global pin mux before gpio-keys is probed; the current boot path does not provide that setup. The tests used a separate, board-specific setup step. The GPIO driver does not program the mux.
The driver used to be part of a series with the interrupt controller, I2C and watchdog drivers and the device tree changes. That series is now split per subsystem. The driver depends on OF and the generic MMIO GPIO and IRQ infrastructure, with no dependency on the platform series [2], which is under review separately. The device tree nodes will follow with the other CS75xx dts changes once the platform is merged.
There is no public documentation; the register layout comes from the GPL vendor kernels. Tested on a Securifi Almond+ (CS7542): the reset button (GPIO 37) works as an active-low gpio-keys input, and the SX8650 touchscreen uses a level-triggered GPIO interrupt.
[1] https://lore.kernel.org/all/20261012-dreamlike-hazily-19bb60326f0a@spud/
[2] https://lore.kernel.org/all/[email protected]/
---
Changes in v6:
- replace the dependency on ARCH_CORTINA_ACCESS || COMPILE_TEST with OF, so the GPIO series can be merged independently of the platform series (Bartosz); HAS_IOMEM is inherited from the MMIO GPIO driver menu
- build built-in and modular on ARM and x86-64 with COMPILE_TEST=n, without the platform series; the driver code is unchanged
- Link to v5: https://patch.msgid.link/[email protected]
Changes in v5:
- explain that ARCH_CORTINA_ACCESS is introduced by the platform series; COMPILE_TEST allows building this driver without that series
- correct the pin mux setup required for testing the Almond+ reset button
- clear the interrupt status after changing the trigger type, so that unmasking an edge interrupt does not fire a stale event (sashiko-bot)
- collect Reviewed-by tags; Linus, I kept yours over the one-line change above
- Link to v4: https://patch.msgid.link/[email protected]
Changes in v4:
- rebase on v7.4-rc1
- split out of "Cortina Systems CS75xx: interrupt controller, GPIO, I2C and TWD watchdog" so that each driver can go through its own tree; no longer based on the platform series
- the pin mux registers are not part of the GPIO controller (Conor): the binding has a single reg entry and the driver no longer switches the
pin mux when a line is requested
(Rob, your Reviewed-by on v3 is not carried because of this change)
- switch a line to input for an interrupt only when it is not requested; flip the polarity of a both-edges line after the ack, so that an edge
in between is not lost (sashiko-bot)
- drop the gpio_chip owner, gpiolib sets it; sort the Makefile entry
- Link to v3: https://patch.msgid.link/[email protected]
Changes in v3:
- rebase on v6 of the platform series
- Link to v2: https://patch.msgid.link/[email protected]
Changes in v2:
- rebase on v5 of the platform series
- do not include <linux/mod_devicetable.h> (Uwe)
- update the both-edges mask only for a valid trigger type and test it under the lock in the interrupt handler; refuse more than 32 lines (sashiko-bot)
- Link to v1: https://patch.msgid.link/[email protected]
To: Linus Walleij <[email protected]>
To: Bartosz Golaszewski <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
Fil Dunsky (2):
dt-bindings: gpio: Add Cortina Systems CS7542 GPIO controller
gpio: Add Cortina Systems CS75xx GPIO driver
.../bindings/gpio/cortina,cs7542-gpio.yaml | 65 +++++ drivers/gpio/Kconfig | 12 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-cs75xx.c | 283 +++++++++++++++++++++ 4 files changed, 361 insertions(+)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261015-cs75xx-gpio-ed0a37ee4a68
Best regards,
Signature · 1 line
Fil Dunsky <[email protected]>
PATCH v6 1/2 dt-bindings: gpio: Add Cortina Systems CS7542 GPIO controller
The Cortina Systems CS75xx SoCs have five banks of 32 GPIO lines. Each pin is shared between a GPIO line and a peripheral function; the pin mux lives in the global control block and is not described here.
--- .../bindings/gpio/cortina,cs7542-gpio.yaml | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+)
Documentation/devicetree/bindings/gpio/cortina,cs7542-gpio.yaml new file +65 -0
@@ -0,0 +1,65 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/gpio/cortina,cs7542-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Cortina Systems CS7542 GPIO controller + +maintainers: + - Fil Dunsky <[email protected]> + +description: + The Cortina Systems CS75xx (Goldengate G2) SoCs have five banks of 32 + GPIO lines, each with its own interrupt. Every pin is shared between a + GPIO line and a peripheral function; the choice is made in the global + control block and is not part of the GPIO controller. + +properties: + compatible: + const: cortina,cs7542-gpio + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + gpio-controller: true + + "#gpio-cells": + const: 2 + + gpio-line-names: + maxItems: 32 + + gpio-reserved-ranges: true + + interrupt-controller: true + + "#interrupt-cells": + const: 2 + +required: + - compatible + - reg + - interrupts + - gpio-controller + - "#gpio-cells" + - interrupt-controller + - "#interrupt-cells" + +additionalProperties: false + +examples: + - | + gpio@f00701f0 { + compatible = "cortina,cs7542-gpio"; + reg = <0xf00701f0 0x20>; + interrupt-parent = <&intc>; + interrupts = <7>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + };
Signature · 1 line
2.53.0
Re: [PATCH v6 1/2] dt-bindings: gpio: Add Cortina Systems CS7542 GPIO controller
Quoted 8 lines · On Thu, Nov 19, 2026 at 4:09 PM Fil Dunsky via B4 Relay…
From: Fil Dunsky <[email protected]>
The Cortina Systems CS75xx SoCs have five banks of 32 GPIO lines. Each pin is shared between a GPIO line and a peripheral function; the pin mux lives in the global control block and is not described here.
Reviewed-by Krzysztof Kozlowski <[email protected]>Signed-off-by Fil Dunsky <[email protected]>
Yours,
Linus Walleij
PATCH v6 2/2 gpio: Add Cortina Systems CS75xx GPIO driver
In reply to Fil DunskyAdd a driver for the GPIO banks of the Cortina Systems CS75xx SoCs. The data and direction registers are handled by gpio-mmio; each bank has its own interrupt with level and edge triggers, both edges are emulated by flipping the polarity.
A pin only works as a GPIO when the pin mux in the global control block selects the GPIO function. That is not part of the GPIO controller and is left to the boot loader until there is a pin controller driver.
The driver depends on OF and generic MMIO GPIO and IRQ support, so it can be enabled independently of the CS75xx platform series.
--- drivers/gpio/Kconfig | 12 ++ drivers/gpio/Makefile | 1 + drivers/gpio/gpio-cs75xx.c | 283 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 296 insertions(+)
drivers/gpio/Kconfig +12 -0
@@ -300,6 +300,18 @@ config GPIO_CLPS711X help Say yes here to support GPIO on CLPS711X SoCs. +config GPIO_CS75XX + tristate "Cortina Systems CS75xx GPIO support" + depends on OF + select GPIO_GENERIC + select GPIOLIB_IRQCHIP + help + Say yes here to support the GPIO banks of the Cortina Systems + CS75xx SoCs, including their interrupts. + + This driver can also be built as a module. If so, the module + will be called gpio-cs75xx. + config GPIO_DAVINCI tristate "TI Davinci/Keystone GPIO support" default y if ARCH_DAVINCI
drivers/gpio/Makefile +1 -0
@@ -60,6 +60,7 @@ obj-$(CONFIG_GPIO_SNPS_CREG) += gpio-creg-snps.o obj-$(CONFIG_GPIO_CROS_EC) += gpio-cros-ec.o obj-$(CONFIG_GPIO_CRYSTAL_COVE) += gpio-crystalcove.o obj-$(CONFIG_GPIO_CS5535) += gpio-cs5535.o +obj-$(CONFIG_GPIO_CS75XX) += gpio-cs75xx.o obj-$(CONFIG_GPIO_DA9052) += gpio-da9052.o obj-$(CONFIG_GPIO_DA9055) += gpio-da9055.o obj-$(CONFIG_GPIO_DAVINCI) += gpio-davinci.o
drivers/gpio/gpio-cs75xx.c new file +283 -0
283 lines not on this page · raw message
Signature · 1 line
2.53.0
Bartosz Golaszewski
AppliedQuoted 15 lines · Fil Dunsky
The Cortina Systems CS75xx ("Goldengate G2") SoCs have five banks of 32 GPIO lines, each bank with its own interrupt. This series adds the binding and a driver based on gpio-mmio; level and edge triggers are supported, both edges are emulated by flipping the polarity.
Each pin is either a GPIO line or belongs to a peripheral (NAND, Ethernet, UART, I2C, ...). That choice is made in the global control block, which is not part of the GPIO controller: as discussed on v1 [1], the driver does not touch the pin mux and leaves it as the boot loader set it up, until there is a pin controller driver for that block. Testing the reset button on the Securifi Almond+ requires selecting GPIO37 in the global pin mux before gpio-keys is probed; the current boot path does not provide that setup. The tests used a separate, board-specific setup step. The GPIO driver does not program the mux.
Quoted 1 line
[...]
Applied, thanks!
[1/2] dt-bindings: gpio: Add Cortina Systems CS7542 GPIO controller
https://git.kernel.org/brgl/c/9413109c1005d207ec6cc3edad820d671c4d73a3 [2/2] gpio: Add Cortina Systems CS75xx GPIO driver https://git.kernel.org/brgl/c/26a9a31378673ae7da0f2dbc706e2c72628405be
Best regards,
Signature · 1 line
Bartosz Golaszewski <[email protected]>