Skip to contentSkip to conversation

ARM: dts: imx6sx-sabreauto: add PMIC support

PATCH Superseded Anson Huang 2 participants 12 messages Apr 25, 2018 – Apr 27, 2018

Subsystems (3)

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/6 ARM: dts: imx6sx-sabreauto: add PMIC support

Add pfuze100 support on i.MX6SX Sabre Auto board.

---
no changes.

 arch/arm/boot/dts/imx6sx-sabreauto.dts | 117 +++++++++++++++++++++++++++++++++
 1 file changed, 117 insertions(+)
arch/arm/boot/dts/imx6sx-sabreauto.dts +117 -0
index 57d1ea0..2caca934 100644
@@ -74,6 +74,14 @@
 
 &iomuxc {
 	imx6x-sabreauto {
+
+		pinctrl_i2c2_1: i2c2grp-1 {
+			fsl,pins = <
+				MX6SX_PAD_GPIO1_IO03__I2C2_SDA          0x4001b8b1
+				MX6SX_PAD_GPIO1_IO02__I2C2_SCL          0x4001b8b1
+			>;
+		};
+
 		pinctrl_uart1: uart1grp {
 			fsl,pins = <
 				MX6SX_PAD_GPIO1_IO04__UART1_TX		0x1b0b1
@@ -148,3 +156,112 @@
 		};
 	};
 };
+
+&i2c2 {
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c2_1>;
+	status = "okay";
+
+	pmic: pfuze100 at 08 {
+		compatible = "fsl,pfuze100";
+		reg = <0x08>;
+
+		regulators {
+			sw1a_reg: sw1ab {
+				regulator-min-microvolt = <300000>;
+				regulator-max-microvolt = <1875000>;
+				regulator-boot-on;
+				regulator-always-on;
+				regulator-ramp-delay = <6250>;
+			};
+
+			sw1c_reg: sw1c {
+				regulator-min-microvolt = <300000>;
+				regulator-max-microvolt = <1875000>;
+				regulator-boot-on;
+				regulator-always-on;
+				regulator-ramp-delay = <6250>;
+			};
+
+			sw2_reg: sw2 {
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			sw3a_reg: sw3a {
+				regulator-min-microvolt = <400000>;
+				regulator-max-microvolt = <1975000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			sw3b_reg: sw3b {
+				regulator-min-microvolt = <400000>;
+				regulator-max-microvolt = <1975000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			sw4_reg: sw4 {
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+			};
+
+			swbst_reg: swbst {
+				regulator-min-microvolt = <5000000>;
+				regulator-max-microvolt = <5150000>;
+			};
+
+			snvs_reg: vsnvs {
+				regulator-min-microvolt = <1000000>;
+				regulator-max-microvolt = <3000000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			vref_reg: vrefddr {
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			vgen1_reg: vgen1 {
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <1550000>;
+				regulator-always-on;
+			};
+
+			vgen2_reg: vgen2 {
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <1550000>;
+			};
+
+			vgen3_reg: vgen3 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+			};
+
+			vgen4_reg: vgen4 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+			};
+
+			vgen5_reg: vgen5 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+			};
+
+			vgen6_reg: vgen6 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+			};
+		};
+	};
+};
Signature · 1 line
2.7.4
#1 lore raw

PATCH v4 2/6 ARM: dts: imx6sx-sabreauto: add max7322 IO expander support

Add MAX7322 IO expander support.

---
no changes.

 arch/arm/boot/dts/imx6sx-sabreauto.dts | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/boot/dts/imx6sx-sabreauto.dts +7 -0
index 2caca934..d59084f 100644
@@ -163,6 +163,13 @@
 	pinctrl-0 = <&pinctrl_i2c2_1>;
 	status = "okay";
 
+	max7322: gpio at 68 {
+		compatible = "maxim,max7322";
+		reg = <0x68>;
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
+
 	pmic: pfuze100 at 08 {
 		compatible = "fsl,pfuze100";
 		reg = <0x08>;
Signature · 1 line
2.7.4
#2 lore raw

PATCH v4 3/6 ARM: dts: imx6sx-sabreauto: add IO expander max7310 support

In reply to Anson Huang

i.MX6SX Sabre Auto board has two max7310 IO expander on I2C3 bus, add support for them.

---
no changes.

 arch/arm/boot/dts/imx6sx-sabreauto.dts | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
arch/arm/boot/dts/imx6sx-sabreauto.dts +28 -0
index d59084f..812f40b 100644
@@ -82,6 +82,13 @@
 			>;
 		};
 
+		pinctrl_i2c3_2: i2c3grp-2 {
+			fsl,pins = <
+				MX6SX_PAD_KEY_ROW4__I2C3_SDA            0x4001b8b1
+				MX6SX_PAD_KEY_COL4__I2C3_SCL            0x4001b8b1
+			>;
+		};
+
 		pinctrl_uart1: uart1grp {
 			fsl,pins = <
 				MX6SX_PAD_GPIO1_IO04__UART1_TX		0x1b0b1
@@ -272,3 +279,24 @@
 		};
 	};
 };
