* [PATCH v6 1/6] dt-bindings: gpio-mmio: Correct opencores GPIO
2026-01-15 15:09 [PATCH v6 0/6] OpenRISC de0 nano single and multicore boards Stafford Horne
@ 2026-01-15 15:09 ` Stafford Horne
2026-01-18 23:19 ` Linus Walleij
0 siblings, 1 reply; 5+ messages in thread
From: Stafford Horne @ 2026-01-15 15:09 UTC (permalink / raw)
To: LKML
Cc: Linux OpenRISC, devicetree, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Stafford Horne, Geert Uytterhoeven,
Krzysztof Kozlowski, Linus Walleij, Bartosz Golaszewski,
linux-gpio
In commit f48b5e8bc2e1 ("dt-bindings: gpio-mmio: Add compatible string
for opencores,gpio") we marked opencores,gpio to be allowed with
brcm,bcm6345-gpio. This was wrong, opencores,gpio is not compatible with
brcm,bcm6345-gpio. It has a different register map and is 8-bit vs
Broadcom which is 32-bit. Change opencores,gpio to be a separate
compatible string for MMIO GPIO.
Also, as this change rewrote the entire enum, I took this opportunity to
alphabetically sort the list.
Fixes: f48b5e8bc2e1 ("dt-bindings: gpio-mmio: Add compatible string for opencores,gpio")
Signed-off-by: Stafford Horne <shorne@gmail.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
Since v5:
- Updated comment based on comments from Krzysztof and Geert.
- Added reviewed-by's.
- Sorted the enum list and added not to commit message based on comment
from Krzysztof.
Since v4:
- New patch.
- Rebased old patch and rewrote commit message.
.../devicetree/bindings/gpio/gpio-mmio.yaml | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml b/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
index 7ee40b9bc562..1b2d253b19c1 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
+++ b/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
@@ -18,16 +18,12 @@ description:
properties:
compatible:
- oneOf:
- - enum:
- - brcm,bcm6345-gpio
- - ni,169445-nand-gpio
- - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller
- - intel,ixp4xx-expansion-bus-mmio-gpio
- - items:
- - enum:
- - opencores,gpio
- - const: brcm,bcm6345-gpio
+ enum:
+ - brcm,bcm6345-gpio
+ - intel,ixp4xx-expansion-bus-mmio-gpio
+ - ni,169445-nand-gpio
+ - opencores,gpio
+ - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller
big-endian: true
--
2.51.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v6 1/6] dt-bindings: gpio-mmio: Correct opencores GPIO
2026-01-15 15:09 ` [PATCH v6 1/6] dt-bindings: gpio-mmio: Correct opencores GPIO Stafford Horne
@ 2026-01-18 23:19 ` Linus Walleij
0 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2026-01-18 23:19 UTC (permalink / raw)
To: Stafford Horne
Cc: LKML, Linux OpenRISC, devicetree, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Krzysztof Kozlowski, Bartosz Golaszewski, linux-gpio
On Thu, Jan 15, 2026 at 4:10 PM Stafford Horne <shorne@gmail.com> wrote:
> In commit f48b5e8bc2e1 ("dt-bindings: gpio-mmio: Add compatible string
> for opencores,gpio") we marked opencores,gpio to be allowed with
> brcm,bcm6345-gpio. This was wrong, opencores,gpio is not compatible with
> brcm,bcm6345-gpio. It has a different register map and is 8-bit vs
> Broadcom which is 32-bit. Change opencores,gpio to be a separate
> compatible string for MMIO GPIO.
>
> Also, as this change rewrote the entire enum, I took this opportunity to
> alphabetically sort the list.
>
> Fixes: f48b5e8bc2e1 ("dt-bindings: gpio-mmio: Add compatible string for opencores,gpio")
> Signed-off-by: Stafford Horne <shorne@gmail.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v6 1/6] dt-bindings: gpio-mmio: Correct opencores GPIO
@ 2026-01-23 14:08 Gary Lau
0 siblings, 0 replies; 5+ messages in thread
From: Gary Lau @ 2026-01-23 14:08 UTC (permalink / raw)
To: Stafford Horne
Cc: linusw, linux-kernel, linux-openrisc, devicetree, robh, krzk+dt,
conor+dt, geert+renesas, krzysztof.kozlowski, brgl, linux-gpio
Hi Stafford,
I've tested the "brcm,bcm6345-gpio" driver with the OpenCores 8-bit GPIO core, and it is working as expected.
For reference, here is the hardware connection logic I used for the OpenRISC to OpenCores GPIO interface:
Verilog:
simple_gpio gpio0 (
.clk_i (clk_i),
.rst_i (rst_i),
.cyc_i (cyc_i & (|sel_i)),
.stb_i (stb_i & (|sel_i)),
.adr_i (adr_i[2]),
.we_i (we_i),
.dat_i (dat_i[7:0]),
.ack_o (ack_o),
.dat_o (dat_o[7:0]),
.gpio (gpio[7:0]),
.gpio_i (gpio_i)
);
And here is the corresponding part of my dts:
gpio0: gpio@91000000 {
compatible = "brcm,bcm6345-gpio";
reg = <0x91000000 0x4>, <0x91000004 0x4>;
reg-names = "dat", "dirout";
gpio-controller;
big-endian;
status = "okay";
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v6 1/6] dt-bindings: gpio-mmio: Correct opencores GPIO
@ 2026-01-23 14:18 Gary Lau
2026-01-24 12:36 ` Stafford Horne
0 siblings, 1 reply; 5+ messages in thread
From: Gary Lau @ 2026-01-23 14:18 UTC (permalink / raw)
To: Stafford Horne
Cc: linusw, linux-kernel, linux-openrisc, devicetree, robh, krzk+dt,
conor+dt, geert+renesas, krzysztof.kozlowski, brgl, linux-gpio
Hi Stafford,
I should clarify my setup: I'm using hardware address translation to make the
OpenCores 8-bit GPIO appear as 32-bit to the CPU. Specifically:
1. Address translation: The CPU's 32-bit addresses are right-shifted by 2 bits
(adr_i[2] in Verilog), so each 32-bit CPU access maps to the correct 8-bit
OpenCores register.
2. Data width adaptation: Only dat_i[7:0] and dat_o[7:0] are connected, so
32-bit writes are truncated to 8-bit, and reads are zero-extended.
This hardware wrapper makes brcm,bcm6345-gpio driver "work" with my OpenCores
GPIO, but it's really a hardware-level compatibility layer, not true software
compatibility.
So you're absolutely right that the native opencores,gpio isn't compatible
with brcm,bcm6345-gpio. My setup works because of custom hardware translation,
not because the IP cores are compatible.
Best regards,
Gary
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v6 1/6] dt-bindings: gpio-mmio: Correct opencores GPIO
2026-01-23 14:18 [PATCH v6 1/6] dt-bindings: gpio-mmio: Correct opencores GPIO Gary Lau
@ 2026-01-24 12:36 ` Stafford Horne
0 siblings, 0 replies; 5+ messages in thread
From: Stafford Horne @ 2026-01-24 12:36 UTC (permalink / raw)
To: Gary Lau
Cc: linusw, linux-kernel, linux-openrisc, devicetree, robh, krzk+dt,
conor+dt, geert+renesas, krzysztof.kozlowski, brgl, linux-gpio
On Fri, Jan 23, 2026 at 10:18:04PM +0800, Gary Lau wrote:
> Hi Stafford,
>
> I should clarify my setup: I'm using hardware address translation to make the
> OpenCores 8-bit GPIO appear as 32-bit to the CPU. Specifically:
>
> 1. Address translation: The CPU's 32-bit addresses are right-shifted by 2 bits
> (adr_i[2] in Verilog), so each 32-bit CPU access maps to the correct 8-bit
> OpenCores register.
>
> 2. Data width adaptation: Only dat_i[7:0] and dat_o[7:0] are connected, so
> 32-bit writes are truncated to 8-bit, and reads are zero-extended.
>
> This hardware wrapper makes brcm,bcm6345-gpio driver "work" with my OpenCores
> GPIO, but it's really a hardware-level compatibility layer, not true software
> compatibility.
>
> So you're absolutely right that the native opencores,gpio isn't compatible
> with brcm,bcm6345-gpio. My setup works because of custom hardware translation,
> not because the IP cores are compatible.
Thanks Gary for testing.
-Stafford
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-01-24 12:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-23 14:18 [PATCH v6 1/6] dt-bindings: gpio-mmio: Correct opencores GPIO Gary Lau
2026-01-24 12:36 ` Stafford Horne
-- strict thread matches above, loose matches on Subject: below --
2026-01-23 14:08 Gary Lau
2026-01-15 15:09 [PATCH v6 0/6] OpenRISC de0 nano single and multicore boards Stafford Horne
2026-01-15 15:09 ` [PATCH v6 1/6] dt-bindings: gpio-mmio: Correct opencores GPIO Stafford Horne
2026-01-18 23:19 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox