linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] gpio: mmio: Support IXP4xx expansion bus MMIO GPIO
@ 2025-08-20 10:59 Linus Walleij
  2025-08-20 10:59 ` [PATCH 1/4] dt-bindings: gpio-mmio: Support hogs Linus Walleij
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Linus Walleij @ 2025-08-20 10:59 UTC (permalink / raw)
  To: Bartosz Golaszewski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Linus Walleij, Imre Kaloz, Krzysztof Kozlowski
  Cc: linux-gpio, devicetree, Linus Walleij

After Florian reminded me to do things properly, here are
fixups and additions to the MMIO GPIO bindings and a
tie-in to the IXP4xx expansion bus memory controller.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Linus Walleij (4):
      dt-bindings: gpio-mmio: Support hogs
      dt-bindings: Add bank width to Intel IXP4xx memory controller
      dt-bindings: gpio-mmio: Add MMIO for IXP4xx expansion bus
      gpio: mmio: Add compatible for the ixp4xx eb MMIO

 .../devicetree/bindings/gpio/gpio-mmio.yaml        | 37 +++++++++++++++++++++-
 .../intel,ixp4xx-expansion-peripheral-props.yaml   |  5 +++
 drivers/gpio/gpio-mmio.c                           |  1 +
 3 files changed, 42 insertions(+), 1 deletion(-)
---
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
change-id: 20250820-ixp4xx-eb-mmio-gpio-80884f67aa67

Best regards,
-- 
Linus Walleij <linus.walleij@linaro.org>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/4] dt-bindings: gpio-mmio: Support hogs
  2025-08-20 10:59 [PATCH 0/4] gpio: mmio: Support IXP4xx expansion bus MMIO GPIO Linus Walleij
@ 2025-08-20 10:59 ` Linus Walleij
  2025-08-22 14:24   ` Rob Herring (Arm)
  2025-08-20 10:59 ` [PATCH 2/4] dt-bindings: Add bank width to Intel IXP4xx memory controller Linus Walleij
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2025-08-20 10:59 UTC (permalink / raw)
  To: Bartosz Golaszewski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Linus Walleij, Imre Kaloz, Krzysztof Kozlowski
  Cc: linux-gpio, devicetree, Linus Walleij

We use hogs on some MMIO GPIO controllers so make sure the
bindings support this using a pattern property.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 Documentation/devicetree/bindings/gpio/gpio-mmio.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml b/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
index 87e986386f32a4a8ba257d6a4d8da492b05d5bbf..ca32317dff85bc72aace6638dabbdd91de5e569b 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
+++ b/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
@@ -89,6 +89,12 @@ properties:
     description:
       If this property is present, the controller cannot drive the GPIO lines.
 
+patternProperties:
+  "^.+-hog(-[0-9]+)?$":
+    type: object
+    required:
+      - gpio-hog
+
 required:
   - compatible
   - reg

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/4] dt-bindings: Add bank width to Intel IXP4xx memory controller
  2025-08-20 10:59 [PATCH 0/4] gpio: mmio: Support IXP4xx expansion bus MMIO GPIO Linus Walleij
  2025-08-20 10:59 ` [PATCH 1/4] dt-bindings: gpio-mmio: Support hogs Linus Walleij
@ 2025-08-20 10:59 ` Linus Walleij
  2025-08-22 14:26   ` Rob Herring
  2025-08-20 10:59 ` [PATCH 3/4] dt-bindings: gpio-mmio: Add MMIO for IXP4xx expansion bus Linus Walleij
  2025-08-20 10:59 ` [PATCH 4/4] gpio: mmio: Add compatible for the ixp4xx eb MMIO Linus Walleij
  3 siblings, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2025-08-20 10:59 UTC (permalink / raw)
  To: Bartosz Golaszewski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Linus Walleij, Imre Kaloz, Krzysztof Kozlowski
  Cc: linux-gpio, devicetree, Linus Walleij

This bank width is necessary to set up the memory controller
properly unless the peripheral is using native bank width.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 .../memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml  | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml b/Documentation/devicetree/bindings/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml
index d1479a7b9c8df4dbefc24a4706b1fecdda37bc6a..e306344373c5cd5c1bc6f4001d1252d8d0485f60 100644
--- a/Documentation/devicetree/bindings/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml
+++ b/Documentation/devicetree/bindings/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml
@@ -15,6 +15,11 @@ maintainers:
   - Linus Walleij <linus.walleij@linaro.org>
 
 properties:
+  bank-width:
+    description: Width (in bytes) of the device on the chip select bank.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [ 1, 2, 4 ]
+
   intel,ixp4xx-eb-t1:
     description: Address timing, extend address phase with n cycles.
     $ref: /schemas/types.yaml#/definitions/uint32

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/4] dt-bindings: gpio-mmio: Add MMIO for IXP4xx expansion bus
  2025-08-20 10:59 [PATCH 0/4] gpio: mmio: Support IXP4xx expansion bus MMIO GPIO Linus Walleij
  2025-08-20 10:59 ` [PATCH 1/4] dt-bindings: gpio-mmio: Support hogs Linus Walleij
  2025-08-20 10:59 ` [PATCH 2/4] dt-bindings: Add bank width to Intel IXP4xx memory controller Linus Walleij
@ 2025-08-20 10:59 ` Linus Walleij
  2025-08-22 14:27   ` Rob Herring (Arm)
  2025-08-20 10:59 ` [PATCH 4/4] gpio: mmio: Add compatible for the ixp4xx eb MMIO Linus Walleij
  3 siblings, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2025-08-20 10:59 UTC (permalink / raw)
  To: Bartosz Golaszewski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Linus Walleij, Imre Kaloz, Krzysztof Kozlowski
  Cc: linux-gpio, devicetree, Linus Walleij

