All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3 0/3] ARM: dts: add flexcan support
@ 2018-11-28  9:39 Joakim Zhang
  2018-11-28  9:39 ` [PATCH V3 1/3] ARM: dts: imx6sx-sdb: " Joakim Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Joakim Zhang @ 2018-11-28  9:39 UTC (permalink / raw)
  To: shawnguo, s.hauer
  Cc: kernel, Fabio Estevam, devicetree, robh+dt, dl-linux-imx, Joakim Zhang

This patch series intends to add flexcan support for IMX6 platforms.

Aisheng Dong (3):
  ARM: dts: imx6sx-sdb: add flexcan support
  ARM: dts: imx6sx-sabreauto: add flexcan support
  ARM: dts: imx6qdl-sabreauto: add flexcan support

 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 47 +++++++++++++++++++
 arch/arm/boot/dts/imx6sx-sabreauto.dts   | 57 ++++++++++++++++++++++++
 arch/arm/boot/dts/imx6sx-sdb-reva.dts    | 12 +++++
 arch/arm/boot/dts/imx6sx-sdb.dts         |  5 +++
 arch/arm/boot/dts/imx6sx-sdb.dtsi        | 42 +++++++++++++++++
 5 files changed, 163 insertions(+)

-- 
2.17.1

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

* [PATCH V3 1/3] ARM: dts: imx6sx-sdb: add flexcan support
  2018-11-28  9:39 [PATCH V3 0/3] ARM: dts: add flexcan support Joakim Zhang
@ 2018-11-28  9:39 ` Joakim Zhang
  2018-11-28  9:39 ` [PATCH V3 2/3] ARM: dts: imx6sx-sabreauto: " Joakim Zhang
  2018-11-28  9:39 ` [PATCH V3 3/3] ARM: dts: imx6qdl-sabreauto: " Joakim Zhang
  2 siblings, 0 replies; 5+ messages in thread
From: Joakim Zhang @ 2018-11-28  9:39 UTC (permalink / raw)
  To: shawnguo, s.hauer
  Cc: kernel, Fabio Estevam, devicetree, robh+dt, dl-linux-imx,
	Aisheng DONG, Joakim Zhang

From: Aisheng Dong <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: Aisheng Dong <aisheng.dong@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
ChangeLog:
V1->V2:
	*no change.
V2->V3:
	*use label node like:
	 &reg_can_en{
	     ...
	 };
---
 arch/arm/boot/dts/imx6sx-sdb-reva.dts | 12 ++++++++
 arch/arm/boot/dts/imx6sx-sdb.dts      |  5 ++++
 arch/arm/boot/dts/imx6sx-sdb.dtsi     | 42 +++++++++++++++++++++++++++
 3 files changed, 59 insertions(+)

diff --git a/arch/arm/boot/dts/imx6sx-sdb-reva.dts b/arch/arm/boot/dts/imx6sx-sdb-reva.dts
index 9cc6ff206aea..82ca8d7c7b9d 100644
--- a/arch/arm/boot/dts/imx6sx-sdb-reva.dts
+++ b/arch/arm/boot/dts/imx6sx-sdb-reva.dts
@@ -142,3 +142,15 @@
 		spi-max-frequency = <66000000>;
 	};
 };
+
+&reg_can_en {
+	/* Transceiver EN/STBY is active high on RevA board */
+	gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>;
+	enable-active-high;
+};
+
+&reg_can_stby {
+	gpio = <&gpio4 27 GPIO_ACTIVE_HIGH>;
+	enable-active-high;
+	vin-supply = <&reg_can_en>;
+};
diff --git a/arch/arm/boot/dts/imx6sx-sdb.dts b/arch/arm/boot/dts/imx6sx-sdb.dts
index 6dd9bebfe027..24a4b4eec29b 100644
--- a/arch/arm/boot/dts/imx6sx-sdb.dts
+++ b/arch/arm/boot/dts/imx6sx-sdb.dts
@@ -136,3 +136,8 @@
 &reg_soc {
 	vin-supply = <&sw1a_reg>;
 };
+
+&reg_can_stby {
+	/* Transceiver EN/STBY is active low on RevB board */
+	gpio = <&gpio4 27 GPIO_ACTIVE_LOW>;
+};
diff --git a/arch/arm/boot/dts/imx6sx-sdb.dtsi b/arch/arm/boot/dts/imx6sx-sdb.dtsi
index 7d7d679945d2..5506a8258816 100644
--- a/arch/arm/boot/dts/imx6sx-sdb.dtsi
+++ b/arch/arm/boot/dts/imx6sx-sdb.dtsi
@@ -140,6 +140,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";
@@ -207,6 +221,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";
@@ -404,6 +432,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] 5+ messages in thread

