add I2C DTS support for S32G2/S32G3 SoCs
v4 cover add I2C DTS support for S32G2/S32G3 SoCs
From: Ciprian Marian Costea <[email protected]>
This patchset aims to add two changes to the S32G2/S32G3 dtsi support:
- Adding I2C dts support for S32G SoC based boards
- Centralize the common part of 'S32G-EVB' and 'S32G-RDB' board revisions into dtsi files. This refactor will serve I2C in this patchset, but in the future it will also be used for other modules such as : FlexCAN and DSPI.
Changes in V4:
- Moved I2C nodes '#address-size' and '#address-cells' entries from board common level to S32G2/S32G3 SoC level.
Changes in V3:
- Separated patchset into multiple stages: common 'I2C' dts entries, board 'I2C' dts entries and the introduction of common 'S32GXXXA-EVB/RDB' dtsi.
- Added missing changelog for V2 of this patchset
Changes in V2:
- Moved I2C end device '#address-size' and '#address-cells' entries from board dts to common 's32gxxxa-evb/rdb' common dtsi.
Ciprian Marian Costea (4):
arm64: dts: s32g: add 'I2C' common board support
arm64: dts: s32g: add common 'S32G-EVB' and 'S32G-RDB' board support
arm64: dts: s32g: include necessary 'EVB/RDB' common board dtsi
arm64: dts: s32g399a-rdb3: Add INA231 sensor entry over I2C4
arch/arm64/boot/dts/freescale/s32g2.dtsi | 55 +++++++ .../arm64/boot/dts/freescale/s32g274a-evb.dts | 1 + .../boot/dts/freescale/s32g274a-rdb2.dts | 1 + arch/arm64/boot/dts/freescale/s32g3.dtsi | 60 +++++++ .../boot/dts/freescale/s32g399a-rdb3.dts | 9 ++ .../boot/dts/freescale/s32gxxxa-evb.dtsi | 150 ++++++++++++++++++ .../boot/dts/freescale/s32gxxxa-rdb.dtsi | 122 ++++++++++++++ 7 files changed, 398 insertions(+) create mode 100644 arch/arm64/boot/dts/freescale/s32gxxxa-evb.dtsi create mode 100644 arch/arm64/boot/dts/freescale/s32gxxxa-rdb.dtsi
Signature · 1 line
2.45.2
PATCH v4 1/4 arm64: dts: s32g: add 'I2C' common board support
From: Ciprian Marian Costea <[email protected]>
On both 'S32G2' and 'S32G3' SoCs there are five i2c controllers available (i2c0-i2c4). Specific S32G2/S32G3 based board 'i2c' dts device support will be added in further commits.
--- arch/arm64/boot/dts/freescale/s32g2.dtsi | 55 ++++++++++++++++++++++ arch/arm64/boot/dts/freescale/s32g3.dtsi | 60 ++++++++++++++++++++++++ 2 files changed, 115 insertions(+)
arch/arm64/boot/dts/freescale/s32g2.dtsi +55 -0
@@ -333,6 +333,39 @@ uart1: serial@401cc000 { status = "disabled"; }; + i2c0: i2c@401e4000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401e4000 0x1000>; + interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c1: i2c@401e8000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401e8000 0x1000>; + interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c2: i2c@401ec000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401ec000 0x1000>; + interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + uart2: serial@402bc000 { compatible = "nxp,s32g2-linflexuart", "fsl,s32v234-linflexuart";
@@ -341,6 +374,28 @@ uart2: serial@402bc000 { status = "disabled"; }; + i2c3: i2c@402d8000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x402d8000 0x1000>; + interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c4: i2c@402dc000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x402dc000 0x1000>; + interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + usdhc0: mmc@402f0000 { compatible = "nxp,s32g2-usdhc"; reg = <0x402f0000 0x1000>;
arch/arm64/boot/dts/freescale/s32g3.dtsi +60 -0
72 lines not on this page · raw message
Signature · 1 line
2.45.2
Frank Li
maintainerRe: [PATCH v4 1/4] arm64: dts: s32g: add 'I2C' common board support
On Fri, Dec 20, 2024 at 02:39:13PM +0200, Ciprian Costea wrote:
Subject is wrong, this patch is not for common board
Simple said: "Add I2C[0..2] support for s32g2 and s32g3"
Quoted 5 lines
From: Ciprian Marian Costea <[email protected]>
On both 'S32G2' and 'S32G3' SoCs there are five i2c controllers available (i2c0-i2c4). Specific S32G2/S32G3 based board 'i2c' dts device support will be added in further commits.
This commit have not touch "based board".
So"Add I2C[0..2] for S32G and S32G3 SoCs commit dts."
Allow only copy subject here for such simple add some nodes.
Quoted 12 lines
Signed-off-by Ciprian Marian Costea <[email protected]>--- arch/arm64/boot/dts/freescale/s32g2.dtsi | 55 ++++++++++++++++++++++ arch/arm64/boot/dts/freescale/s32g3.dtsi | 60 ++++++++++++++++++++++++ 2 files changed, 115 insertions(+)arch/arm64/boot/dts/freescale/s32g2.dtsi +0
-0
arch/arm64/boot/dts/freescale/s32g2.dtsi uart1: serial@401cc000 { · line 340
Quoted 8 lines
arch/arm64/boot/dts/freescale/s32g2.dtsi +5
-0@@ -333,6 +333,39 @@ uart1: serial@401cc000 { status = "disabled"; }; + i2c0: i2c@401e4000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401e4000 0x1000>;
reg should just after compatible.
Frank
Quoted 141 lines
arch/arm64/boot/dts/freescale/s32g2.dtsi +50
-0+ interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c1: i2c@401e8000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401e8000 0x1000>; + interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c2: i2c@401ec000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401ec000 0x1000>; + interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + uart2: serial@402bc000 { compatible = "nxp,s32g2-linflexuart", "fsl,s32v234-linflexuart";@@ -341,6 +374,28 @@ uart2: serial@402bc000 { status = "disabled"; }; + i2c3: i2c@402d8000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x402d8000 0x1000>; + interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c4: i2c@402dc000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x402dc000 0x1000>; + interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + usdhc0: mmc@402f0000 { compatible = "nxp,s32g2-usdhc"; reg = <0x402f0000 0x1000>;arch/arm64/boot/dts/freescale/s32g3.dtsi +60
-1@@ -390,6 +390,42 @@ uart1: serial@401cc000 { status = "disabled"; }; + i2c0: i2c@401e4000 { + compatible = "nxp,s32g3-i2c", + "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401e4000 0x1000>; + interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c1: i2c@401e8000 { + compatible = "nxp,s32g3-i2c", + "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401e8000 0x1000>; + interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c2: i2c@401ec000 { + compatible = "nxp,s32g3-i2c", + "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401ec000 0x1000>; + interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + uart2: serial@402bc000 { compatible = "nxp,s32g3-linflexuart", "fsl,s32v234-linflexuart";@@ -398,6 +434,30 @@ uart2: serial@402bc000 { status = "disabled"; }; + i2c3: i2c@402d8000 { + compatible = "nxp,s32g3-i2c", + "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x402d8000 0x1000>; + interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c4: i2c@402dc000 { + compatible = "nxp,s32g3-i2c", + "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x402dc000 0x1000>; + interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + usdhc0: mmc@402f0000 { compatible = "nxp,s32g3-usdhc", "nxp,s32g2-usdhc"; --2.45.2
Re: [PATCH v4 1/4] arm64: dts: s32g: add 'I2C' common board support
Quoted 2 lines · Frank Li
On Fri, Dec 20, 2024 at 02:39:13PM +0200, Ciprian Costea wrote:
Hello Frank,
Quoted 10 lines
Subject is wrong, this patch is not for common board
Simple said: "Add I2C[0..2] support for s32g2 and s32g3"
Quoted 5 lines
From: Ciprian Marian Costea <[email protected]>
On both 'S32G2' and 'S32G3' SoCs there are five i2c controllers available (i2c0-i2c4). Specific S32G2/S32G3 based board 'i2c' dts device support will be added in further commits.
Quoted 6 lines
This commit have not touch "based board".
So"Add I2C[0..2] for S32G and S32G3 SoCs commit dts."
Allow only copy subject here for such simple add some nodes.
Thanks. I will update accordingly in V5.
Quoted 23 lines
Quoted 12 lines
Signed-off-by Ciprian Marian Costea <[email protected]>--- arch/arm64/boot/dts/freescale/s32g2.dtsi | 55 ++++++++++++++++++++++ arch/arm64/boot/dts/freescale/s32g3.dtsi | 60 ++++++++++++++++++++++++ 2 files changed, 115 insertions(+)arch/arm64/boot/dts/freescale/s32g2.dtsi +0
-0arch/arm64/boot/dts/freescale/s32g2.dtsi uart1: serial@401cc000 { · line 340
Quoted 8 lines
arch/arm64/boot/dts/freescale/s32g2.dtsi +5
-0@@ -333,6 +333,39 @@ uart1: serial@401cc000 { status = "disabled"; }; + i2c0: i2c@401e4000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401e4000 0x1000>;reg should just after compatible.
Quoted 2 lines
Frank
Ok, I have nothing against this. I will update in V5 as I see now newer dtsi follow this.
Quoted 133 lines
Quoted 133 lines
arch/arm64/boot/dts/freescale/s32g2.dtsi +50
-0+ interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c1: i2c@401e8000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401e8000 0x1000>; + interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c2: i2c@401ec000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401ec000 0x1000>; + interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + uart2: serial@402bc000 { compatible = "nxp,s32g2-linflexuart", "fsl,s32v234-linflexuart";@@ -341,6 +374,28 @@ uart2: serial@402bc000 { status = "disabled"; }; + i2c3: i2c@402d8000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x402d8000 0x1000>; + interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c4: i2c@402dc000 { + compatible = "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x402dc000 0x1000>; + interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + usdhc0: mmc@402f0000 { compatible = "nxp,s32g2-usdhc"; reg = <0x402f0000 0x1000>;arch/arm64/boot/dts/freescale/s32g3.dtsi +58
-0@@ -390,6 +390,42 @@ uart1: serial@401cc000 { status = "disabled"; }; + i2c0: i2c@401e4000 { + compatible = "nxp,s32g3-i2c", + "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401e4000 0x1000>; + interrupts = <GIC_SPI 92 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c1: i2c@401e8000 { + compatible = "nxp,s32g3-i2c", + "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401e8000 0x1000>; + interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c2: i2c@401ec000 { + compatible = "nxp,s32g3-i2c", + "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x401ec000 0x1000>; + interrupts = <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + uart2: serial@402bc000 { compatible = "nxp,s32g3-linflexuart", "fsl,s32v234-linflexuart";@@ -398,6 +434,30 @@ uart2: serial@402bc000 { status = "disabled"; }; + i2c3: i2c@402d8000 { + compatible = "nxp,s32g3-i2c", + "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x402d8000 0x1000>; + interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled"; + }; + + i2c4: i2c@402dc000 { + compatible = "nxp,s32g3-i2c", + "nxp,s32g2-i2c"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x402dc000 0x1000>; + interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clks 40>; + clock-names = "ipg"; + status = "disabled";
Quoted 8 lines
Quoted 8 lines
arch/arm64/boot/dts/freescale/s32g3.dtsi +2
-1+ }; + usdhc0: mmc@402f0000 { compatible = "nxp,s32g3-usdhc", "nxp,s32g2-usdhc"; --2.45.2
Best Regards,
Ciprian
PATCH v4 2/4 arm64: dts: s32g: add common 'S32G-EVB' and 'S32G-RDB' board support
In reply to Ciprian CosteaFrom: Ciprian Marian Costea <[email protected]>
With respect to S32G2/S32G3 SoC based boards, there are multiple RDB (rdb2 vs rdb3) and EVB (for G2 vs for G3) board revisions. These versions are quite similar. The common part for the EVB revisions will be centralized in 's32gxxa-evb.dtsi' file, while the RDB commonalities will be placed in 's32gxxa-rdb.dtsi' file.
This refactor will also serve for other modules in the future, such as FlexCAN, DSPI.
--- .../boot/dts/freescale/s32gxxxa-evb.dtsi | 150 ++++++++++++++++++ .../boot/dts/freescale/s32gxxxa-rdb.dtsi | 122 ++++++++++++++ 2 files changed, 272 insertions(+) create mode 100644 arch/arm64/boot/dts/freescale/s32gxxxa-evb.dtsi create mode 100644 arch/arm64/boot/dts/freescale/s32gxxxa-rdb.dtsi
arch/arm64/boot/dts/freescale/s32gxxxa-evb.dtsi new file +150 -0
@@ -0,0 +1,150 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * Copyright 2024 NXP + * + * Authors: Ciprian Marian Costea <[email protected]> + * Ghennadi Procopciuc <[email protected]> + * Larisa Grigore <[email protected]> + */ + +&pinctrl { + i2c0_pins: i2c0-pins { + i2c0-grp0 { + pinmux = <0x101>, <0x111>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c0-grp1 { + pinmux = <0x2352>, <0x2362>; + }; + }; + + i2c0_gpio_pins: i2c0-gpio-pins { + i2c0-gpio-grp0 { + pinmux = <0x100>, <0x110>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c0-gpio-grp1 { + pinmux = <0x2350>, <0x2360>; + }; + }; + + i2c1_pins: i2c1-pins { + i2c1-grp0 { + pinmux = <0x131>, <0x141>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c1-grp1 { + pinmux = <0x2cd2>, <0x2ce2>; + }; + }; + + i2c1_gpio_pins: i2c1-gpio-pins { + i2c1-gpio-grp0 { + pinmux = <0x130>, <0x140>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c1-gpio-grp1 { + pinmux = <0x2cd0>, <0x2ce0>; + }; + }; + + i2c2_pins: i2c2-pins { + i2c2-grp0 { + pinmux = <0x151>, <0x161>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c2-grp1 { + pinmux = <0x2cf2>, <0x2d02>; + }; + }; + + i2c2_gpio_pins: i2c2-gpio-pins { + i2c2-gpio-grp0 { + pinmux = <0x150>, <0x160>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c2-gpio-grp1 { + pinmux = <0x2cf0>, <0x2d00>; + }; + }; + + i2c4_pins: i2c4-pins { + i2c4-grp0 { + pinmux = <0x211>, <0x222>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c4-grp1 { + pinmux = <0x2d43>, <0x2d33>; + }; + }; + + i2c4_gpio_pins: i2c4-gpio-pins { + i2c4-gpio-grp0 { + pinmux = <0x210>, <0x220>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c4-gpio-grp1 { + pinmux = <0x2d40>, <0x2d30>; + }; + }; +}; + +&i2c0 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c0_pins>; + pinctrl-1 = <&i2c0_gpio_pins>; + status = "okay"; +}; + +&i2c1 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c1_pins>; + pinctrl-1 = <&i2c1_gpio_pins>; + status = "okay"; +}; + +&i2c2 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c2_pins>; + pinctrl-1 = <&i2c2_gpio_pins>; + status = "okay"; +}; + +&i2c4 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c4_pins>; + pinctrl-1 = <&i2c4_gpio_pins>; + status = "okay"; +};
arch/arm64/boot/dts/freescale/s32gxxxa-rdb.dtsi new file +122 -0
122 lines not on this page · raw message
Signature · 1 line
2.45.2
Frank Li
maintainerRe: [PATCH v4 2/4] arm64: dts: s32g: add common 'S32G-EVB' and 'S32G-RDB' board support
Quoted 10 lines · Ciprian Costea
From: Ciprian Marian Costea <[email protected]>
With respect to S32G2/S32G3 SoC based boards, there are multiple RDB (rdb2 vs rdb3) and EVB (for G2 vs for G3) board revisions. These versions are quite similar. The common part for the EVB revisions will be centralized in '
s32gxxa-evb.dtsi' file, while the RDB commonalities will be placed in 's32gxxa-rdb.dtsi' file.This refactor will also serve for other modules in the future, such as FlexCAN, DSPI.
https://docs.kernel.org/process/submitting-patches.html
"Describe your changes in imperative mood, e.g. “make xyzzy do frotz” instead of “[This patch] makes xyzzy do frotz” or “[I] changed xyzzy to do frotz”, as if you are giving orders to the codebase to change its behaviour."
So suggest..
Create common part, s32gxxa-evb.dtsi and s32gxxa-rdb.dtsi, for S32G2/S32G3 RDB2\3 and EVB G2/G3 boards to avoid copy duplicate part in boards dts file. Prepare to add other modules easily in the future.
Quoted 8 lines
Signed-off-by Ciprian Marian Costea <[email protected]>--- .../boot/dts/freescale/s32gxxxa-evb.dtsi | 150 ++++++++++++++++++ .../boot/dts/freescale/s32gxxxa-rdb.dtsi | 122 ++++++++++++++ 2 files changed, 272 insertions(+) create mode 100644 arch/arm64/boot/dts/freescale/s32gxxxa-evb.dtsi create mode 100644 arch/arm64/boot/dts/freescale/s32gxxxa-rdb.dtsi
I think you should squash patch 3/4 to this one. All is for the boards dts.
Frank
Quoted 288 lines
arch/arm64/boot/dts/freescale/s32gxxxa-evb.dtsi new file +150
-0@@ -0,0 +1,150 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * Copyright 2024 NXP + * + * Authors: Ciprian Marian Costea <[email protected]> + * Ghennadi Procopciuc <[email protected]> + * Larisa Grigore <[email protected]> + */ + +&pinctrl { + i2c0_pins: i2c0-pins { + i2c0-grp0 { + pinmux = <0x101>, <0x111>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c0-grp1 { + pinmux = <0x2352>, <0x2362>; + }; + }; + + i2c0_gpio_pins: i2c0-gpio-pins { + i2c0-gpio-grp0 { + pinmux = <0x100>, <0x110>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c0-gpio-grp1 { + pinmux = <0x2350>, <0x2360>; + }; + }; + + i2c1_pins: i2c1-pins { + i2c1-grp0 { + pinmux = <0x131>, <0x141>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c1-grp1 { + pinmux = <0x2cd2>, <0x2ce2>; + }; + }; + + i2c1_gpio_pins: i2c1-gpio-pins { + i2c1-gpio-grp0 { + pinmux = <0x130>, <0x140>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c1-gpio-grp1 { + pinmux = <0x2cd0>, <0x2ce0>; + }; + }; + + i2c2_pins: i2c2-pins { + i2c2-grp0 { + pinmux = <0x151>, <0x161>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c2-grp1 { + pinmux = <0x2cf2>, <0x2d02>; + }; + }; + + i2c2_gpio_pins: i2c2-gpio-pins { + i2c2-gpio-grp0 { + pinmux = <0x150>, <0x160>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c2-gpio-grp1 { + pinmux = <0x2cf0>, <0x2d00>; + }; + }; + + i2c4_pins: i2c4-pins { + i2c4-grp0 { + pinmux = <0x211>, <0x222>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c4-grp1 { + pinmux = <0x2d43>, <0x2d33>; + }; + }; + + i2c4_gpio_pins: i2c4-gpio-pins { + i2c4-gpio-grp0 { + pinmux = <0x210>, <0x220>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c4-gpio-grp1 { + pinmux = <0x2d40>, <0x2d30>; + }; + }; +}; + +&i2c0 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c0_pins>; + pinctrl-1 = <&i2c0_gpio_pins>; + status = "okay"; +}; + +&i2c1 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c1_pins>; + pinctrl-1 = <&i2c1_gpio_pins>; + status = "okay"; +}; + +&i2c2 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c2_pins>; + pinctrl-1 = <&i2c2_gpio_pins>; + status = "okay"; +}; + +&i2c4 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c4_pins>; + pinctrl-1 = <&i2c4_gpio_pins>; + status = "okay"; +};arch/arm64/boot/dts/freescale/s32gxxxa-rdb.dtsi new file +122
-1@@ -0,0 +1,122 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * Copyright 2024 NXP + * + * Authors: Ciprian Marian Costea <[email protected]> + * Ghennadi Procopciuc <[email protected]> + * Larisa Grigore <[email protected]> + */ + +&pinctrl { + i2c0_pins: i2c0-pins { + i2c0-grp0 { + pinmux = <0x1f2>, <0x201>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c0-grp1 { + pinmux = <0x2353>, <0x2363>; + }; + }; + + i2c0_gpio_pins: i2c0-gpio-pins { + i2c0-gpio-grp0 { + pinmux = <0x1f0>, <0x200>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c0-gpio-grp1 { + pinmux = <0x2350>, <0x2360>; + }; + }; + + i2c2_pins: i2c2-pins { + i2c2-grp0 { + pinmux = <0x151>, <0x161>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c2-grp1 { + pinmux = <0x2cf2>, <0x2d02>; + }; + }; + + i2c2_gpio_pins: i2c2-gpio-pins { + i2c2-gpio-grp0 { + pinmux = <0x2cf0>, <0x2d00>; + }; + + i2c2-gpio-grp1 { + pinmux = <0x150>, <0x160>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + }; + + i2c4_pins: i2c4-pins { + i2c4-grp0 { + pinmux = <0x211>, <0x222>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c4-grp1 { + pinmux = <0x2d43>, <0x2d33>; + }; + }; + + i2c4_gpio_pins: i2c4-gpio-pins { + i2c4-gpio-grp0 { + pinmux = <0x210>, <0x220>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c4-gpio-grp1 { + pinmux = <0x2d40>, <0x2d30>; + }; + }; +}; + +&i2c0 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c0_pins>; + pinctrl-1 = <&i2c0_gpio_pins>; + status = "okay"; + + pcal6524: gpio-expander@22 { + compatible = "nxp,pcal6524"; + reg = <0x22>; + gpio-controller; + #gpio-cells = <2>; + }; +}; + +&i2c2 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c2_pins>; + pinctrl-1 = <&i2c2_gpio_pins>; + status = "okay"; +}; + +&i2c4 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c4_pins>; + pinctrl-1 = <&i2c4_gpio_pins>; + status = "okay"; +}; --2.45.2
Re: [PATCH v4 2/4] arm64: dts: s32g: add common 'S32G-EVB' and 'S32G-RDB' board support
Quoted 19 lines · Frank Li
Quoted 10 lines · Ciprian Costea
From: Ciprian Marian Costea <[email protected]>
With respect to S32G2/S32G3 SoC based boards, there are multiple RDB (rdb2 vs rdb3) and EVB (for G2 vs for G3) board revisions. These versions are quite similar. The common part for the EVB revisions will be centralized in '
s32gxxa-evb.dtsi' file, while the RDB commonalities will be placed in 's32gxxa-rdb.dtsi' file.This refactor will also serve for other modules in the future, such as FlexCAN, DSPI.
https://docs.kernel.org/process/submitting-patches.html
"Describe your changes in imperative mood, e.g. “make xyzzy do frotz” instead of “[This patch] makes xyzzy do frotz” or “[I] changed xyzzy to do frotz”, as if you are giving orders to the codebase to change its behaviour."
Quoted 6 lines
So suggest..
Create common part,
s32gxxa-evb.dtsiands32gxxa-rdb.dtsi, for S32G2/S32G3 RDB2\3 and EVB G2/G3 boards to avoid copy duplicate part in boards dts file. Prepare to add other modules easily in the future.
Thanks for the suggestion. I will update accordingly in V5.
Quoted 9 lines
Quoted 8 lines
Signed-off-by Ciprian Marian Costea <[email protected]>--- .../boot/dts/freescale/s32gxxxa-evb.dtsi | 150 ++++++++++++++++++ .../boot/dts/freescale/s32gxxxa-rdb.dtsi | 122 ++++++++++++++ 2 files changed, 272 insertions(+)create mode 100644
arch/arm64/boot/dts/freescale/s32gxxxa-evb.dtsicreate mode 100644arch/arm64/boot/dts/freescale/s32gxxxa-rdb.dtsi
Quoted 3 lines
I think you should squash patch 3/4 to this one. All is for the boards dts.
Frank
Sounds good. I will squash patch 3 & 4 in V5.
Ciprian
Quoted 288 lines
Quoted 288 lines
arch/arm64/boot/dts/freescale/s32gxxxa-evb.dtsi new file +150
-0@@ -0,0 +1,150 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * Copyright 2024 NXP + * + * Authors: Ciprian Marian Costea <[email protected]> + * Ghennadi Procopciuc <[email protected]> + * Larisa Grigore <[email protected]> + */ + +&pinctrl { + i2c0_pins: i2c0-pins { + i2c0-grp0 { + pinmux = <0x101>, <0x111>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c0-grp1 { + pinmux = <0x2352>, <0x2362>; + }; + }; + + i2c0_gpio_pins: i2c0-gpio-pins { + i2c0-gpio-grp0 { + pinmux = <0x100>, <0x110>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c0-gpio-grp1 { + pinmux = <0x2350>, <0x2360>; + }; + }; + + i2c1_pins: i2c1-pins { + i2c1-grp0 { + pinmux = <0x131>, <0x141>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c1-grp1 { + pinmux = <0x2cd2>, <0x2ce2>; + }; + }; + + i2c1_gpio_pins: i2c1-gpio-pins { + i2c1-gpio-grp0 { + pinmux = <0x130>, <0x140>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c1-gpio-grp1 { + pinmux = <0x2cd0>, <0x2ce0>; + }; + }; + + i2c2_pins: i2c2-pins { + i2c2-grp0 { + pinmux = <0x151>, <0x161>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c2-grp1 { + pinmux = <0x2cf2>, <0x2d02>; + }; + }; + + i2c2_gpio_pins: i2c2-gpio-pins { + i2c2-gpio-grp0 { + pinmux = <0x150>, <0x160>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c2-gpio-grp1 { + pinmux = <0x2cf0>, <0x2d00>; + }; + }; + + i2c4_pins: i2c4-pins { + i2c4-grp0 { + pinmux = <0x211>, <0x222>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c4-grp1 { + pinmux = <0x2d43>, <0x2d33>; + }; + }; + + i2c4_gpio_pins: i2c4-gpio-pins { + i2c4-gpio-grp0 { + pinmux = <0x210>, <0x220>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c4-gpio-grp1 { + pinmux = <0x2d40>, <0x2d30>; + }; + }; +}; + +&i2c0 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c0_pins>; + pinctrl-1 = <&i2c0_gpio_pins>; + status = "okay"; +}; + +&i2c1 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c1_pins>; + pinctrl-1 = <&i2c1_gpio_pins>; + status = "okay"; +}; + +&i2c2 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c2_pins>; + pinctrl-1 = <&i2c2_gpio_pins>; + status = "okay"; +}; + +&i2c4 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c4_pins>; + pinctrl-1 = <&i2c4_gpio_pins>; + status = "okay"; +};arch/arm64/boot/dts/freescale/s32gxxxa-rdb.dtsi new file +122
-1@@ -0,0 +1,122 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) +/* + * Copyright 2024 NXP + * + * Authors: Ciprian Marian Costea <[email protected]> + * Ghennadi Procopciuc <[email protected]> + * Larisa Grigore <[email protected]> + */ + +&pinctrl { + i2c0_pins: i2c0-pins { + i2c0-grp0 { + pinmux = <0x1f2>, <0x201>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c0-grp1 { + pinmux = <0x2353>, <0x2363>; + }; + }; + + i2c0_gpio_pins: i2c0-gpio-pins { + i2c0-gpio-grp0 { + pinmux = <0x1f0>, <0x200>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c0-gpio-grp1 { + pinmux = <0x2350>, <0x2360>; + }; + }; + + i2c2_pins: i2c2-pins { + i2c2-grp0 { + pinmux = <0x151>, <0x161>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c2-grp1 { + pinmux = <0x2cf2>, <0x2d02>; + }; + }; + + i2c2_gpio_pins: i2c2-gpio-pins { + i2c2-gpio-grp0 { + pinmux = <0x2cf0>, <0x2d00>; + }; + + i2c2-gpio-grp1 { + pinmux = <0x150>, <0x160>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + }; + + i2c4_pins: i2c4-pins { + i2c4-grp0 { + pinmux = <0x211>, <0x222>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c4-grp1 { + pinmux = <0x2d43>, <0x2d33>; + }; + }; + + i2c4_gpio_pins: i2c4-gpio-pins { + i2c4-gpio-grp0 { + pinmux = <0x210>, <0x220>; + drive-open-drain; + output-enable; + input-enable; + slew-rate = <133>; + }; + + i2c4-gpio-grp1 { + pinmux = <0x2d40>, <0x2d30>; + }; + }; +}; + +&i2c0 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c0_pins>; + pinctrl-1 = <&i2c0_gpio_pins>; + status = "okay"; + + pcal6524: gpio-expander@22 { + compatible = "nxp,pcal6524"; + reg = <0x22>; + gpio-controller; + #gpio-cells = <2>; + }; +}; + +&i2c2 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c2_pins>; + pinctrl-1 = <&i2c2_gpio_pins>; + status = "okay"; +}; + +&i2c4 { + pinctrl-names = "default", "gpio"; + pinctrl-0 = <&i2c4_pins>; + pinctrl-1 = <&i2c4_gpio_pins>; + status = "okay"; +}; --2.45.2
PATCH v4 3/4 arm64: dts: s32g: include necessary 'EVB/RDB' common board dtsi
In reply to Ciprian CosteaFrom: Ciprian Marian Costea <[email protected]>
After the 'S32G2/S32G3' common 'EVB' and 'RDB' dtsi support addition, include the necessary header depending on board flavour.
--- arch/arm64/boot/dts/freescale/s32g274a-evb.dts | 1 + arch/arm64/boot/dts/freescale/s32g274a-rdb2.dts | 1 + arch/arm64/boot/dts/freescale/s32g399a-rdb3.dts | 1 + 3 files changed, 3 insertions(+)
arch/arm64/boot/dts/freescale/s32g274a-evb.dts +1 -0
@@ -7,6 +7,7 @@ /dts-v1/; #include "s32g2.dtsi" +#include "s32gxxxa-evb.dtsi" / { model = "NXP S32G2 Evaluation Board (S32G-VNP-EVB)";
arch/arm64/boot/dts/freescale/s32g274a-rdb2.dts +1 -0
@@ -7,6 +7,7 @@ /dts-v1/; #include "s32g2.dtsi" +#include "s32gxxxa-rdb.dtsi" / { model = "NXP S32G2 Reference Design Board 2 (S32G-VNP-RDB2)";
arch/arm64/boot/dts/freescale/s32g399a-rdb3.dts +1 -0
@@ -8,6 +8,7 @@ /dts-v1/; #include "s32g3.dtsi" +#include "s32gxxxa-rdb.dtsi" / { model = "NXP S32G3 Reference Design Board 3 (S32G-VNP-RDB3)";
Signature · 1 line
2.45.2
PATCH v4 4/4 arm64: dts: s32g399a-rdb3: Add INA231 sensor entry over I2C4
In reply to Ciprian CosteaFrom: Ciprian Marian Costea <[email protected]>
On S32G399A-RDB3 boards, an INA231 current sensor is connected over I2C4 bus.
--- arch/arm64/boot/dts/freescale/s32g399a-rdb3.dts | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm64/boot/dts/freescale/s32g399a-rdb3.dts +8 -0
@@ -40,6 +40,14 @@ &uart1 { status = "okay"; }; +&i2c4 { + ina231@40 { + compatible = "ti,ina231"; + reg = <0x40>; + shunt-resistor = <1000>; + }; +}; + &usdhc0 { pinctrl-names = "default", "state_100mhz", "state_200mhz"; pinctrl-0 = <&pinctrl_usdhc0>;
Signature · 1 line
2.45.2
Frank Li
maintainerRe: [PATCH v4 4/4] arm64: dts: s32g399a-rdb3: Add INA231 sensor entry over I2C4
Quoted 4 lines · Ciprian Costea
From: Ciprian Marian Costea <[email protected]>
On S32G399A-RDB3 boards, an INA231 current sensor is connected over I2C4 bus.
Add INA231 current sensor for S32G399A-RDB3 boards.
Quoted 11 lines
Signed-off-by Ciprian Marian Costea <[email protected]>--- arch/arm64/boot/dts/freescale/s32g399a-rdb3.dts | 8 ++++++++ 1 file changed, 8 insertions(+)arch/arm64/boot/dts/freescale/s32g399a-rdb3.dts +0
-0
arch/arm64/boot/dts/freescale/s32g399a-rdb3.dts &uart1 { · line 44
Quoted 5 lines
arch/arm64/boot/dts/freescale/s32g399a-rdb3.dts +2
-0@@ -40,6 +40,14 @@ &uart1 { status = "okay"; }; +&i2c4 { + ina231@40 {
Need use general node name:
https://devicetree-specification.readthedocs.io/en/v0.3/devicetree-basics.html#node-names
look like should be current-sensor
Frank
Quoted 12 lines
arch/arm64/boot/dts/freescale/s32g399a-rdb3.dts +6
-1+ compatible = "ti,ina231"; + reg = <0x40>; + shunt-resistor = <1000>; + }; +}; + &usdhc0 { pinctrl-names = "default", "state_100mhz", "state_200mhz"; pinctrl-0 = <&pinctrl_usdhc0>; --2.45.2
Re: [PATCH v4 4/4] arm64: dts: s32g399a-rdb3: Add INA231 sensor entry over I2C4
Quoted 28 lines · Frank Li
Quoted 4 lines · Ciprian Costea
From: Ciprian Marian Costea <[email protected]>
On S32G399A-RDB3 boards, an INA231 current sensor is connected over I2C4 bus.
Add INA231 current sensor for S32G399A-RDB3 boards.
Quoted 11 lines
Signed-off-by Ciprian Marian Costea <[email protected]>--- arch/arm64/boot/dts/freescale/s32g399a-rdb3.dts | 8 ++++++++ 1 file changed, 8 insertions(+)arch/arm64/boot/dts/freescale/s32g399a-rdb3.dts +0
-0arch/arm64/boot/dts/freescale/s32g399a-rdb3.dts &uart1 { · line 44
Quoted 5 lines
arch/arm64/boot/dts/freescale/s32g399a-rdb3.dts +2
-0@@ -40,6 +40,14 @@ &uart1 { status = "okay"; }; +&i2c4 { + ina231@40 {Need use general node name:
https://devicetree-specification.readthedocs.io/en/v0.3/devicetree-basics.html#node-names
Quoted 4 lines
look like should be current-sensor
Frank
Thanks. I will update in V5.
Ciprian
Quoted 12 lines
Quoted 12 lines
arch/arm64/boot/dts/freescale/s32g399a-rdb3.dts +6
-1+ compatible = "ti,ina231"; + reg = <0x40>; + shunt-resistor = <1000>; + }; +}; + &usdhc0 { pinctrl-names = "default", "state_100mhz", "state_200mhz"; pinctrl-0 = <&pinctrl_usdhc0>; --2.45.2