mbox series

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

Message ID 20230916-vf610-gpio-v2-0-40823da788d7@nxp.com
Headers show
Series gpio: update i.MX93/8ULP and support i.MX95 | expand

Message

Peng Fan (OSS) Sept. 16, 2023, 2:03 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 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 (6):
      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
      arm64: dts: imx8ulp: update gpio node
      arm64: dts: imx93: update gpio node

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

Best regards,

Comments

Krzysztof Kozlowski Sept. 17, 2023, 7:48 a.m. UTC | #1
On 16/09/2023 04:04, Peng Fan (OSS) wrote:
> From: Peng Fan <peng.fan@nxp.com>
> 
> The i.MX8ULP GPIO supports two interrupts and one register base, and not
> compatible with i.MX7ULP. Update the node following dt-binding doc.
> 
I think last email thread concluded they are compatible. Otherwise, how
did it work so far? You break users, which might be ok, but commit does
no say that anything was broken here.

Best regards,
Krzysztof
Peng Fan Sept. 17, 2023, 12:51 p.m. UTC | #2
> Subject: Re: [PATCH v2 5/6] arm64: dts: imx8ulp: update gpio node
> 
> On 16/09/2023 04:04, Peng Fan (OSS) wrote:
> > From: Peng Fan <peng.fan@nxp.com>
> >
> > The i.MX8ULP GPIO supports two interrupts and one register base, and
> > not compatible with i.MX7ULP. Update the node following dt-binding doc.
> >
> I think last email thread concluded they are compatible. Otherwise, how did it
> work so far? You break users, which might be ok, but commit does no say
> that anything was broken here.
Per,
https://lore.kernel.org/all/02e25e44-1146-bb59-58de-800b11d30e7b@linaro.org/
I thought we agree they are not HW compatible, it is SW trick to make
Linux driver could work with both with i.MX7ULP compatible.

I will add more information in commit to describe breaking users.
BTW: in linux driver in this patchset, I have added code to support
legacy bindings.

Thanks,
Peng.

> 
> Best regards,
> Krzysztof