mbox series

[v5,0/7] gpio: update i.MX93/8ULP and support i.MX95

Message ID 20231001-vf610-gpio-v5-0-8d873a8f224a@nxp.com
Headers show
Series gpio: update i.MX93/8ULP and support i.MX95 | expand

Message

Peng Fan (OSS) Oct. 1, 2023, 8:27 a.m. UTC
From hardware perspective:
- i.MX8ULP/93 GPIO supports two interrupts, 1st for Trustzone non-secure irq,
  2nd for Trustzone secure irq.
- i.MX8ULP/93 only has one register base

The current linux gpio-vf610.c could work with i.MX8ULP/i.MX93, it is
because some trick did in device tree node with offset added to base:
  reg = <0x2d010080 0x1000>, <0x2d010040 0x40>;
But actually the register base should be 0x2d010000.

So i.MX8ULP/93 is not HW compatible with i.MX7ULP.

i.MX93 GPIO is directly derived from i.MX8ULP, so make i.MX93 compatible
with i.MX8ULP. i.MX95 GPIO is same as i.MX93, so also compatible with
i.MX8ULP

There maybe dtbs_check failure if only test the 1st patch. After
the patchset applied, no failure.

To make avoid break old bindings from work, update the driver
to support both old/new bindings.

---
Changes in v5:
- Add R-b for patch 1, 2
- Simplify code a bit more in patch 4 pPer Marco's comments
- Update patch 5 to only drop port->sdata check, since patch 4 is changed.
- Link to v4: https://lore.kernel.org/r/20230926-vf610-gpio-v4-0-b57b7f6e8368@nxp.com

Changes in v4:
 Change to minItems for allOf: else: interrupts 
 Update commit log for patch 4/6
 Follow Marco's comments for patch 4/6
 Add a new patch 5/6 Per Marco's comments.

Changes in v3:
Update patch v2 2/6
Update commit log in patch v2 5/6
Add A-b from DT maintainer for patch v2 1/6, 3/6
- Link to v2: https://lore.kernel.org/r/20230916-vf610-gpio-v2-0-40823da788d7@nxp.com

Changes in v2:
- Update bindings with describe items, add one reg base for i.MX8ULP/93
- Update driver to support one reg base, support both new/old bindings
- Add a new patch 1 to update gpio-ranges found in dtbs_check
- Link to v1: https://lore.kernel.org/r/20230914-vf610-gpio-v1-0-3ed418182a6a@nxp.com

---
Peng Fan (7):
      dt-bindings: gpio: vf610: update gpio-ranges
      dt-bindings: gpio: vf610: correct i.MX8ULP and i.MX93
      dt-bindings: gpio: vf610: add i.MX95 compatible
      gpio: vf610: add i.MX8ULP of_device_id entry
      gpio: vf610: simplify code by dropping data check
      arm64: dts: imx8ulp: update gpio node
      arm64: dts: imx93: update gpio node

 .../devicetree/bindings/gpio/gpio-vf610.yaml       | 40 +++++++++++++---
 arch/arm64/boot/dts/freescale/imx8ulp.dtsi         | 21 +++++----
 arch/arm64/boot/dts/freescale/imx93.dtsi           | 28 +++++++-----
 drivers/gpio/gpio-vf610.c                          | 53 ++++++++++++++++++----
 4 files changed, 105 insertions(+), 37 deletions(-)
---
base-commit: e143016b56ecb0fcda5bb6026b0a25fe55274f56
change-id: 20230914-vf610-gpio-46edacd2b513

Best regards,

Comments

Bartosz Golaszewski Oct. 5, 2023, 5:54 p.m. UTC | #1
On Sun, Oct 1, 2023 at 10:23 AM Peng Fan (OSS) <peng.fan@oss.nxp.com> wrote:
>
> From hardware perspective:
> - i.MX8ULP/93 GPIO supports two interrupts, 1st for Trustzone non-secure irq,
>   2nd for Trustzone secure irq.
> - i.MX8ULP/93 only has one register base
>
> The current linux gpio-vf610.c could work with i.MX8ULP/i.MX93, it is
> because some trick did in device tree node with offset added to base:
>   reg = <0x2d010080 0x1000>, <0x2d010040 0x40>;
> But actually the register base should be 0x2d010000.
>
> So i.MX8ULP/93 is not HW compatible with i.MX7ULP.
>
> i.MX93 GPIO is directly derived from i.MX8ULP, so make i.MX93 compatible
> with i.MX8ULP. i.MX95 GPIO is same as i.MX93, so also compatible with
> i.MX8ULP
>
> There maybe dtbs_check failure if only test the 1st patch. After
> the patchset applied, no failure.
>
> To make avoid break old bindings from work, update the driver
> to support both old/new bindings.
>
> ---
> Changes in v5:
> - Add R-b for patch 1, 2
> - Simplify code a bit more in patch 4 pPer Marco's comments
> - Update patch 5 to only drop port->sdata check, since patch 4 is changed.
> - Link to v4: https://lore.kernel.org/r/20230926-vf610-gpio-v4-0-b57b7f6e8368@nxp.com
>
> Changes in v4:
>  Change to minItems for allOf: else: interrupts
>  Update commit log for patch 4/6
>  Follow Marco's comments for patch 4/6
>  Add a new patch 5/6 Per Marco's comments.
>
> Changes in v3:
> Update patch v2 2/6
> Update commit log in patch v2 5/6
> Add A-b from DT maintainer for patch v2 1/6, 3/6
> - Link to v2: https://lore.kernel.org/r/20230916-vf610-gpio-v2-0-40823da788d7@nxp.com
>
> Changes in v2:
> - Update bindings with describe items, add one reg base for i.MX8ULP/93
> - Update driver to support one reg base, support both new/old bindings
> - Add a new patch 1 to update gpio-ranges found in dtbs_check
> - Link to v1: https://lore.kernel.org/r/20230914-vf610-gpio-v1-0-3ed418182a6a@nxp.com
>
> ---
> Peng Fan (7):
>       dt-bindings: gpio: vf610: update gpio-ranges
>       dt-bindings: gpio: vf610: correct i.MX8ULP and i.MX93
>       dt-bindings: gpio: vf610: add i.MX95 compatible
>       gpio: vf610: add i.MX8ULP of_device_id entry
>       gpio: vf610: simplify code by dropping data check
>       arm64: dts: imx8ulp: update gpio node
>       arm64: dts: imx93: update gpio node
>
>  .../devicetree/bindings/gpio/gpio-vf610.yaml       | 40 +++++++++++++---
>  arch/arm64/boot/dts/freescale/imx8ulp.dtsi         | 21 +++++----
>  arch/arm64/boot/dts/freescale/imx93.dtsi           | 28 +++++++-----
>  drivers/gpio/gpio-vf610.c                          | 53 ++++++++++++++++++----
>  4 files changed, 105 insertions(+), 37 deletions(-)
> ---
> base-commit: e143016b56ecb0fcda5bb6026b0a25fe55274f56
> change-id: 20230914-vf610-gpio-46edacd2b513
>
> Best regards,
> --
> Peng Fan <peng.fan@nxp.com>
>

