All of lore.kernel.org
 help / color / mirror / Atom feed
From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/9] ARM: Kirkwood: Convert dnskw to pinctrl
Date: Fri, 26 Oct 2012 08:01:51 +0200	[thread overview]
Message-ID: <20121026060151.GE21046@lunn.ch> (raw)
In-Reply-To: <alpine.DEB.2.02.1210252352360.22302@gonzo>

On Thu, Oct 25, 2012 at 11:58:37PM +0100, Jamie Lentin wrote:
> 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

Thanks. I will probably squash the three patches into my original, and
add a Signed-off-by: if that is O.K. for you.

> 
> 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.

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.

> 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?
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....

> >	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).

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.

> 
> >+				      &pmx_gpio_24 &pmx_gpio_25
> >+				      &pmx_led_power &pmx_led_power
> 
> Shouldn't be repeated, I'm guessing.
> 
> >+				      &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";
> 
> 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

  reply	other threads:[~2012-10-26  6:01 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24 14:53 [PATCH 0/9] ARM: Kirkwood: Convert to pinctrl Andrew Lunn
2012-10-24 14:53 ` [PATCH 1/9] ARM: Kirkwood: Convert TS219 " Andrew Lunn
2012-10-24 19:31   ` Thomas Petazzoni
2012-10-24 19:49     ` Sebastian Hesselbarth
2012-10-24 20:00       ` Thomas Petazzoni
2012-10-24 20:04         ` Andrew Lunn
2012-10-24 20:05           ` Thomas Petazzoni
2012-10-24 20:14         ` Sebastian Hesselbarth
2012-10-24 20:19           ` Thomas Petazzoni
2012-10-24 14:53 ` [PATCH 2/9] ARM: Kirkwood: Convert iConnect " Andrew Lunn
2012-10-24 14:53 ` [PATCH 3/9] ARM: Kirkwood: Convert dnskw " Andrew Lunn
2012-10-25 22:58   ` Jamie Lentin
2012-10-26  6:01     ` Andrew Lunn [this message]
2012-10-26  9:42       ` Jamie Lentin
2012-10-26 10:24         ` Andrew Lunn
2012-10-26 12:30           ` Jamie Lentin
2012-10-24 14:53 ` [PATCH 4/9] ARM: Kirkwood: Convert dockstar " Andrew Lunn
2012-10-24 14:53 ` [PATCH 5/9] ARM: Kirkwood: Convert dreamplug " Andrew Lunn
2012-10-24 14:53 ` [PATCH 6/9] ARM: Kirkwood: Convert GoFlex Net " Andrew Lunn
2012-10-26 17:28   ` Josh Coombs
2012-10-27  8:51     ` Andrew Lunn
2012-10-28 14:31   ` Josh Coombs
2012-10-24 14:53 ` [PATCH 7/9] ARM: Kirkwood: Convert ib62x0 " Andrew Lunn
2012-10-24 20:40   ` Simon Baatz
2012-10-24 14:53 ` [PATCH 8/9] ARM: Kirkwood: Convert lsxl boards " Andrew Lunn
2012-10-24 20:37   ` Michael Walle
2012-10-28 16:40   ` Michael Walle
2012-10-24 14:53 ` [PATCH 9/9] ARM: Kirkwood: Convert IX2-200 " Andrew Lunn
2012-10-24 20:04   ` Thomas Petazzoni
2012-10-24 20:20     ` Andrew Lunn
2012-10-24 20:29       ` Thomas Petazzoni
2012-10-24 15:29 ` [PATCH 0/9] ARM: Kirkwood: Convert " Josh Coombs
2012-10-24 15:35   ` Andrew Lunn
2012-10-24 19:26     ` Thomas Petazzoni
2012-10-24 18:06 ` Michael Walle
2012-10-24 20:01   ` Andrew Lunn
2012-10-24 20:47     ` Michael Walle
2012-10-24 21:33     ` Thomas Petazzoni
2012-10-25  5:46       ` Andrew Lunn
2012-10-25  6:28         ` Thomas Petazzoni
2012-10-25  7:39           ` Michael Walle
2012-10-25  7:43             ` Thomas Petazzoni
2012-10-25 20:19               ` Michael Walle
2012-10-26 18:06               ` Michael Walle
2012-10-26 18:45                 ` Thomas Petazzoni
2012-10-26 20:17                   ` Michael Walle
2012-10-27  8:59                     ` Andrew Lunn
2012-10-25 22:57           ` Jamie Lentin
2012-10-28 16:57 ` Andrew Lunn
2012-10-28 18:17   ` Michael Walle
2012-10-28 19:50   ` Simon Baatz
2012-10-28 20:01     ` Andrew Lunn
2012-10-28 21:06   ` Jamie Lentin
2012-10-31 22:38   ` Josh Coombs
2012-11-07 16:13   ` [RFC PATCH 0/2] Kirkwood 98dx4122 pinctrl variant Valentin Longchamp
2012-11-07 17:36     ` Andrew Lunn
2012-11-07 16:13   ` [PATCH 1/2] ARM: support 98DX412x kirkwoods with pinctrl Valentin Longchamp
2012-11-07 16:13   ` [PATCH 2/2] ARM: convert the km_kirkwood board to pinctrl Valentin Longchamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121026060151.GE21046@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.