ARM: Kirkwood: Convert to pinctrl
Subsystems (5)
Andrew Lunn
maintainercover ARM: Kirkwood: Convert to pinctrl
This patchset converts all DT kirkwood boards to using pinctrl.
This patchset depends on an earlier patchset to allow the mvebu pinctrl driver and gpio driver to be built for kirkwood.
Only the TS219 conversion has been tested on hardware. The remaining are compile tested. Before merging upstream, it would be good if the others could be tested on hardware.
This series along with the dependents can be found in:
git://github.com/lunn/linux.git v3.7-rc2-pinctrl
Andrew Lunn (9):
ARM: Kirkwood: Convert TS219 to pinctrl.
ARM: Kirkwood: Convert iConnect to pinctrl.
ARM: Kirkwood: Convert dnskw to pinctrl
ARM: Kirkwood: Convert dockstar to pinctrl.
ARM: Kirkwood: Convert dreamplug to pinctrl.
ARM: Kirkwood: Convert GoFlex Net to pinctrl.
ARM: Kirkwood: Convert ib62x0 to pinctrl.
ARM: Kirkwood: Convert lsxl boards to pinctrl.
ARM: Kirkwood: Convert IX2-200 to pinctrl.
arch/arm/boot/dts/kirkwood-dnskw.dtsi | 136 +++++++++++++++++++++++++ arch/arm/boot/dts/kirkwood-dockstar.dts | 21 ++++ arch/arm/boot/dts/kirkwood-dreamplug.dts | 26 +++++ arch/arm/boot/dts/kirkwood-goflexnet.dts | 57 +++++++++++ arch/arm/boot/dts/kirkwood-ib62x0.dts | 41 ++++++++ arch/arm/boot/dts/kirkwood-iconnect.dts | 52 ++++++++++ arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts | 90 ++++++++++++++++ arch/arm/boot/dts/kirkwood-lsxl.dtsi | 67 ++++++++++++ arch/arm/boot/dts/kirkwood-ts219-6281.dts | 56 ++++++++++ arch/arm/boot/dts/kirkwood-ts219-6282.dts | 56 ++++++++++ arch/arm/mach-kirkwood/board-dnskw.c | 37 ------- arch/arm/mach-kirkwood/board-dockstar.c | 10 -- arch/arm/mach-kirkwood/board-dreamplug.c | 14 --- arch/arm/mach-kirkwood/board-goflexnet.c | 18 ---- arch/arm/mach-kirkwood/board-ib62x0.c | 21 ---- arch/arm/mach-kirkwood/board-iconnect.c | 17 ---- arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 24 ----- arch/arm/mach-kirkwood/board-lsxl.c | 19 ---- arch/arm/mach-kirkwood/board-ts219.c | 25 ----- 19 files changed, 602 insertions(+), 185 deletions(-)
Signature · 1 line
1.7.10.4
Andrew Lunn
maintainerPATCH 1/9 ARM: Kirkwood: Convert TS219 to pinctrl.
Make use of the pinctrl driver for configuring all the pins, instead of using the Orion mpp code.
--- arch/arm/boot/dts/kirkwood-ts219-6281.dts | 56 +++++++++++++++++++++++++++++ arch/arm/boot/dts/kirkwood-ts219-6282.dts | 56 +++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-ts219.c | 25 ------------- 3 files changed, 112 insertions(+), 25 deletions(-)
arch/arm/boot/dts/kirkwood-ts219-6281.dts +56 -0
@@ -3,6 +3,62 @@ /include/ "kirkwood-ts219.dtsi" / { + ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_uart0 &pmx_uart1 &pmx_spi + &pmx_twsi0 &pmx_sata0 &pmx_sata1 + &pmx_ram_size &pmx_reset_button + &pmx_USB_copy_button &pmx_board_id>; + pinctrl-names = "default"; + + pmx_uart0: pmx-uart0 { + marvell,pins = "mpp10", "mpp11"; + marvell,function = "uart0"; + }; + pmx_uart1: pmx-uart1 { + marvell,pins = "mpp13", "mpp14"; + marvell,function = "uart1"; + }; + pmx_spi: pmx-spi { + marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3"; + marvell,function = "spi"; + }; + pmx_twsi0: pmx-twsi0 { + marvell,pins = "mpp8", "mpp9"; + marvell,function = "twsi0"; + }; + pmx_sata0: pmx-sata0 { + marvell,pins = "mpp5", "mpp21", "mpp23"; + marvell,function = "sata0"; + }; + pmx_sata1: pmx-sata1 { + marvell,pins = "mpp4", "mpp20", "mpp22"; + marvell,function = "sata1"; + }; + pmx_ram_size: pmx-ram-size { + /* RAM: 0: 256 MB, 1: 512 MB */ + marvell,pins = "mpp36"; + marvell,function = "gpio"; + }; + pmx_USB_copy_button: pmx-USB-copy-button { + marvell,pins = "mpp15"; + marvell,function = "gpio"; + }; + pmx_reset_button: pmx-reset-button { + marvell,pins = "mpp16"; + marvell,function = "gpio"; + }; + pmx_board_id: pmx-board-id { + /* 0: TS-11x, 1: TS-21x */ + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + }; + }; + gpio_keys { compatible = "gpio-keys"; #address-cells = <1>;
arch/arm/boot/dts/kirkwood-ts219-6282.dts +56 -0
62 lines not on this page · raw message
arch/arm/mach-kirkwood/board-ts219.c +0 -25
@@ -26,41 +26,16 @@#include <asm/mach/arch.h> #include <mach/kirkwood.h> #include "common.h" -#include "mpp.h" #include "tsx1x-common.h" static struct mv643xx_eth_platform_data qnap_ts219_ge00_data = { .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), }; -static unsigned int qnap_ts219_mpp_config[]__initdata = { - MPP0_SPI_SCn, -MPP1_SPI_MOSI , -MPP2_SPI_SCK , -MPP3_SPI_MISO , - MPP4_SATA1_ACTn, - MPP5_SATA0_ACTn, -MPP8_TW0_SDA , -MPP9_TW0_SCK , -MPP10_UART0_TXD , -MPP11_UART0_RXD , -MPP13_UART1_TXD ,/* PIC controller */ -MPP14_UART1_RXD ,/* PIC controller */ -MPP15_GPIO ,/* USB Copy button (on devices with 88F6281) */ -MPP16_GPIO ,/* Reset button (on devices with 88F6281) */ -MPP36_GPIO ,/* RAM: 0: 256 MB, 1: 512 MB */ -MPP37_GPIO ,/* Reset button (on devices with 88F6282) */ -MPP43_GPIO ,/* USB Copy button (on devices with 88F6282) */ -MPP44_GPIO ,/* Board ID: 0: TS-11x, 1: TS-21x */ -0 -}; -void __init qnap_dt_ts219_init (void ) {u32 dev, rev; -kirkwood_mpp_conf (qnap_ts219_mpp_config); -kirkwood_pcie_id (&dev, &rev);if (dev ==MV88F6282_DEV_ID ) qnap_ts219_ge00_data.phy_addr =MV643XX_ETH_PHY_ADDR (0 );
Signature · 1 line
1.7.10.4
PATCH 1/9 ARM: Kirkwood: Convert TS219 to pinctrl.
Dear Andrew Lunn,
arch/arm/boot/dts/kirkwood-ts219-6281.dts line 14
Quoted 4 lines · Andrew Lunn
arch/arm/boot/dts/kirkwood-ts219-6281.dts +4
-0+ pinctrl-0 = < &pmx_uart0 &pmx_uart1 &pmx_spi + &pmx_twsi0 &pmx_sata0 &pmx_sata1 + &pmx_ram_size &pmx_reset_button + &pmx_USB_copy_button &pmx_board_id>;
It would be really better to have those under each device, rather than globally declared here. For some devices such as UARTs, it is not yet possible with the 8250 driver to associate pinctrl pins (but I'm planning to work on that soon). However for the other drivers (SPI, TWSI, SATA, button), it should be possible.
Quoted 16 lines
arch/arm/boot/dts/kirkwood-ts219-6281.dts +16
-0+ pinctrl-names = "default"; + + pmx_uart0: pmx-uart0 { + marvell,pins = "mpp10", "mpp11"; + marvell,function = "uart0"; + }; + pmx_uart1: pmx-uart1 { + marvell,pins = "mpp13", "mpp14"; + marvell,function = "uart1"; + }; + pmx_spi: pmx-spi { + marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3"; + marvell,function = "spi"; + }; + pmx_twsi0: pmx-twsi0 { + marvell,pins = "mpp8", "mpp9";
arch/arm/boot/dts/kirkwood-ts219-6281.dts line 40
Quoted 10 lines
arch/arm/boot/dts/kirkwood-ts219-6281.dts +10
-0+ marvell,function = "twsi0"; + }; + pmx_sata0: pmx-sata0 { + marvell,pins = "mpp5", "mpp21", "mpp23"; + marvell,function = "sata0"; + }; + pmx_sata1: pmx-sata1 { + marvell,pins = "mpp4", "mpp20", "mpp22"; + marvell,function = "sata1"; + };
All those definitions are not board specific, they are common to the SoC. So they should be in the corresponding .dtsi file.
Basically:
* The SoC .dtsi file should define all the pinmux groups that are described in the datasheet and are used by boards. I.e, there may be conflicting groups defined, where one group configures pin X with function Y, while another group configures pin X with function Z.
* The board .dts file should define the pinmux groups that are really board-specific (buttons, LEDs, etc.), and then for each device, point to the correct pinmux group (either defined in the .dtsi file or in the board file).
See for example imx28.dtsi, and then the boards such as imx28-cfa10036.dts, imx28-evk.dts, imx28-m28evk.dts, imx28-tx28.dts.
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
Sebastian Hesselbarth
maintainerPATCH 1/9 ARM: Kirkwood: Convert TS219 to pinctrl.
Quoted 4 lines · Thomas Petazzoni
Dear Andrew Lunn,
On Wed, 24 Oct 2012 16:53:46 +0200, Andrew Lunn wrote:
Quoted 10 lines
Review
Quoted 4 lines
(quoted diff) +4
-0+ pinctrl-0 =< &pmx_uart0&pmx_uart1&pmx_spi + &pmx_twsi0&pmx_sata0&pmx_sata1 + &pmx_ram_size&pmx_reset_button + &pmx_USB_copy_button&pmx_board_id>;It would be really better to have those under each device, rather than globally declared here. For some devices such as UARTs, it is not yet possible with the 8250 driver to associate pinctrl pins (but I'm planning to work on that soon). However for the other drivers (SPI, TWSI, SATA, button), it should be possible.
Thomas,
Agree, but for now a global pinhog on pinctrl node itself is the correct way to go here. As soon as there is pinctrl support in the specific device drivers we can move pinmux phandle there.
Quoted 9 lines
arch/arm/boot/dts/kirkwood-ts219-6281.dts line 20
Quoted 5 lines
arch/arm/boot/dts/kirkwood-ts219-6281.dts +4
-0+ pmx_uart0: pmx-uart0 { + marvell,pins = "mpp10", "mpp11"; + marvell,function = "uart0"; + };All those definitions are not board specific, they are common to the SoC. So they should be in the corresponding .dtsi file.
Quoted 6 lines
Basically:
* The SoC .dtsi file should define all the pinmux groups that are described in the datasheet and are used by boards. I.e, there may be conflicting groups defined, where one group configures pin X with function Y, while another group configures pin X with function Z.
Here I disagree. Even quite simple interfaces like uart can have dozens of possible mpp configurations, e.g. rx/tx on up to three different pins each plus rts/cts on various pins plus all possible combinations.
Now consider some more complex interface with more than one mpp pin per interface pin. Do you really want to predefine all possible combinations even if it is more likely that in fact only one is used on all boards because they are all based on the same reference design?
Quoted 4 lines
* The board .dts file should define the pinmux groups that are really board-specific (buttons, LEDs, etc.), and then for each device, point to the correct pinmux group (either defined in the .dtsi file or in the board file).
With respect to mpp the actual configuration _is_ board specific. There are maybe only some pins that are always used if a specific interface is used, e.g. nand pins on dove can only be switched with gpio.
Sebastian
PATCH 1/9 ARM: Kirkwood: Convert TS219 to pinctrl.
Sebastian,
Quoted 3 lines · Sebastian Hesselbarth
Agree, but for now a global pinhog on pinctrl node itself is the correct way to go here. As soon as there is pinctrl support in the specific device drivers we can move pinmux phandle there.
I agree.
Quoted 8 lines
Here I disagree. Even quite simple interfaces like uart can have dozens of possible mpp configurations, e.g. rx/tx on up to three different pins each plus rts/cts on various pins plus all possible combinations.
Now consider some more complex interface with more than one mpp pin per interface pin. Do you really want to predefine all possible combinations even if it is more likely that in fact only one is used on all boards because they are all based on the same reference design?
Where did I say that you should define *all* possible configurations?
I said: "The SoC .dtsi file should define all the pinmux groups that are described in the datasheet and are used by boards". Read again the "and are used by boards".
So I'm clearly not advocating adding *all* possible configurations, because there would be gazillions of them. But I'm in favor of moving the *used* configurations to the .dtsi files.
Quoted 8 lines
Quoted 4 lines
* The board .dts file should define the pinmux groups that are really board-specific (buttons, LEDs, etc.), and then for each device, point to the correct pinmux group (either defined in the .dtsi file or in the board file).
With respect to mpp the actual configuration _is_ board specific. There are maybe only some pins that are always used if a specific interface is used, e.g. nand pins on dove can only be switched with gpio.
I am not sure to follow you here. There is clearly some MPP pins whose muxing groups can be defined in the SoC level file, and some other MPP pins whose muxing should entirely be done at the board level file.
For a UART, the .dtsi file can define a pinmux configuration for RX/TX/RTS/CTS, and the .dts file only needs to reference this configuration.
For LEDs, buttons and similar things, the pinmux configuration should be defined in the .dts file, and of course the .dts file will reference this configuration.
I think what Shawn Guo did with i.MX 28 is really neat. In the current patches posted by Andrew, for example, the following piece:
+ pmx_uart1: pmx-uart1 {
+ marvell,pins = "mpp13", "mpp14";
+ marvell,function = "uart1";
+ };
is needlessly repeated in kirkwood-ts219-6281.dts, kirkwood-ts219-6282.dts and kirkwood-dnskw.dtsi. This is clearly a pinmux configuration that sets up TXD/RXD of UART1, and it should be in kirkwood.dtsi.
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
Andrew Lunn
maintainerPATCH 1/9 ARM: Kirkwood: Convert TS219 to pinctrl.
Quoted 8 lines
I think what Shawn Guo did with i.MX 28 is really neat. In the current patches posted by Andrew, for example, the following piece:
arch/arm/boot/dts/kirkwood-ts219-6281.dts +4
-0+ pmx_uart1: pmx-uart1 { + marvell,pins = "mpp13", "mpp14"; + marvell,function = "uart1"; + };
Quoted 4 lines
is needlessly repeated in
kirkwood-ts219-6281.dts,kirkwood-ts219-6282.dtsandkirkwood-dnskw.dtsi. This is clearly a pinmux configuration that sets up TXD/RXD of UART1, and it should be inkirkwood.dtsi.
I did try that, but was getting errors from dtc.
Andrew
PATCH 1/9 ARM: Kirkwood: Convert TS219 to pinctrl.
Andrew,
Quoted 6 lines · Andrew Lunn
Quoted 4 lines
is needlessly repeated in
kirkwood-ts219-6281.dts,kirkwood-ts219-6282.dtsandkirkwood-dnskw.dtsi. This is clearly a pinmux configuration that sets up TXD/RXD of UART1, and it should be inkirkwood.dtsi.I did try that, but was getting errors from dtc.
I can probably help figuring out what the problem is. Do you have a patch that exhibits the problem so I can test it here?
Thanks,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Sebastian Hesselbarth
maintainerPATCH 1/9 ARM: Kirkwood: Convert TS219 to pinctrl.
In reply to Thomas PetazzoniQuoted 11 lines · Thomas Petazzoni
Quoted 4 lines · Sebastian Hesselbarth
Now consider some more complex interface with more than one mpp pin per interface pin. Do you really want to predefine all possible combinations even if it is more likely that in fact only one is used on all boards because they are all based on the same reference design?
Where did I say that you should define *all* possible configurations?
I said: "The SoC .dtsi file should define all the pinmux groups that are described in the datasheet and are used by boards". Read again the "and are used by boards".
Ok, then I overread "and used by other boards". Sorry for that.
Quoted 3 lines
So I'm clearly not advocating adding *all* possible configurations, because there would be gazillions of them. But I'm in favor of moving the *used* configurations to the .dtsi files.
Agreed.
Sebastian
PATCH 1/9 ARM: Kirkwood: Convert TS219 to pinctrl.
Sebastian,
Quoted 7 lines · Sebastian Hesselbarth
Quoted 5 lines
Where did I say that you should define *all* possible configurations?
I said: "The SoC .dtsi file should define all the pinmux groups that are described in the datasheet and are used by boards". Read again the "and are used by boards".
Ok, then I overread "and used by other boards". Sorry for that.
No problem :)
Quoted 5 lines
Quoted 3 lines
So I'm clearly not advocating adding *all* possible configurations, because there would be gazillions of them. But I'm in favor of moving the *used* configurations to the .dtsi files.
Agreed.
Great!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
Andrew Lunn
maintainerPATCH 2/9 ARM: Kirkwood: Convert iConnect to pinctrl.
In reply to Andrew Lunn--- arch/arm/boot/dts/kirkwood-iconnect.dts | 52 +++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-iconnect.c | 17 ---------- 2 files changed, 52 insertions(+), 17 deletions(-)
arch/arm/boot/dts/kirkwood-iconnect.dts +52 -0
@@ -18,6 +18,58 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_gpio_12 &pmx_gpio_35 + &pmx_gpio_41 &pmx_gpio_42 + &pmx_gpio_43 &pmx_gpio_44 + &pmx_gpio_45 &pmx_gpio_46 + &pmx_gpio_47 &pmx_gpio_48 >; + pinctrl-names = "default"; + + pmx_gpio_12: pmx-gpio-12 { + marvell,pins = "mpp12"; + marvell,function = "gpio"; + }; + pmx_gpio_35: pmx-gpio-35 { + marvell,pins = "mpp35"; + marvell,function = "gpio"; + }; + pmx_gpio_41: pmx-gpio-41 { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + pmx_gpio_42: pmx-gpio-42 { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + pmx_gpio_43: pmx-gpio-43 { + marvell,pins = "mpp43"; + marvell,function = "gpio"; + }; + pmx_gpio_44: pmx-gpio-44 { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + pmx_gpio_45: pmx-gpio-45 { + marvell,pins = "mpp45"; + marvell,function = "gpio"; + }; + pmx_gpio_46: pmx-gpio-46 { + marvell,pins = "mpp46"; + marvell,function = "gpio"; + }; + pmx_gpio_47: pmx-gpio-47 { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + pmx_gpio_48: pmx-gpio-48 { + marvell,pins = "mpp48"; + marvell,function = "gpio"; + }; + }; i2c at 11000 { status = "okay";
arch/arm/mach-kirkwood/board-iconnect.c +0 -17
@@ -21,30 +21,13 @@#include <asm/mach/arch.h> #include <mach/kirkwood.h> #include "common.h" -#include "mpp.h" static struct mv643xx_eth_platform_data iconnect_ge00_data = { .phy_addr =MV643XX_ETH_PHY_ADDR (11 ), }; -static unsigned int iconnect_mpp_config[]__initdata = { -MPP12_GPIO , -MPP35_GPIO , -MPP41_GPIO , -MPP42_GPIO , -MPP43_GPIO , -MPP44_GPIO , -MPP45_GPIO , -MPP46_GPIO , -MPP47_GPIO , -MPP48_GPIO , -0 -}; -void __init iconnect_init (void ) { -kirkwood_mpp_conf (iconnect_mpp_config); -kirkwood_ehci_init ();kirkwood_ge00_init (&iconnect_ge00_data); }
Signature · 1 line
1.7.10.4
Andrew Lunn
maintainerPATCH 3/9 ARM: Kirkwood: Convert dnskw to pinctrl
In reply to Andrew Lunn--- arch/arm/boot/dts/kirkwood-dnskw.dtsi | 136 +++++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-dnskw.c | 37 --------- 2 files changed, 136 insertions(+), 37 deletions(-)
arch/arm/boot/dts/kirkwood-dnskw.dtsi +136 -0
@@ -36,6 +36,142 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_uart1 &pmx_sata1 + &pmx_gpio_24 &pmx_gpio_25 + &pmx_led_power &pmx_led_power + &pmx_led_red_right_hdd + &pmx_led_red_left_hdd + &pmx_led_red_usb_325 + &pmx_gpio_30 &pmx_gpio_31 + &pmx_gpio_32 &pmx_gpio_33 + &pmx_button_power + &pmx_led_red_usb_320 + &pmx_power_off &pmx_power_back_on + &pmx_power_sata0 &pmx_power_sata1 + &pmx_present_sata0 &pmx_present_sata1 + &pmx_led_white_usb &pmx_fan_tacho + &pmx_fan_high_speed &pmx_fan_low_speed + &pmx_button_unmount &pmx_button_reset + &pmx_temp_alarm >; + pinctrl-names = "default"; + + pmx_uart1: pmx-uart1 { + marvell,pins = "mpp13", "mpp14"; + marvell,function = "uart1"; + }; + pmx_sata1: pmx-sata1 { + marvell,pins = "mpp4", "mpp20", "mpp22"; + marvell,function = "sata1"; + }; + pmx_gpio_24: pmx-gpio-24 { + marvell,pins = "mpp24"; + marvell,function = "gpio"; + }; + pmx_gpio_25: pmx-gpio-25 { + marvell,pins = "mpp25"; + marvell,function = "gpio"; + }; + pmx_led_power: pmx-led-power { + marvell,pins = "mpp26"; + marvell,function = "gpio"; + }; + pmx_led_red_right_hdd: pmx-led-red-right-hdd { + marvell,pins = "mpp27"; + marvell,function = "gpio"; + }; + pmx_led_red_left_hdd: pmx-led-red-left-hdd { + marvell,pins = "mpp28"; + marvell,function = "gpio"; + }; + pmx_led_red_usb_325: pmx-led-red-usb-325 { + marvell,pins = "mpp29"; + marvell,function = "gpio"; + }; + pmx_gpio_30: pmx-gpio-30 { + marvell,pins = "mpp30"; + marvell,function = "gpio"; + }; + pmx_gpio_31: pmx-gpio-31 { + marvell,pins = "mpp31"; + marvell,function = "gpio"; + }; + pmx_gpio_32: pmx-gpio-32 { + marvell,pins = "mpp32"; + marvell,function = "gpio"; + }; + pmx_gpio_33: pmx-gpio-33 { + marvell,pins = "mpp33"; + marvell,function = "gpio"; + }; + pmx_button_power: pmx-button-power { + marvell,pins = "mpp34"; + marvell,function = "gpio"; + }; + pmx_led_red_usb_320: pmx-led-red-usb-320 { + marvell,pins = "mpp35"; + marvell,function = "gpio"; + }; + pmx_power_off: pmx-power-off { + marvell,pins = "mpp36"; + marvell,function = "gpio"; + }; + pmx_power_back_on: pmx-power-back-on { + marvell,pins = "mpp37"; + marvell,function = "gpio"; + }; + pmx_gpio_38: pmx-gpio-38 { + marvell,pins = "mpp38"; + marvell,function = "gpio"; + }; + pmx_power_sata0: pmx-power-sata0 { + marvell,pins = "mpp39"; + marvell,function = "gpio"; + }; + pmx_power_sata1: pmx-power-sata1 { + marvell,pins = "mpp40"; + marvell,function = "gpio"; + }; + pmx_present_sata0: pmx-present-sata0 { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + pmx_present_sata1: pmx-present-sata1 { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + pmx_led_white_usb: pmx-led-white-usb { + marvell,pins = "mpp43"; + marvell,function = "gpio"; + }; + pmx_fan_tacho: pmx-fan-tacho { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + pmx_fan_high_speed: pmx-fan-high-speed { + marvell,pins = "mpp45"; + marvell,function = "gpio"; + }; + pmx_fan_low_speed: pmx-fan-low-speed { + marvell,pins = "mpp46"; + marvell,function = "gpio"; + }; + pmx_button_unmount: pmx-button-unmount { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + pmx_button_reset: pmx-button-reset { + marvell,pins = "mpp48"; + marvell,function = "gpio"; + }; + pmx_temp_alarm: pmx-temp-alarm { + marvell,pins = "mpp49"; + marvell,function = "gpio"; + }; + }; sata at 80000 { status = "okay"; nr-ports = <2>;
arch/arm/mach-kirkwood/board-dnskw.c +0 -37
@@ -17,46 +17,11 @@#include <linux/mv643xx_eth.h> #include <linux/gpio.h> #include "common.h" -#include "mpp.h" static struct mv643xx_eth_platform_data dnskw_ge00_data = { .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), }; -static unsigned int dnskw_mpp_config[]__initdata = { -MPP13_UART1_TXD ,/* Custom ... */ -MPP14_UART1_RXD ,/* ... Controller (DNS-320 only) */ - MPP20_SATA1_ACTn,/* LED: White Right HDD */ - MPP21_SATA0_ACTn,/* LED: White Left HDD */ -MPP24_GPIO , -MPP25_GPIO , -MPP26_GPIO ,/* LED: Power */ -MPP27_GPIO ,/* LED: Red Right HDD */ -MPP28_GPIO ,/* LED: Red Left HDD */ -MPP29_GPIO ,/* LED: Red USB (DNS-325 only) */ -MPP30_GPIO , -MPP31_GPIO , -MPP32_GPIO , -MPP33_GPO , -MPP34_GPIO ,/* Button: Front power */ -MPP35_GPIO ,/* LED: Red USB (DNS-320 only) */ -MPP36_GPIO ,/* Power: Turn off board */ -MPP37_GPIO ,/* Power: Turn back on after power failure */ -MPP38_GPIO , -MPP39_GPIO ,/* Power: SATA0 */ -MPP40_GPIO ,/* Power: SATA1 */ -MPP41_GPIO ,/* SATA0 present */ -MPP42_GPIO ,/* SATA1 present */ -MPP43_GPIO ,/* LED: White USB */ -MPP44_GPIO ,/* Fan: Tachometer Pin */ -MPP45_GPIO ,/* Fan: high speed */ -MPP46_GPIO ,/* Fan: low speed */ -MPP47_GPIO ,/* Button: Back unmount */ -MPP48_GPIO ,/* Button: Back reset */ -MPP49_GPIO ,/* Temp Alarm (DNS-325) Pin of U5 (DNS-320) */ -0 -}; -static void dnskw_power_off (void ) {gpio_set_value (36 ,1 );
@@ -76,8 +41,6 @@ static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)void __init dnskw_init (void ) { -kirkwood_mpp_conf (dnskw_mpp_config); -kirkwood_ehci_init ();kirkwood_ge00_init (&dnskw_ge00_data);
Signature · 1 line
1.7.10.4
PATCH 3/9 ARM: Kirkwood: Convert dnskw to pinctrl
Thanks for doing all this. Some typos to fix, I've commented below but I thought it might be easier to push a version for you to steal. It's here:
git://github.com/lentinj/linux.git v3.7-rc2-pinctrl
https://raw.github.com/lentinj/linux/v3.7-rc2-pinctrl/arch/arm/boot/dts/kirkwood-dnskw.dtsi
Tested on a DNS-320, not a DNS-325 yet.
Similar to lsxl_init, the custom GPIO registrations fail:-
dnskw: failed to configure power-off GPIO
dnskw: Failed to register dnskw:power:sata0
dnskw: Failed to register dnskw:power:sata1
dnskw: Failed to register dnskw:power:recover
So I guess they will need a new home somewhere.
However most things (fan, buttons, SATA detect/power via sysfs, power via sysfs) work. The key thing that doesn't is LEDs. Registration looks reasonable:
Registered led device: dns320:blue:power
kirkwood-pinctrl f1010000.pinctrl: request pin 43 (PIN43) for mvebu-gpio:43 Registered led device: dns320:blue:usb
kirkwood-pinctrl f1010000.pinctrl: request pin 28 (PIN28) for mvebu-gpio:28 Registered led device: dns320:orange:l_hdd
kirkwood-pinctrl f1010000.pinctrl: request pin 27 (PIN27) for mvebu-gpio:27 Registered led device: dns320:orange:r_hdd
kirkwood-pinctrl f1010000.pinctrl: request pin 35 (PIN35) for mvebu-gpio:35 Registered led device: dns320:orange:usb
However setting brightness on/off does the following:
cat /sys/class/leds/dns320\:blue\:power/trigger
dns320:blue:power - No effect, LED continues to blink as bootloader configures it
dns320:orange:l_hdd - Works fine
dns320:orange:r_hdd - Works fine
dns320:orange:usb - Turns on, turning off locks NAS hard dns320:blue:usb - Turns on, turning off locks NAS hard
Any ideas?
Cheers,
Quoted 11 lines · Andrew Lunn
Signed-off-by Andrew Lunn <[email protected]>---
arch/arm/boot/dts/kirkwood-dnskw.dtsi| 136 +++++++++++++++++++++++++++++++++arch/arm/mach-kirkwood/board-dnskw.c| 37 ---------2 files changed, 136 insertions(+), 37 deletions(-)arch/arm/boot/dts/kirkwood-dnskw.dtsi +0
-0
arch/arm/boot/dts/kirkwood-dnskw.dtsi line 43
Quoted 8 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +5
-0@@ -36,6 +36,142 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_uart1 &pmx_sata1
Need a &pmx_sata0 too (see below).
arch/arm/boot/dts/kirkwood-dnskw.dtsi line 45
Quoted 2 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +2
-0+ &pmx_gpio_24 &pmx_gpio_25 + &pmx_led_power &pmx_led_power
Shouldn't be repeated, I'm guessing.
Quoted 12 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +12
-0+ &pmx_led_red_right_hdd + &pmx_led_red_left_hdd + &pmx_led_red_usb_325 + &pmx_gpio_30 &pmx_gpio_31 + &pmx_gpio_32 &pmx_gpio_33 + &pmx_button_power + &pmx_led_red_usb_320 + &pmx_power_off &pmx_power_back_on + &pmx_power_sata0 &pmx_power_sata1 + &pmx_present_sata0 &pmx_present_sata1 + &pmx_led_white_usb &pmx_fan_tacho + &pmx_fan_high_speed &pmx_fan_low_speed
arch/arm/boot/dts/kirkwood-dnskw.dtsi line 67
Quoted 10 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +10
-0+ &pmx_button_unmount &pmx_button_reset + &pmx_temp_alarm >; + pinctrl-names = "default"; + + pmx_uart1: pmx-uart1 { + marvell,pins = "mpp13", "mpp14"; + marvell,function = "uart1"; + }; + pmx_sata1: pmx-sata1 { + marvell,pins = "mpp4", "mpp20", "mpp22";
mpp4 is for the NAND. I'm guessing mpp22 should be mpp21, but this should have the "sata0" function.
On a related note, the NAND pins aren't registered. I probably should have done this before, although if the bootloader didn't set up the NAND pins then it'd probably not get this far :)
arch/arm/boot/dts/kirkwood-dnskw.dtsi line 77
Quoted 10 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +10
-0+ marvell,function = "sata1"; + }; + pmx_gpio_24: pmx-gpio-24 { + marvell,pins = "mpp24"; + marvell,function = "gpio"; + }; + pmx_gpio_25: pmx-gpio-25 { + marvell,pins = "mpp25"; + marvell,function = "gpio"; + };
These don't actually do anything (there's no more NAS functions left to find now), so could they just be left out? They didn't serve any purpose before other than making it easy to see where the gaps were.
Quoted 22 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +22
-0+ pmx_led_power: pmx-led-power { + marvell,pins = "mpp26"; + marvell,function = "gpio"; + }; + pmx_led_red_right_hdd: pmx-led-red-right-hdd { + marvell,pins = "mpp27"; + marvell,function = "gpio"; + }; + pmx_led_red_left_hdd: pmx-led-red-left-hdd { + marvell,pins = "mpp28"; + marvell,function = "gpio"; + }; + pmx_led_red_usb_325: pmx-led-red-usb-325 { + marvell,pins = "mpp29"; + marvell,function = "gpio"; + }; + pmx_gpio_30: pmx-gpio-30 { + marvell,pins = "mpp30"; + marvell,function = "gpio"; + }; + pmx_gpio_31: pmx-gpio-31 { + marvell,pins = "mpp31";
arch/arm/boot/dts/kirkwood-dnskw.dtsi line 109
Quoted 10 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +10
-0+ marvell,function = "gpio"; + }; + pmx_gpio_32: pmx-gpio-32 { + marvell,pins = "mpp32"; + marvell,function = "gpio"; + }; + pmx_gpio_33: pmx-gpio-33 { + marvell,pins = "mpp33"; + marvell,function = "gpio"; + };
Should be "gpo", but could just leave out all 4.
Quoted 10 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +10
-0+ pmx_button_power: pmx-button-power { + marvell,pins = "mpp34"; + marvell,function = "gpio"; + }; + pmx_led_red_usb_320: pmx-led-red-usb-320 { + marvell,pins = "mpp35"; + marvell,function = "gpio"; + }; + pmx_power_off: pmx-power-off { + marvell,pins = "mpp36";
arch/arm/boot/dts/kirkwood-dnskw.dtsi line 129
Quoted 10 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +10
-0+ marvell,function = "gpio"; + }; + pmx_power_back_on: pmx-power-back-on { + marvell,pins = "mpp37"; + marvell,function = "gpio"; + }; + pmx_gpio_38: pmx-gpio-38 { + marvell,pins = "mpp38"; + marvell,function = "gpio"; + };
This one wasn't registered above, but not a used pin.
Quoted 109 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +45
-0+ pmx_power_sata0: pmx-power-sata0 { + marvell,pins = "mpp39"; + marvell,function = "gpio"; + }; + pmx_power_sata1: pmx-power-sata1 { + marvell,pins = "mpp40"; + marvell,function = "gpio"; + }; + pmx_present_sata0: pmx-present-sata0 { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + pmx_present_sata1: pmx-present-sata1 { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + pmx_led_white_usb: pmx-led-white-usb { + marvell,pins = "mpp43"; + marvell,function = "gpio"; + }; + pmx_fan_tacho: pmx-fan-tacho { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + pmx_fan_high_speed: pmx-fan-high-speed { + marvell,pins = "mpp45"; + marvell,function = "gpio"; + }; + pmx_fan_low_speed: pmx-fan-low-speed { + marvell,pins = "mpp46"; + marvell,function = "gpio"; + }; + pmx_button_unmount: pmx-button-unmount { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + pmx_button_reset: pmx-button-reset { + marvell,pins = "mpp48"; + marvell,function = "gpio"; + }; + pmx_temp_alarm: pmx-temp-alarm { + marvell,pins = "mpp49"; + marvell,function = "gpio"; + }; + }; sata at 80000 { status = "okay"; nr-ports = <2>;arch/arm/mach-kirkwood/board-dnskw.c +0
-37@@ -17,46 +17,11 @@#include <linux/mv643xx_eth.h> #include <linux/gpio.h> #include "common.h" -#include "mpp.h" static struct mv643xx_eth_platform_data dnskw_ge00_data = { .phy_addr =MV643XX_ETH_PHY_ADDR (8 ), }; -static unsigned int dnskw_mpp_config[]__initdata = { -MPP13_UART1_TXD ,/* Custom ... */ -MPP14_UART1_RXD ,/* ... Controller (DNS-320 only) */ - MPP20_SATA1_ACTn,/* LED: White Right HDD */ - MPP21_SATA0_ACTn,/* LED: White Left HDD */ -MPP24_GPIO , -MPP25_GPIO , -MPP26_GPIO ,/* LED: Power */ -MPP27_GPIO ,/* LED: Red Right HDD */ -MPP28_GPIO ,/* LED: Red Left HDD */ -MPP29_GPIO ,/* LED: Red USB (DNS-325 only) */ -MPP30_GPIO , -MPP31_GPIO , -MPP32_GPIO , -MPP33_GPO , -MPP34_GPIO ,/* Button: Front power */ -MPP35_GPIO ,/* LED: Red USB (DNS-320 only) */ -MPP36_GPIO ,/* Power: Turn off board */ -MPP37_GPIO ,/* Power: Turn back on after power failure */ -MPP38_GPIO , -MPP39_GPIO ,/* Power: SATA0 */ -MPP40_GPIO ,/* Power: SATA1 */ -MPP41_GPIO ,/* SATA0 present */ -MPP42_GPIO ,/* SATA1 present */ -MPP43_GPIO ,/* LED: White USB */ -MPP44_GPIO ,/* Fan: Tachometer Pin */ -MPP45_GPIO ,/* Fan: high speed */ -MPP46_GPIO ,/* Fan: low speed */ -MPP47_GPIO ,/* Button: Back unmount */ -MPP48_GPIO ,/* Button: Back reset */ -MPP49_GPIO ,/* Temp Alarm (DNS-325) Pin of U5 (DNS-320) */ -0 -}; -static void dnskw_power_off (void ) {gpio_set_value (36 ,1 );@@ -76,8 +41,6 @@ static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)void __init dnskw_init (void ) { -kirkwood_mpp_conf (dnskw_mpp_config); -kirkwood_ehci_init ();kirkwood_ge00_init (&dnskw_ge00_data);
Signature · 1 line
Jamie Lentin
Andrew Lunn
maintainerPATCH 3/9 ARM: Kirkwood: Convert dnskw to pinctrl
Quoted 6 lines · Jamie Lentin
Thanks for doing all this. Some typos to fix, I've commented below but I thought it might be easier to push a version for you to steal. It's here:
git://github.com/lentinj/linux.gitv3.7-rc2-pinctrl
https://raw.github.com/lentinj/linux/v3.7-rc2-pinctrl/arch/arm/boot/dts/kirkwood-dnskw.dtsi
Thanks. I will probably squash the three patches into my original, and add a Signed-off-by: if that is O.K. for you.
Quoted 11 lines
Tested on a DNS-320, not a DNS-325 yet.
Similar to
lsxl_init, the custom GPIO registrations fail:-dnskw: failed to configure power-off GPIO
dnskw: Failed to register dnskw:power:sata0
dnskw: Failed to register dnskw:power:sata1
dnskw: Failed to register dnskw:power:recoverSo I guess they will need a new home somewhere.
I hope to look at this problem this weekend. Maybe a gpio regulator could be a solution, or loading the pinctrl stuff earlier. We will see.
Quoted 17 lines
However most things (fan, buttons, SATA detect/power via sysfs, power via sysfs) work. The key thing that doesn't is LEDs. Registration looks reasonable:
Registered led device: dns320:blue:power
kirkwood-pinctrl f1010000.pinctrl: request pin 43 (PIN43) for mvebu-gpio:43 Registered led device: dns320:blue:usb
kirkwood-pinctrl f1010000.pinctrl: request pin 28 (PIN28) for mvebu-gpio:28 Registered led device: dns320:orange:l_hdd
kirkwood-pinctrl f1010000.pinctrl: request pin 27 (PIN27) for mvebu-gpio:27 Registered led device: dns320:orange:r_hdd
kirkwood-pinctrl f1010000.pinctrl: request pin 35 (PIN35) for mvebu-gpio:35 Registered led device: dns320:orange:usbHowever setting brightness on/off does the following:
cat /sys/class/leds/dns320\:blue\:power/trigger
Quoted 8 lines
dns320:blue:power - No effect, LED continues to blink as bootloader configures it
dns320:orange:l_hdd - Works fine
dns320:orange:r_hdd - Works fine
dns320:orange:usb - Turns on, turning off locks NAS hard dns320:blue:usb - Turns on, turning off locks NAS hardAny ideas?
First thing that comes to mind, is it registering them for the correct GPIO controller. I think with the new setup, pinctrl and gpio are closely linked, so maybe, its modifying pins on the wrong controller. Bit of a long shot....
Quoted 8 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi line 43
Quoted 6 lines
ocp at f1000000 {arch/arm/boot/dts/kirkwood-dnskw.dtsi +5
-0+ pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_uart1 &pmx_sata1Need a
&pmx_sata0too (see below).
I just turned the existing MPP setup into pinctrl. Things like SATA, SPI pins, etc, i left alone if they were not configured in the old C code. I've no problems adding them here.
Quoted 23 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi line 45
Quoted 3 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +2
-0+ &pmx_gpio_24 &pmx_gpio_25 + &pmx_led_power &pmx_led_powerShouldn't be repeated, I'm guessing.
Quoted 17 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +17
-0+ &pmx_led_red_right_hdd + &pmx_led_red_left_hdd + &pmx_led_red_usb_325 + &pmx_gpio_30 &pmx_gpio_31 + &pmx_gpio_32 &pmx_gpio_33 + &pmx_button_power + &pmx_led_red_usb_320 + &pmx_power_off &pmx_power_back_on + &pmx_power_sata0 &pmx_power_sata1 + &pmx_present_sata0 &pmx_present_sata1 + &pmx_led_white_usb &pmx_fan_tacho + &pmx_fan_high_speed &pmx_fan_low_speed + &pmx_button_unmount &pmx_button_reset + &pmx_temp_alarm >; + pinctrl-names = "default"; + + pmx_uart1: pmx-uart1 {
Quoted 8 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi line 67
Quoted 5 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +5
-0+ marvell,pins = "mpp13", "mpp14"; + marvell,function = "uart1"; + }; + pmx_sata1: pmx-sata1 { + marvell,pins = "mpp4", "mpp20", "mpp22";mpp4 is for the NAND. I'm guessing mpp22 should be mpp21, but this should have the "sata0" function.
MPP_MODE(4,
MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)),
MPP_VAR_FUNCTION(0x1, "nand", "io6", V(1, 1, 1, 1, 1)),
MPP_VAR_FUNCTION(0x2, "uart0", "rxd", V(1, 1, 1, 1, 1)),
MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1)),
MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1)),
MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0))),4 can be both NAND and SATA. It looks like NAND has to use pins mpp0-mpp5,mpp18-mmp19, they are not available anywhere else. SATA1 is duplicated, so we have to be careful to get the right pins.
Maybe boot the old kernel and look these lines:
[ 16.187814] initial MPP regs: 01112222 43303311 55550000 00000000 00000000 00000000 00000000 [ 16.187833] final MPP regs: 01552222 03303311 55550000 00000000 00000000 00000000 00000000
The first line is how uboot setup the MPP pins. The second is after the init function was called.
Andrew
PATCH 3/9 ARM: Kirkwood: Convert dnskw to pinctrl
Quoted 11 lines · Andrew Lunn
Quoted 6 lines · Jamie Lentin
Thanks for doing all this. Some typos to fix, I've commented below but I thought it might be easier to push a version for you to steal. It's here:
git://github.com/lentinj/linux.gitv3.7-rc2-pinctrl
https://raw.github.com/lentinj/linux/v3.7-rc2-pinctrl/arch/arm/boot/dts/kirkwood-dnskw.dtsiThanks. I will probably squash the three patches into my original, and add a Signed-off-by: if that is O.K. for you.
Sounds good.
Quoted 10 lines
Quoted 10 lines
Tested on a DNS-320, not a DNS-325 yet.
Similar to
lsxl_init, the custom GPIO registrations fail:-dnskw: failed to configure power-off GPIO
dnskw: Failed to register dnskw:power:sata0
dnskw: Failed to register dnskw:power:sata1
dnskw: Failed to register dnskw:power:recover
Quoted 6 lines
Quoted 1 line
So I guess they will need a new home somewhere.
I hope to look at this problem this weekend. Maybe a gpio regulator could be a solution, or loading the pinctrl stuff earlier. We will see.
I did look at using the gpio-regulator stuff a while back, and decided it wasn't quite the right shape. Although I can't remember why, and it might have changed since.
The power-off GPIO registration could happen in dnskw_power_off instead, or the attempt at a gpio-poweroff driver could be resurrected (I'd forgotten about it until now).
I could accept dnskw:power:recover is a weirdo configuration option that should be set in the bootloader / userland rather than the kernel supporting it. Although it would be nice if the kernel registered it's purpose. Maybe GPIO pins could be exported by adding sub-nodes to the GPIO chip, if that's not too hackish?
Quoted 24 lines
Quoted 24 lines
However most things (fan, buttons, SATA detect/power via sysfs, power via sysfs) work. The key thing that doesn't is LEDs. Registration looks reasonable:
Registered led device: dns320:blue:power
kirkwood-pinctrl f1010000.pinctrl: request pin 43 (PIN43) for mvebu-gpio:43 Registered led device: dns320:blue:usb
kirkwood-pinctrl f1010000.pinctrl: request pin 28 (PIN28) for mvebu-gpio:28 Registered led device: dns320:orange:l_hdd
kirkwood-pinctrl f1010000.pinctrl: request pin 27 (PIN27) for mvebu-gpio:27 Registered led device: dns320:orange:r_hdd
kirkwood-pinctrl f1010000.pinctrl: request pin 35 (PIN35) for mvebu-gpio:35 Registered led device: dns320:orange:usbHowever setting brightness on/off does the following:
cat /sys/class/leds/dns320\:blue\:power/triggerdns320:blue:power - No effect, LED continues to blink as bootloader configures it
dns320:orange:l_hdd - Works fine
dns320:orange:r_hdd - Works fine
dns320:orange:usb - Turns on, turning off locks NAS hard dns320:blue:usb - Turns on, turning off locks NAS hard
Quoted 6 lines
Quoted 1 line
Any ideas?
First thing that comes to mind, is it registering them for the correct GPIO controller. I think with the new setup, pinctrl and gpio are closely linked, so maybe, its modifying pins on the wrong controller. Bit of a long shot....
I did wonder that, but then why would turning the LEDs on work fine? I wonder if both pins are being toggled or something. I'll investigate further and report back. The two that cause the NAS to lock up are the only ones on &gpio1 though.
Quoted 53 lines
Quoted 8 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi line 43
Quoted 6 lines
ocp at f1000000 {arch/arm/boot/dts/kirkwood-dnskw.dtsi +5
-0+ pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_uart1 &pmx_sata1Need a
&pmx_sata0too (see below).I just turned the existing MPP setup into pinctrl. Things like SATA, SPI pins, etc, i left alone if they were not configured in the old C code. I've no problems adding them here.
Quoted 23 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi line 45
Quoted 3 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +2
-0+ &pmx_gpio_24 &pmx_gpio_25 + &pmx_led_power &pmx_led_powerShouldn't be repeated, I'm guessing.
Quoted 17 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +17
-0+ &pmx_led_red_right_hdd + &pmx_led_red_left_hdd + &pmx_led_red_usb_325 + &pmx_gpio_30 &pmx_gpio_31 + &pmx_gpio_32 &pmx_gpio_33 + &pmx_button_power + &pmx_led_red_usb_320 + &pmx_power_off &pmx_power_back_on + &pmx_power_sata0 &pmx_power_sata1 + &pmx_present_sata0 &pmx_present_sata1 + &pmx_led_white_usb &pmx_fan_tacho + &pmx_fan_high_speed &pmx_fan_low_speed + &pmx_button_unmount &pmx_button_reset + &pmx_temp_alarm >; + pinctrl-names = "default"; + + pmx_uart1: pmx-uart1 {Quoted 8 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi line 67
Quoted 5 lines
arch/arm/boot/dts/kirkwood-dnskw.dtsi +5
-0+ marvell,pins = "mpp13", "mpp14"; + marvell,function = "uart1"; + }; + pmx_sata1: pmx-sata1 { + marvell,pins = "mpp4", "mpp20", "mpp22";mpp4 is for the NAND. I'm guessing mpp22 should be mpp21, but this should have the "sata0" function.
MPP_MODE(4, MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), MPP_VAR_FUNCTION(0x1, "nand", "io6", V(1, 1, 1, 1, 1)), MPP_VAR_FUNCTION(0x2, "uart0", "rxd", V(1, 1, 1, 1, 1)), MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1)), MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1)), MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0))),
Quoted 4 lines
4 can be both NAND and SATA. It looks like NAND has to use pins mpp0-mpp5,mpp18-mmp19, they are not available anywhere else. SATA1 is duplicated, so we have to be careful to get the right pins.
The sata0 and sata1 activity leds are definitely MPP20 and MPP21---I've set them up as GPIO leds before successfully.
Quoted 7 lines
Maybe boot the old kernel and look these lines:
[ 16.187814] initial MPP regs: 01112222 43303311 55550000 00000000 00000000 00000000 00000000 [ 16.187833] final MPP regs: 01552222 03303311 55550000 00000000 00000000 00000000 00000000The first line is how uboot setup the MPP pins. The second is after the init function was called.
initial MPP regs: 01111111 03303311 00551100 00000000 00000000 00000000 00000000
final MPP regs: 01111111 03303311 00551100 00000000 00000000 00000000 00000000
Although the initial MPP regs is also set by a recompiled u-boot with ~identical MPP setup code.
Quoted 3 lines
Andrew
Signature · 1 line
Jamie Lentin
Andrew Lunn
maintainerPATCH 3/9 ARM: Kirkwood: Convert dnskw to pinctrl
Quoted 3 lines
I did look at using the gpio-regulator stuff a while back, and decided it wasn't quite the right shape. Although I can't remember why, and it might have changed since.
O.K. I will look at it this weekend.
Quoted 3 lines
The power-off GPIO registration could happen in
dnskw_power_offinstead, or the attempt at a gpio-poweroff driver could be resurrected (I'd forgotten about it until now).
I dusted the code off last weekend, but ran out of time. I wanted to make it also support the pxa use-case.
Quoted 5 lines
I could accept dnskw:power:recover is a weirdo configuration option that should be set in the bootloader / userland rather than the kernel supporting it. Although it would be nice if the kernel registered it's purpose. Maybe GPIO pins could be exported by adding sub-nodes to the GPIO chip, if that's not too hackish?
We need some sort of solution. It is quite common to use GPIO this way, to enable power, etc. So either we need some form of gpio regulator, or the ability to set gpio defaults as you said in the gpio DT node, or fix the ordering so the init function can set them up.
Quoted 10 lines
Quoted 5 lines
First thing that comes to mind, is it registering them for the correct GPIO controller. I think with the new setup, pinctrl and gpio are closely linked, so maybe, its modifying pins on the wrong controller. Bit of a long shot....
I did wonder that, but then why would turning the LEDs on work fine? I wonder if both pins are being toggled or something. I'll investigate further and report back. The two that cause the NAS to lock up are the only ones on &gpio1 though.
What would they map to on gpio0? NAND?
Quoted 2 lines
The sata0 and sata1 activity leds are definitely MPP20 and MPP21---I've set them up as GPIO leds before successfully.
O.K.
Quoted 11 lines
Quoted 5 lines
[ 16.187814] initial MPP regs: 01112222 43303311 55550000 00000000 00000000 00000000 00000000 [ 16.187833] final MPP regs: 01552222 03303311 55550000 00000000 00000000 00000000 00000000The first line is how uboot setup the MPP pins. The second is after the init function was called.
initial MPP regs: 01111111 03303311 00551100 00000000 00000000 00000000 00000000
final MPP regs: 01111111 03303311 00551100 00000000 00000000 00000000 00000000Although the initial MPP regs is also set by a recompiled u-boot with ~identical MPP setup code.
It might be useful to generate the same sort of dumps with the new driver, even if its code just hacked in for testing.
Andrew
PATCH 3/9 ARM: Kirkwood: Convert dnskw to pinctrl
Quoted 4 lines · Andrew Lunn
Quoted 3 lines
I did look at using the gpio-regulator stuff a while back, and decided it wasn't quite the right shape. Although I can't remember why, and it might have changed since.
Quoted 8 lines
O.K. I will look at it this weekend.
Quoted 3 lines
The power-off GPIO registration could happen in
dnskw_power_offinstead, or the attempt at a gpio-poweroff driver could be resurrected (I'd forgotten about it until now).I dusted the code off last weekend, but ran out of time. I wanted to make it also support the pxa use-case.
Okay, I'm unlikely to get a chance to have a play with it for a week or so but if I do I'll let you know.
Quoted 10 lines
Quoted 5 lines
I could accept dnskw:power:recover is a weirdo configuration option that should be set in the bootloader / userland rather than the kernel supporting it. Although it would be nice if the kernel registered it's purpose. Maybe GPIO pins could be exported by adding sub-nodes to the GPIO chip, if that's not too hackish?
We need some sort of solution. It is quite common to use GPIO this way, to enable power, etc. So either we need some form of gpio regulator, or the ability to set gpio defaults as you said in the gpio DT node, or fix the ordering so the init function can set them up.
Setting the defaults in the DT gpio node would get my vote, as it pretty much removes board-dnskw.c, and there'd be easy sysfs files to turn the pins on/off (maybe someone out there doesn't want their NAS to turn back on after a power failure...).
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
First thing that comes to mind, is it registering them for the correct GPIO controller. I think with the new setup, pinctrl and gpio are closely linked, so maybe, its modifying pins on the wrong controller. Bit of a long shot....
Quoted 7 lines
Quoted 4 lines
I did wonder that, but then why would turning the LEDs on work fine? I wonder if both pins are being toggled or something. I'll investigate further and report back. The two that cause the NAS to lock up are the only ones on &gpio1 though.
What would they map to on gpio0? NAND?
3 & 11, so NAND and UART0 RX. But it's not just that the console is dead, I can't ping the NAS any more either. However the power LED is still blinking via. hardware GPIO blink.
Quoted 11 lines
Quoted 2 lines
The sata0 and sata1 activity leds are definitely MPP20 and MPP21---I've set them up as GPIO leds before successfully.
O.K.
Quoted 6 lines
Quoted 5 lines
[ 16.187814] initial MPP regs: 01112222 43303311 55550000 00000000 00000000 00000000 00000000 [ 16.187833] final MPP regs: 01552222 03303311 55550000 00000000 00000000 00000000 00000000The first line is how uboot setup the MPP pins. The second is after the init function was called.
Quoted 8 lines
Quoted 5 lines
initial MPP regs: 01111111 03303311 00551100 00000000 00000000 00000000 00000000
final MPP regs: 01111111 03303311 00551100 00000000 00000000 00000000 00000000Although the initial MPP regs is also set by a recompiled u-boot with ~identical MPP setup code.
It might be useful to generate the same sort of dumps with the new driver, even if its code just hacked in for testing.
I'd been looking at the debugfs output if you hadn't spotted it:
root at rocoto:~# cat /debug/pinctrl/f1010000.pinctrl/pinmux-pins Pinmux settings per pin
Format: pin (name): mux_owner gpio_owner hog?
pin 0 (PIN0): f1010000.pinctrl (GPIO UNCLAIMED) (HOG) function nand group mpp0 pin 1 (PIN1): f1010000.pinctrl (GPIO UNCLAIMED) (HOG) function nand group mpp1 pin 2 (PIN2): f1010000.pinctrl (GPIO UNCLAIMED) (HOG) function nand group mpp2
. . .
Although it doesn't say what the initial MPP setup was.
Quoted 3 lines
Andrew
Signature · 1 line
Jamie Lentin
Andrew Lunn
maintainerPATCH 4/9 ARM: Kirkwood: Convert dockstar to pinctrl.
In reply to Andrew Lunn--- arch/arm/boot/dts/kirkwood-dockstar.dts | 21 +++++++++++++++++++++ arch/arm/mach-kirkwood/board-dockstar.c | 10 ---------- 2 files changed, 21 insertions(+), 10 deletions(-)
arch/arm/boot/dts/kirkwood-dockstar.dts +21 -0
@@ -16,6 +16,27 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_usb_power_enable + &pmx_led_green &pmx_led_orange >; + pinctrl-names = "default"; + + pmx_usb_power_enable: pmx-usb-power-enable { + marvell,pins = "mpp29"; + marvell,function = "gpio"; + }; + pmx_led_green: pmx-led-green { + marvell,pins = "mpp46"; + marvell,function = "gpio"; + }; + pmx_led_orange: pmx-led-orange { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + }; serial at 12000 { clock-frequency = <200000000>; status = "ok";
arch/arm/mach-kirkwood/board-dockstar.c +0 -10
@@ -32,26 +32,16 @@#include <mach/bridge-regs.h> #include <linux/platform_data/mmc-mvsdio.h> #include "common.h" -#include "mpp.h" static struct mv643xx_eth_platform_data dockstar_ge00_data = { .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), }; -static unsigned int dockstar_mpp_config[]__initdata = { -MPP29_GPIO ,/* USB Power Enable */ -MPP46_GPIO ,/* LED green */ -MPP47_GPIO ,/* LED orange */ -0 -}; -void __init dockstar_dt_init (void ) {/* * Basic setup. Needs to be called early. */ -kirkwood_mpp_conf (dockstar_mpp_config); -if (gpio_request (29 ,"USB Power Enable" ) !=0 ||gpio_direction_output (29 ,1 ) !=0 )pr_err ("can't setup GPIO 29 (USB Power Enable)\n" );
Signature · 1 line
1.7.10.4
Andrew Lunn
maintainerPATCH 5/9 ARM: Kirkwood: Convert dreamplug to pinctrl.
In reply to Andrew Lunn--- arch/arm/boot/dts/kirkwood-dreamplug.dts | 26 ++++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-dreamplug.c | 14 -------------- 2 files changed, 26 insertions(+), 14 deletions(-)
arch/arm/boot/dts/kirkwood-dreamplug.dts +26 -0
@@ -16,6 +16,32 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_spi + &pmx_led_bluetooth &pmx_led_wifi + &pmx_led_wifi_ap >; + pinctrl-names = "default"; + + pmx_spi: pmx-spi { + marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3"; + marvell,function = "spi"; + }; + pmx_led_bluetooth: pmx-led-bluetooth { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + pmx_led_wifi: pmx-led-wifi { + marvell,pins = "mpp48"; + marvell,function = "gpio"; + }; + pmx_led_wifi_ap: pmx-led-wifi-ap { + marvell,pins = "mpp49"; + marvell,function = "gpio"; + }; + }; serial at 12000 { clock-frequency = <200000000>; status = "ok";
arch/arm/mach-kirkwood/board-dreamplug.c +0 -14
@@ -32,7 +32,6 @@#include <mach/bridge-regs.h> #include <linux/platform_data/mmc-mvsdio.h> #include "common.h" -#include "mpp.h" static struct mv643xx_eth_platform_data dreamplug_ge00_data = { .phy_addr =MV643XX_ETH_PHY_ADDR (0 ),
@@ -46,24 +45,11 @@ static struct mvsdio_platform_data dreamplug_mvsdio_data = {/* unfortunately the CD signal has not been connected */ }; -static unsigned int dreamplug_mpp_config[]__initdata = { - MPP0_SPI_SCn, -MPP1_SPI_MOSI , -MPP2_SPI_SCK , -MPP3_SPI_MISO , -MPP47_GPIO ,/* Bluetooth LED */ -MPP48_GPIO ,/* Wifi LED */ -MPP49_GPIO ,/* Wifi AP LED */ -0 -}; -void __init dreamplug_init (void ) {/* * Basic setup. Needs to be called early. */ -kirkwood_mpp_conf (dreamplug_mpp_config); -kirkwood_ehci_init ();kirkwood_ge00_init (&dreamplug_ge00_data);kirkwood_ge01_init (&dreamplug_ge01_data);
Signature · 1 line
1.7.10.4
Andrew Lunn
maintainerPATCH 6/9 ARM: Kirkwood: Convert GoFlex Net to pinctrl.
In reply to Andrew Lunn--- arch/arm/boot/dts/kirkwood-goflexnet.dts | 57 ++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-goflexnet.c | 18 ---------- 2 files changed, 57 insertions(+), 18 deletions(-)
arch/arm/boot/dts/kirkwood-goflexnet.dts +57 -0
@@ -16,6 +16,63 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_usb_power_enable &pmx_led_orange + &pmx_led_left_cap_0 &pmx_led_left_cap_1 + &pmx_led_left_cap_2 &pmx_led_left_cap_3 + &pmx_led_right_cap_0 &pmx_led_right_cap_1 + &pmx_led_right_cap_2 &pmx_led_right_cap_3 + >; + pinctrl-names = "default"; + + pmx_usb_power_enable: pmx-usb-power-enable { + marvell,pins = "mpp29"; + marvell,function = "gpio"; + }; + pmx_led_right_cap_0: pmx-led_right_cap_0 { + marvell,pins = "mpp38"; + marvell,function = "gpio"; + }; + pmx_led_right_cap_1: pmx-led_right_cap_1 { + marvell,pins = "mpp39"; + marvell,function = "gpio"; + }; + pmx_led_right_cap_2: pmx-led_right_cap_2 { + marvell,pins = "mpp40"; + marvell,function = "gpio"; + }; + pmx_led_right_cap_3: pmx-led_right_cap_3 { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + pmx_led_left_cap_0: pmx-led_left_cap_0 { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + pmx_led_left_cap_1: pmx-led_left_cap_1 { + marvell,pins = "mpp43"; + marvell,function = "gpio"; + }; + pmx_led_left_cap_2: pmx-led_left_cap_2 { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + pmx_led_left_cap_3: pmx-led_left_cap_3 { + marvell,pins = "mpp45"; + marvell,function = "gpio"; + }; + pmx_led_green: pmx-led_green { + marvell,pins = "mpp46"; + marvell,function = "gpio"; + }; + pmx_led_orange: pmx-led_orange { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + }; serial at 12000 { clock-frequency = <200000000>; status = "ok";
arch/arm/mach-kirkwood/board-goflexnet.c +0 -18
@@ -34,34 +34,16 @@#include <mach/bridge-regs.h> #include <linux/platform_data/mmc-mvsdio.h> #include "common.h" -#include "mpp.h" static struct mv643xx_eth_platform_data goflexnet_ge00_data = { .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), }; -static unsigned int goflexnet_mpp_config[]__initdata = { -MPP29_GPIO ,/* USB Power Enable */ -MPP47_GPIO ,/* LED Orange */ -MPP46_GPIO ,/* LED Green */ -MPP45_GPIO ,/* LED Left Capacity 3 */ -MPP44_GPIO ,/* LED Left Capacity 2 */ -MPP43_GPIO ,/* LED Left Capacity 1 */ -MPP42_GPIO ,/* LED Left Capacity 0 */ -MPP41_GPIO ,/* LED Right Capacity 3 */ -MPP40_GPIO ,/* LED Right Capacity 2 */ -MPP39_GPIO ,/* LED Right Capacity 1 */ -MPP38_GPIO ,/* LED Right Capacity 0 */ -0 -}; -void __init goflexnet_init (void ) {/* * Basic setup. Needs to be called early. */ -kirkwood_mpp_conf (goflexnet_mpp_config); -if (gpio_request (29 ,"USB Power Enable" ) !=0 ||gpio_direction_output (29 ,1 ) !=0 )pr_err ("can't setup GPIO 29 (USB Power Enable)\n" );
Signature · 1 line
1.7.10.4
PATCH 6/9 ARM: Kirkwood: Convert GoFlex Net to pinctrl.
Initial test with my 3.7-rc2 DT kernel config failed when it tried to build modules:
Building modules, stage 2.
MODPOST 733 modules
ERROR: "read_current_timer" [drivers/video/udlfb.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined! make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
I didn't realize my play kernel test package still includes the following patch, I thought it had been dealt with already. Should I start a new thread on this issue?
arch/arm/kernel/armksyms.c +1 -0
@@ -50,6 +50,7 @@ extern void fpundefinstr(void);/* platform dependent support */ EXPORT_SYMBOL (arm_delay_ops); +EXPORT_SYMBOL (read_current_timer);/* networking */ EXPORT_SYMBOL (csum_partial);
In the mean time, I'll start a build with the default conf as suggested and post test results once I have them.
Josh Coombs
Quoted 116 lines · Andrew Lunn
Signed-off-by Andrew Lunn <[email protected]>--- arch/arm/boot/dts/kirkwood-goflexnet.dts | 57 ++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-goflexnet.c | 18 ---------- 2 files changed, 57 insertions(+), 18 deletions(-)arch/arm/boot/dts/kirkwood-goflexnet.dts +57
-0@@ -16,6 +16,63 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_usb_power_enable &pmx_led_orange + &pmx_led_left_cap_0 &pmx_led_left_cap_1 + &pmx_led_left_cap_2 &pmx_led_left_cap_3 + &pmx_led_right_cap_0 &pmx_led_right_cap_1 + &pmx_led_right_cap_2 &pmx_led_right_cap_3 + >; + pinctrl-names = "default"; + + pmx_usb_power_enable: pmx-usb-power-enable { + marvell,pins = "mpp29"; + marvell,function = "gpio"; + }; + pmx_led_right_cap_0: pmx-led_right_cap_0 { + marvell,pins = "mpp38"; + marvell,function = "gpio"; + }; + pmx_led_right_cap_1: pmx-led_right_cap_1 { + marvell,pins = "mpp39"; + marvell,function = "gpio"; + }; + pmx_led_right_cap_2: pmx-led_right_cap_2 { + marvell,pins = "mpp40"; + marvell,function = "gpio"; + }; + pmx_led_right_cap_3: pmx-led_right_cap_3 { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + pmx_led_left_cap_0: pmx-led_left_cap_0 { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + pmx_led_left_cap_1: pmx-led_left_cap_1 { + marvell,pins = "mpp43"; + marvell,function = "gpio"; + }; + pmx_led_left_cap_2: pmx-led_left_cap_2 { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + pmx_led_left_cap_3: pmx-led_left_cap_3 { + marvell,pins = "mpp45"; + marvell,function = "gpio"; + }; + pmx_led_green: pmx-led_green { + marvell,pins = "mpp46"; + marvell,function = "gpio"; + }; + pmx_led_orange: pmx-led_orange { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + }; serial at 12000 { clock-frequency = <200000000>; status = "ok";arch/arm/mach-kirkwood/board-goflexnet.c +0
-19@@ -34,34 +34,16 @@#include <mach/bridge-regs.h> #include <linux/platform_data/mmc-mvsdio.h> #include "common.h" -#include "mpp.h" static struct mv643xx_eth_platform_data goflexnet_ge00_data = { .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), }; -static unsigned int goflexnet_mpp_config[]__initdata = { -MPP29_GPIO ,/* USB Power Enable */ -MPP47_GPIO ,/* LED Orange */ -MPP46_GPIO ,/* LED Green */ -MPP45_GPIO ,/* LED Left Capacity 3 */ -MPP44_GPIO ,/* LED Left Capacity 2 */ -MPP43_GPIO ,/* LED Left Capacity 1 */ -MPP42_GPIO ,/* LED Left Capacity 0 */ -MPP41_GPIO ,/* LED Right Capacity 3 */ -MPP40_GPIO ,/* LED Right Capacity 2 */ -MPP39_GPIO ,/* LED Right Capacity 1 */ -MPP38_GPIO ,/* LED Right Capacity 0 */ -0 -}; -void __init goflexnet_init (void ) {/* * Basic setup. Needs to be called early. */ -kirkwood_mpp_conf (goflexnet_mpp_config); -if (gpio_request (29 ,"USB Power Enable" ) !=0 ||gpio_direction_output (29 ,1 ) !=0 )pr_err ("can't setup GPIO 29 (USB Power Enable)\n" ); --1.7.10.4
Andrew Lunn
maintainerPATCH 6/9 ARM: Kirkwood: Convert GoFlex Net to pinctrl.
Quoted 10 lines · Josh Coombs
Initial test with my 3.7-rc2 DT kernel config failed when it tried to build modules:
Building modules, stage 2.
MODPOST 733 modules
ERROR: "read_current_timer" [drivers/video/udlfb.ko] undefined!
ERROR: "read_current_timer" [crypto/tcrypt.ko] undefined! make[1]: *** [__modpost] Error 1
make: *** [modules] Error 2
Quoted 3 lines
I didn't realize my play kernel test package still includes the following patch, I thought it had been dealt with already. Should I start a new thread on this issue?
Hi Josh
It is a known issue which i've seen discussed on the lists. I expect it to be fixed soon.
Andrew
PATCH 6/9 ARM: Kirkwood: Convert GoFlex Net to pinctrl.
In reply to Andrew LunnQuoted 116 lines · Andrew Lunn
Signed-off-by Andrew Lunn <[email protected]>--- arch/arm/boot/dts/kirkwood-goflexnet.dts | 57 ++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-goflexnet.c | 18 ---------- 2 files changed, 57 insertions(+), 18 deletions(-)arch/arm/boot/dts/kirkwood-goflexnet.dts +57
-0@@ -16,6 +16,63 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_usb_power_enable &pmx_led_orange + &pmx_led_left_cap_0 &pmx_led_left_cap_1 + &pmx_led_left_cap_2 &pmx_led_left_cap_3 + &pmx_led_right_cap_0 &pmx_led_right_cap_1 + &pmx_led_right_cap_2 &pmx_led_right_cap_3 + >; + pinctrl-names = "default"; + + pmx_usb_power_enable: pmx-usb-power-enable { + marvell,pins = "mpp29"; + marvell,function = "gpio"; + }; + pmx_led_right_cap_0: pmx-led_right_cap_0 { + marvell,pins = "mpp38"; + marvell,function = "gpio"; + }; + pmx_led_right_cap_1: pmx-led_right_cap_1 { + marvell,pins = "mpp39"; + marvell,function = "gpio"; + }; + pmx_led_right_cap_2: pmx-led_right_cap_2 { + marvell,pins = "mpp40"; + marvell,function = "gpio"; + }; + pmx_led_right_cap_3: pmx-led_right_cap_3 { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + pmx_led_left_cap_0: pmx-led_left_cap_0 { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + pmx_led_left_cap_1: pmx-led_left_cap_1 { + marvell,pins = "mpp43"; + marvell,function = "gpio"; + }; + pmx_led_left_cap_2: pmx-led_left_cap_2 { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + pmx_led_left_cap_3: pmx-led_left_cap_3 { + marvell,pins = "mpp45"; + marvell,function = "gpio"; + }; + pmx_led_green: pmx-led_green { + marvell,pins = "mpp46"; + marvell,function = "gpio"; + }; + pmx_led_orange: pmx-led_orange { + marvell,pins = "mpp47"; + marvell,function = "gpio"; + }; + }; serial at 12000 { clock-frequency = <200000000>; status = "ok";arch/arm/mach-kirkwood/board-goflexnet.c +0
-19@@ -34,34 +34,16 @@#include <mach/bridge-regs.h> #include <linux/platform_data/mmc-mvsdio.h> #include "common.h" -#include "mpp.h" static struct mv643xx_eth_platform_data goflexnet_ge00_data = { .phy_addr =MV643XX_ETH_PHY_ADDR (0 ), }; -static unsigned int goflexnet_mpp_config[]__initdata = { -MPP29_GPIO ,/* USB Power Enable */ -MPP47_GPIO ,/* LED Orange */ -MPP46_GPIO ,/* LED Green */ -MPP45_GPIO ,/* LED Left Capacity 3 */ -MPP44_GPIO ,/* LED Left Capacity 2 */ -MPP43_GPIO ,/* LED Left Capacity 1 */ -MPP42_GPIO ,/* LED Left Capacity 0 */ -MPP41_GPIO ,/* LED Right Capacity 3 */ -MPP40_GPIO ,/* LED Right Capacity 2 */ -MPP39_GPIO ,/* LED Right Capacity 1 */ -MPP38_GPIO ,/* LED Right Capacity 0 */ -0 -}; -void __init goflexnet_init (void ) {/* * Basic setup. Needs to be called early. */ -kirkwood_mpp_conf (goflexnet_mpp_config); -if (gpio_request (29 ,"USB Power Enable" ) !=0 ||gpio_direction_output (29 ,1 ) !=0 )pr_err ("can't setup GPIO 29 (USB Power Enable)\n" ); --1.7.10.4
Andrew Lunn
maintainerPATCH 7/9 ARM: Kirkwood: Convert ib62x0 to pinctrl.
In reply to Andrew Lunn--- arch/arm/boot/dts/kirkwood-ib62x0.dts | 41 +++++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-ib62x0.c | 21 ----------------- 2 files changed, 41 insertions(+), 21 deletions(-)
arch/arm/boot/dts/kirkwood-ib62x0.dts +41 -0
@@ -16,6 +16,47 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_nand + &pmx_led_os_red &pmx_power_off + &pmx_led_os_green &pmx_led_usb_transfer + &pmx_button_reset &pmx_button_usb_copy >; + pinctrl-names = "default"; + + pmx_nand: pmx-nand { + marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3", + "mpp04", "mpp5", "mpp18", + "mpp19"; + marvell,function = "nand"; + }; + pmx_led_os_red: pmx-led-os-red { + marvell,pins = "mpp22"; + marvell,function = "gpio"; + }; + pmx_power_off: pmx-power-off { + marvell,pins = "mpp24"; + marvell,function = "gpio"; + }; + pmx_led_os_green: pmx-led-os-green { + marvell,pins = "mpp25"; + marvell,function = "gpio"; + }; + pmx_led_usb_transfer: pmx-led-usb-transfer { + marvell,pins = "mpp27"; + marvell,function = "gpio"; + }; + pmx_button_reset: pmx-button-reset { + marvell,pins = "mpp28"; + marvell,function = "gpio"; + }; + pmx_button_usb_copy: pmx-button-usb-copy { + marvell,pins = "mpp29"; + marvell,function = "gpio"; + }; + }; serial at 12000 { clock-frequency = <200000000>; status = "okay";
arch/arm/mach-kirkwood/board-ib62x0.c +0 -21
@@ -23,7 +23,6 @@#include <asm/mach/arch.h> #include <mach/kirkwood.h> #include "common.h" -#include "mpp.h" #define IB62X0_GPIO_POWER_OFF 24
@@ -31,24 +30,6 @@ static struct mv643xx_eth_platform_data ib62x0_ge00_data = { .phy_addr = MV643XX_ETH_PHY_ADDR(8), }; -static unsigned int ib62x0_mpp_config[]__initdata = { -MPP0_NF_IO2 , -MPP1_NF_IO3 , -MPP2_NF_IO4 , -MPP3_NF_IO5 , -MPP4_NF_IO6 , -MPP5_NF_IO7 , -MPP18_NF_IO0 , -MPP19_NF_IO1 , -MPP22_GPIO ,/* OS LED red */ -MPP24_GPIO ,/* Power off device */ -MPP25_GPIO ,/* OS LED green */ -MPP27_GPIO ,/* USB transfer LED */ -MPP28_GPIO ,/* Reset button */ -MPP29_GPIO ,/* USB Copy button */ -0 -}; -static void ib62x0_power_off (void ) {gpio_set_value (IB62X0_GPIO_POWER_OFF ,1 );
@@ -59,8 +40,6 @@ void __init ib62x0_init(void)/* * Basic setup. Needs to be called early. */ -kirkwood_mpp_conf (ib62x0_mpp_config); -kirkwood_ehci_init ();kirkwood_ge00_init (&ib62x0_ge00_data); if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 &&
Signature · 1 line
1.7.10.4
PATCH 7/9 ARM: Kirkwood: Convert ib62x0 to pinctrl.
Hi Andrew,
first of all thanks for providing these patches!
Just a typo for now:
Quoted 17 lines · Andrew Lunn
Signed-off-by Andrew Lunn <[email protected]>--- arch/arm/boot/dts/kirkwood-ib62x0.dts | 41 +++++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-ib62x0.c | 21 ----------------- 2 files changed, 41 insertions(+), 21 deletions(-)arch/arm/boot/dts/kirkwood-ib62x0.dts +3
-0@@ -16,6 +16,47 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>;
arch/arm/boot/dts/kirkwood-ib62x0.dts line 31
Quoted 10 lines
arch/arm/boot/dts/kirkwood-ib62x0.dts +10
-0+ + pinctrl-0 = < &pmx_nand + &pmx_led_os_red &pmx_power_off + &pmx_led_os_green &pmx_led_usb_transfer + &pmx_button_reset &pmx_button_usb_copy >; + pinctrl-names = "default"; + + pmx_nand: pmx-nand { + marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3", + "mpp04", "mpp5", "mpp18",
mpp04 -> mpp4
- Simon
Andrew Lunn
maintainerPATCH 8/9 ARM: Kirkwood: Convert lsxl boards to pinctrl.
In reply to Andrew Lunn--- arch/arm/boot/dts/kirkwood-lsxl.dtsi | 67 ++++++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-lsxl.c | 19 ---------- 2 files changed, 67 insertions(+), 19 deletions(-)
arch/arm/boot/dts/kirkwood-lsxl.dtsi +67 -0
@@ -6,6 +6,73 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_power_hdd &pmx_usb_vbus + &pmx_fan_low &pmx_fan_high + &pmx_led_function_red &pmx_led_alarm + &pmx_led_info &pmx_led_power + &pmx_fan_lock &pmx_button_function + &pmx_power_switch &pmx_power_auto_switch + &pmx_led_function_blue >; + pinctrl-names = "default"; + + pmx_power_hdd: pmx-power-hdd { + marvell,pins = "mpp10"; + marvell,function = "gpio"; + }; + pmx_usb_vbus: pmx-usb-vbus { + marvell,pins = "mpp11"; + marvell,function = "gpio"; + }; + pmx_fan_high: pmx-fan-high { + marvell,pins = "mpp18"; + marvell,function = "gpo"; + }; + pmx_fan_low: pmx-fan-low { + marvell,pins = "mpp19"; + marvell,function = "gpo"; + }; + pmx_led_function_blue: pmx-led-function-blue { + marvell,pins = "mpp36"; + marvell,function = "gpio"; + }; + pmx_led_alarm: pmx-led-alarm { + marvell,pins = "mpp37"; + marvell,function = "gpio"; + }; + pmx_led_info: pmx-led-info { + marvell,pins = "mpp38"; + marvell,function = "gpio"; + }; + pmx_led_power: pmx-led-power { + marvell,pins = "mpp39"; + marvell,function = "gpio"; + }; + pmx_fan_lock: pmx-fan-lock { + marvell,pins = "mpp40"; + marvell,function = "gpo"; + }; + pmx_button_function: pmx-button-function { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + pmx_power_switch: pmx-power-switch { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + pmx_power_auto_switch: pmx-power-auto-switch { + marvell,pins = "mpp43"; + marvell,function = "gpio"; + }; + pmx_led_function_red: pmx-led-function_red { + marvell,pins = "mpp43"; + marvell,function = "gpio"; + }; + + }; sata at 80000 { status = "okay"; nr-ports = <1>;
arch/arm/mach-kirkwood/board-lsxl.c +0 -19
@@ -26,7 +26,6 @@#include <asm/mach/arch.h> #include <mach/kirkwood.h> #include "common.h" -#include "mpp.h" static struct mv643xx_eth_platform_data lsxl_ge00_data = { .phy_addr =MV643XX_ETH_PHY_ADDR (0 ),
@@ -36,23 +35,6 @@ static struct mv643xx_eth_platform_data lsxl_ge01_data = { .phy_addr = MV643XX_ETH_PHY_ADDR(8), }; -static unsigned int lsxl_mpp_config[]__initdata = { -MPP10_GPO ,/* HDD Power Enable */ -MPP11_GPIO ,/* USB Vbus Enable */ -MPP18_GPO ,/* FAN High Enable# */ -MPP19_GPO ,/* FAN Low Enable# */ -MPP36_GPIO ,/* Function Blue LED */ -MPP37_GPIO ,/* Alarm LED */ -MPP38_GPIO ,/* Info LED */ -MPP39_GPIO ,/* Power LED */ -MPP40_GPIO ,/* Fan Lock */ -MPP41_GPIO ,/* Function Button */ -MPP42_GPIO ,/* Power Switch */ -MPP43_GPIO ,/* Power Auto Switch */ -MPP48_GPIO ,/* Function Red LED */ -0 -}; -#define LSXL_GPIO_FAN_HIGH 18#define LSXL_GPIO_FAN_LOW 19#define LSXL_GPIO_FAN_LOCK 40
@@ -119,7 +101,6 @@ void __init lsxl_init(void)/* * Basic setup. Needs to be called early. */ -kirkwood_mpp_conf (lsxl_mpp_config);/* usb and sata power on */ gpio_set_value (LSXL_GPIO_USB_POWER ,1 );
Signature · 1 line
1.7.10.4
PATCH 8/9 ARM: Kirkwood: Convert lsxl boards to pinctrl.
Am Mittwoch 24 Oktober 2012, 16:53:53 schrieb Andrew Lunn:
Quoted 21 lines
Signed-off-by Andrew Lunn <[email protected]>--- arch/arm/boot/dts/kirkwood-lsxl.dtsi | 67 ++++++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-lsxl.c | 19 ---------- 2 files changed, 67 insertions(+), 19 deletions(-)(quoted diff) +0
-0
b/arch/arm/boot/dts/kirkwood-lsxl.dtsiindex 8fea375..01d6e3a 100644arch/arm/boot/dts/kirkwood-lsxl.dtsi +6
-0@@ -6,6 +6,73 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_power_hdd &pmx_usb_vbus + &pmx_fan_low &pmx_fan_high
arch/arm/boot/dts/kirkwood-lsxl.dtsi line 24
Quoted 10 lines
arch/arm/boot/dts/kirkwood-lsxl.dtsi +10
-0+ &pmx_led_function_red &pmx_led_alarm + &pmx_led_info &pmx_led_power + &pmx_fan_lock &pmx_button_function + &pmx_power_switch &pmx_power_auto_switch + &pmx_led_function_blue >; + pinctrl-names = "default"; + + pmx_power_hdd: pmx-power-hdd { + marvell,pins = "mpp10"; + marvell,function = "gpio";
function is "gpo";
Quoted 22 lines
arch/arm/boot/dts/kirkwood-lsxl.dtsi +22
-0+ }; + pmx_usb_vbus: pmx-usb-vbus { + marvell,pins = "mpp11"; + marvell,function = "gpio"; + }; + pmx_fan_high: pmx-fan-high { + marvell,pins = "mpp18"; + marvell,function = "gpo"; + }; + pmx_fan_low: pmx-fan-low { + marvell,pins = "mpp19"; + marvell,function = "gpo"; + }; + pmx_led_function_blue: pmx-led-function-blue { + marvell,pins = "mpp36"; + marvell,function = "gpio"; + }; + pmx_led_alarm: pmx-led-alarm { + marvell,pins = "mpp37"; + marvell,function = "gpio"; + }; + pmx_led_info: pmx-led-info {
arch/arm/boot/dts/kirkwood-lsxl.dtsi line 56
Quoted 10 lines
arch/arm/boot/dts/kirkwood-lsxl.dtsi +10
-0+ marvell,pins = "mpp38"; + marvell,function = "gpio"; + }; + pmx_led_power: pmx-led-power { + marvell,pins = "mpp39"; + marvell,function = "gpio"; + }; + pmx_fan_lock: pmx-fan-lock { + marvell,pins = "mpp40"; + marvell,function = "gpo";
gpio
Quoted 66 lines
arch/arm/boot/dts/kirkwood-lsxl.dtsi +19
-0+ }; + pmx_button_function: pmx-button-function { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + pmx_power_switch: pmx-power-switch { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + pmx_power_auto_switch: pmx-power-auto-switch { + marvell,pins = "mpp43"; + marvell,function = "gpio"; + }; + pmx_led_function_red: pmx-led-function_red { + marvell,pins = "mpp43"; + marvell,function = "gpio"; + }; + + }; sata at 80000 { status = "okay"; nr-ports = <1>;(quoted diff) +0
-0
b/arch/arm/mach-kirkwood/board-lsxl.cindex 83d8975..868bdb0 100644arch/arm/mach-kirkwood/board-lsxl.c +0
-19@@ -26,7 +26,6 @@#include <asm/mach/arch.h> #include <mach/kirkwood.h> #include "common.h" -#include "mpp.h" static struct mv643xx_eth_platform_data lsxl_ge00_data = { .phy_addr =MV643XX_ETH_PHY_ADDR (0 ),@@ -36,23 +35,6 @@ static struct mv643xx_eth_platform_data lsxl_ge01_data = { .phy_addr = MV643XX_ETH_PHY_ADDR(8), }; -static unsigned int lsxl_mpp_config[]__initdata = { -MPP10_GPO ,/* HDD Power Enable */ -MPP11_GPIO ,/* USB Vbus Enable */ -MPP18_GPO ,/* FAN High Enable# */ -MPP19_GPO ,/* FAN Low Enable# */ -MPP36_GPIO ,/* Function Blue LED */ -MPP37_GPIO ,/* Alarm LED */ -MPP38_GPIO ,/* Info LED */ -MPP39_GPIO ,/* Power LED */ -MPP40_GPIO ,/* Fan Lock */ -MPP41_GPIO ,/* Function Button */ -MPP42_GPIO ,/* Power Switch */ -MPP43_GPIO ,/* Power Auto Switch */ -MPP48_GPIO ,/* Function Red LED */ -0 -}; -#define LSXL_GPIO_FAN_HIGH 18#define LSXL_GPIO_FAN_LOW 19#define LSXL_GPIO_FAN_LOCK 40@@ -119,7 +101,6 @@ void __init lsxl_init(void)/* * Basic setup. Needs to be called early. */ -kirkwood_mpp_conf (lsxl_mpp_config);/* usb and sata power on */ gpio_set_value (LSXL_GPIO_USB_POWER ,1 );
Signature · 1 line
Michael
PATCH 8/9 ARM: Kirkwood: Convert lsxl boards to pinctrl.
In reply to Andrew Lunn[This is also includes the annotations from my previous reply. I missed the mpp43<->mpp48 in my previous reply]
Am Mittwoch 24 Oktober 2012, 16:53:53 schrieb Andrew Lunn:
Quoted 21 lines
Signed-off-by Andrew Lunn <[email protected]>--- arch/arm/boot/dts/kirkwood-lsxl.dtsi | 67 ++++++++++++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-lsxl.c | 19 ---------- 2 files changed, 67 insertions(+), 19 deletions(-)(quoted diff) +0
-0
b/arch/arm/boot/dts/kirkwood-lsxl.dtsiindex 8fea375..01d6e3a 100644arch/arm/boot/dts/kirkwood-lsxl.dtsi +6
-0@@ -6,6 +6,73 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_power_hdd &pmx_usb_vbus + &pmx_fan_low &pmx_fan_high
arch/arm/boot/dts/kirkwood-lsxl.dtsi line 24
Quoted 10 lines
arch/arm/boot/dts/kirkwood-lsxl.dtsi +10
-0+ &pmx_led_function_red &pmx_led_alarm + &pmx_led_info &pmx_led_power + &pmx_fan_lock &pmx_button_function + &pmx_power_switch &pmx_power_auto_switch + &pmx_led_function_blue >; + pinctrl-names = "default"; + + pmx_power_hdd: pmx-power-hdd { + marvell,pins = "mpp10"; + marvell,function = "gpio";
gpo
Quoted 22 lines
arch/arm/boot/dts/kirkwood-lsxl.dtsi +22
-0+ }; + pmx_usb_vbus: pmx-usb-vbus { + marvell,pins = "mpp11"; + marvell,function = "gpio"; + }; + pmx_fan_high: pmx-fan-high { + marvell,pins = "mpp18"; + marvell,function = "gpo"; + }; + pmx_fan_low: pmx-fan-low { + marvell,pins = "mpp19"; + marvell,function = "gpo"; + }; + pmx_led_function_blue: pmx-led-function-blue { + marvell,pins = "mpp36"; + marvell,function = "gpio"; + }; + pmx_led_alarm: pmx-led-alarm { + marvell,pins = "mpp37"; + marvell,function = "gpio"; + }; + pmx_led_info: pmx-led-info {
arch/arm/boot/dts/kirkwood-lsxl.dtsi line 56
Quoted 10 lines
arch/arm/boot/dts/kirkwood-lsxl.dtsi +10
-0+ marvell,pins = "mpp38"; + marvell,function = "gpio"; + }; + pmx_led_power: pmx-led-power { + marvell,pins = "mpp39"; + marvell,function = "gpio"; + }; + pmx_fan_lock: pmx-fan-lock { + marvell,pins = "mpp40"; + marvell,function = "gpo";
gpio
Quoted 5 lines
arch/arm/boot/dts/kirkwood-lsxl.dtsi +5
-0+ }; + pmx_button_function: pmx-button-function { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + };
arch/arm/boot/dts/kirkwood-lsxl.dtsi line 71
Quoted 10 lines
arch/arm/boot/dts/kirkwood-lsxl.dtsi +10
-0+ pmx_power_switch: pmx-power-switch { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + pmx_power_auto_switch: pmx-power-auto-switch { + marvell,pins = "mpp43"; + marvell,function = "gpio"; + }; + pmx_led_function_red: pmx-led-function_red { + marvell,pins = "mpp43";
mpp48
Quoted 51 lines
arch/arm/boot/dts/kirkwood-lsxl.dtsi +4
-0+ marvell,function = "gpio"; + }; + + }; sata at 80000 { status = "okay"; nr-ports = <1>;(quoted diff) +0
-0
b/arch/arm/mach-kirkwood/board-lsxl.cindex 83d8975..868bdb0 100644arch/arm/mach-kirkwood/board-lsxl.c +0
-19@@ -26,7 +26,6 @@#include <asm/mach/arch.h> #include <mach/kirkwood.h> #include "common.h" -#include "mpp.h" static struct mv643xx_eth_platform_data lsxl_ge00_data = { .phy_addr =MV643XX_ETH_PHY_ADDR (0 ),@@ -36,23 +35,6 @@ static struct mv643xx_eth_platform_data lsxl_ge01_data = { .phy_addr = MV643XX_ETH_PHY_ADDR(8), }; -static unsigned int lsxl_mpp_config[]__initdata = { -MPP10_GPO ,/* HDD Power Enable */ -MPP11_GPIO ,/* USB Vbus Enable */ -MPP18_GPO ,/* FAN High Enable# */ -MPP19_GPO ,/* FAN Low Enable# */ -MPP36_GPIO ,/* Function Blue LED */ -MPP37_GPIO ,/* Alarm LED */ -MPP38_GPIO ,/* Info LED */ -MPP39_GPIO ,/* Power LED */ -MPP40_GPIO ,/* Fan Lock */ -MPP41_GPIO ,/* Function Button */ -MPP42_GPIO ,/* Power Switch */ -MPP43_GPIO ,/* Power Auto Switch */ -MPP48_GPIO ,/* Function Red LED */ -0 -}; -#define LSXL_GPIO_FAN_HIGH 18#define LSXL_GPIO_FAN_LOW 19#define LSXL_GPIO_FAN_LOCK 40@@ -119,7 +101,6 @@ void __init lsxl_init(void)/* * Basic setup. Needs to be called early. */ -kirkwood_mpp_conf (lsxl_mpp_config);/* usb and sata power on */ gpio_set_value (LSXL_GPIO_USB_POWER ,1 );
Signature · 1 line
Michael
Andrew Lunn
maintainerPATCH 9/9 ARM: Kirkwood: Convert IX2-200 to pinctrl.
In reply to Andrew Lunn--- arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts | 90 +++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 24 ------- 2 files changed, 90 insertions(+), 24 deletions(-)
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +90 -0
@@ -16,6 +16,96 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>; + + pinctrl-0 = < &pmx_button_reset &pmx_button_power + &pmx_led_backup &pmx_led_power + &pmx_button_otb &pmx_led_rebuild + &pmx_led_health + &pmx_led_sata_brt_ctrl_1 + &pmx_led_sata_brt_ctrl_2 + &pmx_led_backup_brt_ctrl_1 + &pmx_led_backup_brt_ctrl_2 + &pmx_led_power_brt_ctrl_1 + &pmx_led_power_brt_ctrl_2 + &pmx_led_health_brt_ctrl_1 + &pmx_led_health_brt_ctrl_2 + &pmx_led_rebuild_brt_ctrl_1 + &pmx_led_rebuild_brt_ctrl_2 >; + pinctrl-names = "default"; + + pmx_button_reset: pmx-button-reset { + marvell,pins = "mpp12"; + marvell,function = "gpio"; + }; + pmx_button_power: pmx-button-power { + marvell,pins = "mpp14"; + marvell,function = "gpio"; + }; + pmx_led_backup: pmx-led-backup { + marvell,pins = "mpp15"; + marvell,function = "gpio"; + }; + pmx_led_power: pmx-led-power { + marvell,pins = "mpp16"; + marvell,function = "gpio"; + }; + pmx_button_otb: pmx-button-otb { + marvell,pins = "mpp35"; + marvell,function = "gpio"; + }; + pmx_led_rebuild: pmx-led-rebuild { + marvell,pins = "mpp36"; + marvell,function = "gpio"; + }; + pmx_led_health: pmx-led_health { + marvell,pins = "mpp37"; + marvell,function = "gpio"; + }; + pmx_led_sata_brt_ctrl_1: pmx-led-sata-brt-ctrl-1 { + marvell,pins = "mpp38"; + marvell,function = "gpio"; + }; + pmx_led_sata_brt_ctrl_2: pmx-led-sata-brt-ctrl-2 { + marvell,pins = "mpp39"; + marvell,function = "gpio"; + }; + pmx_led_backup_brt_ctrl_1: pmx-led-backup-brt-ctrl-1 { + marvell,pins = "mpp40"; + marvell,function = "gpio"; + }; + pmx_led_backup_brt_ctrl_2: pmx-led-backup-brt-ctrl-2 { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + pmx_led_power_brt_ctrl_1: pmx-led-power-brt-ctrl-1 { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + pmx_led_power_brt_ctrl_2: pmx-led-power-brt-ctrl-2 { + marvell,pins = "mpp43"; + marvell,function = "gpio"; + }; + pmx_led_health_brt_ctrl_1: pmx-led-health-brt-ctrl-1 { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + pmx_led_health_brt_ctrl_2: pmx-led-health-brt-ctrl-2 { + marvell,pins = "mpp45"; + marvell,function = "gpio"; + }; + pmx_led_rebuild_brt_ctrl_1: pmx-led-rebuild-brt-ctrl-1 { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + pmx_led_rebuild_brt_ctrl_2: pmx-led-rebuild-brt-ctrl-2 { + marvell,pins = "mpp45"; + marvell,function = "gpio"; + }; + + }; i2c at 11000 { status = "okay";
arch/arm/mach-kirkwood/board-iomega_ix2_200.c +0 -24
@@ -15,7 +15,6 @@#include <linux/ethtool.h> #include <mach/kirkwood.h> #include "common.h" -#include "mpp.h" static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = { .phy_addr =MV643XX_ETH_PHY_NONE ,
@@ -23,34 +22,11 @@ static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = { .duplex = DUPLEX_FULL, }; -static unsigned int iomega_ix2_200_mpp_config[]__initdata = { -MPP12_GPIO ,/* Reset Button */ -MPP14_GPIO ,/* Power Button */ -MPP15_GPIO ,/* Backup LED (blue) */ -MPP16_GPIO ,/* Power LED (white) */ -MPP35_GPIO ,/* OTB Button */ -MPP36_GPIO ,/* Rebuild LED (white) */ -MPP37_GPIO ,/* Health LED (red) */ -MPP38_GPIO ,/* SATA LED brightness control 1 */ -MPP39_GPIO ,/* SATA LED brightness control 2 */ -MPP40_GPIO ,/* Backup LED brightness control 1 */ -MPP41_GPIO ,/* Backup LED brightness control 2 */ -MPP42_GPIO ,/* Power LED brightness control 1 */ -MPP43_GPIO ,/* Power LED brightness control 2 */ -MPP44_GPIO ,/* Health LED brightness control 1 */ -MPP45_GPIO ,/* Health LED brightness control 2 */ -MPP46_GPIO ,/* Rebuild LED brightness control 1 */ -MPP47_GPIO ,/* Rebuild LED brightness control 2 */ -0 -}; -void __init iomega_ix2_200_init (void ) {/* * Basic setup. Needs to be called early. */ -kirkwood_mpp_conf (iomega_ix2_200_mpp_config); -kirkwood_ehci_init ();kirkwood_ge01_init (&iomega_ix2_200_ge00_data);
Signature · 1 line
1.7.10.4
PATCH 9/9 ARM: Kirkwood: Convert IX2-200 to pinctrl.
Andrew,
Quoted 11 lines · Andrew Lunn
Signed-off-by Andrew Lunn <[email protected]>--- arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts | 90 +++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 24 ------- 2 files changed, 90 insertions(+), 24 deletions(-)arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +0
-0
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts line 21
Quoted 6 lines
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +3
-0@@ -16,6 +16,96 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>;
This definition (compatible + reg) should go in kirkwood.dtsi. The pinctrl unit should be declared at the SoC level. Ditto for all other patches.
Quoted 74 lines
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +74
-0+ pinctrl-0 = < &pmx_button_reset &pmx_button_power + &pmx_led_backup &pmx_led_power + &pmx_button_otb &pmx_led_rebuild + &pmx_led_health + &pmx_led_sata_brt_ctrl_1 + &pmx_led_sata_brt_ctrl_2 + &pmx_led_backup_brt_ctrl_1 + &pmx_led_backup_brt_ctrl_2 + &pmx_led_power_brt_ctrl_1 + &pmx_led_power_brt_ctrl_2 + &pmx_led_health_brt_ctrl_1 + &pmx_led_health_brt_ctrl_2 + &pmx_led_rebuild_brt_ctrl_1 + &pmx_led_rebuild_brt_ctrl_2 >; + pinctrl-names = "default"; + + pmx_button_reset: pmx-button-reset { + marvell,pins = "mpp12"; + marvell,function = "gpio"; + }; + pmx_button_power: pmx-button-power { + marvell,pins = "mpp14"; + marvell,function = "gpio"; + }; + pmx_led_backup: pmx-led-backup { + marvell,pins = "mpp15"; + marvell,function = "gpio"; + }; + pmx_led_power: pmx-led-power { + marvell,pins = "mpp16"; + marvell,function = "gpio"; + }; + pmx_button_otb: pmx-button-otb { + marvell,pins = "mpp35"; + marvell,function = "gpio"; + }; + pmx_led_rebuild: pmx-led-rebuild { + marvell,pins = "mpp36"; + marvell,function = "gpio"; + }; + pmx_led_health: pmx-led_health { + marvell,pins = "mpp37"; + marvell,function = "gpio"; + }; + pmx_led_sata_brt_ctrl_1: pmx-led-sata-brt-ctrl-1 { + marvell,pins = "mpp38"; + marvell,function = "gpio"; + }; + pmx_led_sata_brt_ctrl_2: pmx-led-sata-brt-ctrl-2 { + marvell,pins = "mpp39"; + marvell,function = "gpio"; + }; + pmx_led_backup_brt_ctrl_1: pmx-led-backup-brt-ctrl-1 { + marvell,pins = "mpp40"; + marvell,function = "gpio"; + }; + pmx_led_backup_brt_ctrl_2: pmx-led-backup-brt-ctrl-2 { + marvell,pins = "mpp41"; + marvell,function = "gpio"; + }; + pmx_led_power_brt_ctrl_1: pmx-led-power-brt-ctrl-1 { + marvell,pins = "mpp42"; + marvell,function = "gpio"; + }; + pmx_led_power_brt_ctrl_2: pmx-led-power-brt-ctrl-2 { + marvell,pins = "mpp43"; + marvell,function = "gpio"; + }; + pmx_led_health_brt_ctrl_1: pmx-led-health-brt-ctrl-1 { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + pmx_led_health_brt_ctrl_2: pmx-led-health-brt-ctrl-2 { + marvell,pins = "mpp45";
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts line 106
Quoted 10 lines
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +10
-0+ marvell,function = "gpio"; + }; + pmx_led_rebuild_brt_ctrl_1: pmx-led-rebuild-brt-ctrl-1 { + marvell,pins = "mpp44"; + marvell,function = "gpio"; + }; + pmx_led_rebuild_brt_ctrl_2: pmx-led-rebuild-brt-ctrl-2 { + marvell,pins = "mpp45"; + marvell,function = "gpio"; + };
This is not a strong comment, but I am not sure it is really useful to define one pinmux configuration for each pin. You can do something like:
pmx_buttons: pmx-buttons {
marvell,pins = "mpp45", "mpp46", "mpp47", "mpp48";
marvell,function = "gpio";
};I think all the pins used for buttons or for LEDs kind of make sense to be muxed together. And then, when you declare the LEDs in the DT, you can do:
leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&led_pins>;
red_led {
label = "red_led";
gpios = <&gpio1 17 1>;
default-state = "off";
};
yellow_led {
label = "yellow_led";
gpios = <&gpio1 19 1>;
default-state = "off";
};
green_led {
label = "green_led";
gpios = <&gpio1 21 1>;
default-state = "off";
linux,default-trigger = "heartbeat";
};
};Where "led_pins" is a pinmux configuration that includes three pins.
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
Andrew Lunn
maintainerPATCH 9/9 ARM: Kirkwood: Convert IX2-200 to pinctrl.
Quoted 16 lines · Thomas Petazzoni
Andrew,
Quoted 13 lines · Andrew Lunn
Signed-off-by Andrew Lunn <[email protected]>--- arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts | 90 +++++++++++++++++++++++++ arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 24 ------- 2 files changed, 90 insertions(+), 24 deletions(-)arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +0
-0@@ -16,6 +16,96 @@ };
Quoted 8 lines
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts line 21
Quoted 4 lines
arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts +3
-0ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,88f6281-pinctrl"; + reg = <0x10000 0x20>;This definition (compatible + reg) should go in
kirkwood.dtsi. The pinctrl unit should be declared at the SoC level. Ditto for all other patches.
The reg maybe. Compatibility not. We need to tell pinctrl which of the 5 different variants of kirkwood this particular kirkwood is. See
drivers/pinctrl/pinctrl-kirkwood.c
enum kirkwood_variant {
VARIANT_MV88F6180 = V(1, 0, 0, 0, 0),
VARIANT_MV88F6190 = V(0, 1, 0, 0, 0),
VARIANT_MV88F6192 = V(0, 0, 1, 0, 0),
VARIANT_MV88F6281 = V(0, 0, 0, 1, 0),
VARIANT_MV88F6282 = V(0, 0, 0, 0, 1),
};static struct of_device_id kirkwood_pinctrl_of_match[] __devinitdata = {
{ .compatible = "marvell,88f6180-pinctrl", .data = &mv88f6180_info },
{ .compatible = "marvell,88f6190-pinctrl", .data = &mv88f6190_info },
{ .compatible = "marvell,88f6192-pinctrl", .data = &mv88f6192_info },
{ .compatible = "marvell,88f6281-pinctrl", .data = &mv88f6281_info },
{ .compatible = "marvell,88f6282-pinctrl", .data = &mv88f6282_info },
{ }
};What SoC is mounted on a board is a property of the board....
Andrew
PATCH 9/9 ARM: Kirkwood: Convert IX2-200 to pinctrl.
Andrew,
Quoted 2 lines · Andrew Lunn
The reg maybe. Compatibility not. We need to tell pinctrl which of the 5 different variants of kirkwood this particular kirkwood is. See
Agreed.
Quoted 19 lines
drivers/pinctrl/pinctrl-kirkwood.cenum kirkwood_variant { VARIANT_MV88F6180 = V(1, 0, 0, 0, 0), VARIANT_MV88F6190 = V(0, 1, 0, 0, 0), VARIANT_MV88F6192 = V(0, 0, 1, 0, 0), VARIANT_MV88F6281 = V(0, 0, 0, 1, 0), VARIANT_MV88F6282 = V(0, 0, 0, 0, 1), };static struct of_device_id kirkwood_pinctrl_of_match[] __devinitdata = { { .compatible = "marvell,88f6180-pinctrl", .data = &mv88f6180_info }, { .compatible = "marvell,88f6190-pinctrl", .data = &mv88f6190_info }, { .compatible = "marvell,88f6192-pinctrl", .data = &mv88f6192_info }, { .compatible = "marvell,88f6281-pinctrl", .data = &mv88f6281_info }, { .compatible = "marvell,88f6282-pinctrl", .data = &mv88f6282_info }, { } };
Quoted 1 line
What SoC is mounted on a board is a property of the board....
The way we solved that on Armada XP is that we have a common armada-xp.dtsi file with definitions common to all SoCs in the family. Then, we have sub .dtsi files named armada-xp-mv78230.dtsi, armada-xp-mv78260.dtsi and armada-xp-mv78460.dtsi that handle the differences between specific SoCs in the family. For example, the differences are: different compatible string for the pinctrl driver, different number of CPUs, different number of pins and therefore different number of GPIOs, different number of PCIe ports, etc. But besides those differences, most units have a lot of common definitions, that we factor out in armada-xp.dtsi.
So we have the following hierarchy:
+ armada-xp.dtsi
+ armada-xp-mv78230.dtsi
+ someboard-here.dts
+ armada-xp-mv78260.dtsi
+ openblocks-ax3-4.dts
+ armada-xp-mv78460.dtsi
+ armada-xp-db.dts
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 to pinctrl
In reply to Andrew LunnAndrew, are there any required kernel config changes to go along with this? I didn't see any updates to the default configs in the patches so I want to make sure I'm testing with the right options enabled.
Josh C
Quoted 48 lines · Andrew Lunn
This patchset converts all DT kirkwood boards to using pinctrl.
This patchset depends on an earlier patchset to allow the mvebu pinctrl driver and gpio driver to be built for kirkwood.
Only the TS219 conversion has been tested on hardware. The remaining are compile tested. Before merging upstream, it would be good if the others could be tested on hardware.
This series along with the dependents can be found in:
git://github.com/lunn/linux.gitv3.7-rc2-pinctrlAndrew Lunn (9):
ARM: Kirkwood: Convert TS219 to pinctrl.
ARM: Kirkwood: Convert iConnect to pinctrl.
ARM: Kirkwood: Convert dnskw to pinctrl
ARM: Kirkwood: Convert dockstar to pinctrl.
ARM: Kirkwood: Convert dreamplug to pinctrl.
ARM: Kirkwood: Convert GoFlex Net to pinctrl.
ARM: Kirkwood: Convert ib62x0 to pinctrl.
ARM: Kirkwood: Convert lsxl boards to pinctrl.
ARM: Kirkwood: Convert IX2-200 to pinctrl.arch/arm/boot/dts/kirkwood-dnskw.dtsi | 136 +++++++++++++++++++++++++ arch/arm/boot/dts/kirkwood-dockstar.dts | 21 ++++ arch/arm/boot/dts/kirkwood-dreamplug.dts | 26 +++++ arch/arm/boot/dts/kirkwood-goflexnet.dts | 57 +++++++++++ arch/arm/boot/dts/kirkwood-ib62x0.dts | 41 ++++++++ arch/arm/boot/dts/kirkwood-iconnect.dts | 52 ++++++++++ arch/arm/boot/dts/kirkwood-iomega_ix2_200.dts | 90 ++++++++++++++++ arch/arm/boot/dts/kirkwood-lsxl.dtsi | 67 ++++++++++++ arch/arm/boot/dts/kirkwood-ts219-6281.dts | 56 ++++++++++ arch/arm/boot/dts/kirkwood-ts219-6282.dts | 56 ++++++++++ arch/arm/mach-kirkwood/board-dnskw.c | 37 ------- arch/arm/mach-kirkwood/board-dockstar.c | 10 -- arch/arm/mach-kirkwood/board-dreamplug.c | 14 --- arch/arm/mach-kirkwood/board-goflexnet.c | 18 ---- arch/arm/mach-kirkwood/board-ib62x0.c | 21 ---- arch/arm/mach-kirkwood/board-iconnect.c | 17 ---- arch/arm/mach-kirkwood/board-iomega_ix2_200.c | 24 ----- arch/arm/mach-kirkwood/board-lsxl.c | 19 ---- arch/arm/mach-kirkwood/board-ts219.c | 25 ----- 19 files changed, 602 insertions(+), 185 deletions(-)--
1.7.10.4
Andrew Lunn
maintainercover ARM: Kirkwood: Convert to pinctrl
Quoted 3 lines · Josh Coombs
Andrew, are there any required kernel config changes to go along with this? I didn't see any updates to the default configs in the patches so I want to make sure I'm testing with the right options enabled.
Hi Josh
I've been testing with is:
make kirkwood_defconfig
make
The _defconfig file now contains all boards and should build most common drivers to get the boards booted. If something critical is missing for your boards, please let us known and we will add it to _defconfig.
Andrew
cover ARM: Kirkwood: Convert to pinctrl
Andrew,
Quoted 9 lines · Andrew Lunn
I've been testing with is:
make
kirkwood_defconfig
makeThe
_defconfigfile now contains all boards and should build most common drivers to get the boards booted. If something critical is missing for your boards, please let us known and we will add it to_defconfig.
Are you sure you don't need to add a
select PINCTRL
in the CONFIG_ARCH_KIRKWOOD symbol?
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 to pinctrl
In reply to Andrew LunnHi Andrew,
Am Mittwoch 24 Oktober 2012, 16:53:45 schrieb Andrew Lunn:
Quoted 10 lines
This patchset converts all DT kirkwood boards to using pinctrl.
This patchset depends on an earlier patchset to allow the mvebu pinctrl driver and gpio driver to be built for kirkwood.
Only the TS219 conversion has been tested on hardware. The remaining are compile tested. Before merging upstream, it would be good if the others could be tested on hardware.
This series along with the dependents can be found in:
Unfortunately, this doesn't work for me. git bisect tells me its commit e01139ec82162f21875d09e820686aede4219695.
I guess it has something to do with the lsxl_init calling gpio_set_value().
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Linux version 3.7.0-rc2-00015-g2773c33 (mw at thanatos) (gcc version 4.4.5 (Debian 4.4.5-8) ) #8 PREEMPT Wed Oct 24 20:05:32 CEST 2012
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
CPU: VIVT data cache, VIVT instruction cache
Machine: Marvell Kirkwood (Flattened Device Tree), model: Buffalo Linkstation LS-CHLv2
bootconsole [earlycon0] enabled
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256 Kernel command line: console=ttyS0,115200 root=/dev/sda2 earlyprintk PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 55828k/55828k available, 9708k reserved, 0K highmem Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xc4800000 - 0xff000000 ( 936 MB)
lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc04e2660 (4970 kB)
.init : 0xc04e3000 - 0xc0506cc0 ( 144 kB)
.data : 0xc0508000 - 0xc0540280 ( 225 kB)
.bss : 0xc05402a4 - 0xc05d7a3c ( 606 kB)SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 NR_IRQS:114sched_clock: 32 bits at 166MHz, resolution 5ns, wraps every 25769ms
Console: colour dummy device 80x30
Calibrating delay loop... 597.60 BogoMIPS (lpj=2988032)pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x3baaa8 - 0x3baae4 pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 1024 KiB pool for atomic coherent allocations
Kirkwood: MV88F6281-A1, TCLK=166666667.
Feroceon L2: Enabling L2
Feroceon L2: Cache support initialised.
Unable to handle kernel NULL pointer dereference at virtual address 0000003c pgd = c0004000 [0000003c] *pgd=00000000 Internal error: Oops: 5 [#1] PREEMPT ARM Modules linked in: CPU: 0 Not tainted (3.7.0-rc2-00015-g2773c33 #8) PC is at __gpio_set_value+0x20/0xb4 LR is at lsxl_init+0x14/0x58 pc : [<c01ab75c>] lr : [<c04e99d0>] psr: 20000053
sp : c342ff20 ip : 00000000 fp : 00000000
r10: 00000089 r9 : c0506878 r8 : c04e4498
r7 : 00000000 r6 : c05cea18 r5 : 00000000 r4 : 0000000b r3 : 00000084 r2 : 00000001 r1 : 00000001 r0 : 0000000b
Flags: nzCv IRQs on FIQs off Mode SVC_32 ISA ARM Segment kernel
Control: 0005397f Table: 00004000 DAC: 00000017
Process swapper (pid: 1, stack limit = 0xc342e1b8)
Stack: (0xc342ff20 to 0xc3430000)
ff20: 00000037 c3b5508c c0516230 00000004 c05402c0 c04e99d0 c05005f8 c04e9640
ff40: c05005f8 c04e44b4 c05005f8 c0008614 00000003 00000003 00000000 c05005f8
ff60: c05005f8 00000004 c05402c0 c0500610 c04e31b0 00000089 00000000 c03ab064
ff80: 00000003 00000003 c04e31b0 c03aaf74 00000000 c03aaf74 00000000 00000000
ffa0: 00000000 00000000 00000000 c0008dd0 00000000 00000000 00000000 00000000
ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [<c01ab75c>] (__gpio_set_value+0x20/0xb4) from [<c04e99d0>] (lsxl_init+0x14/0x58)
[<c04e99d0>] (lsxl_init+0x14/0x58) from [<c04e9640>] (kirkwood_dt_init+0xe4/0x158)
[<c04e9640>] (kirkwood_dt_init+0xe4/0x158) from [<c04e44b4>] (customize_machine+0x1c/0x28)
[<c04e44b4>] (customize_machine+0x1c/0x28) from [<c0008614>] (do_one_initcall+0x30/0x174)
[<c0008614>] (do_one_initcall+0x30/0x174) from [<c03ab064>] (kernel_init+0xf0/0x2a0)
[<c03ab064>] (kernel_init+0xf0/0x2a0) from [<c0008dd0>] (ret_from_fork+0x14/0x24)
Code: e24dd008 e1a04000 e7965003 e1a02001 (e5d5303c) ---[ end trace 1b75b31a2719ed1c ]--- Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
Signature · 1 line
Michael
Andrew Lunn
maintainercover ARM: Kirkwood: Convert to pinctrl
Quoted 12 lines · Michael Walle
Hi Andrew,
Am Mittwoch 24 Oktober 2012, 16:53:45 schrieb Andrew Lunn:
Quoted 9 lines
This patchset converts all DT kirkwood boards to using pinctrl.
This patchset depends on an earlier patchset to allow the mvebu pinctrl driver and gpio driver to be built for kirkwood.
Only the TS219 conversion has been tested on hardware. The remaining are compile tested. Before merging upstream, it would be good if the others could be tested on hardware.
Quoted 6 lines
Quoted 1 line
This series along with the dependents can be found in:
Unfortunately, this doesn't work for me. git bisect tells me its commit
e01139ec82162f21875d09e820686aede4219695.I guess it has something to do with the
lsxl_initcallinggpio_set_value().
Humm.
I guess it is too early to use gpio. I don't think the gpio driver has not been configured yet.
I need to think about this.
What happens if you comment out these two gpio_set_value calls?
Andrew
cover ARM: Kirkwood: Convert to pinctrl
Am Mittwoch 24 Oktober 2012, 22:01:28 schrieb Andrew Lunn:
Quoted 1 line
What happens if you comment out these two
gpio_set_valuecalls?
After commenting out and fixing the mpp funtions (see earlier mail from me) the kernel hangs after rtc-mv/before orion_wdt.
Your tree:
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Linux version 3.7.0-rc2-00015-g2773c33-dirty (mw at thanatos) (gcc version 4.4.5 (Debian 4.4.5-8) ) #9 PREEMPT Wed Oct 24 22:27:07 CEST 2012
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
CPU: VIVT data cache, VIVT instruction cache
Machine: Marvell Kirkwood (Flattened Device Tree), model: Buffalo Linkstation LS-CHLv2
bootconsole [earlycon0] enabled
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256 Kernel command line: console=ttyS0,115200 root=/dev/sda2 earlyprintk PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 55828k/55828k available, 9708k reserved, 0K highmem
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xc4800000 - 0xff000000 ( 936 MB)
lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc04e2660 (4970 kB)
.init : 0xc04e3000 - 0xc0506ca0 ( 144 kB)
.data : 0xc0508000 - 0xc0540280 ( 225 kB)
.bss : 0xc05402a4 - 0xc05d7a3c ( 606 kB)SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 NR_IRQS:114sched_clock: 32 bits at 166MHz, resolution 5ns, wraps every 25769ms
Console: colour dummy device 80x30
Calibrating delay loop... 597.60 BogoMIPS (lpj=2988032)pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x3baaa8 - 0x3baae4 pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 1024 KiB pool for atomic coherent allocations
Kirkwood: MV88F6281-A1, TCLK=166666667.
Feroceon L2: Enabling L2
Feroceon L2: Cache support initialised.
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
cfg80211: Calling CRDA to update world regulatory domain Switching to clocksource orion_clocksource
NET: Registered protocol family 2
TCP established hash table entries: 2048 (order: 2, 16384 bytes) TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
jffs2: version 2.2. (NAND) ? 2001-2006 Red Hat, Inc.
msgmni has been set to 109
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
kirkwood-pinctrl f1010000.pinctrl: registered pinctrl driver mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver mv_xor mv_xor.0: Marvell XOR: ( xor cpy )mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )mv_xor mv_xor.2: Marvell XOR: ( xor cpy )mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
loop: module loadedsata_mv sata_mv.0: cannot get optional clkdevsata_mv sata_mv.0: slots 32 ports 1
scsi0 : sata_mv
ata1: SATA max UDMA/133 irq 21
m25p80 spi0.0: m25p40 (512 Kbytes)
3 ofpart partitions found on MTD device spi0.0
Creating 3 MTD partitions on "spi0.0":
0x000000000000-0x000000060000 : "uboot" 0x000000060000-0x000000070000 : "dtb" 0x000000070000-0x000000080000 : "uboot_env"mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
libphy: mv643xx_eth smi: probedmv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:00:00:00:00:00mv643xx_eth_port mv643xx_eth_port.1 eth1: port 0 with MAC address 4c:e6:76:61:b9:f7libertas_sdio: Libertas SDIO driverlibertas_sdio: Copyright Pierre Ossmanehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver orion-ehci orion-ehci.0: Marvell Orion EHCI
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1 orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000 orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver ums-datafab
usbcore: registered new interface driver ums-freecom
usbcore: registered new interface driver ums-jumpshot
usbcore: registered new interface driver ums-sddr09
usbcore: registered new interface driver ums-sddr55
mousedev: PS/2 mouse device common for all mice
rtc-mv f1010300.rtc: rtc core: registered f1010300.rtc as rtc0 i2c /dev entries driver
v3.7rc2 tag:
Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0
Linux version 3.7.0-rc2 (mw at thanatos) (gcc version 4.4.5 (Debian 4.4.5-8) ) #11 PREEMPT Wed Oct 24 22:42:25 CEST 2012
CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=00053977
CPU: VIVT data cache, VIVT instruction cache
Machine: Marvell Kirkwood (Flattened Device Tree), model: Buffalo Linkstation LS-CHLv2
Memory policy: ECC disabled, Data cache writeback
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256 Kernel command line: console=ttyS0,115200 root=/dev/sda2 earlyprintk PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 55884k/55884k available, 9652k reserved, 0K highmem Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xc4800000 - 0xff000000 ( 936 MB)
lowmem : 0xc0000000 - 0xc4000000 ( 64 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc04d82e4 (4929 kB)
.init : 0xc04d9000 - 0xc04fcda0 ( 144 kB)
.data : 0xc04fe000 - 0xc0533fa0 ( 216 kB)
.bss : 0xc0533fc4 - 0xc05cb59c ( 606 kB)SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 NR_IRQS:114sched_clock: 32 bits at 166MHz, resolution 5ns, wraps every 25769ms
Console: colour dummy device 80x30
Calibrating delay loop... 597.60 BogoMIPS (lpj=2988032)pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x3b41c8 - 0x3b4204
NET: Registered protocol family 16
DMA: preallocated 1024 KiB pool for atomic coherent allocations
Kirkwood: MV88F6281-A1, TCLK=166666667.
Feroceon L2: Enabling L2
Feroceon L2: Cache support initialised.
bio: create slab <bio-0> at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
cfg80211: Calling CRDA to update world regulatory domain Switching to clocksource orion_clocksource
NET: Registered protocol family 2
TCP established hash table entries: 2048 (order: 2, 16384 bytes) TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
jffs2: version 2.2. (NAND) ? 2001-2006 Red Hat, Inc.
msgmni has been set to 109
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)mv_xor_shared mv_xor_shared.0: Marvell shared XOR driver mv_xor_shared mv_xor_shared.1: Marvell shared XOR driver mv_xor mv_xor.0: Marvell XOR: ( xor cpy )mv_xor mv_xor.1: Marvell XOR: ( xor fill cpy )mv_xor mv_xor.2: Marvell XOR: ( xor cpy )mv_xor mv_xor.3: Marvell XOR: ( xor fill cpy )
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 33) is a 16550A console [ttyS0] enabled
loop: module loadedsata_mv sata_mv.0: cannot get optional clkdevsata_mv sata_mv.0: slots 32 ports 1
scsi0 : sata_mv
ata1: SATA max UDMA/133 irq 21
m25p80 spi0.0: m25p40 (512 Kbytes)
3 ofpart partitions found on MTD device spi0.0
Creating 3 MTD partitions on "spi0.0":
0x000000000000-0x000000060000 : "uboot" 0x000000060000-0x000000070000 : "dtb" 0x000000070000-0x000000080000 : "uboot_env"mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
libphy: mv643xx_eth smi: probedmv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:00:00:00:00:00mv643xx_eth_port mv643xx_eth_port.1 eth1: port 0 with MAC address 4c:e6:76:61:b9:f7libertas_sdio: Libertas SDIO driverlibertas_sdio: Copyright Pierre Ossmanehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver orion-ehci orion-ehci.0: Marvell Orion EHCI
orion-ehci orion-ehci.0: new USB bus registered, assigned bus number 1 orion-ehci orion-ehci.0: irq 19, io mem 0xf1050000 orion-ehci orion-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver ums-datafab
usbcore: registered new interface driver ums-freecom
usbcore: registered new interface driver ums-jumpshot
usbcore: registered new interface driver ums-sddr09
usbcore: registered new interface driver ums-sddr55
mousedev: PS/2 mouse device common for all mice
rtc-mv f1010300.rtc: rtc core: registered f1010300.rtc as rtc0 i2c /dev entries driverorion_wdt: Initial timeout 25 sec
cpuidle: using governor ladder
cpuidle: using governor menu
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
oprofile: no performance counters
oprofile: using timer interrupt.
TCP: cubic registered
NET: Registered protocol family 17
lib80211: common routines for IEEE802.11 drivers
input: gpio_keys.1 as /devices/gpio_keys.1/input/input0 rtc-mv f1010300.rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
ata1: SATA link down (SStatus 0 SControl F300)
VFS: Cannot open root device "sda2" or unknown-block(0,0): error -6
--
michael
cover ARM: Kirkwood: Convert to pinctrl
In reply to Andrew LunnAndrew,
Quoted 6 lines · Andrew Lunn
I guess it is too early to use gpio. I don't think the gpio driver has not been configured yet.
I need to think about this.
What happens if you comment out these two
gpio_set_valuecalls?
The problem is (probably, I haven't tested) that in mach-kirkwood/board-dt.c, the of_platform_populate() function is called after all the board-specific init. So all the devices described in the DT, including GPIO banks, have not been registered yet. Most likely the of_platform_populate() should come before the board specific inits.
Also there should probably be a gpio_request() before those gpio_set_value().
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
Andrew Lunn
maintainercover ARM: Kirkwood: Convert to pinctrl
Quoted 9 lines · Thomas Petazzoni
Andrew,
Quoted 5 lines · Andrew Lunn
I guess it is too early to use gpio. I don't think the gpio driver has not been configured yet.
I need to think about this.
Quoted 7 lines
Quoted 1 line
What happens if you comment out these two
gpio_set_valuecalls?The problem is (probably, I haven't tested) that in
mach-kirkwood/board-dt.c, theof_platform_populate()function is called after all the board-specific init. So all the devices described in the DT, including GPIO banks, have not been registered yet. Most likely theof_platform_populate()should come before the board specific inits.
Thanks Thomas, i will play around with this.
I'm just wondering if we are going to get into ordering issues. These gpio operations are providing power to subsystems. We probably need that to happen before the driver is loaded. If we call of_platform_populate() too early, do we have the danger the driver probing is going to happen before the init routine can enable the power?
It seems like we want pinctrl/gpio working first, with pins hogged as specified in DT, then the board init() function, then the rest of DT setup.
Quoted 2 lines
Also there should probably be a
gpio_request()before thosegpio_set_value().
Yes. That worked before, but might break now. Most of the init() functions do actually make a gpip_request() call.
Andrew
cover ARM: Kirkwood: Convert to pinctrl
Andrew,
Quoted 9 lines · Andrew Lunn
Thanks Thomas, i will play around with this.
I'm just wondering if we are going to get into ordering issues. These gpio operations are providing power to subsystems. We probably need that to happen before the driver is loaded. If we call
of_platform_populate()too early, do we have the danger the driver probing is going to happen before the init routine can enable the power?
Quoted 3 lines
It seems like we want pinctrl/gpio working first, with pins hogged as specified in DT, then the board
init()function, then the rest of DT setup.
If those GPIO value settings are needed to get a particular driver to work, then I'd recommend letting the driver do the GPIO value setting. For example, in the lsxl board, I see:
/* usb and sata power on */
gpio_set_value(LSXL_GPIO_USB_POWER, 1);
gpio_set_value(LSXL_GPIO_HDD_POWER, 1);If the LSXL_GPIO_USB_POWER GPIO should be set to one to get the EHCI driver to work properly, then I think we should let the EHCI driver set this GPIO value in its ->probe() operation. Of course, the GPIO reference will be passed in the platform_data (for old-style probing), or through specific DT properties (for new-style, DT-based, probing).
Regarding the LSXL_GPIO_HDD_POWER GPIO, I am not sure. Is it required to apply power on this GPIO to get the SATA driver to probe properly, or is it possible to get the SATA driver to probe properly, then apply power and have the HDD still being recognized? I haven't looked at all at how SATA drivers were working, so I can't say.
Also, ultimately, if those GPIOs are providing power, then they should probably not be handled as simple GPIOs, but rather as regulator, using the gpio-regulator driver. But let's do things steps by steps :-)
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 to pinctrl
Quoted 31 lines · Thomas Petazzoni
Andrew,
Quoted 9 lines · Andrew Lunn
Thanks Thomas, i will play around with this.
I'm just wondering if we are going to get into ordering issues. These gpio operations are providing power to subsystems. We probably need that to happen before the driver is loaded. If we call
of_platform_populate()too early, do we have the danger the driver probing is going to happen before the init routine can enable the power?Quoted 3 lines
It seems like we want pinctrl/gpio working first, with pins hogged as specified in DT, then the board
init()function, then the rest of DT setup.If those GPIO value settings are needed to get a particular driver to work, then I'd recommend letting the driver do the GPIO value setting. For example, in the lsxl board, I see:
/* usb and sata power on */ gpio_set_value(LSXL_GPIO_USB_POWER, 1); gpio_set_value(LSXL_GPIO_HDD_POWER, 1);If the
LSXL_GPIO_USB_POWERGPIO should be set to one to get the EHCI driver to work properly, then I think we should let the EHCI driver set this GPIO value in its ->probe() operation. Of course, the GPIO reference will be passed in theplatform_data(for old-style probing), or through specific DT properties (for new-style, DT-based, probing).
Quoted 5 lines
Regarding the
LSXL_GPIO_HDD_POWERGPIO, I am not sure. Is it required to apply power on this GPIO to get the SATA driver to probe properly, or is it possible to get the SATA driver to probe properly, then apply power and have the HDD still being recognized? I haven't looked at all at how SATA drivers were working, so I can't say.
LSXL_GPIO_USB_POWER and LSXL_GPIO_HDD_POWER switches the power on the USB and SATA connector. So they are not needed to be set before the driver probes, at least in my case here.
But i can imagine boards where you have to enable some kind of buffer/muxer/etc which are controlled by GPIO pins. And I don't think that should be part of the actual driver, because that would be highly board dependant.
Quoted 3 lines
Also, ultimately, if those GPIOs are providing power, then they should probably not be handled as simple GPIOs, but rather as regulator, using the gpio-regulator driver. But let's do things steps by steps :-)
Signature · 1 line
michael
cover ARM: Kirkwood: Convert to pinctrl
Dear Michael Walle,
Quoted 3 lines · Michael Walle
LSXL_GPIO_USB_POWERandLSXL_GPIO_HDD_POWERswitches the power on the USB and SATA connector. So they are not needed to be set before the driver probes, at least in my case here.
Ok.
Quoted 4 lines
But i can imagine boards where you have to enable some kind of buffer/muxer/etc which are controlled by GPIO pins. And I don't think that should be part of the actual driver, because that would be highly board dependant.
You'd have to provide a more specific example so I can imagine how it will be solved. But for example, if you have a GPIO-controlled muxer for an I2C bus, then the I2C devices behind the muxer are described as sub-devices of the muxer, so the probing order is correct.
Of course, I'm not pretending I have ready-to-use solutions for all situations, but I think we can solve this problem on a case-by-case basis.
Regardless of those GPIOs, did you solve the hang that happened even when you removed the gpio_set_value() calls? Or is it still a problem currently?
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 to pinctrl
Am Donnerstag 25 Oktober 2012, 09:43:43 schrieb Thomas Petazzoni:
Quoted 14 lines
Dear Michael Walle,
Quoted 3 lines · Michael Walle
LSXL_GPIO_USB_POWERandLSXL_GPIO_HDD_POWERswitches the power on the USB and SATA connector. So they are not needed to be set before the driver probes, at least in my case here.Ok.
Quoted 4 lines
But i can imagine boards where you have to enable some kind of buffer/muxer/etc which are controlled by GPIO pins. And I don't think that should be part of the actual driver, because that would be highly board dependant.
Quoted 4 lines
You'd have to provide a more specific example so I can imagine how it will be solved. But for example, if you have a GPIO-controlled muxer for an I2C bus, then the I2C devices behind the muxer are described as sub-devices of the muxer, so the probing order is correct.
Assume an ethernet phy which needs a valid reference clock before it can be probed for example. Of course, this is pure theoretical. But should we impose restrictions on when we can do the GPIO settings? Esp. since it worked before (i guess).
Quoted 7 lines
Of course, I'm not pretending I have ready-to-use solutions for all situations, but I think we can solve this problem on a case-by-case basis.
Regardless of those GPIOs, did you solve the hang that happened even when you removed the
gpio_set_value()calls? Or is it still a problem currently?
Still a problem. Haven't really looket into i atm. Hopefully i find some time this weekend.
Signature · 1 line
michael
cover ARM: Kirkwood: Convert to pinctrl
In reply to Thomas PetazzoniHi Thomas
Am Donnerstag 25 Oktober 2012, 09:43:43 schrieb Thomas Petazzoni:
Quoted 3 lines
Regardless of those GPIOs, did you solve the hang that happened even when you removed the
gpio_set_value()calls? Or is it still a problem currently?
quick update, i found out, that my board loops in the mvebu interrupt handler mvebu_gpio_irq_handler(). maybe this is also the lockup Jamie Lentin sees.
are interrupts always enabled, now? is there a way to control them? maybe there is something missing in the dts, now.
Signature · 1 line
michael
cover ARM: Kirkwood: Convert to pinctrl
Dear Michael Walle,
Quoted 11 lines · Michael Walle
Am Donnerstag 25 Oktober 2012, 09:43:43 schrieb Thomas Petazzoni:
Quoted 3 lines
Regardless of those GPIOs, did you solve the hang that happened even when you removed the
gpio_set_value()calls? Or is it still a problem currently?quick update, i found out, that my board loops in the mvebu interrupt handler
mvebu_gpio_irq_handler(). maybe this is also the lockup Jamie Lentin sees.are interrupts always enabled, now? is there a way to control them? maybe there is something missing in the dts, now.
Ah, this is interesting. It is not entirely surprising, since the gpio driver is new. Even though it re-uses most of the previous gpio driver, it is by far not impossible that there will be a few regressions.
Could you add a few debug prints to see if you're looping *inside* the function (which I find pretty unlikely), or if the function gets called over and over again? Could it be that the hang occurs during the initialization of the gpio-leds or gpio-keys drivers?
Also, even though I'm pretty sure it isn't going to fix your problem, note the following mvebu-gpio fix:
http://article.gmane.org/gmane.linux.ports.arm.kernel/195018
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 to pinctrl
Hi Thomas.
Am Freitag 26 Oktober 2012, 20:45:05 schrieb Thomas Petazzoni:
Quoted 7 lines
Ah, this is interesting. It is not entirely surprising, since the gpio driver is new. Even though it re-uses most of the previous gpio driver, it is by far not impossible that there will be a few regressions.
Could you add a few debug prints to see if you're looping *inside* the function (which I find pretty unlikely), or if the function gets called over and over again?
ah sorry, my bad. of course the handler is called forever:
mvebu_gpio_to_irq pin=8mvebu_gpio_irq_set_type pin=8mvebu_gpio_edge_irq_unmaskmvebu_gpio_irq_handler irq=103mvebu_gpio_level_irq_mask irq=103mvebu_gpio_irq_handler irq=100mvebu_gpio_level_irq_mask irq=100mvebu_gpio_irq_handler irq=101mvebu_gpio_level_irq_mask irq=101mvebu_gpio_irq_handler irq=102mvebu_gpio_level_irq_mask irq=102mvebu_gpio_irq_handler irq=103mvebu_gpio_level_irq_mask irq=103mvebu_gpio_irq_handler irq=112mvebu_gpio_level_irq_mask irq=112mvebu_gpio_irq_handler irq=103mvebu_gpio_level_irq_mask irq=103mvebu_gpio_irq_handler irq=103mvebu_gpio_level_irq_mask irq=103mvebu_gpio_irq_handler irq=103mvebu_gpio_level_irq_mask irq=103mvebu_gpio_irq_handler irq=103mvebu_gpio_level_irq_mask irq=103mvebu_gpio_irq_handler irq=103mvebu_gpio_level_irq_mask irq=103mvebu_gpio_irq_handler irq=103mvebu_gpio_level_irq_mask irq=103mvebu_gpio_irq_handler irq=103mvebu_gpio_level_irq_mask irq=103mvebu_gpio_irq_handler irq=103
[..]
Quoted 2 lines
Could it be that the hang occurs during the initialization of the gpio-leds or gpio-keys drivers?
yeah, if i disable gpio-leds, gpio-keys and gpio-fan the hang will disappear. But once i enable one of it the board hangs again.
Quoted 4 lines
Also, even though I'm pretty sure it isn't going to fix your problem, note the following mvebu-gpio fix:
http://article.gmane.org/gmane.linux.ports.arm.kernel/195018
thats already in andrew's tree.
Signature · 1 line
michael
Andrew Lunn
maintainercover ARM: Kirkwood: Convert to pinctrl
Quoted 35 lines · Michael Walle
Hi Thomas.
Am Freitag 26 Oktober 2012, 20:45:05 schrieb Thomas Petazzoni:
Quoted 7 lines
Ah, this is interesting. It is not entirely surprising, since the gpio driver is new. Even though it re-uses most of the previous gpio driver, it is by far not impossible that there will be a few regressions.
Could you add a few debug prints to see if you're looping *inside* the function (which I find pretty unlikely), or if the function gets called over and over again?
ah sorry, my bad. of course the handler is called forever:
mvebu_gpio_to_irqpin=8mvebu_gpio_irq_set_typepin=8mvebu_gpio_edge_irq_unmaskmvebu_gpio_irq_handlerirq=103mvebu_gpio_level_irq_maskirq=103mvebu_gpio_irq_handlerirq=100mvebu_gpio_level_irq_maskirq=100mvebu_gpio_irq_handlerirq=101mvebu_gpio_level_irq_maskirq=101mvebu_gpio_irq_handlerirq=102mvebu_gpio_level_irq_maskirq=102mvebu_gpio_irq_handlerirq=103mvebu_gpio_level_irq_maskirq=103mvebu_gpio_irq_handlerirq=112mvebu_gpio_level_irq_maskirq=112mvebu_gpio_irq_handlerirq=103mvebu_gpio_level_irq_maskirq=103mvebu_gpio_irq_handlerirq=103mvebu_gpio_level_irq_maskirq=103mvebu_gpio_irq_handlerirq=103mvebu_gpio_level_irq_maskirq=103mvebu_gpio_irq_handlerirq=103
Quoted 8 lines
mvebu_gpio_level_irq_maskirq=103mvebu_gpio_irq_handlerirq=103mvebu_gpio_level_irq_maskirq=103mvebu_gpio_irq_handlerirq=103mvebu_gpio_level_irq_maskirq=103mvebu_gpio_irq_handlerirq=103mvebu_gpio_level_irq_maskirq=103mvebu_gpio_irq_handlerirq=103
That makes me think edge vs level triggering.
For gpio-keys you want edge triggered interrupts, but if the controller is setup for level, you would see this.
Try adding some debug into the function mvebu_gpio_irq_set_type()
Andrew
cover ARM: Kirkwood: Convert to pinctrl
In reply to Thomas PetazzoniQuoted 31 lines · Thomas Petazzoni
Andrew,
Quoted 9 lines · Andrew Lunn
Thanks Thomas, i will play around with this.
I'm just wondering if we are going to get into ordering issues. These gpio operations are providing power to subsystems. We probably need that to happen before the driver is loaded. If we call
of_platform_populate()too early, do we have the danger the driver probing is going to happen before the init routine can enable the power?Quoted 3 lines
It seems like we want pinctrl/gpio working first, with pins hogged as specified in DT, then the board
init()function, then the rest of DT setup.If those GPIO value settings are needed to get a particular driver to work, then I'd recommend letting the driver do the GPIO value setting. For example, in the lsxl board, I see:
/* usb and sata power on */ gpio_set_value(LSXL_GPIO_USB_POWER, 1); gpio_set_value(LSXL_GPIO_HDD_POWER, 1);If the
LSXL_GPIO_USB_POWERGPIO should be set to one to get the EHCI driver to work properly, then I think we should let the EHCI driver set this GPIO value in its ->probe() operation. Of course, the GPIO reference will be passed in theplatform_data(for old-style probing), or through specific DT properties (for new-style, DT-based, probing).
Quoted 5 lines
Regarding the
LSXL_GPIO_HDD_POWERGPIO, I am not sure. Is it required to apply power on this GPIO to get the SATA driver to probe properly, or is it possible to get the SATA driver to probe properly, then apply power and have the HDD still being recognized? I haven't looked at all at how SATA drivers were working, so I can't say.
FWIW, Applying power to the HDD after SATA probe works fine on my NAS (admittedly not an lsxl board, but close enough). Turning it off again is a little unclean, but works.
Quoted 8 lines
Also, ultimately, if those GPIOs are providing power, then they should probably not be handled as simple GPIOs, but rather as regulator, using the gpio-regulator driver. But let's do things steps by steps :-)
Best regards,
Thomas
Signature · 1 line
Jamie Lentin
Andrew Lunn
maintainercover ARM: Kirkwood: Convert to pinctrl
In reply to Andrew LunnQuoted 1 line · Andrew Lunn
This patchset converts all DT kirkwood boards to using pinctrl.
Thanks for the feedback everybody gave.
Progress has been made:
The bug causing the lockups has been found, fixed and passed upstream.
I factored out the repeated pinmux definitions for sata0, sata1, spi, twsi0, uart0, uart1.
I fixed a few types reported by testers.
I found a solution to many of the gpio_request() failures. The ones for controlling power to SATA or USB i've replaced with a regulator in DT. The regulator will grab the GPIO, set it to output, and driver it high/low as required. I just hope we don't have an ordering issue. The regulator framework seems to load quite early and probes all the regulators. This fails, because pinctrl has not yet loaded, so the gpio framework returns EPROBE_DEFER. This is not fatal to the regulator framework, it tries again later. But this later is after most of the rest of the drivers have loaded. So we might get into issues where uboot has not enabled power to USB/SATA, the driver is probed and fails because of the lack of power, and once things of gone wrong, we turn the power on.
I still expect problems with GPIOs used for power off. I've not yet touched them. Again, a regulator makes sense, but there is no 'out of the box' regulator type or property which adds itself to pm_power_off.
The last problem is:
/* Set NAS to turn back on after a power failure */
dnskw_gpio_register(37, "dnskw:power:recover", 1);I think its a bit of a stretch calling this a regulator.
Since the current patchset is 18 patches, plus a few other bug fixes and dependencies, i'm not going to post them all here. I think we are still at the smoke/no-smoke stage of testing. Please pull from:
git://github.com/lunn/linux.git v3.7-rc2-pinctrl-v2
and let me know if things work, what typo's need fixing, where the smoke comes out, etc.
Thanks
Andrew
cover ARM: Kirkwood: Convert to pinctrl
Hi Andrew,
Am Sonntag 28 Oktober 2012, 17:57:11 schrieb Andrew Lunn:
Quoted 8 lines
Since the current patchset is 18 patches, plus a few other bug fixes and dependencies, i'm not going to post them all here. I think we are still at the smoke/no-smoke stage of testing. Please pull from:
git://github.com/lunn/linux.gitv3.7-rc2-pinctrl-v2and let me know if things work, what typo's need fixing, where the smoke comes out, etc.
works for me now.
Thanks, Andrew
Signature · 1 line
michael
cover ARM: Kirkwood: Convert to pinctrl
In reply to Andrew LunnHi Andrew,
Quoted 6 lines · Andrew Lunn
Quoted 1 line · Andrew Lunn
This patchset converts all DT kirkwood boards to using pinctrl.
I still expect problems with GPIOs used for power off. I've not yet touched them. Again, a regulator makes sense, but there is no 'out of the box' regulator type or property which adds itself to
pm_power_off.
the IB-NAS 62x0 works with the exception of the power off via GPIO. Additionally, the original U-Boot enables hardware blinking for the power led and Jamie's patch might be needed here as well. However, I don't use this U-Boot anymore and can't test this.
- Simon
Andrew Lunn
maintainercover ARM: Kirkwood: Convert to pinctrl
Quoted 6 lines · Simon Baatz
Hi Andrew,
Quoted 3 lines · Andrew Lunn
Quoted 1 line · Andrew Lunn
This patchset converts all DT kirkwood boards to using pinctrl.
Quoted 8 lines
Quoted 3 lines
I still expect problems with GPIOs used for power off. I've not yet touched them. Again, a regulator makes sense, but there is no 'out of the box' regulator type or property which adds itself to
pm_power_off.the IB-NAS 62x0 works with the exception of the power off via GPIO. Additionally, the original U-Boot enables hardware blinking for the power led and Jamie's patch might be needed here as well. However, I don't use this U-Boot anymore and can't test this.
Hi Simon
Thanks for testing.
I hope Thomas Petazzoni will pickup the blinking patch and make sure its O.K. for 370/XP. It can then be merged in.
power off via GPIO is next on my list of things to solve.
Andrew
cover ARM: Kirkwood: Convert to pinctrl
In reply to Andrew LunnQuoted 31 lines · Andrew Lunn
Quoted 1 line · Andrew Lunn
This patchset converts all DT kirkwood boards to using pinctrl.
Thanks for the feedback everybody gave.
Progress has been made:
The bug causing the lockups has been found, fixed and passed upstream.
I factored out the repeated pinmux definitions for sata0, sata1, spi, twsi0, uart0, uart1.
I fixed a few types reported by testers.
I found a solution to many of the
gpio_request()failures. The ones for controlling power to SATA or USB i've replaced with a regulator in DT. The regulator will grab the GPIO, set it to output, and driver it high/low as required. I just hope we don't have an ordering issue. The regulator framework seems to load quite early and probes all the regulators. This fails, because pinctrl has not yet loaded, so the gpio framework returnsEPROBE_DEFER. This is not fatal to the regulator framework, it tries again later. But this later is after most of the rest of the drivers have loaded. So we might get into issues where uboot has not enabled power to USB/SATA, the driver is probed and fails because of the lack of power, and once things of gone wrong, we turn the power on.I still expect problems with GPIOs used for power off. I've not yet touched them. Again, a regulator makes sense, but there is no 'out of the box' regulator type or property which adds itself to
pm_power_off.
Quoted 6 lines
The last problem is:
/* Set NAS to turn back on after a power failure */ dnskw_gpio_register(37, "dnskw:power:recover", 1);I think its a bit of a stretch calling this a regulator.
Definitely.
Quoted 8 lines
Since the current patchset is 18 patches, plus a few other bug fixes and dependencies, i'm not going to post them all here. I think we are still at the smoke/no-smoke stage of testing. Please pull from:
git://github.com/lunn/linux.gitv3.7-rc2-pinctrl-v2and let me know if things work, what typo's need fixing, where the smoke comes out, etc.
No smoke came out, the SATA ports were both powered up. Beyond what's already known about, no problems.
Quoted 4 lines
Thanks
Andrew
Signature · 1 line
Jamie Lentin
cover ARM: Kirkwood: Convert to pinctrl
In reply to Andrew LunnSorry it took me so long to test on my GoFlex Net. Working fine.
tested by: Joshua Coombs <[email protected]>
Quoted 42 lines · Andrew Lunn
Quoted 1 line · Andrew Lunn
This patchset converts all DT kirkwood boards to using pinctrl.
Thanks for the feedback everybody gave.
Progress has been made:
The bug causing the lockups has been found, fixed and passed upstream.
I factored out the repeated pinmux definitions for sata0, sata1, spi, twsi0, uart0, uart1.
I fixed a few types reported by testers.
I found a solution to many of the
gpio_request()failures. The ones for controlling power to SATA or USB i've replaced with a regulator in DT. The regulator will grab the GPIO, set it to output, and driver it high/low as required. I just hope we don't have an ordering issue. The regulator framework seems to load quite early and probes all the regulators. This fails, because pinctrl has not yet loaded, so the gpio framework returnsEPROBE_DEFER. This is not fatal to the regulator framework, it tries again later. But this later is after most of the rest of the drivers have loaded. So we might get into issues where uboot has not enabled power to USB/SATA, the driver is probed and fails because of the lack of power, and once things of gone wrong, we turn the power on.I still expect problems with GPIOs used for power off. I've not yet touched them. Again, a regulator makes sense, but there is no 'out of the box' regulator type or property which adds itself to
pm_power_off.The last problem is:
/* Set NAS to turn back on after a power failure */ dnskw_gpio_register(37, "dnskw:power:recover", 1);I think its a bit of a stretch calling this a regulator.
Since the current patchset is 18 patches, plus a few other bug fixes and dependencies, i'm not going to post them all here. I think we are still at the smoke/no-smoke stage of testing. Please pull from:
Quoted 8 lines
git://github.com/lunn/linux.gitv3.7-rc2-pinctrl-v2and let me know if things work, what typo's need fixing, where the smoke comes out, etc.
Thanks
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121031/08091f97/attachment-0001.html>
cover Kirkwood 98dx4122 pinctrl variant
In reply to Andrew LunnThese two patches add a pinctrl variant for the kirkwood embedded in the 98dx4122 SoC. Although it is based on a 6281 kirkwood, a lot of pins and functionalities are absent ant that's why a new variant is needed.
These two patches are based on Andrew's v2 pinctrl branch:
git://github.com/lunn/linux.git v3.7-rc2-pinctrl-v2
Valentin Longchamp (2):
ARM: support 98DX412x kirkwoods with pinctrl
ARM: convert the km_kirkwood board to pinctrl
.../bindings/pinctrl/marvell,kirkwood-pinctrl.txt | 39 ++ arch/arm/boot/dts/kirkwood-98dx4122.dtsi | 31 ++ arch/arm/boot/dts/kirkwood-km_kirkwood.dts | 17 + arch/arm/mach-kirkwood/board-km_kirkwood.c | 11 - drivers/pinctrl/mvebu/pinctrl-kirkwood.c | 568 ++++++++++---------- 5 files changed, 377 insertions(+), 289 deletions(-) create mode 100644 arch/arm/boot/dts/kirkwood-98dx4122.dtsi
Andrew Lunn
maintainercover Kirkwood 98dx4122 pinctrl variant
Quoted 12 lines · Valentin Longchamp
These two patches add a pinctrl variant for the kirkwood embedded in the 98dx4122 SoC. Although it is based on a 6281 kirkwood, a lot of pins and functionalities are absent ant that's why a new variant is needed.
These two patches are based on Andrew's v2 pinctrl branch:
git://github.com/lunn/linux.gitv3.7-rc2-pinctrl-v2Valentin Longchamp (2):
ARM: support 98DX412x kirkwoods with pinctrl
ARM: convert thekm_kirkwoodboard to pinctrl
Quoted 7 lines
.../bindings/pinctrl/marvell,kirkwood-pinctrl.txt | 39 ++ arch/arm/boot/dts/kirkwood-98dx4122.dtsi | 31 ++ arch/arm/boot/dts/kirkwood-km_kirkwood.dts | 17 + arch/arm/mach-kirkwood/board-km_kirkwood.c | 11 - drivers/pinctrl/mvebu/pinctrl-kirkwood.c | 568 ++++++++++---------- 5 files changed, 377 insertions(+), 289 deletions(-) create mode 100644 arch/arm/boot/dts/kirkwood-98dx4122.dtsi
Hi Valentin
Thanks for doing this. It looks great. I will pull them into my pinctrl tree and if nobody makes any comments see about passing them up to Jason.
Thanks
Andrew
PATCH 1/2 ARM: support 98DX412x kirkwoods with pinctrl
In reply to Andrew LunnThe Marvell 98DX412x SoC embed a kirkwood variant that does not have pinctrl support yet. Even though this kirkwood is very similar to the 88f6281, on the MPP front a lot of pins are not available. That's why a new kirkwood pinctrl variant is needed.
--- .../bindings/pinctrl/marvell,kirkwood-pinctrl.txt | 39 ++ arch/arm/boot/dts/kirkwood-98dx4122.dtsi | 31 ++ drivers/pinctrl/mvebu/pinctrl-kirkwood.c | 568 ++++++++++---------- 3 files changed, 360 insertions(+), 278 deletions(-) create mode 100644 arch/arm/boot/dts/kirkwood-98dx4122.dtsi
Documentation/devicetree/bindings/pinctrl/marvell,kirkwood-pinctrl.txt +39 -0
@@ -7,8 +7,10 @@ Required properties: - compatible: "marvell,88f6180-pinctrl", "marvell,88f6190-pinctrl", "marvell,88f6192-pinctrl", "marvell,88f6281-pinctrl", "marvell,88f6282-pinctrl" + "marvell,98dx4122-pinctrl" This driver supports all kirkwood variants, i.e. 88f6180, 88f619x, and 88f628x. +It also support the 88f6281-based variant in the 98dx412x Bobcat SoCs. Available mpp pins/groups and functions: Note: brackets (x) are not part of the mpp name for marvell,function and given
@@ -277,3 +279,40 @@ mpp46 46 gpio, ts(mp10), tdm(fs), lcd(hsync) mpp47 47 gpio, ts(mp11), tdm(drx), lcd(vsync) mpp48 48 gpio, ts(mp12), tdm(dtx), lcd(d16) mpp49 49 gpo, tdm(rx0ql), pex(clkreq), lcd(d17) + +* Marvell Bobcat 98dx4122 + +name pins functions +================================================================================ +mpp0 0 gpio, nand(io2), spi(cs) +mpp1 1 gpo, nand(io3), spi(mosi) +mpp2 2 gpo, nand(io4), spi(sck) +mpp3 3 gpo, nand(io5), spi(miso) +mpp4 4 gpio, nand(io6), uart0(rxd) +mpp5 5 gpo, nand(io7), uart0(txd) +mpp6 6 sysrst(out), spi(mosi) +mpp7 7 gpo, pex(rsto), spi(cs) +mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts) +mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts) +mpp10 10 gpo, spi(sck), uart0(txd) +mpp11 11 gpio, spi(miso), uart0(rxd) +mpp13 13 gpio, uart1(txd) +mpp14 14 gpio, uart1(rxd) +mpp15 15 gpio, uart0(rts) +mpp16 16 gpio, uart0(cts) +mpp18 18 gpo, nand(io0) +mpp19 19 gpo, nand(io1) +mpp34 34 gpio +mpp35 35 gpio +mpp36 36 gpio +mpp37 37 gpio +mpp38 38 gpio +mpp39 39 gpio +mpp40 40 gpio +mpp41 41 gpio +mpp42 42 gpio +mpp43 43 gpio +mpp44 44 gpio +mpp45 45 gpio +mpp49 49 gpio +
arch/arm/boot/dts/kirkwood-98dx4122.dtsi new file +31 -0
@@ -0,0 +1,31 @@ +/ { + ocp at f1000000 { + pinctrl: pinctrl at 10000 { + compatible = "marvell,98dx4122-pinctrl"; + reg = <0x10000 0x20>; + + pmx_nand: pmx-nand { + marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3", + "mpp4", "mpp5", "mpp18", + "mpp19"; + marvell,function = "nand"; + }; + pmx_spi: pmx-spi { + marvell,pins = "mpp0", "mpp1", "mpp2", "mpp3"; + marvell,function = "spi"; + }; + pmx_twsi0: pmx-twsi0 { + marvell,pins = "mpp8", "mpp9"; + marvell,function = "twsi0"; + }; + pmx_uart0: pmx-uart0 { + marvell,pins = "mpp10", "mpp11"; + marvell,function = "uart0"; + }; + pmx_uart1: pmx-uart1 { + marvell,pins = "mpp13", "mpp14"; + marvell,function = "uart1"; + }; + }; + }; +};
drivers/pinctrl/mvebu/pinctrl-kirkwood.c +290 -278
642 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 2/2 ARM: convert the km_kirkwood board to pinctrl
In reply to Andrew Lunn--- arch/arm/boot/dts/kirkwood-km_kirkwood.dts | 17 +++++++++++++++++ arch/arm/mach-kirkwood/board-km_kirkwood.c | 11 ----------- 2 files changed, 17 insertions(+), 11 deletions(-)
arch/arm/boot/dts/kirkwood-km_kirkwood.dts +17 -0
@@ -1,6 +1,7 @@ /dts-v1/; /include/ "kirkwood.dtsi" +/include/ "kirkwood-98dx4122.dtsi" / { model = "Keymile Kirkwood Reference Design";
@@ -16,6 +17,22 @@ }; ocp at f1000000 { + pinctrl: pinctrl at 10000 { + + pinctrl-0 = < &pmx_nand &pmx_i2c_gpio_sda + &pmx_i2c_gpio_scl >; + pinctrl-names = "default"; + + pmx_i2c_gpio_sda: pmx-gpio-sda { + marvell,pins = "mpp8"; + marvell,function = "gpio"; + }; + pmx_i2c_gpio_scl: pmx-gpio-scl { + marvell,pins = "mpp9"; + marvell,function = "gpio"; + }; + }; + serial at 12000 { clock-frequency = <200000000>; status = "ok";
arch/arm/mach-kirkwood/board-km_kirkwood.c +0 -11
@@ -24,21 +24,10 @@ static struct mv643xx_eth_platform_data km_kirkwood_ge00_data = { .phy_addr = MV643XX_ETH_PHY_ADDR(0), }; -static unsigned int km_kirkwood_mpp_config[]__initdata = { -MPP8_GPIO ,/* I2C SDA */ -MPP9_GPIO ,/* I2C SCL */ -0 -}; -void __init km_kirkwood_init (void ) {struct clk *sata_clk;/* -* Basic setup. Needs to be called early. -*/ -kirkwood_mpp_conf (km_kirkwood_mpp_config); - -/* * Our variant of kirkwood (integrated in the Bobcat) hangs on accessing * SATA bits (14-15) of the Clock Gating Control Register. Since these * devices are also not present in this variant, their clocks get
Signature · 1 line
1.7.1