This expansion is a simple MMIO-mapped GPIO device but the bus has a
number of additional properties that we need to bring in using
a reference to the bus child node schema.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 .../devicetree/bindings/gpio/gpio-mmio.yaml        | 31 +++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml b/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
index ca32317dff85bc72aace6638dabbdd91de5e569b..487efab2710e02402ef8ca3e407b6ebc24e3f399 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
+++ b/Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
@@ -22,6 +22,7 @@ properties:
       - brcm,bcm6345-gpio
       - ni,169445-nand-gpio
       - wd,mbl-gpio # Western Digital MyBook Live memory-mapped GPIO controller
+      - intel,ixp4xx-expansion-bus-mmio-gpio
 
   big-endian: true
 
@@ -89,6 +90,14 @@ properties:
     description:
       If this property is present, the controller cannot drive the GPIO lines.
 
+if:
+  properties:
+    compatible:
+      contains:
+        const: intel,ixp4xx-expansion-bus-mmio-gpio
+then:
+  $ref: /schemas/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml#
+
 patternProperties:
   "^.+-hog(-[0-9]+)?$":
     type: object
@@ -102,7 +111,7 @@ required:
   - '#gpio-cells'
   - gpio-controller
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
@@ -132,3 +141,23 @@ examples:
       gpio-controller;
       #gpio-cells = <2>;
     };
+
+    bus@c4000000 {
+        compatible = "intel,ixp42x-expansion-bus-controller", "syscon";
+        reg = <0xc4000000 0x30>;
+        native-endian;
+        #address-cells = <2>;
+        #size-cells = <1>;
+        ranges = <0 0x0 0x50000000 0x01000000>;
+        dma-ranges = <0 0x0 0x50000000 0x01000000>;
+        gpio@1,0 {
+            compatible = "intel,ixp4xx-expansion-bus-mmio-gpio";
+            gpio-controller;
+            #gpio-cells = <2>;
+            bank-width = <2>;
+            big-endian;
+            reg = <1 0x00000000 0x2>;
+            reg-names = "dat";
+            intel,ixp4xx-eb-write-enable = <1>;
+        };
+    };

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/4] gpio: mmio: Add compatible for the ixp4xx eb MMIO
  2025-08-20 10:59 [PATCH 0/4] gpio: mmio: Support IXP4xx expansion bus MMIO GPIO Linus Walleij
                   ` (2 preceding siblings ...)
  2025-08-20 10:59 ` [PATCH 3/4] dt-bindings: gpio-mmio: Add MMIO for IXP4xx expansion bus Linus Walleij
@ 2025-08-20 10:59 ` Linus Walleij
  3 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2025-08-20 10:59 UTC (permalink / raw)
  To: Bartosz Golaszewski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Linus Walleij, Imre Kaloz, Krzysztof Kozlowski
  Cc: linux-gpio, devicetree, Linus Walleij

The IXP4xx expansion bus can have simple memory-mapped GPIO
on it. Using the proper device tree bindings, support probing
this directly from the device tree.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-mmio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpio/gpio-mmio.c b/drivers/gpio/gpio-mmio.c
index 021ad62778c2f49f0819b767a60112945999f572..79e1be149c94842cb6fa6b657343b11e78701220 100644
--- a/drivers/gpio/gpio-mmio.c
+++ b/drivers/gpio/gpio-mmio.c
@@ -730,6 +730,7 @@ static const struct of_device_id bgpio_of_match[] = {
 	{ .compatible = "brcm,bcm6345-gpio" },
 	{ .compatible = "wd,mbl-gpio" },
 	{ .compatible = "ni,169445-nand-gpio" },
+	{ .compatible = "intel,ixp4xx-expansion-bus-mmio-gpio" },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, bgpio_of_match);

-- 
2.50.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] dt-bindings: gpio-mmio: Support hogs
  2025-08-20 10:59 ` [PATCH 1/4] dt-bindings: gpio-mmio: Support hogs Linus Walleij
