ARM: mx28: Add SPI 2 pinmux into imx28.dtsi
Subsystems (6)
PATCH v2 1/4 ARM: mx28: Add SPI 2 pinmux into imx28.dtsi
Add this SSP port 2 pin multiplexing configuration into the imx28.dtsi file.
--- arch/arm/boot/dts/imx28.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+)
V2: Add only SSP2 pinmux.
arch/arm/boot/dts/imx28.dtsi +13 -0
@@ -507,6 +507,19 @@ fsl,voltage = <1>; fsl,pull-up = <0>; }; + + spi2_pins_a: spi2 at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x2100 /* MX28_PAD_SSP2_SCK__SSP2_SCK */ + 0x2110 /* MX28_PAD_SSP2_MOSI__SSP2_CMD */ + 0x2120 /* MX28_PAD_SSP2_MISO__SSP2_D0 */ + 0x2130 /* MX28_PAD_SSP2_SS0__SSP2_D3 */ + >; + fsl,drive-strength = <1>; + fsl,voltage = <1>; + fsl,pull-up = <1>; + }; }; digctl at 8001c000 {
Signature · 1 line
1.7.10.4
PATCH v2 2/4 ARM: mx28: Add USB PHY overcurrent pinmux
Add the pinmux settings for USB PHY overcurrent pins.
--- arch/arm/boot/dts/imx28.dtsi | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
V2: This is pulled from the M28EVK and SPS1 board files, put it into common
file.
arch/arm/boot/dts/imx28.dtsi +30 -0
@@ -520,6 +520,36 @@ fsl,voltage = <1>; fsl,pull-up = <1>; }; + + usbphy0_pins_a: usbphy0 at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x2152 /* MX28_PAD_SSP2_SS2__USB0_OVERCURRENT */ + >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + usbphy0_pins_b: usbphy0 at 1 { + reg = <0>; + fsl,pinmux-ids = < + 0x3061 /* MX28_PAD_AUART1_CTS__USB0_OVERCURRENT */ + >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + usbphy1_pins_a: usbphy1 at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x2142 /* MX28_PAD_SSP2_SS1__USB1_OVERCURRENT */ + >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; }; digctl at 8001c000 {
Signature · 1 line
1.7.10.4
PATCH v2 2/4 ARM: mx28: Add USB PHY overcurrent pinmux
Quoted 25 lines · Marek Vasut
Add the pinmux settings for USB PHY overcurrent pins.
Signed-off-by Marek Vasut <[email protected]>Cc Chris Ball <[email protected]>Cc Fabio Estevam <[email protected]>Cc Mark Brown <[email protected]>Cc Shawn Guo <[email protected]>--- arch/arm/boot/dts/imx28.dtsi | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)V2: This is pulled from the M28EVK and SPS1 board files, put it into common
file.arch/arm/boot/dts/imx28.dtsi +3
-0@@ -520,6 +520,36 @@ fsl,voltage = <1>; fsl,pull-up = <1>; }; + + usbphy0_pins_a: usbphy0 at 0 { + reg = <0>;
arch/arm/boot/dts/imx28.dtsi line 535
Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi +10
-0+ fsl,pinmux-ids = < + 0x2152 /* MX28_PAD_SSP2_SS2__USB0_OVERCURRENT */ + >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + usbphy0_pins_b: usbphy0 at 1 { + reg = <0>;
This should be
reg = <1>;
Fixed it up and applied the patch.
Quoted 23 lines
arch/arm/boot/dts/imx28.dtsi +17
-0+ fsl,pinmux-ids = < + 0x3061 /* MX28_PAD_AUART1_CTS__USB0_OVERCURRENT */ + >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + usbphy1_pins_a: usbphy1 at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x2142 /* MX28_PAD_SSP2_SS1__USB1_OVERCURRENT */ + >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; }; digctl at 8001c000 {Signature · 1 line
1.7.10.4
Signature · 2 lines
Regards, Shawn
PATCH v2 2/4 ARM: mx28: Add USB PHY overcurrent pinmux
In reply to Marek VasutHi Marek, Peter,
Quoted 57 lines · Marek Vasut
Add the pinmux settings for USB PHY overcurrent pins.
Signed-off-by Marek Vasut <[email protected]>Cc Chris Ball <[email protected]>Cc Fabio Estevam <[email protected]>Cc Mark Brown <[email protected]>Cc Shawn Guo <[email protected]>--- arch/arm/boot/dts/imx28.dtsi | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)V2: This is pulled from the M28EVK and SPS1 board files, put it into common
file.arch/arm/boot/dts/imx28.dtsi +30
-0@@ -520,6 +520,36 @@ fsl,voltage = <1>; fsl,pull-up = <1>; }; + + usbphy0_pins_a: usbphy0 at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x2152 /* MX28_PAD_SSP2_SS2__USB0_OVERCURRENT */ + >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + usbphy0_pins_b: usbphy0 at 1 { + reg = <0>; + fsl,pinmux-ids = < + 0x3061 /* MX28_PAD_AUART1_CTS__USB0_OVERCURRENT */ + >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + usbphy1_pins_a: usbphy1 at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x2142 /* MX28_PAD_SSP2_SS1__USB1_OVERCURRENT */ + >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; }; digctl at 8001c000 {Signature · 1 line
1.7.10.4
@Marek: Did you test the overcurrent functionality with the MX28 and this pinmux?
I currently can not trigger any overcurrent events and also don't see changes in the PORTSC register after pulling the OC pin to 3V3.
Thanks,
Michael
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
PATCH v2 2/4 ARM: mx28: Add USB PHY overcurrent pinmux
Quoted 55 lines
Review
Quoted 4 lines
(quoted diff) +0
-0
b/arch/arm/boot/dts/imx28.dtsiarch/arm/boot/dts/imx28.dtsi line 527
Quoted 12 lines
index b996c2d..3cba62d 100644
arch/arm/boot/dts/imx28.dtsi +5
-0@@ -520,6 +520,36 @@ fsl,voltage = <1>; fsl,pull-up = <1>; }; + + usbphy0_pins_a: usbphy0 at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x2152 /*
MX28_PAD_SSP2_SS2__USB0_OVERCURRENT*/arch/arm/boot/dts/imx28.dtsi
Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi +10
-0+ >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + usbphy0_pins_b: usbphy0 at 1 { + reg = <0>; + fsl,pinmux-ids = < + 0x3061 /*
MX28_PAD_AUART1_CTS__USB0_OVERCURRENT*/arch/arm/boot/dts/imx28.dtsi
Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi +10
-0+ >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + usbphy1_pins_a: usbphy1 at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x2142 /*
MX28_PAD_SSP2_SS1__USB1_OVERCURRENT*/Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi +5
-1+ >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; }; digctl at 8001c000 { --1.7.10.4
@Marek: Did you test the overcurrent functionality with the MX28 and this pinmux?
Quoted 3 lines
I currently can not trigger any overcurrent events and also don't see changes in the PORTSC register after pulling the OC pin to 3V3.
I haven't checked pinmux detail, have you enabled oc and set oc's polarity (HW_DIGCTL_CTRL - 8001_C000h)?
Peter
PATCH v2 2/4 ARM: mx28: Add USB PHY overcurrent pinmux
Quoted 55 lines · Peter Chen
Quoted 55 lines
Review
Quoted 4 lines
(quoted diff) +0
-0
b/arch/arm/boot/dts/imx28.dtsiarch/arm/boot/dts/imx28.dtsi line 527
Quoted 12 lines
index b996c2d..3cba62d 100644
arch/arm/boot/dts/imx28.dtsi +5
-0@@ -520,6 +520,36 @@ fsl,voltage = <1>; fsl,pull-up = <1>; }; + + usbphy0_pins_a: usbphy0 at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x2152 /*
MX28_PAD_SSP2_SS2__USB0_OVERCURRENT*/arch/arm/boot/dts/imx28.dtsi
Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi +10
-0+ >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + usbphy0_pins_b: usbphy0 at 1 { + reg = <0>; + fsl,pinmux-ids = < + 0x3061 /*
MX28_PAD_AUART1_CTS__USB0_OVERCURRENT*/arch/arm/boot/dts/imx28.dtsi
Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi +10
-0+ >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + usbphy1_pins_a: usbphy1 at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x2142 /*
MX28_PAD_SSP2_SS1__USB1_OVERCURRENT*/Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi +5
-1+ >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; }; digctl at 8001c000 { --1.7.10.4
@Marek: Did you test the overcurrent functionality with the MX28 and this pinmux?
Quoted 6 lines
Quoted 3 lines
I currently can not trigger any overcurrent events and also don't see changes in the PORTSC register after pulling the OC pin to 3V3.
I haven't checked pinmux detail, have you enabled oc and set oc's polarity (
HW_DIGCTL_CTRL- 8001_C000h)?
No, I was not aware those DIG*DEEP*CTL bits exist. :)
Thank you Peter!
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
PATCH v2 2/4 ARM: mx28: Add USB PHY overcurrent pinmux
In reply to Michael GrzeschikHello Michael,
Quoted 29 lines
Hi Marek, Peter,
Quoted 26 lines · Marek Vasut
Add the pinmux settings for USB PHY overcurrent pins.
Signed-off-by Marek Vasut <[email protected]>Cc Chris Ball <[email protected]>Cc Fabio Estevam <[email protected]>Cc Mark Brown <[email protected]>Cc Shawn Guo <[email protected]>---
arch/arm/boot/dts/imx28.dtsi | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)V2: This is pulled from the M28EVK and SPS1 board files, put it into common
file.
arch/arm/boot/dts/imx28.dtsi +0
-0@@ -520,6 +520,36 @@ fsl,voltage = <1>; fsl,pull-up = <1>;
Quoted 7 lines
arch/arm/boot/dts/imx28.dtsi
Quoted 7 lines
arch/arm/boot/dts/imx28.dtsi +5
-0}; + + usbphy0_pins_a: usbphy0 at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x2152 /*
MX28_PAD_SSP2_SS2__USB0_OVERCURRENT */
Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi
Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi +10
-0+ >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + usbphy0_pins_b: usbphy0 at 1 { + reg = <0>; + fsl,pinmux-ids = < + 0x3061 /*
MX28_PAD_AUART1_CTS__USB0_OVERCURRENT */
Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi
Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi +10
-0+ >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + usbphy1_pins_a: usbphy1 at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x2142 /*
MX28_PAD_SSP2_SS1__USB1_OVERCURRENT */
Quoted 8 lines
Quoted 8 lines
arch/arm/boot/dts/imx28.dtsi +5
-0+ >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + };};
Quoted 7 lines
Quoted 1 line
digctl at
8001c000{@Marek: Did you test the overcurrent functionality with the MX28 and this pinmux?
I currently can not trigger any overcurrent events and also don't see changes in the PORTSC register after pulling the OC pin to 3V3.
Sorry for the late reply, I see Peter already replied. Do you see the changes if you configure the pin as a GPIO at least ?
Best regards,
PATCH v2 2/4 ARM: mx28: Add USB PHY overcurrent pinmux
Hi Marek, Peter,
Quoted 74 lines · Marek Vasut
Hello Michael,
Quoted 29 lines
Hi Marek, Peter,
Quoted 26 lines · Marek Vasut
Add the pinmux settings for USB PHY overcurrent pins.
Signed-off-by Marek Vasut <[email protected]>Cc Chris Ball <[email protected]>Cc Fabio Estevam <[email protected]>Cc Mark Brown <[email protected]>Cc Shawn Guo <[email protected]>---
arch/arm/boot/dts/imx28.dtsi | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)V2: This is pulled from the M28EVK and SPS1 board files, put it into common
file.
arch/arm/boot/dts/imx28.dtsi +0
-0@@ -520,6 +520,36 @@ fsl,voltage = <1>; fsl,pull-up = <1>;Quoted 7 lines
arch/arm/boot/dts/imx28.dtsi
Quoted 7 lines
arch/arm/boot/dts/imx28.dtsi +5
-0}; + + usbphy0_pins_a: usbphy0 at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x2152 /*
MX28_PAD_SSP2_SS2__USB0_OVERCURRENT*/Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi
Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi +10
-0+ >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + usbphy0_pins_b: usbphy0 at 1 { + reg = <0>; + fsl,pinmux-ids = < + 0x3061 /*
MX28_PAD_AUART1_CTS__USB0_OVERCURRENT*/Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi
Quoted 10 lines
arch/arm/boot/dts/imx28.dtsi +10
-0+ >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + usbphy1_pins_a: usbphy1 at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x2142 /*
MX28_PAD_SSP2_SS1__USB1_OVERCURRENT*/Quoted 13 lines
arch/arm/boot/dts/imx28.dtsi line 555
Quoted 9 lines
arch/arm/boot/dts/imx28.dtsi +5
-0+ >; + fsl,drive-strength = <2>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + };arch/arm/boot/dts/imx28.dtsi +0
-0}; digctl at 8001c000 {@Marek: Did you test the overcurrent functionality with the MX28 and this pinmux?
Quoted 5 lines
Quoted 2 lines
I currently can not trigger any overcurrent events and also don't see changes in the PORTSC register after pulling the OC pin to 3V3.
Sorry for the late reply, I see Peter already replied. Do you see the changes if you configure the pin as a GPIO at least ?
The GPIO is working for this pin. But also the DIGCTL register bits helped here. Now the OC event triggers if the pin gets pulled to 3V3.
I am currently looking for a good place to enable the DIGCTL bits. I suggest to enable them per default. As we don't have USBMISC registers in MX28, the bits should be toggled in ci_hdrc_imx.c if the of property "disable-overcurrent" is not found. I will use the syscon interface to reach them with the regmap interface.
Any objections?
Regards,
Michael
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
PATCH v2 2/4 ARM: mx28: Add USB PHY overcurrent pinmux
Quoted 4 lines
Quoted 9 lines
The GPIO is working for this pin. But also the DIGCTL register bits helped here. Now the OC event triggers if the pin gets pulled to 3V3.
I am currently looking for a good place to enable the DIGCTL bits. I suggest to enable them per default. As we don't have USBMISC registers in MX28, the bits should be toggled in
ci_hdrc_imx.cif the of property "disable-overcurrent" is not found. I will use the syscon interface to reach them with the regmap interface.
Hi Michael,
usbmisc register doesn't stand for the register needs to be in usb controller. Any registers which are related to USB function can be considered as usbmisc registers. You will see FSL-style SoC, the over-current or other related setting are at controller base + 0x800 (0x600), but Sigmatel-style SoC (mx28/mx23), the usb register are not at controller register region.
My suggestion is: create usbmisc node for mx28, and put oc setting at there, it can keep ci_hdrc_imx.c clean.
Besides, you may need two dts user setting for oc enable and oc polarity.
Peter
PATCH v2 2/4 ARM: mx28: Add USB PHY overcurrent pinmux
Hi Peter,
Quoted 15 lines · Peter Chen
Quoted 9 lines
The GPIO is working for this pin. But also the DIGCTL register bits helped here. Now the OC event triggers if the pin gets pulled to 3V3.
I am currently looking for a good place to enable the DIGCTL bits. I suggest to enable them per default. As we don't have USBMISC registers in MX28, the bits should be toggled in
ci_hdrc_imx.cif the of property "disable-overcurrent" is not found. I will use the syscon interface to reach them with the regmap interface.usbmisc register doesn't stand for the register needs to be in usb controller. Any registers which are related to USB function can be considered as usbmisc registers. You will see FSL-style SoC, the over-current or other related setting are at controller base +
0x800(0x600), but Sigmatel-style SoC (mx28/mx23), the usb register are not at controller register region.
Quoted 3 lines
My suggestion is: create usbmisc node for mx28, and put oc setting at there, it can keep
ci_hdrc_imx.cclean.
Besides, you may need two dts user setting for oc enable and oc polarity.
IMHO usbmisc is a driver with memery mapped region. So it would probably make more sense to use syscon for that purpose, as we only need special registers out of the digctl register.
What do you think of that code:
drivers/usb/chipidea/ci_hdrc_imx.c +26 -0
@@ -19,12 +19,18 @@#include <linux/dma-mapping.h> #include <linux/usb/chipidea.h> #include <linux/clk.h> +#include <linux/regmap.h> +#include <linux/mfd/syscon.h> #include "ci.h" #include "ci_hdrc_imx.h" #define CI_HDRC_IMX_IMX28_WRITE_FIX BIT(0) +#define DIGCTL_CTRL_SET 0x4 +#define USB_OTG_OC_ENABLE_BIT BIT(23) +#define USB_H1_OC_ENABLE_BIT BIT(24) +struct ci_hdrc_imx_platform_flag {unsigned int flags; };
@@ -105,6 +111,26 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)const struct of_device_id *of_id =of_match_device (ci_hdrc_imx_dt_ids, &pdev->dev);const struct ci_hdrc_imx_platform_flag *imx_platform_flag = of_id->data; +struct device_node *np = pdev->dev.of_node; +struct regmap *digctl; + +/* Some SoCs don't have digctl registers */ +if (of_get_property (np,"fsl,digctl" ,NULL )) { +struct of_phandle_args args; +int enable_bit =USB_OTG_OC_ENABLE_BIT ; + ret =of_parse_phandle_with_args (np,"fsl,digctl" ,"#index-cells" , +0 , &args); + digctl =syscon_regmap_lookup_by_phandle + (np,"fsl,digctl" ); +if (IS_ERR (digctl)) { +dev_dbg (&pdev->dev, +"failed to find regmap for digctl\n" ); + }else { +if (args.args[0 ]) + enable_bit =USB_H1_OC_ENABLE_BIT ; +regmap_write (digctl,DIGCTL_CTRL_SET , enable_bit); + } + } data =devm_kzalloc (&pdev->dev,sizeof (*data),GFP_KERNEL );if (!data) {
arch/arm/boot/dts/imx28.dtsi +6 -3
@@ -668,11 +668,12 @@ }; }; - digctl at 8001c000 { - compatible = "fsl,imx28-digctl"; + digctl: digctl at 8001c000 { + #index-cells = <1>; + compatible = "fsl,imx28-digctl", "syscon"; reg = <0x8001c000 0x2000>; interrupts = <89>; - status = "disabled"; + status = "okay"; }; etm at 80022000 {
@@ -976,6 +977,7 @@ interrupts = <93>; clocks = <&clks 60>; fsl,usbphy = <&usbphy0>; + fsl,digctl = <&digctl 0>; status = "disabled"; };
@@ -985,6 +987,7 @@ interrupts = <92>; clocks = <&clks 61>; fsl,usbphy = <&usbphy1>; + fsl,digctl = <&digctl 1>; status = "disabled"; };
Thanks,
Michael
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
PATCH v2 2/4 ARM: mx28: Add USB PHY overcurrent pinmux
Quoted 18 lines · Michael Grzeschik
Hi Peter,
Quoted 15 lines · Peter Chen
Quoted 9 lines
The GPIO is working for this pin. But also the DIGCTL register bits helped here. Now the OC event triggers if the pin gets pulled to 3V3.
I am currently looking for a good place to enable the DIGCTL bits. I suggest to enable them per default. As we don't have USBMISC registers in MX28, the bits should be toggled in
ci_hdrc_imx.cif the of property "disable-overcurrent" is not found. I will use the syscon interface to reach them with the regmap interface.usbmisc register doesn't stand for the register needs to be in usb controller. Any registers which are related to USB function can be considered as usbmisc registers. You will see FSL-style SoC, the over-current or other related setting are at controller base +
0x800(0x600), but Sigmatel-style SoC (mx28/mx23), the usb register are not at controller register region.
Quoted 8 lines
Quoted 3 lines
My suggestion is: create usbmisc node for mx28, and put oc setting at there, it can keep
ci_hdrc_imx.cclean.
Besides, you may need two dts user setting for oc enable and oc polarity.IMHO usbmisc is a driver with memery mapped region. So it would probably make more sense to use syscon for that purpose, as we only need special registers out of the digctl register.
Hi Michael, the reason why we have usbmisc is that we want to hide SoC's differentiate at ci_hdrc_imx.c, and call uniform APIs in it. We already have over-current handling at usbmisc for other SoCs, it is better to put all i.mx over-current handlings at the same place.
Yes, when we design usbmisc, we just thought it was for usb non-core register and this register region is only for USB, but now, we find it is not correct for i.mx28 whose usb registers are at other regions and shared with others modules.
I think usbmisc should handle it, that is some SoCs uses memory mapped region, and others use syscon. It is SoC differentiate, the dts can describe it.
Peter
Quoted 99 lines
What do you think of that code:
drivers/usb/chipidea/ci_hdrc_imx.c +26
-0@@ -19,12 +19,18 @@#include <linux/dma-mapping.h> #include <linux/usb/chipidea.h> #include <linux/clk.h> +#include <linux/regmap.h> +#include <linux/mfd/syscon.h> #include "ci.h" #include "ci_hdrc_imx.h" #define CI_HDRC_IMX_IMX28_WRITE_FIX BIT(0) +#define DIGCTL_CTRL_SET 0x4 +#define USB_OTG_OC_ENABLE_BIT BIT(23) +#define USB_H1_OC_ENABLE_BIT BIT(24) +struct ci_hdrc_imx_platform_flag {unsigned int flags; };@@ -105,6 +111,26 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev)const struct of_device_id *of_id =of_match_device (ci_hdrc_imx_dt_ids, &pdev->dev);const struct ci_hdrc_imx_platform_flag *imx_platform_flag = of_id->data; +struct device_node *np = pdev->dev.of_node; +struct regmap *digctl; + +/* Some SoCs don't have digctl registers */ +if (of_get_property (np,"fsl,digctl" ,NULL )) { +struct of_phandle_args args; +int enable_bit =USB_OTG_OC_ENABLE_BIT ; + ret =of_parse_phandle_with_args (np,"fsl,digctl" ,"#index-cells" , +0 , &args); + digctl =syscon_regmap_lookup_by_phandle + (np,"fsl,digctl" ); +if (IS_ERR (digctl)) { +dev_dbg (&pdev->dev, +"failed to find regmap for digctl\n" ); + }else { +if (args.args[0 ]) + enable_bit =USB_H1_OC_ENABLE_BIT ; +regmap_write (digctl,DIGCTL_CTRL_SET , enable_bit); + } + } data =devm_kzalloc (&pdev->dev,sizeof (*data),GFP_KERNEL );if (!data) {arch/arm/boot/dts/imx28.dtsi +6
-3@@ -668,11 +668,12 @@ }; }; - digctl at 8001c000 { - compatible = "fsl,imx28-digctl"; + digctl: digctl at 8001c000 { + #index-cells = <1>; + compatible = "fsl,imx28-digctl", "syscon"; reg = <0x8001c000 0x2000>; interrupts = <89>; - status = "disabled"; + status = "okay"; }; etm at 80022000 {@@ -976,6 +977,7 @@ interrupts = <93>; clocks = <&clks 60>; fsl,usbphy = <&usbphy0>; + fsl,digctl = <&digctl 0>; status = "disabled"; };@@ -985,6 +987,7 @@ interrupts = <92>; clocks = <&clks 61>; fsl,usbphy = <&usbphy1>; + fsl,digctl = <&digctl 1>; status = "disabled"; };Thanks,
MichaelSignature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Signature · 2 lines
Best Regards, Peter Chen
PATCH v2 3/4 ARM: mxs: Update DENX M28 machine and dts file
In reply to Marek VasutUpdate the mach-mxs machine by removing the enet_clkout(). The new revision of the board doesn't need that. Also, update the DTS file with all the new drivers pulled in the mainline recently, that is, SPI, LRADC, USB.
--- arch/arm/boot/dts/imx28-m28evk.dts | 81 +++++++++++++++++++++++++++++++++--- arch/arm/mach-mxs/mach-mxs.c | 1 - 2 files changed, 75 insertions(+), 7 deletions(-)
Move the usbphy overcurrent definition to include file.
arch/arm/boot/dts/imx28-m28evk.dts +75 -6
@@ -23,6 +23,8 @@ apb at 80000000 { apbh at 80000000 { gpmi-nand at 8000c000 { + #address-cells = <1>; + #size-cells = <1>; pinctrl-names = "default"; pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>; status = "okay";
@@ -62,9 +64,27 @@ &mmc0_sck_cfg>; bus-width = <8>; wp-gpios = <&gpio3 10 1>; + vmmc-supply = <®_vddio_sd0>; status = "okay"; }; + ssp2: ssp at 80014000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,imx28-spi"; + pinctrl-names = "default"; + pinctrl-0 = <&spi2_pins_a>; + status = "okay"; + + flash: m25p80 at 0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "m25p80"; + spi-max-frequency = <40000000>; + reg = <0>; + }; + }; + pinctrl at 80018000 { pinctrl-names = "default"; pinctrl-0 = <&hog_pins_a>;
@@ -72,8 +92,11 @@ hog_pins_a: hog-gpios at 0 { reg = <0>; fsl,pinmux-ids = < + 0x31c3 /* MX28_PAD_PWM3__GPIO_3_28 */ 0x30a3 /* MX28_PAD_AUART2_CTS__GPIO_3_10 */ 0x30b3 /* MX28_PAD_AUART2_RTS__GPIO_3_11 */ + 0x30c3 /* MX28_PAD_AUART3_RX__GPIO_3_12 */ + 0x30d3 /* MX28_PAD_AUART3_TX__GPIO_3_13 */ >; fsl,drive-strength = <0>; fsl,voltage = <1>;
@@ -129,6 +152,7 @@ i2c0: i2c at 80058000 { pinctrl-names = "default"; pinctrl-0 = <&i2c0_pins_a>; + clock-frequency = <400000>; status = "okay"; sgtl5000: codec at 0a {
@@ -151,32 +175,51 @@ }; }; + lradc at 80050000 { + status = "okay"; + }; + duart: serial at 80074000 { pinctrl-names = "default"; pinctrl-0 = <&duart_pins_a>; status = "okay"; }; - auart0: serial at 8006a000 { - pinctrl-names = "default"; - pinctrl-0 = <&auart0_2pins_a>; + usbphy0: usbphy at 8007c000 { status = "okay"; }; - auart3: serial at 80070000 { + usbphy1: usbphy at 8007e000 { + status = "okay"; + }; + + auart0: serial at 8006a000 { pinctrl-names = "default"; - pinctrl-0 = <&auart3_pins_a>; + pinctrl-0 = <&auart0_2pins_a>; status = "okay"; }; }; }; ahb at 80080000 { + usb0: usb at 80080000 { + vbus-supply = <®_usb0_vbus>; + pinctrl-names = "default"; + pinctrl-0 = <&usbphy0_pins_a>; + status = "okay"; + }; + + usb1: usb at 80090000 { + vbus-supply = <®_usb1_vbus>; + pinctrl-names = "default"; + pinctrl-0 = <&usbphy1_pins_a>; + status = "okay"; + }; + mac0: ethernet at 800f0000 { phy-mode = "rmii"; pinctrl-names = "default"; pinctrl-0 = <&mac0_pins_a>; - phy-reset-gpios = <&gpio3 11 0>; status = "okay"; };
@@ -198,6 +241,32 @@ regulator-max-microvolt = <3300000>; regulator-always-on; }; + + reg_vddio_sd0: vddio-sd0 { + compatible = "regulator-fixed"; + regulator-name = "vddio-sd0"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + gpio = <&gpio3 28 0>; + }; + + reg_usb0_vbus: usb0_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb0_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio3 12 0>; + enable-active-low; + }; + + reg_usb1_vbus: usb1_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb1_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio3 13 0>; + enable-active-low; + }; }; sound {
arch/arm/mach-mxs/mach-mxs.c +0 -1
@@ -241,7 +241,6 @@ static void __init imx28_evk_init(void)static void __init m28evk_init (void ) { -enable_clk_enet_out ();update_fec_mac_prop (OUI_DENX ); mxsfb_pdata.mode_list = m28evk_video_modes;
Signature · 1 line
1.7.10.4
PATCH v2 3/4 ARM: mxs: Update DENX M28 machine and dts file
Quoted 6 lines · Marek Vasut
arch/arm/boot/dts/imx28-m28evk.dts +6
-0+ + reg_vddio_sd0: vddio-sd0 { + compatible = "regulator-fixed"; + regulator-name = "vddio-sd0"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>;
arch/arm/boot/dts/imx28-m28evk.dts line 259
Quoted 10 lines
arch/arm/boot/dts/imx28-m28evk.dts +10
-0+ gpio = <&gpio3 28 0>; + }; + + reg_usb0_vbus: usb0_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb0_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio3 12 0>; + enable-active-low;
Documentation/devicetree/bindings/regulator/fixed-regulator.txt:
- enable-active-high: Polarity of GPIO is Active high If this property is missing, the default assumed is Active low.
I suspect you need to recheck this aspect for all these 3 fixed regulators.
Quoted 10 lines
arch/arm/boot/dts/imx28-m28evk.dts +10
-0+ }; + + reg_usb1_vbus: usb1_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb1_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio3 13 0>; + enable-active-low; + };
Signature · 2 lines
Regards, Shawn
PATCH v2 3/4 ARM: mxs: Update DENX M28 machine and dts file
Dear Shawn Guo,
Quoted 20 lines · Marek Vasut
Quoted 6 lines
arch/arm/boot/dts/imx28-m28evk.dts +6
-0+ + reg_vddio_sd0: vddio-sd0 { + compatible = "regulator-fixed"; + regulator-name = "vddio-sd0"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>;arch/arm/boot/dts/imx28-m28evk.dts line 259
Quoted 10 lines
arch/arm/boot/dts/imx28-m28evk.dts +10
-0+ gpio = <&gpio3 28 0>; + }; + + reg_usb0_vbus: usb0_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb0_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio3 12 0>; + enable-active-low;
Documentation/devicetree/bindings/regulator/fixed-regulator.txt:
Quoted 5 lines
- enable-active-high: Polarity of GPIO is Active high If this property is missing, the default assumed is Active low.
I suspect you need to recheck this aspect for all these 3 fixed regulators.
Ok, so the prop had no impact? I'll retest and resubmit. Also, put the SPS1 on hold until the led issue is done for.
Thanks
Quoted 10 lines
arch/arm/boot/dts/imx28-m28evk.dts line 269
Quoted 10 lines
arch/arm/boot/dts/imx28-m28evk.dts +10
-0+ }; + + reg_usb1_vbus: usb1_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb1_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio3 13 0>; + enable-active-low; + };
Best regards,
Marek Vasut
PATCH 4/4 ARM: mxs: Add SchulerControl SPS1 DTS file
In reply to Marek VasutAdd DTS file for this custom board.
--- arch/arm/boot/dts/imx28-sps1.dts | 168 ++++++++++++++++++++++++++++++++++++++ arch/arm/mach-mxs/mach-mxs.c | 3 + 2 files changed, 171 insertions(+) create mode 100644 arch/arm/boot/dts/imx28-sps1.dts
arch/arm/boot/dts/imx28-sps1.dts new file +168 -0
@@ -0,0 +1,168 @@ +/* + * Copyright (C) 2012 Marek Vasut <[email protected]> + * + * The code contained herein is licensed under the GNU General Public + * License. You may obtain a copy of the GNU General Public License + * Version 2 or later at the following locations: + * + * http://www.opensource.org/licenses/gpl-license.html + * http://www.gnu.org/copyleft/gpl.html + */ + +/dts-v1/; +/include/ "imx28.dtsi" + +/ { + model = "SchulerControl GmbH, SC SPS 1"; + compatible = "schulercontrol,imx28-sps1", "fsl,imx28"; + + memory { + reg = <0x40000000 0x08000000>; + }; + + apb at 80000000 { + apbh at 80000000 { + pinctrl at 80018000 { + led_pins_sps1: leds at 0 { + reg = <0>; + fsl,pinmux-ids = < + 0x0003 /* MX28_PAD_GPMI_D00__GPIO_0_0 */ + 0x0033 /* MX28_PAD_GPMI_D03__GPIO_0_3 */ + 0x0063 /* MX28_PAD_GPMI_D06__GPIO_0_6 */ + >; + fsl,drive-strength = <0>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + }; + + ssp0: ssp at 80010000 { + compatible = "fsl,imx28-mmc"; + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_4bit_pins_a>; + bus-width = <4>; + status = "okay"; + }; + + ssp2: ssp at 80014000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,imx28-spi"; + pinctrl-names = "default"; + pinctrl-0 = <&spi2_pins_a>; + status = "okay"; + + flash: m25p80 at 0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "everspin,mr25h256", "mr25h256"; + spi-max-frequency = <40000000>; + reg = <0>; + }; + }; + }; + + apbx at 80040000 { + i2c0: i2c at 80058000 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins_a>; + clock-frequency = <400000>; + status = "okay"; + + rtc: rtc at 51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + }; + + eeprom: eeprom at 52 { + compatible = "atmel,24c64"; + reg = <0x52>; + pagesize = <32>; + }; + }; + + duart: serial at 80074000 { + pinctrl-names = "default"; + pinctrl-0 = <&duart_pins_a>; + status = "okay"; + }; + + usbphy0: usbphy at 8007c000 { + status = "okay"; + }; + + auart0: serial at 8006a000 { + pinctrl-names = "default"; + pinctrl-0 = <&auart0_pins_a>; + status = "okay"; + }; + + rtc at 80056000 { + status = "okay"; + }; + }; + }; + + ahb at 80080000 { + usb0: usb at 80080000 { + vbus-supply = <®_usb0_vbus>; + pinctrl-names = "default"; + pinctrl-0 = <&usbphy0_pins_b>; + status = "okay"; + }; + + mac0: ethernet at 800f0000 { + phy-mode = "rmii"; + pinctrl-names = "default"; + pinctrl-0 = <&mac0_pins_a>; + status = "okay"; + }; + + mac1: ethernet at 800f4000 { + phy-mode = "rmii"; + pinctrl-names = "default"; + pinctrl-0 = <&mac1_pins_a>; + status = "okay"; + }; + }; + + regulators { + compatible = "simple-bus"; + + reg_usb0_vbus: usb0_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb0_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio3 9 0>; + enable-active-low; + }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_pins_sps1>; + status = "okay"; + + led at 1 { + label = "sps1-1:yellow:user"; + gpios = <&gpio0 6 0>; + linux,default-trigger = "heartbeat"; + }; + + led at 2 { + label = "sps1-2:red:user"; + gpios = <&gpio0 3 0>; + linux,default-trigger = "heartbeat"; + }; + + led at 3 { + label = "sps1-3:red:user"; + gpios = <&gpio0 0 0>; + default-trigger = "heartbeat"; + }; + + }; +};
arch/arm/mach-mxs/mach-mxs.c +3 -0
@@ -279,6 +279,8 @@ static void __init mxs_machine_init(void)m28evk_init (); else if (of_machine_is_compatible("bluegiga,apx4devkit")) apx4devkit_init(); + else if (of_machine_is_compatible("schulercontrol,imx28-sps1")) +imx28_evk_init ();of_platform_populate (NULL , of_default_bus_match_table, mxs_auxdata_lookup,NULL );
@@ -298,6 +300,7 @@ static const char *imx28_dt_compat[] __initdata = {"denx,m28evk" ,"fsl,imx28-evk" ,"karo,tx28" , +"schulercontrol,imx28-sps1" ,"fsl,imx28" , NULL, };
Signature · 1 line
1.7.10.4
PATCH 4/4 ARM: mxs: Add SchulerControl SPS1 DTS file
Please base it on my mxs/dt-for-3.7 branch.
Quoted 24 lines · Marek Vasut
Add DTS file for this custom board.
Signed-off-by Marek Vasut <[email protected]>Cc Fabio Estevam <[email protected]>Cc Shawn Guo <[email protected]>--- arch/arm/boot/dts/imx28-sps1.dts | 168 ++++++++++++++++++++++++++++++++++++++ arch/arm/mach-mxs/mach-mxs.c | 3 + 2 files changed, 171 insertions(+) create mode 100644 arch/arm/boot/dts/imx28-sps1.dtsarch/arm/boot/dts/imx28-sps1.dts new file +7
-0@@ -0,0 +1,168 @@ +/* + * Copyright (C) 2012 Marek Vasut <[email protected]> + * + * The code contained herein is licensed under the GNU General Public + * License. You may obtain a copy of the GNU General Public License + * Version 2 or later at the following locations: + *
arch/arm/boot/dts/imx28-sps1.dts line 17
Quoted 10 lines
arch/arm/boot/dts/imx28-sps1.dts new file +10
-0+ * http://www.opensource.org/licenses/gpl-license.html + * http://www.gnu.org/copyleft/gpl.html + */ + +/dts-v1/; +/include/ "imx28.dtsi" + +/ { + model = "SchulerControl GmbH, SC SPS 1"; + compatible = "schulercontrol,imx28-sps1", "fsl,imx28";
We should use the short name as prefix if it has one.
arch/arm/boot/dts/imx28-sps1.dts line 26
Quoted 9 lines
arch/arm/boot/dts/imx28-sps1.dts new file +9
-0+ + memory { + reg = <0x40000000 0x08000000>; + }; + + apb at 80000000 { + apbh at 80000000 { + pinctrl at 80018000 { + led_pins_sps1: leds at 0 {
It should be referenced by the pinctrl state directly under node pinctrl at 80018000, otherwise the pins will not be set up.
Also we usually use a generic name here something like
hog_pins_a: hog at 0 {so that we do not need to create new node every time we add pins for a new module.
Quoted 23 lines
arch/arm/boot/dts/imx28-sps1.dts new file +23
-0+ reg = <0>; + fsl,pinmux-ids = < + 0x0003 /* MX28_PAD_GPMI_D00__GPIO_0_0 */ + 0x0033 /* MX28_PAD_GPMI_D03__GPIO_0_3 */ + 0x0063 /* MX28_PAD_GPMI_D06__GPIO_0_6 */ + >; + fsl,drive-strength = <0>; + fsl,voltage = <1>; + fsl,pull-up = <0>; + }; + + }; + + ssp0: ssp at 80010000 { + compatible = "fsl,imx28-mmc"; + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_4bit_pins_a>; + bus-width = <4>; + status = "okay"; + }; + + ssp2: ssp at 80014000 { + #address-cells = <1>;
arch/arm/boot/dts/imx28-sps1.dts line 59
Quoted 10 lines
arch/arm/boot/dts/imx28-sps1.dts new file +10
-0+ #size-cells = <0>; + compatible = "fsl,imx28-spi"; + pinctrl-names = "default"; + pinctrl-0 = <&spi2_pins_a>; + status = "okay"; + + flash: m25p80 at 0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "everspin,mr25h256", "mr25h256";
Node name "m25p80" and "mr25h256", same thing?
Quoted 34 lines
arch/arm/boot/dts/imx28-sps1.dts new file +34
-0+ spi-max-frequency = <40000000>; + reg = <0>; + }; + }; + }; + + apbx at 80040000 { + i2c0: i2c at 80058000 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins_a>; + clock-frequency = <400000>; + status = "okay"; + + rtc: rtc at 51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + }; + + eeprom: eeprom at 52 { + compatible = "atmel,24c64"; + reg = <0x52>; + pagesize = <32>; + }; + }; + + duart: serial at 80074000 { + pinctrl-names = "default"; + pinctrl-0 = <&duart_pins_a>; + status = "okay"; + }; + + usbphy0: usbphy at 8007c000 { + status = "okay"; + };
arch/arm/boot/dts/imx28-sps1.dts line 103
Quoted 10 lines
arch/arm/boot/dts/imx28-sps1.dts new file +10
-0+ + auart0: serial at 8006a000 { + pinctrl-names = "default"; + pinctrl-0 = <&auart0_pins_a>; + status = "okay"; + }; + + rtc at 80056000 { + status = "okay"; + };
This is not needed. We have rtc enabled in imx28.dtsi by default now.
Quoted 26 lines
arch/arm/boot/dts/imx28-sps1.dts new file +26
-0+ }; + }; + + ahb at 80080000 { + usb0: usb at 80080000 { + vbus-supply = <®_usb0_vbus>; + pinctrl-names = "default"; + pinctrl-0 = <&usbphy0_pins_b>; + status = "okay"; + }; + + mac0: ethernet at 800f0000 { + phy-mode = "rmii"; + pinctrl-names = "default"; + pinctrl-0 = <&mac0_pins_a>; + status = "okay"; + }; + + mac1: ethernet at 800f4000 { + phy-mode = "rmii"; + pinctrl-names = "default"; + pinctrl-0 = <&mac1_pins_a>; + status = "okay"; + }; + }; +
arch/arm/boot/dts/imx28-sps1.dts line 139
Quoted 10 lines
arch/arm/boot/dts/imx28-sps1.dts new file +10
-0+ regulators { + compatible = "simple-bus"; + + reg_usb0_vbus: usb0_vbus { + compatible = "regulator-fixed"; + regulator-name = "usb0_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&gpio3 9 0>; + enable-active-low;
Same comment I put on patch #3.
arch/arm/boot/dts/imx28-sps1.dts line 146
Quoted 7 lines
arch/arm/boot/dts/imx28-sps1.dts new file +7
-0+ }; + }; + + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&led_pins_sps1>;
Aha, you put it here. But do you have leds-gpio driver call pinctrl to set them up?
arch/arm/boot/dts/imx28-sps1.dts line 149
Quoted 3 lines
arch/arm/boot/dts/imx28-sps1.dts new file +3
-0+ status = "okay"; + + led at 1 {
There should be a "reg" property matching the number after @. So you need to either give it a unique node name without @?, or you add a reg property.
Quoted 24 lines
arch/arm/boot/dts/imx28-sps1.dts new file +19
-0+ label = "sps1-1:yellow:user"; + gpios = <&gpio0 6 0>; + linux,default-trigger = "heartbeat"; + }; + + led at 2 { + label = "sps1-2:red:user"; + gpios = <&gpio0 3 0>; + linux,default-trigger = "heartbeat"; + }; + + led at 3 { + label = "sps1-3:red:user"; + gpios = <&gpio0 0 0>; + default-trigger = "heartbeat"; + }; + + }; +};arch/arm/mach-mxs/mach-mxs.c +0
-0
arch/arm/mach-mxs/mach-mxs.c static void __init mxs_machine_init(void) · line 283
Quoted 5 lines
arch/arm/mach-mxs/mach-mxs.c +2
-0@@ -279,6 +279,8 @@ static void __init mxs_machine_init(void)m28evk_init (); else if (of_machine_is_compatible("bluegiga,apx4devkit")) apx4devkit_init(); + else if (of_machine_is_compatible("schulercontrol,imx28-sps1")) +imx28_evk_init ();
Call imx28_evk_init for imx28-sps1 board?
arch/arm/mach-mxs/mach-mxs.c static const char *imx28_dt_compat[] __initdata = { · line 303
Quoted 8 lines
arch/arm/mach-mxs/mach-mxs.c +1
-0of_platform_populate (NULL , of_default_bus_match_table, mxs_auxdata_lookup,NULL );@@ -298,6 +300,7 @@ static const char *imx28_dt_compat[] __initdata = {"denx,m28evk" ,"fsl,imx28-evk" ,"karo,tx28" , + "schulercontrol,imx28-sps1",
See mxs/dt-for-3.7 branch. We are using generic compat string for matching.
Quoted 6 lines
arch/arm/mach-mxs/mach-mxs.c +0
-0"fsl,imx28" , NULL, };Signature · 1 line
1.7.10.4
Signature · 2 lines
Regards, Shawn
PATCH 4/4 ARM: mxs: Add SchulerControl SPS1 DTS file
Dear Shawn Guo,
Quoted 55 lines
Please base it on my mxs/dt-for-3.7 branch.
Quoted 26 lines · Marek Vasut
Add DTS file for this custom board.
Signed-off-by Marek Vasut <[email protected]>Cc Fabio Estevam <[email protected]>Cc Shawn Guo <[email protected]>---
arch/arm/boot/dts/imx28-sps1.dts | 168 ++++++++++++++++++++++++++++++++++++++ arch/arm/mach-mxs/mach-mxs.c | 3 + 2 files changed, 171 insertions(+) create mode 100644 arch/arm/boot/dts/imx28-sps1.dts(quoted diff) +0
-0
b/arch/arm/boot/dts/imx28-sps1.dtsnew file mode 100644 index 0000000..d05b1cbarch/arm/boot/dts/imx28-sps1.dts new file +7
-0@@ -0,0 +1,168 @@ +/* + * Copyright (C) 2012 Marek Vasut <[email protected]> + * + * The code contained herein is licensed under the GNU General Public + * License. You may obtain a copy of the GNU General Public License + * Version 2 or later at the following locations: + *arch/arm/boot/dts/imx28-sps1.dts line 17
Quoted 10 lines
arch/arm/boot/dts/imx28-sps1.dts new file +10
-0+ * http://www.opensource.org/licenses/gpl-license.html + * http://www.gnu.org/copyleft/gpl.html + */ + +/dts-v1/; +/include/ "imx28.dtsi" + +/ { + model = "SchulerControl GmbH, SC SPS 1"; + compatible = "schulercontrol,imx28-sps1", "fsl,imx28";We should use the short name as prefix if it has one.
arch/arm/boot/dts/imx28-sps1.dts line 26
Quoted 9 lines
arch/arm/boot/dts/imx28-sps1.dts new file +9
-0+ + memory { + reg = <0x40000000 0x08000000>; + }; + + apb at 80000000 { + apbh at 80000000 { + pinctrl at 80018000 { + led_pins_sps1: leds at 0 {It should be referenced by the pinctrl state directly under node pinctrl at 80018000, otherwise the pins will not be set up.
Quoted 6 lines
Also we usually use a generic name here something like
hog_pins_a: hog at 0 {so that we do not need to create new node every time we add pins for a new module.
So I'll ignore this comment and add pinctrl call into leds-gpio ... can we agree on that ?
[...]
PATCH 4/4 ARM: mxs: Add SchulerControl SPS1 DTS file
Quoted 3 lines · Marek Vasut
So I'll ignore this comment and add pinctrl call into leds-gpio ... can we agree on that ?
I'm fine. But I have to postpone this part of dts change until I see the driver part gets accepted.
Signature · 2 lines
Regards, Shawn
PATCH 4/4 ARM: mxs: Add SchulerControl SPS1 DTS file
In reply to Shawn GuoQuoted 7 lines · Shawn Guo
arch/arm/boot/dts/imx28-sps1.dts line 59
Quoted 4 lines
arch/arm/boot/dts/imx28-sps1.dts new file +4
-0+ flash: m25p80 at 0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "everspin,mr25h256", "mr25h256";Node name "m25p80" and "mr25h256", same thing?
Ok, just got reminded by Fabio, m25p80 covers many devices including mr25h256 here.
Signature · 2 lines
Regards, Shawn
PATCH 4/4 ARM: mxs: Add SchulerControl SPS1 DTS file
Dear Shawn Guo,
Quoted 5 lines · Shawn Guo
Quoted 4 lines
arch/arm/boot/dts/imx28-sps1.dts
Quoted 4 lines
arch/arm/boot/dts/imx28-sps1.dts new file +4
-0+ flash: m25p80 at 0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "everspin,mr25h256",
"mr25h256";
Quoted 5 lines
Quoted 2 lines
Node name "m25p80" and "mr25h256", same thing?
Ok, just got reminded by Fabio, m25p80 covers many devices including mr25h256 here.
I still need to look into the OUI
Best regards,
Marek Vasut
Shawn Guo
AppliedPATCH v2 1/4 ARM: mx28: Add SPI 2 pinmux into imx28.dtsi
In reply to Marek VasutQuoted 7 lines · Marek Vasut
Add this SSP port 2 pin multiplexing configuration into the
imx28.dtsifile.Signed-off-by Marek Vasut <[email protected]>Cc Chris Ball <[email protected]>Cc Fabio Estevam <[email protected]>Cc Mark Brown <[email protected]>Cc Shawn Guo <[email protected]>
Applied, thanks.
Signature · 2 lines
Regards, Shawn