ARM: kirkwood: Convert the mplcec4 board to pinctrl
Subsystems (3)
cover ARM: kirkwood: Convert the mplcec4 board to pinctrl
Hello Andrew
This is my try to convert the mplcec4 board to your pinctrl patches. The only problem I see is that I get an uart1 using mpp13 and mpp14 which are used by the mvsdio driver (and mentioned accordingly in the appropriate entry under /proc/device-tree/ocp at f00....). I did not find a way to get rid of this uart1 and because the SD card interface does work and no kernel errors or warnings are issued, it obviosely does no harm. However, I will rework this patch if you have some input in this respect.
Regards
Stefan Peter
Stefan Peter (1):
Convert mplcec4 board to pinctrl
arch/arm/boot/dts/kirkwood-mplcec4.dts | 64 ++++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-mplcec4.c | 35 ----------------- 2 files changed, 64 insertions(+), 35 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 1/1 ARM: kirkwood: Convert mplcec4 board to pinctrl
---
arch/arm/boot/dts/kirkwood-mplcec4.dts +64 -0
@@ -1,6 +1,7 @@ /dts-v1/; /include/ "kirkwood.dtsi" +/include/ "kirkwood-6281.dtsi" / { model = "MPL CEC4";
@@ -16,6 +17,69 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + + pinctrl-0 = < &pmx_nand &pmx_uart0 + &pmx_led_health &pmx_sdio + &pmx_sata0 &pmx_sata1 + &pmx_led_user1o + &pmx_led_user1g &pmx_led_user0o + &pmx_led_user0g &pmx_led_misc + &pmx_sdio_cd + >; + pinctrl-names = "default"; + + pmx_led_health: pmx-led-health { + marvell,pins = "mpp7"; + marvell,function = "gpo"; + }; + + pmx_sdio: pmx-sdio { + marvell,pins = "mpp12", "mmp13", "mpp14", + "mpp15", "mpp16", "mpp17"; + marvell,function = "sdio"; + }; + + pmx_sata1: pmx-sata1 { + marvell,pins = "mpp34"; + marvell,function = "sata1"; + }; + + pmx_sata0: pmx-sata0 { + marvell,pins = "mpp35"; + marvell,function = "sata0"; + }; + + pmx_led_user1o: pmx-led-user1o { + marvell,pins = "mpp40"; + marvell,function = "gpio"; + }; + + pmx_led_user1g: pmx-led-user1g { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + + pmx_led_user0o: pmx-led-user0o { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + + pmx_led_user0g: pmx-led-user0g { + marvell,pins = "mpp45"; + marvell,function = "gpio"; + }; + + pmx_led_misc: pmx-led-misc { + marvell,pins = "mpp46"; + marvell,function = "gpio"; + }; + + pmx_sdio_cd: pmx-sdio-cd { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + }; i2c at 11000 { status = "okay";
arch/arm/mach-kirkwood/board-mplcec4.c +0 -35
@@ -24,51 +24,16 @@ static struct mv643xx_eth_platform_data mplcec4_ge01_data = { .phy_addr = MV643XX_ETH_PHY_ADDR(2), }; -static unsigned int mplcec4_mpp_config[]__initdata = { -MPP0_NF_IO2 , -MPP1_NF_IO3 , -MPP2_NF_IO4 , -MPP3_NF_IO5 , -MPP4_NF_IO6 , -MPP5_NF_IO7 , - MPP6_SYSRST_OUTn, -MPP7_GPO ,/* Status LED Green High Active */ -MPP10_UART0_TXD , -MPP11_UART0_RXD , -MPP12_SD_CLK , -MPP13_SD_CMD ,/* Alt UART1_TXD */ -MPP14_SD_D0 ,/* Alt UART1_RXD */ -MPP15_SD_D1 , -MPP16_SD_D2 , -MPP17_SD_D3 , -MPP18_NF_IO0 , -MPP19_NF_IO1 , -MPP28_GPIO ,/* Input SYS_POR_DET (active High) */ -MPP29_GPIO ,/* Input SYS_RTC_INT (active High) */ - MPP34_SATA1_ACTn, - MPP35_SATA0_ACTn, -MPP40_GPIO ,/* LED User1 orange */ -MPP41_GPIO ,/* LED User1 green */ -MPP44_GPIO ,/* LED User0 orange */ -MPP45_GPIO ,/* LED User0 green */ -MPP46_GPIO ,/* Status LED Yellow High Active */ -MPP47_GPIO ,/* SD_CD# (in/IRQ)*/ -0 -}; - -static struct mvsdio_platform_data mplcec4_mvsdio_data = { .gpio_card_detect =47 ,/* MPP47 used as SD card detect */ }; -void __init mplcec4_init (void ) {/* * Basic setup. Needs to be called early. */ -kirkwood_mpp_conf (mplcec4_mpp_config);kirkwood_ehci_init ();kirkwood_ge00_init (&mplcec4_ge00_data);kirkwood_ge01_init (&mplcec4_ge01_data);
Signature · 1 line
1.7.9.5
PATCH 1/1 ARM: kirkwood: Convert mplcec4 board to pinctrl
Quoted 31 lines · Stefan Peter
Signed-off-by Stefan Peter <[email protected]>---
arch/arm/boot/dts/kirkwood-mplcec4.dts +13
-0@@ -1,6 +1,7 @@ /dts-v1/; /include/ "kirkwood.dtsi" +/include/ "kirkwood-6281.dtsi" / { model = "MPL CEC4";@@ -16,6 +17,69 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + + pinctrl-0 = < &pmx_nand &pmx_uart0 + &pmx_led_health &pmx_sdio + &pmx_sata0 &pmx_sata1 + &pmx_led_user1o + &pmx_led_user1g &pmx_led_user0o + &pmx_led_user0g &pmx_led_misc + &pmx_sdio_cd + >; + pinctrl-names = "default"; +
arch/arm/boot/dts/kirkwood-mplcec4.dts line 41
Quoted 10 lines
arch/arm/boot/dts/kirkwood-mplcec4.dts +10
-0+ pmx_led_health: pmx-led-health { + marvell,pins = "mpp7"; + marvell,function = "gpo"; + }; + + pmx_sdio: pmx-sdio { + marvell,pins = "mpp12", "mmp13", "mpp14", + "mpp15", "mpp16", "mpp17"; + marvell,function = "sdio"; + };
Please could you move this into kirkwood-6281.dtsi. It should be generic so that other boards using sdio can use it.
Thanks
Andrew
cover ARM: kirkwood: Convert the mplcec4 board to pinctrl
In reply to Stefan PeterQuoted 5 lines · Stefan Peter
Hello Andrew
This is my try to convert the mplcec4 board to your pinctrl patches. The only problem I see is that I get an uart1 using mpp13 and mpp14 which are used by the mvsdio driver
Hi Stefan
Interesting.
If you convert the dtb back to a dtc:
dtc -o mplcec4.dts -O dts arch/arm/boot/kirkwood-mplcec4.dtb
you see:
pinctrl at 10000 {
compatible = "marvell,88f6281-pinctrl";
reg = <0x10000 0x20>;
pinctrl-0 = <0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd>;
pinctrl-names = "default";
pmx-nand {
marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3", "mpp4", "mpp5", "mpp18", "mpp19";
marvell,function = "nand";
linux,phandle = <0x2>;
phandle = <0x2>;
};
pmx-sata0 {
marvell,pins = "mpp35";
marvell,function = "sata0";
linux,phandle = <0x6>;
phandle = <0x6>;
};
pmx-sata1 {
marvell,pins = "mpp34";
marvell,function = "sata1";
linux,phandle = <0x7>;
phandle = <0x7>;
};
pmx-spi {
marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3";
marvell,function = "spi";
};
pmx-twsi0 {
marvell,pins = "mpp8", "mpp9";
marvell,function = "twsi0";
};
pmx-uart0 {
marvell,pins = "mpp10", "mpp11";
marvell,function = "uart0";
linux,phandle = <0x3>;
phandle = <0x3>;
};
pmx-uart1 {
marvell,pins = "mpp13", "mpp14";
marvell,function = "uart1";
};
pmx-led-health {
marvell,pins = "mpp7";
marvell,function = "gpo";
linux,phandle = <0x4>;
phandle = <0x4>;
};
pmx-sdio {
marvell,pins = "mpp12", "mmp13", "mpp14", "mpp15", "mpp16", "mpp17";
marvell,function = "sdio";
linux,phandle = <0x5>;
phandle = <0x5>;
};
pmx-led-user1o {
marvell,pins = "mpp40";
marvell,function = "gpio";
linux,phandle = <0x8>;
phandle = <0x8>;
};
pmx-led-user1g {
marvell,pins = "mpp41";
marvell,function = "gpio";
linux,phandle = <0x9>;
phandle = <0x9>;
};
pmx-led-user0o {
marvell,pins = "mpp44";
marvell,function = "gpio";
linux,phandle = <0xa>;
phandle = <0xa>;
};
pmx-led-user0g {
marvell,pins = "mpp45";
marvell,function = "gpio";
linux,phandle = <0xb>;
phandle = <0xb>;
};
pmx-led-misc {
marvell,pins = "mpp46";
marvell,function = "gpio";
linux,phandle = <0xc>;
phandle = <0xc>;
};
pmx-sdio-cd {
marvell,pins = "mpp47";
marvell,function = "gpio";
linux,phandle = <0xd>;
phandle = <0xd>;
};
};
};pmx-uart1 has no linux.phandle, and its not listed in
pinctrl-0 = <0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd>;
so it should not be used as a pin hog.
So, during boot do you see:
f1012100.serial: ttyS1 at MMIO 0xf1012100 (irq = 34) is a 16550A
I expect 'no', since:
serial at 12100 {
compatible = "ns16550a";
reg = <0x12100 0x100>;
reg-shift = <0x2>;
interrupts = <0x22>;
status = "disabled";
};What do you see in /debug/pinctrl/f1010000.pinctrl/pinmux-pins contain?
Since i have a second UART on my board i have:
pin 13 (PIN13): f1010000.pinctrl (GPIO UNCLAIMED) (HOG) function uart1 group mpp13 pin 14 (PIN14): f1010000.pinctrl (GPIO UNCLAIMED) (HOG) function uart1 group mpp14
but i would expect to see function sdio.
Thanks
Andrew
cover ARM: kirkwood: Convert the mplcec4 board to pinctrl
Hello Andrew
Am 19.11.2012 12:18, schrieb Andrew Lunn:
Quoted 22 lines · Stefan Peter
Quoted 5 lines
Hello Andrew
This is my try to convert the mplcec4 board to your pinctrl patches. The only problem I see is that I get an uart1 using mpp13 and mpp14 which are used by the mvsdio driver
Hi Stefan
Interesting.
If you convert the dtb back to a dtc:
dtc -o
mplcec4.dts-O dtsarch/arm/boot/kirkwood-mplcec4.dtbyou see:
pinctrl at 10000 { }; };
Quoted 5 lines
pmx-uart1 has no linux.phandle, and its not listed in
pinctrl-0 = <
0x20x30x40x50x60x70x80x90xa0xb0xc0xd>;so it should not be used as a pin hog.
Exactly.
Quoted 5 lines
So, during boot do you see:
f1012100.serial: ttyS1 at MMIO
0xf1012100(irq = 34) is a 16550A
No
Quoted 9 lines
What do you see in /debug/pinctrl/f1010000.pinctrl/pinmux-pins contain?
Since i have a second UART on my board i have:
pin 13 (PIN13): f1010000.pinctrl (GPIO UNCLAIMED) (HOG) function uart1 group mpp13 pin 14 (PIN14): f1010000.pinctrl (GPIO UNCLAIMED) (HOG) function uart1 group mpp14
but i would expect to see function sdio.
No, I see
pin 12 (PIN12): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 13 (PIN13): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 14 (PIN14): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 15 (PIN15): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 16 (PIN16): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 17 (PIN17): (MUX UNCLAIMED) (GPIO UNCLAIMED)
However, there is a phandle in pinctrl at 10000/pmx-sdio/
Quoted 4 lines
Thanks
Andrew
Regards
Stefan Peter
Signature · 2 lines
MPL AG, Switzerland http://www.mpl.ch Tel. +41 (0)56 483 34 34 Fax: +41(0)56 493 30 20
cover ARM: kirkwood: Convert the mplcec4 board to pinctrl
Quoted 11 lines
Quoted 8 lines
What do you see in /debug/pinctrl/f1010000.pinctrl/pinmux-pins contain?
Since i have a second UART on my board i have:
pin 13 (PIN13): f1010000.pinctrl (GPIO UNCLAIMED) (HOG) function uart1 group mpp13 pin 14 (PIN14): f1010000.pinctrl (GPIO UNCLAIMED) (HOG) function uart1 group mpp14
but i would expect to see function sdio.
No, I see
Quoted 8 lines
pin 12 (PIN12): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 13 (PIN13): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 14 (PIN14): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 15 (PIN15): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 16 (PIN16): (MUX UNCLAIMED) (GPIO UNCLAIMED) pin 17 (PIN17): (MUX UNCLAIMED) (GPIO UNCLAIMED)
However, there is a phandle in pinctrl at 10000/pmx-sdio/
Humm..
Try enabling CONFIG_DEBUG_PINCTRL. It prints out a lot of debug as the driver loads.
Andrew
cover ARM: kirkwood: Convert the mplcec4 board to pinctrl
Hi Andrew
Am 19.11.2012 13:18, schrieb Andrew Lunn:
Quoted 5 lines
Humm..
Try enabling
CONFIG_DEBUG_PINCTRL. It prints out a lot of debug as the driver loads.
This is what I get
kirkwood-pinctrl f1010000.pinctrl: try to register 50 pins ... pinctrl core: registered pin 0 (PIN0) on f1010000.pinctrl pinctrl core: registered pin 1 (PIN1) on f1010000.pinctrl
...
pinctrl core: registered pin 12 (PIN12) on f1010000.pinctrl pinctrl core: registered pin 13 (PIN13) on f1010000.pinctrl pinctrl core: registered pin 14 (PIN14) on f1010000.pinctrl pinctrl core: registered pin 15 (PIN15) on f1010000.pinctrl pinctrl core: registered pin 16 (PIN16) on f1010000.pinctrl pinctrl core: registered pin 17 (PIN17) on f1010000.pinctrl
...
pinctrl core: add 8 pinmux maps
pinctrl core: add 2 pinmux maps
pinctrl core: add 1 pinmux maps
kirkwood-pinctrl f1010000.pinctrl: unknown pin mmp13 pinctrl core: add 6 pinmux maps
pinctrl core: failed to register map default (5): invalid type given kirkwood-pinctrl f1010000.pinctrl: registered pinctrl driver
I tried to get behind the reason for the "unknown pin mpp13" hoping that the subsequent errors regarding the maps are related, but it may be faster asking for your opinion.
Regards
Stefan Peter
Signature · 2 lines
MPL AG, Switzerland http://www.mpl.ch Tel. +41 (0)56 483 34 34 Fax: +41(0)56 493 30 20
cover ARM: kirkwood: Convert the mplcec4 board to pinctrl
Dear Stefan Peter,
Quoted 1 line · Stefan Peter
kirkwood-pinctrl f1010000.pinctrl: unknown pin mmp13
It should be 'mpp13', not 'mmp13'.
The problem is in your Device Tree as well :-)
Best regards,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
cover ARM: kirkwood: Convert the mplcec4 board to pinctrl
In reply to Stefan PeterQuoted 31 lines · Stefan Peter
Hi Andrew
Am 19.11.2012 13:18, schrieb Andrew Lunn:
Quoted 5 lines
Humm..
Try enabling
CONFIG_DEBUG_PINCTRL. It prints out a lot of debug as the driver loads.This is what I get
kirkwood-pinctrl f1010000.pinctrl: try to register 50 pins ... pinctrl core: registered pin 0 (PIN0) on f1010000.pinctrl pinctrl core: registered pin 1 (PIN1) on f1010000.pinctrl
...
pinctrl core: registered pin 12 (PIN12) on f1010000.pinctrl pinctrl core: registered pin 13 (PIN13) on f1010000.pinctrl pinctrl core: registered pin 14 (PIN14) on f1010000.pinctrl pinctrl core: registered pin 15 (PIN15) on f1010000.pinctrl pinctrl core: registered pin 16 (PIN16) on f1010000.pinctrl pinctrl core: registered pin 17 (PIN17) on f1010000.pinctrl
...
pinctrl core: add 8 pinmux maps
pinctrl core: add 2 pinmux maps
pinctrl core: add 1 pinmux maps
kirkwood-pinctrl f1010000.pinctrl: unknown pin mmp13 pinctrl core: add 6 pinmux maps
pinctrl core: failed to register map default (5): invalid type given kirkwood-pinctrl f1010000.pinctrl: registered pinctrl driver
Quoted 1 line
I tried to get behind the reason for the "unknown pin mpp13" hoping that
Hi Stefan
Read the error message again....unknown pin mmp13
^^^
Sorry i missed it earlier.
Andrew
cover ARM: kirkwood: Convert the mplcec4 board to pinctrl
Hi Andrew
Am 19.11.2012 15:26, schrieb Andrew Lunn:
Quoted 2 lines
Read the error message again....unknown pin mmp13
^^^
Blush. But now it works, patch will follow.
Regards
Stefan Peter
Signature · 2 lines
MPL AG, Switzerland http://www.mpl.ch Tel. +41 (0)56 483 34 34 Fax: +41(0)56 493 30 20