+
+&i2c3 {
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_i2c3_2>;
+	status = "okay";
+
+	max7310_a: gpio at 30 {
+		compatible = "maxim,max7310";
+		reg = <0x30>;
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
+
+	max7310_b: gpio at 32 {
+		compatible = "maxim,max7310";
+		reg = <0x32>;
+		gpio-controller;
+		#gpio-cells = <2>;
+	};
+};
Signature · 1 line
2.7.4
reviewer
#3 lore raw

Re: [PATCH V4 3/6] ARM: dts: imx6sx-sabreauto: add IO expander max7310 support

Quoted 9 lines · Anson Huang

+&i2c3 {

arch/arm/boot/dts/imx6sx-sabreauto.dts +8 -0
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c3_2>;
+       status = "okay";
+
+       max7310_a: gpio at 30 {
+               compatible = "maxim,max7310";
+               reg = <0x30>;

arch/arm/boot/dts/imx6sx-sabreauto.dts line 301

Quoted 10 lines
arch/arm/boot/dts/imx6sx-sabreauto.dts +10 -0
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
+
+       max7310_b: gpio at 32 {
+               compatible = "maxim,max7310";
+               reg = <0x32>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };

Please also add the users for the MAX7310 pins, such as Ethernet PHY.

#4 lore raw

RE: [PATCH V4 3/6] ARM: dts: imx6sx-sabreauto: add IO expander max7310 support

Hi, Fabio

Anson Huang
Best Regards!

Quoted 31 lines

-----Original Message-----
From: Fabio Estevam [mailto:festevam at gmail.com]
Sent: Thursday, April 26, 2018 5:46 AM
To: Anson Huang <[email protected]>
Cc: Shawn Guo <[email protected]>; Sascha Hauer <[email protected]>; Fabio Estevam <[email protected]>; Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Russell King - ARM Linux <[email protected]>; dl-linux-imx <[email protected]>; moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE <[email protected]>; open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS <[email protected]>; linux-kernel <[email protected]>
Subject: Re: [PATCH V4 3/6] ARM: dts: imx6sx-sabreauto: add IO expander max7310 support

Quoted 13 lines · Anson Huang

+&i2c3 {

arch/arm/boot/dts/imx6sx-sabreauto.dts +12 -0
+       clock-frequency = <100000>;
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_i2c3_2>;
+       status = "okay";
+
+       max7310_a: gpio at 30 {
+               compatible = "maxim,max7310";
+               reg = <0x30>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };
+
Quoted 8 lines

arch/arm/boot/dts/imx6sx-sabreauto.dts line 301

Quoted 6 lines
arch/arm/boot/dts/imx6sx-sabreauto.dts +6 -0
+       max7310_b: gpio at 32 {
+               compatible = "maxim,max7310";
+               reg = <0x32>;
+               gpio-controller;
+               #gpio-cells = <2>;
+       };

Please also add the users for the MAX7310 pins, such as Ethernet PHY.

MAX7310 pins are for PCIe, CAN, MLB. GPS etc., these modules are NOT enabled yet, so I can NOT test it, I think we should add MAX7310 users when these modules are enabled, ethernet PHY is NOT controlled by it.

Anson.

reviewer
#5 lore raw

Re: [PATCH V4 3/6] ARM: dts: imx6sx-sabreauto: add IO expander max7310 support

Quoted 3 lines · Anson Huang

MAX7310 pins are for PCIe, CAN, MLB. GPS etc., these modules are NOT enabled yet, so I can NOT test it, I think we should add MAX7310 users when these modules are enabled, ethernet PHY is NOT controlled by it.

You said previously that MAX7310 also controls the Ethernet PHY. Is the vendor dts wrong then?

If there are no MAX7310 users, why are you adding support for MAX7310 then?

Confused.

#6 lore raw

RE: [PATCH V4 3/6] ARM: dts: imx6sx-sabreauto: add IO expander max7310 support

Anson Huang
Best Regards!

Quoted 22 lines

-----Original Message-----
From: Fabio Estevam [mailto:festevam at gmail.com]
Sent: Thursday, April 26, 2018 2:21 PM
To: Anson Huang <[email protected]>
Cc: Shawn Guo <[email protected]>; Sascha Hauer <[email protected]>; Fabio Estevam <[email protected]>; Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Russell King - ARM Linux <[email protected]>; dl-linux-imx <[email protected]>; moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE <[email protected]>; open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS <[email protected]>; linux-kernel <[email protected]>
Subject: Re: [PATCH V4 3/6] ARM: dts: imx6sx-sabreauto: add IO expander max7310 support

Quoted 3 lines · Anson Huang

MAX7310 pins are for PCIe, CAN, MLB. GPS etc., these modules are NOT enabled yet, so I can NOT test it, I think we should add MAX7310 users when these modules are enabled, ethernet PHY is NOT controlled by it.

Quoted 6 lines

You said previously that MAX7310 also controls the Ethernet PHY. Is the vendor dts wrong then?

If there are no MAX7310 users, why are you adding support for MAX7310 then?

Confused.

I searched the mail I sent, I can NOT found where I said "MAX7310 controls the ethernet phy"....

There are MAX7310 users, it is just because currently those users are NOT enabled, so I can NOT verify them. MAX7310 is an independent I2C device, why we can NOT enable it first?
I tested it from sysfs interface, we can control the MAX7310's IO output via echo different value to GPIO value, that means MAX7310 itself as an IO expander chip is working just fine, similar with PMIC, it is a I2C device, can be enabled independently, then consumers can be added later when they are enabled. Just my personal opinion, thanks.

Anson.

reviewer
#7 lore raw

Re: [PATCH V4 3/6] ARM: dts: imx6sx-sabreauto: add IO expander max7310 support

Quoted 1 line · Anson Huang

I searched the mail I sent, I can NOT found where I said "MAX7310 controls the ethernet phy"....

Initially you passed: pinctrl-assert-gpios = <&max7322 0 GPIO_ACTIVE_HIGH> inside the fec1 node.

Then I explained that 'pinctrl-assert-gpios' is not a valid property in mainline. It only exists in NXP vendor tree.

Then you explained:

"Sorry, I made a mistake here, the MAX7320 IO0 is for adjusting FEC1's voltage"

Quoted 6 lines

There are MAX7310 users, it is just because currently those users are NOT enabled, so I can NOT verify them. MAX7310 is an independent I2C device, why we can NOT enable it first?
I tested it from sysfs interface, we can control the MAX7310's IO output via echo different value to GPIO value, that means MAX7310 itself as an IO expander chip is working just fine, similar with PMIC, it is a I2C device, can be enabled independently, then consumers can be added later when they are enabled. Just my personal opinion, thanks.

Right, but if FEC needs max7322 IO0 at level 1 then better describe it in dts.

#8 lore raw

RE: [PATCH V4 3/6] ARM: dts: imx6sx-sabreauto: add IO expander max7310 support

Anson Huang
Best Regards!

Quoted 24 lines

-----Original Message-----
From: Fabio Estevam [mailto:festevam at gmail.com]
Sent: Friday, April 27, 2018 1:24 AM
To: Anson Huang <[email protected]>
Cc: Shawn Guo <[email protected]>; Sascha Hauer <[email protected]>; Fabio Estevam <[email protected]>; Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Russell King - ARM Linux <[email protected]>; dl-linux-imx <[email protected]>; moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE <[email protected]>; open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS <[email protected]>; linux-kernel <[email protected]>
Subject: Re: [PATCH V4 3/6] ARM: dts: imx6sx-sabreauto: add IO expander max7310 support

Quoted 1 line · Anson Huang

I searched the mail I sent, I can NOT found where I said "MAX7310 controls

the ethernet phy"....

Initially you passed: pinctrl-assert-gpios = <&max7322 0 GPIO_ACTIVE_HIGH> inside the fec1 node.

Quoted 6 lines

Then I explained that 'pinctrl-assert-gpios' is not a valid property in mainline. It only exists in NXP vendor tree.

Then you explained:

"Sorry, I made a mistake here, the MAX7320 IO0 is for adjusting FEC1's voltage"

The ' pinctrl-assert-gpios ' is ONLY in NXP local tree, FEC owner added it because he wants to set this GPIO ONCE during kernel boot up, but upstream kernel does NOT support the pinctrl-assert-gpio, so we have to drop it, the MAX7322 IO0 is for adjusting FEC's voltage, I meant for FEC IO's voltage, 1.5V or 1.8V. If I made any confuse, I am sorry for that, I think it should be clear now, all we want/need is to set this GPIO ONCE to get the IO voltage we want.

Quoted 4 lines
Quoted 3 lines

There are MAX7310 users, it is just because currently those users are NOT enabled, so I can NOT verify them. MAX7310 is an independent I2C

device, why we can NOT enable it first?

Quoted 8 lines
Quoted 3 lines

I tested it from sysfs interface, we can control the MAX7310's IO output via echo different value to GPIO value, that means MAX7310 itself as an IO expander chip is working just fine, similar with PMIC, it is a I2C

device, can be enabled independently, then consumers can be added later when they are enabled.

Quoted 1 line

Just my personal opinion, thanks.

Right, but if FEC needs max7322 IO0 at level 1 then better describe it in dts.

Agree, since currently our FEC driver does NOT support adjusting such IO voltage in driver, and there is NO such requirement of runtime switching IO voltage for FEC, so I think it should be good here, just use the default settings of MAX7322 IO0 described in 'reg_fec', if there is any further requirement of runtime adjusting FEC IO voltage, I think FEC driver needs to add such support, and there will be new patch for it.

Thanks.

Anson.

#9 lore raw

PATCH v4 4/6 ARM: dts: imx6sx-sabreauto: add fec support

In reply to Anson Huang

Add FEC support on i.MX6SX Sabre Auto board.

---
no changes.

 arch/arm/boot/dts/imx6sx-sabreauto.dts | 69 ++++++++++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)
arch/arm/boot/dts/imx6sx-sabreauto.dts +69 -0
index 812f40b..fdc642f 100644
@@ -41,6 +41,39 @@
 	clock-frequency = <24576000>;
 };
 
+&fec1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_enet1_1>;
+	phy-mode = "rgmii";
+	phy-handle = <&ethphy1>;
+	fsl,magic-packet;
+	status = "okay";
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		ethphy0: ethernet-phy at 0 {
+			compatible = "ethernet-phy-ieee802.3-c22";
+			reg = <0>;
+		};
+
+		ethphy1: ethernet-phy at 1 {
+			compatible = "ethernet-phy-ieee802.3-c22";
+			reg = <1>;
+		};
+	};
+};
+
+&fec2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_enet2_1>;
+	phy-mode = "rgmii";
+	phy-handle = <&ethphy0>;
+	fsl,magic-packet;
+	status = "okay";
+};
+
 &uart1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_uart1>;
