linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: dts: imx6sx-sdb: Add flexcan support
@ 2018-10-19  9:42 Joakim Zhang
  2018-10-19 12:51 ` Fabio Estevam
  0 siblings, 1 reply; 3+ messages in thread
From: Joakim Zhang @ 2018-10-19  9:42 UTC (permalink / raw)
  To: shawnguo, s.hauer, kernel, Fabio Estevam, dl-linux-imx, robh+dt,
	mark.rutland
  Cc: linux-arm-kernel, devicetree, linux-kernel, A.s. Dong, Joakim Zhang

From: Dong Aisheng <aisheng.dong@nxp.com>

CAN transceiver is different on RevA and RevB board.
It's active high on RevA while active low on Rev B.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 arch/arm/boot/dts/imx6sx-sdb.dts  |  5 ++++
 arch/arm/boot/dts/imx6sx-sdb.dtsi | 42 +++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/arch/arm/boot/dts/imx6sx-sdb.dts b/arch/arm/boot/dts/imx6sx-sdb.dts
index 6dd9bebfe027..092b8de142a8 100644
--- a/arch/arm/boot/dts/imx6sx-sdb.dts
+++ b/arch/arm/boot/dts/imx6sx-sdb.dts
@@ -10,6 +10,11 @@
 
 / {
 	model = "Freescale i.MX6 SoloX SDB RevB Board";
+
+	/* Transceiver EN/STBY is active low on RevB board */
+	reg_can_stby: regulator-can-stby {
+		gpio = <&gpio4 27 GPIO_ACTIVE_LOW>;
+	};
 };
 
 &i2c1 {
diff --git a/arch/arm/boot/dts/imx6sx-sdb.dtsi b/arch/arm/boot/dts/imx6sx-sdb.dtsi
index f8f31872fa14..e37ec4b396a2 100644
--- a/arch/arm/boot/dts/imx6sx-sdb.dtsi
+++ b/arch/arm/boot/dts/imx6sx-sdb.dtsi
@@ -136,6 +136,20 @@
 		regulator-max-microvolt = <5000000>;
 	};
 
+	reg_can_en: regulator-can-en {
+		compatible = "regulator-fixed";
+		regulator-name = "can-en";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
+	reg_can_stby: regulator-can-stby {
+		compatible = "regulator-fixed";
+		regulator-name = "can-stby";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
 	sound {
 		compatible = "fsl,imx6sx-sdb-wm8962", "fsl,imx-audio-wm8962";
 		model = "wm8962-audio";
@@ -202,6 +216,20 @@
 	status = "okay";
 };
 
+&flexcan1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_flexcan1>;
+	xceiver-supply = <&reg_can_stby>;
+	status = "okay";
+};
+
+&flexcan2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_flexcan2>;
+	xceiver-supply = <&reg_can_stby>;
+	status = "okay";
+};
+
 &i2c3 {
 	clock-frequency = <100000>;
 	pinctrl-names = "default";
@@ -397,6 +425,20 @@
 			>;
 		};
 
+		pinctrl_flexcan1: flexcan1grp {
+			fsl,pins = <
+				MX6SX_PAD_QSPI1B_DQS__CAN1_TX		0x1b020
+				MX6SX_PAD_QSPI1A_SS1_B__CAN1_RX		0x1b020
+			>;
+		};
+
+		pinctrl_flexcan2: flexcan2grp {
+			fsl,pins = <
+				MX6SX_PAD_QSPI1B_SS1_B__CAN2_RX		0x1b020
+				MX6SX_PAD_QSPI1A_DQS__CAN2_TX		0x1b020
+			>;
+		};
+
 		pinctrl_gpio_keys: gpio_keysgrp {
 			fsl,pins = <
 				MX6SX_PAD_CSI_DATA04__GPIO1_IO_18 0x17059
-- 
2.17.1


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

* Re: [PATCH] ARM: dts: imx6sx-sdb: Add flexcan support
  2018-10-19  9:42 [PATCH] ARM: dts: imx6sx-sdb: Add flexcan support Joakim Zhang
@ 2018-10-19 12:51 ` Fabio Estevam
  2018-10-20  2:03   ` Joakim Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2018-10-19 12:51 UTC (permalink / raw)
  To: qiangqing.zhang
  Cc: Shawn Guo, Sascha Hauer, Sascha Hauer, Fabio Estevam,
	NXP Linux Team, Rob Herring, Mark Rutland, Dong Aisheng,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE

Hi Joakim,

On Fri, Oct 19, 2018 at 6:43 AM Joakim Zhang <qiangqing.zhang@nxp.com> wrote:
>
> From: Dong Aisheng <aisheng.dong@nxp.com>
>
> CAN transceiver is different on RevA and RevB board.
> It's active high on RevA while active low on Rev B.
>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> ---
>  arch/arm/boot/dts/imx6sx-sdb.dts  |  5 ++++
>  arch/arm/boot/dts/imx6sx-sdb.dtsi | 42 +++++++++++++++++++++++++++++++
>  2 files changed, 47 insertions(+)
>
> diff --git a/arch/arm/boot/dts/imx6sx-sdb.dts b/arch/arm/boot/dts/imx6sx-sdb.dts
> index 6dd9bebfe027..092b8de142a8 100644
> --- a/arch/arm/boot/dts/imx6sx-sdb.dts
> +++ b/arch/arm/boot/dts/imx6sx-sdb.dts
> @@ -10,6 +10,11 @@
>
>  / {
>         model = "Freescale i.MX6 SoloX SDB RevB Board";
> +
> +       /* Transceiver EN/STBY is active low on RevB board */
> +       reg_can_stby: regulator-can-stby {
> +               gpio = <&gpio4 27 GPIO_ACTIVE_LOW>;

Don't we need a  gpio = <&gpio4 27 GPIO_ACTIVE_HIGH>; and also a
"enable-active-high" entries in the imx6sx-sdb-reva.dts?

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

* RE: [PATCH] ARM: dts: imx6sx-sdb: Add flexcan support
  2018-10-19 12:51 ` Fabio Estevam