* [PATCH V3 2/3] ARM: dts: imx6sx-sabreauto: add flexcan support
  2018-11-28  9:39 [PATCH V3 0/3] ARM: dts: add flexcan support Joakim Zhang
  2018-11-28  9:39 ` [PATCH V3 1/3] ARM: dts: imx6sx-sdb: " Joakim Zhang
@ 2018-11-28  9:39 ` Joakim Zhang
  2018-11-28  9:39 ` [PATCH V3 3/3] ARM: dts: imx6qdl-sabreauto: " Joakim Zhang
  2 siblings, 0 replies; 5+ messages in thread
From: Joakim Zhang @ 2018-11-28  9:39 UTC (permalink / raw)
  To: shawnguo, s.hauer
  Cc: kernel, Fabio Estevam, devicetree, robh+dt, dl-linux-imx,
	Aisheng DONG, Joakim Zhang

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

The CAN transceiver on MX6SX Sabreauto board seems in sleep mode by default
after power up the board. User has to press the wakeup key on ARD baseboard
before using the transceiver, or it may not work properly when power up the
board at the first time(warm reset does not have such issue).

This patch operates the wake pin too besides stby/en pins by chaining them
together in regulator mode.

Signed-off-by: Aisheng Dong <aisheng.dong@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
ChangeLog:
V1->V3:
	*no change.
---
 arch/arm/boot/dts/imx6sx-sabreauto.dts | 57 ++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/arch/arm/boot/dts/imx6sx-sabreauto.dts b/arch/arm/boot/dts/imx6sx-sabreauto.dts
index 841a27f3198f..8f3319e7692f 100644
--- a/arch/arm/boot/dts/imx6sx-sabreauto.dts
+++ b/arch/arm/boot/dts/imx6sx-sabreauto.dts
@@ -36,6 +36,35 @@
 		gpio = <&gpio2 11 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 	};
+
+	reg_can_wake: regulator-can-wake {
+		compatible = "regulator-fixed";
+		regulator-name = "can-wake";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&max7310_b 7 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
+	reg_can_en: regulator-can-en {
+		compatible = "regulator-fixed";
+		regulator-name = "can-en";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&max7310_b 5 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		vin-supply = <&reg_can_wake>;
+	};
+
+	reg_can_stby: regulator-can-stby {
+		compatible = "regulator-fixed";
+		regulator-name = "can-stby";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&max7310_b 4 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		vin-supply = <&reg_can_en>;
+	};
 };
 
 &anaclk2 {
@@ -75,6 +104,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";
+};
+
 &uart1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart1>;
@@ -149,6 +192,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_i2c2: i2c2grp {
 		fsl,pins = <
 			MX6SX_PAD_GPIO1_IO03__I2C2_SDA          0x4001b8b1
-- 
2.17.1

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

* [PATCH V3 3/3] ARM: dts: imx6qdl-sabreauto: add flexcan support
  2018-11-28  9:39 [PATCH V3 0/3] ARM: dts: add flexcan support Joakim Zhang
  2018-11-28  9:39 ` [PATCH V3 1/3] ARM: dts: imx6sx-sdb: " Joakim Zhang
  2018-11-28  9:39 ` [PATCH V3 2/3] ARM: dts: imx6sx-sabreauto: " Joakim Zhang
@ 2018-11-28  9:39 ` Joakim Zhang
  2018-11-28 10:00   ` Marc Kleine-Budde
  2 siblings, 1 reply; 5+ messages in thread
From: Joakim Zhang @ 2018-11-28  9:39 UTC (permalink / raw)
  To: shawnguo, s.hauer
  Cc: kernel, Fabio Estevam, devicetree, robh+dt, dl-linux-imx,
	Aisheng DONG, Joakim Zhang

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

The flexcan1 is pin conflict with fec. User would make flexcan1 enabled
with fec disabled to use CAN.

Signed-off-by: Aisheng Dong <aisheng.dong@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
V1->V2:
	*using SPDX tag for new files and remove pinctrl-assert-gpios property.
V2->V3:
	*remove the new files due to a pile of DTS files for a single
	 development board with pin sharing among different devices not
	 maintained.
---
 arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 47 ++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
index a10f0ad0bfb1..bd4fe0add59d 100644
--- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
@@ -101,6 +101,25 @@
 		enable-active-high;
 	};
 
+	reg_can_en: regulator-can-en {
+		compatible = "regulator-fixed";
+		regulator-name = "can-en";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&max7310_b 6 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
+	reg_can_stby: regulator-can-stby {
+		compatible = "regulator-fixed";
+		regulator-name = "can-stby";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&max7310_b 5 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		vin-supply = <&reg_can_en>;
+	};
+
 	sound-cs42888 {
 		compatible = "fsl,imx6-sabreauto-cs42888",
 			"fsl,imx-audio-cs42888";
@@ -279,6 +298,20 @@
 	status = "okay";
 };
 
+&can1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_flexcan1>;
+	pinctrl-assert-gpios = <&max7310_b 3 GPIO_ACTIVE_HIGH>; /* TX */
+	xceiver-supply = <&reg_can_stby>;
+	status = "disabled"; /* pin conflict with fec */ };
+
+&can2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_flexcan2>;
+	xceiver-supply = <&reg_can_stby>;
+	status = "okay";
+};
+
 &gpmi {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_gpmi_nand>;
@@ -494,6 +527,20 @@
 			>;
 		};
 
+		pinctrl_flexcan1: flexcan1grp {
+			fsl,pins = <
+				MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX        0x17059
+				MX6QDL_PAD_KEY_COL2__FLEXCAN1_TX	0x17059
+			>;
+		};
+
+		pinctrl_flexcan2: flexcan2grp {
+			fsl,pins = <
+				MX6QDL_PAD_KEY_COL4__FLEXCAN2_TX	0x17059
+				MX6QDL_PAD_KEY_ROW4__FLEXCAN2_RX	0x17059
+			>;
+		};
+
 		pinctrl_gpio_keys: gpiokeysgrp {
 			fsl,pins = <
 				MX6QDL_PAD_SD2_CMD__GPIO1_IO11		0x1b0b0
-- 
2.17.1

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

* Re: [PATCH V3 3/3] ARM: dts: imx6qdl-sabreauto: add flexcan support
  2018-11-28  9:39 ` [PATCH V3 3/3] ARM: dts: imx6qdl-sabreauto: " Joakim Zhang