@ 2025-08-22 14:24   ` Rob Herring (Arm)
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring (Arm) @ 2025-08-22 14:24 UTC (permalink / raw)
  To: Linus Walleij
  Cc: linux-gpio, Krzysztof Kozlowski, Linus Walleij, devicetree,
	Bartosz Golaszewski, Conor Dooley, Imre Kaloz,
	Krzysztof Kozlowski


On Wed, 20 Aug 2025 12:59:43 +0200, Linus Walleij wrote:
> We use hogs on some MMIO GPIO controllers so make sure the
> bindings support this using a pattern property.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  Documentation/devicetree/bindings/gpio/gpio-mmio.yaml | 6 ++++++
>  1 file changed, 6 insertions(+)
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/4] dt-bindings: Add bank width to Intel IXP4xx memory controller
  2025-08-20 10:59 ` [PATCH 2/4] dt-bindings: Add bank width to Intel IXP4xx memory controller Linus Walleij
@ 2025-08-22 14:26   ` Rob Herring
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring @ 2025-08-22 14:26 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Bartosz Golaszewski, Krzysztof Kozlowski, Conor Dooley,
	Linus Walleij, Imre Kaloz, Krzysztof Kozlowski, linux-gpio,
	devicetree

On Wed, Aug 20, 2025 at 12:59:44PM +0200, Linus Walleij wrote:
> This bank width is necessary to set up the memory controller
> properly unless the peripheral is using native bank width.

What's the native width?

> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  .../memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml  | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml b/Documentation/devicetree/bindings/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml
> index d1479a7b9c8df4dbefc24a4706b1fecdda37bc6a..e306344373c5cd5c1bc6f4001d1252d8d0485f60 100644
> --- a/Documentation/devicetree/bindings/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml
> +++ b/Documentation/devicetree/bindings/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml
> @@ -15,6 +15,11 @@ maintainers:
>    - Linus Walleij <linus.walleij@linaro.org>
>  
>  properties:
> +  bank-width:
> +    description: Width (in bytes) of the device on the chip select bank.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [ 1, 2, 4 ]
> +

Is there a default? If so, we should be able to omit that width.

>    intel,ixp4xx-eb-t1:
>      description: Address timing, extend address phase with n cycles.
>      $ref: /schemas/types.yaml#/definitions/uint32
> 
> -- 
> 2.50.1
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/4] dt-bindings: gpio-mmio: Add MMIO for IXP4xx expansion bus
  2025-08-20 10:59 ` [PATCH 3/4] dt-bindings: gpio-mmio: Add MMIO for IXP4xx expansion bus Linus Walleij
@ 2025-08-22 14:27   ` Rob Herring (Arm)
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Herring (Arm) @ 2025-08-22 14:27 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Conor Dooley, Linus Walleij, devicetree, Imre Kaloz, linux-gpio,
	Bartosz Golaszewski, Krzysztof Kozlowski, Krzysztof Kozlowski


On Wed, 20 Aug 2025 12:59:45 +0200, Linus Walleij wrote:
> This expansion is a simple MMIO-mapped GPIO device but the bus has a
> number of additional properties that we need to bring in using
> a reference to the bus child node schema.
> 
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  .../devicetree/bindings/gpio/gpio-mmio.yaml        | 31 +++++++++++++++++++++-
>  1 file changed, 30 insertions(+), 1 deletion(-)
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2025-08-22 14:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-20 10:59 [PATCH 0/4] gpio: mmio: Support IXP4xx expansion bus MMIO GPIO Linus Walleij
2025-08-20 10:59 ` [PATCH 1/4] dt-bindings: gpio-mmio: Support hogs Linus Walleij
2025-08-22 14:24   ` Rob Herring (Arm)
2025-08-20 10:59 ` [PATCH 2/4] dt-bindings: Add bank width to Intel IXP4xx memory controller Linus Walleij
2025-08-22 14:26   ` Rob Herring
2025-08-20 10:59 ` [PATCH 3/4] dt-bindings: gpio-mmio: Add MMIO for IXP4xx expansion bus Linus Walleij
2025-08-22 14:27   ` Rob Herring (Arm)
2025-08-20 10:59 ` [PATCH 4/4] gpio: mmio: Add compatible for the ixp4xx eb MMIO Linus Walleij

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).