@ 2018-10-20  2:03   ` Joakim Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Joakim Zhang @ 2018-10-20  2:03 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: Shawn Guo, Sascha Hauer, Sascha Hauer, Fabio Estevam,
	dl-linux-imx, Rob Herring, Mark Rutland, A.s. Dong,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-kernel,
	moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE


-----Original Message-----
From: Fabio Estevam [mailto:festevam@gmail.com] 
Sent: 2018年10月19日 20:52
To: Joakim Zhang <qiangqing.zhang@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>; Sascha Hauer <s.hauer@pengutronix.de>; Sascha Hauer <kernel@pengutronix.de>; Fabio Estevam <fabio.estevam@nxp.com>; dl-linux-imx <linux-imx@nxp.com>; Rob Herring <robh+dt@kernel.org>; Mark Rutland <mark.rutland@arm.com>; A.s. Dong <aisheng.dong@nxp.com>; open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS <devicetree@vger.kernel.org>; linux-kernel <linux-kernel@vger.kernel.org>; moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] ARM: dts: imx6sx-sdb: Add flexcan support

Hi Joakim,

On Fri, Oct 19, 2018 at 6:43 AM Joakim Zhang <qiangqing.zhang@nxp.com> wrote:
>
> From: Dong Aisheng <aisheng.dong@nxp.com>
>
> CAN transceiver is different on RevA and RevB board.
> It's active high on RevA while active low on Rev B.
>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> ---
>  arch/arm/boot/dts/imx6sx-sdb.dts  |  5 ++++  
> arch/arm/boot/dts/imx6sx-sdb.dtsi | 42 +++++++++++++++++++++++++++++++
>  2 files changed, 47 insertions(+)
>
> diff --git a/arch/arm/boot/dts/imx6sx-sdb.dts 
> b/arch/arm/boot/dts/imx6sx-sdb.dts
> index 6dd9bebfe027..092b8de142a8 100644
> --- a/arch/arm/boot/dts/imx6sx-sdb.dts
> +++ b/arch/arm/boot/dts/imx6sx-sdb.dts
> @@ -10,6 +10,11 @@
>
>  / {
>         model = "Freescale i.MX6 SoloX SDB RevB Board";
> +
> +       /* Transceiver EN/STBY is active low on RevB board */
> +       reg_can_stby: regulator-can-stby {
> +               gpio = <&gpio4 27 GPIO_ACTIVE_LOW>;

Don't we need a  gpio = <&gpio4 27 GPIO_ACTIVE_HIGH>; and also a "enable-active-high" entries in the imx6sx-sdb-reva.dts?

Yes, you are right. I will add the entry in the imx6sx-sdb-reva.dts. Thanks a lot! 

BRs,
Jaokim Zhang


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

end of thread, other threads:[~2018-10-20  2:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-19  9:42 [PATCH] ARM: dts: imx6sx-sdb: Add flexcan support Joakim Zhang
2018-10-19 12:51 ` Fabio Estevam
2018-10-20  2:03   ` Joakim Zhang

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