This looks good enough. I applied patches 1-5. If you could send a
follow-up with a comment clarification for patch 4/5, that would be
great.

Thanks,
Bart
Peng Fan Oct. 10, 2023, 1:35 a.m. UTC | #2
Hi Shawn,

> Subject: [PATCH v5 0/7] gpio: update i.MX93/8ULP and support i.MX95


GPIO maintainers has picked up patch 1-5, would you pick patch 6,7?

Thanks,
Peng.
> 
> From hardware perspective:
> - i.MX8ULP/93 GPIO supports two interrupts, 1st for Trustzone non-secure irq,
>   2nd for Trustzone secure irq.
> - i.MX8ULP/93 only has one register base
> 
> The current linux gpio-vf610.c could work with i.MX8ULP/i.MX93, it is
> because some trick did in device tree node with offset added to base:
>   reg = <0x2d010080 0x1000>, <0x2d010040 0x40>; But actually the register
> base should be 0x2d010000.
> 
> So i.MX8ULP/93 is not HW compatible with i.MX7ULP.
> 
> i.MX93 GPIO is directly derived from i.MX8ULP, so make i.MX93 compatible
> with i.MX8ULP. i.MX95 GPIO is same as i.MX93, so also compatible with
> i.MX8ULP
> 
> There maybe dtbs_check failure if only test the 1st patch. After the patchset
> applied, no failure.
> 
> To make avoid break old bindings from work, update the driver to support
> both old/new bindings.
> 
> ---
> Changes in v5:
> - Add R-b for patch 1, 2
> - Simplify code a bit more in patch 4 pPer Marco's comments
> - Update patch 5 to only drop port->sdata check, since patch 4 is changed.
> - Link to v4: https://lore.kernel.org/r/20230926-vf610-gpio-v4-0-
> b57b7f6e8368@nxp.com
> 
> Changes in v4:
>  Change to minItems for allOf: else: interrupts  Update commit log for patch
> 4/6  Follow Marco's comments for patch 4/6  Add a new patch 5/6 Per
> Marco's comments.
> 
> Changes in v3:
> Update patch v2 2/6
> Update commit log in patch v2 5/6
> Add A-b from DT maintainer for patch v2 1/6, 3/6
> - Link to v2: https://lore.kernel.org/r/20230916-vf610-gpio-v2-0-
> 40823da788d7@nxp.com
> 
> Changes in v2:
> - Update bindings with describe items, add one reg base for i.MX8ULP/93
> - Update driver to support one reg base, support both new/old bindings
> - Add a new patch 1 to update gpio-ranges found in dtbs_check
> - Link to v1: https://lore.kernel.org/r/20230914-vf610-gpio-v1-0-
> 3ed418182a6a@nxp.com
> 
> ---
> Peng Fan (7):
>       dt-bindings: gpio: vf610: update gpio-ranges
>       dt-bindings: gpio: vf610: correct i.MX8ULP and i.MX93
>       dt-bindings: gpio: vf610: add i.MX95 compatible
>       gpio: vf610: add i.MX8ULP of_device_id entry
>       gpio: vf610: simplify code by dropping data check
>       arm64: dts: imx8ulp: update gpio node
>       arm64: dts: imx93: update gpio node
> 
>  .../devicetree/bindings/gpio/gpio-vf610.yaml       | 40 +++++++++++++---
>  arch/arm64/boot/dts/freescale/imx8ulp.dtsi         | 21 +++++----
>  arch/arm64/boot/dts/freescale/imx93.dtsi           | 28 +++++++-----
>  drivers/gpio/gpio-vf610.c                          | 53 ++++++++++++++++++----
>  4 files changed, 105 insertions(+), 37 deletions(-)
> ---
> base-commit: e143016b56ecb0fcda5bb6026b0a25fe55274f56
> change-id: 20230914-vf610-gpio-46edacd2b513
> 
> Best regards,
> --
> Peng Fan <peng.fan@nxp.com>