@@ -75,6 +108,42 @@
 &iomuxc {
 	imx6x-sabreauto {
 
+		pinctrl_enet1_1: enet1grp-1 {
+			fsl,pins = <
+				MX6SX_PAD_ENET1_MDIO__ENET1_MDIO        0xa0b1
+				MX6SX_PAD_ENET1_MDC__ENET1_MDC          0xa0b1
+				MX6SX_PAD_RGMII1_TXC__ENET1_RGMII_TXC   0xa0b9
+				MX6SX_PAD_RGMII1_TD0__ENET1_TX_DATA_0   0xa0b1
+				MX6SX_PAD_RGMII1_TD1__ENET1_TX_DATA_1   0xa0b1
+				MX6SX_PAD_RGMII1_TD2__ENET1_TX_DATA_2   0xa0b1
+				MX6SX_PAD_RGMII1_TD3__ENET1_TX_DATA_3   0xa0b1
+				MX6SX_PAD_RGMII1_TX_CTL__ENET1_TX_EN    0xa0b1
+				MX6SX_PAD_RGMII1_RXC__ENET1_RX_CLK      0x3081
+				MX6SX_PAD_RGMII1_RD0__ENET1_RX_DATA_0   0x3081
+				MX6SX_PAD_RGMII1_RD1__ENET1_RX_DATA_1   0x3081
+				MX6SX_PAD_RGMII1_RD2__ENET1_RX_DATA_2   0x3081
+				MX6SX_PAD_RGMII1_RD3__ENET1_RX_DATA_3   0x3081
+				MX6SX_PAD_RGMII1_RX_CTL__ENET1_RX_EN    0x3081
+			>;
+		};
+
+		pinctrl_enet2_1: enet2grp-1 {
+			fsl,pins = <
+				MX6SX_PAD_RGMII2_TXC__ENET2_RGMII_TXC   0xa0b9
+				MX6SX_PAD_RGMII2_TD0__ENET2_TX_DATA_0   0xa0b1
+				MX6SX_PAD_RGMII2_TD1__ENET2_TX_DATA_1   0xa0b1
+				MX6SX_PAD_RGMII2_TD2__ENET2_TX_DATA_2   0xa0b1
+				MX6SX_PAD_RGMII2_TD3__ENET2_TX_DATA_3   0xa0b1
+				MX6SX_PAD_RGMII2_TX_CTL__ENET2_TX_EN    0xa0b1
+				MX6SX_PAD_RGMII2_RXC__ENET2_RX_CLK      0x3081
+				MX6SX_PAD_RGMII2_RD0__ENET2_RX_DATA_0   0x3081
+				MX6SX_PAD_RGMII2_RD1__ENET2_RX_DATA_1   0x3081
+				MX6SX_PAD_RGMII2_RD2__ENET2_RX_DATA_2   0x3081
+				MX6SX_PAD_RGMII2_RD3__ENET2_RX_DATA_3   0x3081
+				MX6SX_PAD_RGMII2_RX_CTL__ENET2_RX_EN    0x3081
+			>;
+		};
+
 		pinctrl_i2c2_1: i2c2grp-1 {
 			fsl,pins = <
 				MX6SX_PAD_GPIO1_IO03__I2C2_SDA          0x4001b8b1
Signature · 1 line
2.7.4
#10 lore raw

PATCH v4 5/6 ARM: dts: imx6sx-sabreauto: add wdog external reset support

In reply to Anson Huang

i.MX6SX Sabre Auto board has GPIO1_IO13 pin can be MUXed as WDOG output to reset PMIC, add this function support.

---
no changes.

 arch/arm/boot/dts/imx6sx-sabreauto.dts | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/boot/dts/imx6sx-sabreauto.dts +12 -0
index fdc642f..ccf1cbb 100644
@@ -230,6 +230,12 @@
 				MX6SX_PAD_KEY_COL1__GPIO2_IO_11		0x17059
 			>;
 		};
+
+		pinctrl_wdog: wdoggrp {
+			fsl,pins = <
+				MX6SX_PAD_GPIO1_IO13__WDOG1_WDOG_ANY 0x30b0
+			>;
+		};
 	};
 };
 
@@ -369,3 +375,9 @@
 		#gpio-cells = <2>;
 	};
 };
+
+&wdog1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinctrl_wdog>;
+	fsl,ext-reset-output;
+};
Signature · 1 line
2.7.4
#11 lore raw

PATCH v4 6/6 ARM: imx_v6_v7_defconfig: Select CONFIG_GPIO_MAX732X by default

In reply to Anson Huang

Enable max7320 IO expander for i.MX platforms.

---
 arch/arm/configs/imx_v6_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)
arch/arm/configs/imx_v6_v7_defconfig +1 -0
index 3a30843..8455d39 100644
@@ -199,6 +199,7 @@ CONFIG_SPI_GPIO=y
 CONFIG_SPI_IMX=y
 CONFIG_SPI_FSL_DSPI=y
 CONFIG_GPIO_SYSFS=y
+CONFIG_GPIO_MAX732X=y
 CONFIG_GPIO_MC9S08DZ60=y
 CONFIG_GPIO_PCA953X=y
 CONFIG_GPIO_STMPE=y
Signature · 1 line
2.7.4