2021-01-15 10:18:39

by Pawel Dembicki

[permalink] [raw]
Subject: [PATCH 1/2] arm64: dts: fsl-ls1012a-rdb: add i2c devices

LS1012A-RDB equipped in some i2c devices:
- 3x GPIO Expander: PCAL9555A (NXP)
- Gyro: FXAS21002 (NXP)
- Accelerometer: FXOS8700 (NXP)
- Current & Power Monitor: INA220 (TI)

This patch add listed devices to dts.

Signed-off-by: Pawel Dembicki <[email protected]>
---
.../boot/dts/freescale/fsl-ls1012a-rdb.dts | 45 +++++++++++++++++++
1 file changed, 45 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
index d45c17620b98..12117a973eb6 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
@@ -7,6 +7,7 @@
*/
/dts-v1/;

+#include <dt-bindings/interrupt-controller/irq.h>
#include "fsl-ls1012a.dtsi"

/ {
@@ -33,6 +34,50 @@ &esdhc1 {

&i2c0 {
status = "okay";
+
+ accelerometer@1e {
+ compatible = "nxp,fxos8700";
+ reg = <0x1e>;
+ interrupt-parent = <&gpio26>;
+ interrupts = <13 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "INT1";
+ };
+
+ gyroscope@20 {
+ compatible = "nxp,fxas21002c";
+ reg = <0x20>;
+ };
+
+ gpio@24 {
+ compatible = "nxp,pcal9555a";
+ reg = <0x24>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ gpio@25 {
+ compatible = "nxp,pcal9555a";
+ reg = <0x25>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ gpio26: gpio@26 {
+ compatible = "nxp,pcal9555a";
+ reg = <0x26>;
+ interrupt-parent = <&gpio0>;
+ interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
+ interrupt-controller;
+ #interrupt-cells = <2>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
+
+ current-sensor@40 {
+ compatible = "ti,ina220";
+ reg = <0x40>;
+ shunt-resistor = <2000>;
+ };
};

&qspi {
--
2.25.1


2021-01-15 10:19:10

by Pawel Dembicki

[permalink] [raw]
Subject: [PATCH 2/2] arm64: dts: fsl-ls1012a-frdm: add spi-uart device

This patch adds spi-uart controller to LS1012A-FRDM board dts.
Device is equipped in SC16IS740 from NXP.

Signed-off-by: Pawel Dembicki <[email protected]>
---
.../boot/dts/freescale/fsl-ls1012a-frdm.dts | 21 +++++++++++++++++++
1 file changed, 21 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts b/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts
index 67702667ed8a..9473d16336a2 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts
@@ -7,6 +7,7 @@
*/
/dts-v1/;

+#include <dt-bindings/interrupt-controller/irq.h>
#include "fsl-ls1012a.dtsi"

/ {
@@ -57,6 +58,26 @@ simple-audio-card,codec {
};
};

+&dspi {
+ status = "okay";
+ bus-num = <0>;
+
+ serial@0 {
+ reg = <0>;
+ compatible = "nxp,sc16is740";
+ spi-max-frequency = <4000000>;
+ clocks = <&sc16is7xx_clk>;
+ interrupt-parent = <&gpio1>;
+ interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
+
+ sc16is7xx_clk: sc16is7xx_clk {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <24000000>;
+ };
+ };
+};
+
&duart0 {
status = "okay";
};
--
2.25.1

2021-01-18 07:40:34

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH 1/2] arm64: dts: fsl-ls1012a-rdb: add i2c devices

On Fri, Jan 15, 2021 at 11:16:12AM +0100, Pawel Dembicki wrote:
> LS1012A-RDB equipped in some i2c devices:
> - 3x GPIO Expander: PCAL9555A (NXP)
> - Gyro: FXAS21002 (NXP)
> - Accelerometer: FXOS8700 (NXP)
> - Current & Power Monitor: INA220 (TI)
>
> This patch add listed devices to dts.
>
> Signed-off-by: Pawel Dembicki <[email protected]>
> ---
> .../boot/dts/freescale/fsl-ls1012a-rdb.dts | 45 +++++++++++++++++++
> 1 file changed, 45 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
> index d45c17620b98..12117a973eb6 100644
> --- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
> +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
> @@ -7,6 +7,7 @@
> */
> /dts-v1/;
>
> +#include <dt-bindings/interrupt-controller/irq.h>
> #include "fsl-ls1012a.dtsi"
>
> / {
> @@ -33,6 +34,50 @@ &esdhc1 {
>
> &i2c0 {
> status = "okay";
> +
> + accelerometer@1e {
> + compatible = "nxp,fxos8700";
> + reg = <0x1e>;
> + interrupt-parent = <&gpio26>;
> + interrupts = <13 IRQ_TYPE_EDGE_RISING>;
> + interrupt-names = "INT1";
> + };
> +
> + gyroscope@20 {

Please sort these device node in unit-address.

Shawn

> + compatible = "nxp,fxas21002c";
> + reg = <0x20>;
> + };
> +
> + gpio@24 {
> + compatible = "nxp,pcal9555a";
> + reg = <0x24>;
> + gpio-controller;
> + #gpio-cells = <2>;
> + };
> +
> + gpio@25 {
> + compatible = "nxp,pcal9555a";
> + reg = <0x25>;
> + gpio-controller;
> + #gpio-cells = <2>;
> + };
> +
> + gpio26: gpio@26 {
> + compatible = "nxp,pcal9555a";
> + reg = <0x26>;
> + interrupt-parent = <&gpio0>;
> + interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
> + interrupt-controller;
> + #interrupt-cells = <2>;
> + gpio-controller;
> + #gpio-cells = <2>;
> + };
> +
> + current-sensor@40 {
> + compatible = "ti,ina220";
> + reg = <0x40>;
> + shunt-resistor = <2000>;
> + };
> };
>
> &qspi {
> --
> 2.25.1
>

2021-01-18 23:08:42

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH 2/2] arm64: dts: fsl-ls1012a-frdm: add spi-uart device

On Fri, Jan 15, 2021 at 11:16:13AM +0100, Pawel Dembicki wrote:
> This patch adds spi-uart controller to LS1012A-FRDM board dts.
> Device is equipped in SC16IS740 from NXP.
>
> Signed-off-by: Pawel Dembicki <[email protected]>
> ---
> .../boot/dts/freescale/fsl-ls1012a-frdm.dts | 21 +++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts b/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts
> index 67702667ed8a..9473d16336a2 100644
> --- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts
> +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts
> @@ -7,6 +7,7 @@
> */
> /dts-v1/;
>
> +#include <dt-bindings/interrupt-controller/irq.h>
> #include "fsl-ls1012a.dtsi"
>
> / {
> @@ -57,6 +58,26 @@ simple-audio-card,codec {
> };
> };
>
> +&dspi {
> + status = "okay";
> + bus-num = <0>;

Let's end property list with `status`.

> +
> + serial@0 {
> + reg = <0>;
> + compatible = "nxp,sc16is740";

Let's start property list with `compatible`.

> + spi-max-frequency = <4000000>;
> + clocks = <&sc16is7xx_clk>;
> + interrupt-parent = <&gpio1>;
> + interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
> +
> + sc16is7xx_clk: sc16is7xx_clk {

clock-sc16is7xx for node name maybe.

Shawn

> + compatible = "fixed-clock";
> + #clock-cells = <0>;
> + clock-frequency = <24000000>;
> + };
> + };
> +};
> +
> &duart0 {
> status = "okay";
> };
> --
> 2.25.1
>

2021-01-19 05:22:41

by Pawel Dembicki

[permalink] [raw]
Subject: Re: [PATCH 1/2] arm64: dts: fsl-ls1012a-rdb: add i2c devices

On 18.01.2021 at 08:36 Shawn Guo <[email protected]> wrote:
>
> On Fri, Jan 15, 2021 at 11:16:12AM +0100, Pawel Dembicki wrote:
> > LS1012A-RDB equipped in some i2c devices:
> > - 3x GPIO Expander: PCAL9555A (NXP)
> > - Gyro: FXAS21002 (NXP)
> > - Accelerometer: FXOS8700 (NXP)
> > - Current & Power Monitor: INA220 (TI)
> >
> > This patch add listed devices to dts.
> >
> > Signed-off-by: Pawel Dembicki <[email protected]>
> > ---
> > .../boot/dts/freescale/fsl-ls1012a-rdb.dts | 45 +++++++++++++++++++
> > 1 file changed, 45 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
> > index d45c17620b98..12117a973eb6 100644
> > --- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
> > +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
> > @@ -7,6 +7,7 @@
> > */
> > /dts-v1/;
> >
> > +#include <dt-bindings/interrupt-controller/irq.h>
> > #include "fsl-ls1012a.dtsi"
> >
> > / {
> > @@ -33,6 +34,50 @@ &esdhc1 {
> >
> > &i2c0 {
> > status = "okay";
> > +
> > + accelerometer@1e {
> > + compatible = "nxp,fxos8700";
> > + reg = <0x1e>;
> > + interrupt-parent = <&gpio26>;
> > + interrupts = <13 IRQ_TYPE_EDGE_RISING>;
> > + interrupt-names = "INT1";
> > + };
> > +
> > + gyroscope@20 {
>
> Please sort these device node in unit-address.
>
> Shawn
>

Could You give me more details please? Devices are sorted by
unit-address ascending.

Pawel

> > + compatible = "nxp,fxas21002c";
> > + reg = <0x20>;
> > + };
> > +
> > + gpio@24 {
> > + compatible = "nxp,pcal9555a";
> > + reg = <0x24>;
> > + gpio-controller;
> > + #gpio-cells = <2>;
> > + };
> > +
> > + gpio@25 {
> > + compatible = "nxp,pcal9555a";
> > + reg = <0x25>;
> > + gpio-controller;
> > + #gpio-cells = <2>;
> > + };
> > +
> > + gpio26: gpio@26 {
> > + compatible = "nxp,pcal9555a";
> > + reg = <0x26>;
> > + interrupt-parent = <&gpio0>;
> > + interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
> > + interrupt-controller;
> > + #interrupt-cells = <2>;
> > + gpio-controller;
> > + #gpio-cells = <2>;
> > + };
> > +
> > + current-sensor@40 {
> > + compatible = "ti,ina220";
> > + reg = <0x40>;
> > + shunt-resistor = <2000>;
> > + };
> > };
> >
> > &qspi {
> > --
> > 2.25.1
> >

2021-01-19 09:09:04

by Shawn Guo

[permalink] [raw]
Subject: Re: [PATCH 1/2] arm64: dts: fsl-ls1012a-rdb: add i2c devices

On Mon, Jan 18, 2021 at 11:08:11AM +0100, Paweł Dembicki wrote:
> On 18.01.2021 at 08:36 Shawn Guo <[email protected]> wrote:
> >
> > On Fri, Jan 15, 2021 at 11:16:12AM +0100, Pawel Dembicki wrote:
> > > LS1012A-RDB equipped in some i2c devices:
> > > - 3x GPIO Expander: PCAL9555A (NXP)
> > > - Gyro: FXAS21002 (NXP)
> > > - Accelerometer: FXOS8700 (NXP)
> > > - Current & Power Monitor: INA220 (TI)
> > >
> > > This patch add listed devices to dts.
> > >
> > > Signed-off-by: Pawel Dembicki <[email protected]>
> > > ---
> > > .../boot/dts/freescale/fsl-ls1012a-rdb.dts | 45 +++++++++++++++++++
> > > 1 file changed, 45 insertions(+)
> > >
> > > diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
> > > index d45c17620b98..12117a973eb6 100644
> > > --- a/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
> > > +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts
> > > @@ -7,6 +7,7 @@
> > > */
> > > /dts-v1/;
> > >
> > > +#include <dt-bindings/interrupt-controller/irq.h>
> > > #include "fsl-ls1012a.dtsi"
> > >
> > > / {
> > > @@ -33,6 +34,50 @@ &esdhc1 {
> > >
> > > &i2c0 {
> > > status = "okay";
> > > +
> > > + accelerometer@1e {
> > > + compatible = "nxp,fxos8700";
> > > + reg = <0x1e>;
> > > + interrupt-parent = <&gpio26>;
> > > + interrupts = <13 IRQ_TYPE_EDGE_RISING>;
> > > + interrupt-names = "INT1";
> > > + };
> > > +
> > > + gyroscope@20 {
> >
> > Please sort these device node in unit-address.
> >
> > Shawn
> >
>
> Could You give me more details please? Devices are sorted by
> unit-address ascending.

Oops! I'm sorry. It must be something went wrong with my eyes.

Shawn