@ 2018-11-28 10:00   ` Marc Kleine-Budde
  0 siblings, 0 replies; 5+ messages in thread
From: Marc Kleine-Budde @ 2018-11-28 10:00 UTC (permalink / raw)
  To: Joakim Zhang, shawnguo, s.hauer
  Cc: Aisheng DONG, devicetree, robh+dt, dl-linux-imx, kernel, Fabio Estevam


[-- Attachment #1.1: Type: text/plain, Size: 3141 bytes --]

On 11/28/18 10:39 AM, Joakim Zhang wrote:
> From: Aisheng Dong <aisheng.dong@nxp.com>
> 
> The flexcan1 is pin conflict with fec. User would make flexcan1 enabled
> with fec disabled to use CAN.
> 
> Signed-off-by: Aisheng Dong <aisheng.dong@nxp.com>
> Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
> ---
> V1->V2:
> 	*using SPDX tag for new files and remove pinctrl-assert-gpios property.

There's a pinctrl-assert-gpios in the dtsi.

> V2->V3:
> 	*remove the new files due to a pile of DTS files for a single
> 	 development board with pin sharing among different devices not
> 	 maintained.
> ---
>  arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 47 ++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
> index a10f0ad0bfb1..bd4fe0add59d 100644
> --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
> +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi
> @@ -101,6 +101,25 @@
>  		enable-active-high;
>  	};
>  
> +	reg_can_en: regulator-can-en {
> +		compatible = "regulator-fixed";
> +		regulator-name = "can-en";
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +		gpio = <&max7310_b 6 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +	};
> +
> +	reg_can_stby: regulator-can-stby {
> +		compatible = "regulator-fixed";
> +		regulator-name = "can-stby";
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +		gpio = <&max7310_b 5 GPIO_ACTIVE_HIGH>;
> +		enable-active-high;
> +		vin-supply = <&reg_can_en>;
> +	};
> +
>  	sound-cs42888 {
>  		compatible = "fsl,imx6-sabreauto-cs42888",
>  			"fsl,imx-audio-cs42888";
> @@ -279,6 +298,20 @@
>  	status = "okay";
>  };
>  
> +&can1 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_flexcan1>;
> +	pinctrl-assert-gpios = <&max7310_b 3 GPIO_ACTIVE_HIGH>; /* TX */
        ^^^^^^^^^^^^^^^^^^^^

Marc

> +	xceiver-supply = <&reg_can_stby>;
> +	status = "disabled"; /* pin conflict with fec */ };
> +
> +&can2 {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pinctrl_flexcan2>;
> +	xceiver-supply = <&reg_can_stby>;
> +	status = "okay";
> +};
> +
>  &gpmi {
>  	pinctrl-names = "default";
>  	pinctrl-0 = <&pinctrl_gpmi_nand>;
> @@ -494,6 +527,20 @@
>  			>;
>  		};
>  
> +		pinctrl_flexcan1: flexcan1grp {
> +			fsl,pins = <
> +				MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX        0x17059
> +				MX6QDL_PAD_KEY_COL2__FLEXCAN1_TX	0x17059
> +			>;
> +		};
> +
> +		pinctrl_flexcan2: flexcan2grp {
> +			fsl,pins = <
> +				MX6QDL_PAD_KEY_COL4__FLEXCAN2_TX	0x17059
> +				MX6QDL_PAD_KEY_ROW4__FLEXCAN2_RX	0x17059
> +			>;
> +		};
> +
>  		pinctrl_gpio_keys: gpiokeysgrp {
>  			fsl,pins = <
>  				MX6QDL_PAD_SD2_CMD__GPIO1_IO11		0x1b0b0
> 


-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2018-11-28 20:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-28  9:39 [PATCH V3 0/3] ARM: dts: add flexcan support Joakim Zhang
2018-11-28  9:39 ` [PATCH V3 1/3] ARM: dts: imx6sx-sdb: " Joakim Zhang
2018-11-28  9:39 ` [PATCH V3 2/3] ARM: dts: imx6sx-sabreauto: " Joakim Zhang
2018-11-28  9:39 ` [PATCH V3 3/3] ARM: dts: imx6qdl-sabreauto: " Joakim Zhang
2018-11-28 10:00   ` Marc Kleine-Budde

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.