All of lore.kernel.org
 help / color / mirror / Atom feed
* mvsdio not working on OpenRD
@ 2016-01-10  4:26 Martin Michlmayr
  2016-01-10 15:38 ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Michlmayr @ 2016-01-10  4:26 UTC (permalink / raw)
  To: linux-arm-kernel

Rick Thomas reported that MMC no longer works on his OpenRD Base.

With Debian's 3.16 kernel (using mach ID):

mvsdio mvsdio: no pins associated
mmc0: host does not support reading read-only switch.  assuming write-enable.
mmc0: new high speed SDHC card at address 0007
mmcblk0: mmc0:0007 SD4GB 3.70 GiB?
 mmcblk0: p1

With Debian's 4.3 and 4.4-rc8 kernels (using Device Tree):

kirkwood-pinctrl f1010000.pin-controller: pin PIN13 already requested by f1012100.serial; cannot claim for f1090000.mvsdio
kirkwood-pinctrl f1010000.pin-controller: pin-13 (f1090000.mvsdio) status -22
kirkwood-pinctrl f1010000.pin-controller: could not request pin 13 (PIN13) from group mpp13  on device f1010000.pin-controller
mvsdio f1090000.mvsdio: Error applying setting, reverse things back
mvsdio f1090000.mvsdio: Got CD GPIO
[and no mmc0 or mmcblk0]

-- 
Martin Michlmayr
http://www.cyrius.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* mvsdio not working on OpenRD
  2016-01-10  4:26 mvsdio not working on OpenRD Martin Michlmayr
@ 2016-01-10 15:38 ` Andrew Lunn
  2016-01-10 21:19   ` Rick Thomas
                     ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Andrew Lunn @ 2016-01-10 15:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Jan 09, 2016 at 08:26:19PM -0800, Martin Michlmayr wrote:
> Rick Thomas reported that MMC no longer works on his OpenRD Base.
> 
> With Debian's 3.16 kernel (using mach ID):
> 
> mvsdio mvsdio: no pins associated
> mmc0: host does not support reading read-only switch.  assuming write-enable.
> mmc0: new high speed SDHC card at address 0007
> mmcblk0: mmc0:0007 SD4GB 3.70 GiB?
>  mmcblk0: p1
> 
> With Debian's 4.3 and 4.4-rc8 kernels (using Device Tree):
> 
> kirkwood-pinctrl f1010000.pin-controller: pin PIN13 already requested by f1012100.serial; cannot claim for f1090000.mvsdio
> kirkwood-pinctrl f1010000.pin-controller: pin-13 (f1090000.mvsdio) status -22
> kirkwood-pinctrl f1010000.pin-controller: could not request pin 13 (PIN13) from group mpp13  on device f1010000.pin-controller
> mvsdio f1090000.mvsdio: Error applying setting, reverse things back
> mvsdio f1090000.mvsdio: Got CD GPIO
> [and no mmc0 or mmcblk0]
> 
> -- 
> Martin Michlmayr
> http://www.cyrius.com/

Hi Rick, Martin

If i remember correctly, the OpenRD has some odd muxing going on with
MMC and the second serial port. This fits the error message:

                        pmx_uart1: pmx-uart1 {
                                marvell,pins = "mpp13", "mpp14";
                                marvell,function = "uart1";
                        };

and

                        pmx_sdio: pmx-sdio {
                                marvell,pins = "mpp12", "mpp13", "mpp14",
                                               "mpp15", "mpp16", "mpp17";
                                marvell,function = "sdio";
			};

Either you can have MMC, or you can have the RS-232/RS485 on a DB9 or
you can have MMC. You cannot have both.

It seems like older Debian kernels has defaulted to MMC, so we should
probably disable the serial port.

Please can you try the following patch. If this works, i can add it to
mainline. The issue we might run into is that somebody else wants
serial not MMC....

       Andrew

diff --git a/arch/arm/boot/dts/kirkwood-openrd-base.dts b/arch/arm/boot/dts/kirkwood-openrd-base.dts
index 8af58999606d..883bd416ba0b 100644
--- a/arch/arm/boot/dts/kirkwood-openrd-base.dts
+++ b/arch/arm/boot/dts/kirkwood-openrd-base.dts
@@ -18,11 +18,6 @@
 / {
        model = "OpenRD Base";
        compatible = "marvell,openrd-base", "marvell,openrd", "marvell,kirkwood-88f6281", "marvell,kirkwood";
-
-       ocp at f1000000 {
-               serial at 12100 {
-                       status = "okay";
-               };
        };
 };

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* mvsdio not working on OpenRD
  2016-01-10 15:38 ` Andrew Lunn
@ 2016-01-10 21:19   ` Rick Thomas
  2016-01-15 18:03   ` Aaro Koskinen
  2016-01-17 22:42   ` Martin Michlmayr
  2 siblings, 0 replies; 8+ messages in thread
From: Rick Thomas @ 2016-01-10 21:19 UTC (permalink / raw)
  To: linux-arm-kernel


On Jan 10, 2016, at 7:38 AM, Andrew Lunn <andrew@lunn.ch> wrote:

> On Sat, Jan 09, 2016 at 08:26:19PM -0800, Martin Michlmayr wrote:
>> Rick Thomas reported that MMC no longer works on his OpenRD Base.
>> 
>> With Debian's 3.16 kernel (using mach ID):
>> 
>> mvsdio mvsdio: no pins associated
>> mmc0: host does not support reading read-only switch.  assuming write-enable.
>> mmc0: new high speed SDHC card at address 0007
>> mmcblk0: mmc0:0007 SD4GB 3.70 GiB?
>> mmcblk0: p1
>> 
>> With Debian's 4.3 and 4.4-rc8 kernels (using Device Tree):
>> 
>> kirkwood-pinctrl f1010000.pin-controller: pin PIN13 already requested by f1012100.serial; cannot claim for f1090000.mvsdio
>> kirkwood-pinctrl f1010000.pin-controller: pin-13 (f1090000.mvsdio) status -22
>> kirkwood-pinctrl f1010000.pin-controller: could not request pin 13 (PIN13) from group mpp13  on device f1010000.pin-controller
>> mvsdio f1090000.mvsdio: Error applying setting, reverse things back
>> mvsdio f1090000.mvsdio: Got CD GPIO
>> [and no mmc0 or mmcblk0]
>> 
>> -- 
>> Martin Michlmayr
>> http://www.cyrius.com/
> 
> Hi Rick, Martin
> 
> If i remember correctly, the OpenRD has some odd muxing going on with
> MMC and the second serial port. This fits the error message:
> 
>                        pmx_uart1: pmx-uart1 {
>                                marvell,pins = "mpp13", "mpp14";
>                                marvell,function = "uart1";
>                        };
> 
> and
> 
>                        pmx_sdio: pmx-sdio {
>                                marvell,pins = "mpp12", "mpp13", "mpp14",
>                                               "mpp15", "mpp16", "mpp17";
>                                marvell,function = "sdio";
> 			};
> 
> Either you can have MMC, or you can have the RS-232/RS485 on a DB9 or
> you can have MMC. You cannot have both.
> 
> It seems like older Debian kernels has defaulted to MMC, so we should
> probably disable the serial port.
> 
> Please can you try the following patch. If this works, i can add it to
> mainline. The issue we might run into is that somebody else wants
> serial not MMC....
> 
>       Andrew
> 
> diff --git a/arch/arm/boot/dts/kirkwood-openrd-base.dts b/arch/arm/boot/dts/kirkwood-openrd-base.dts
> index 8af58999606d..883bd416ba0b 100644
> --- a/arch/arm/boot/dts/kirkwood-openrd-base.dts
> +++ b/arch/arm/boot/dts/kirkwood-openrd-base.dts
> @@ -18,11 +18,6 @@
> / {
>        model = "OpenRD Base";
>        compatible = "marvell,openrd-base", "marvell,openrd", "marvell,kirkwood-88f6281", "marvell,kirkwood";
> -
> -       ocp at f1000000 {
> -               serial at 12100 {
> -                       status = "okay";
> -               };
>        };
> };

OK, I understand the issue, and what the patch would mean.  Given that Debian releases up thru Jessie have chosen to support MMC rather than RS-232/RS485, I don?t think there will be many Debian users who would complain.

Unfortuntaely, I?m not set up to build kernels here.  If someone can apply this patch and send me a link to the resulting binary or .deb or .dts, or ? I?ll be happy to try it out on my test machine.

Thanks!
Rick

^ permalink raw reply	[flat|nested] 8+ messages in thread

* mvsdio not working on OpenRD
  2016-01-10 15:38 ` Andrew Lunn
  2016-01-10 21:19   ` Rick Thomas
@ 2016-01-15 18:03   ` Aaro Koskinen
  2016-01-15 19:22     ` Martin Michlmayr
  2016-01-17 22:42   ` Martin Michlmayr
  2 siblings, 1 reply; 8+ messages in thread
From: Aaro Koskinen @ 2016-01-15 18:03 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Sun, Jan 10, 2016 at 04:38:43PM +0100, Andrew Lunn wrote:
> If i remember correctly, the OpenRD has some odd muxing going on with
> MMC and the second serial port. This fits the error message:
> 
>                         pmx_uart1: pmx-uart1 {
>                                 marvell,pins = "mpp13", "mpp14";
>                                 marvell,function = "uart1";
>                         };
> 
> and
> 
>                         pmx_sdio: pmx-sdio {
>                                 marvell,pins = "mpp12", "mpp13", "mpp14",
>                                                "mpp15", "mpp16", "mpp17";
>                                 marvell,function = "sdio";
> 			};
> 
> Either you can have MMC, or you can have the RS-232/RS485 on a DB9 or
> you can have MMC. You cannot have both.
> 
> It seems like older Debian kernels has defaulted to MMC, so we should
> probably disable the serial port.

In addition, the UART/SD selection GPIO needs to be set up. I sent a
patch proposal for this:

	http://marc.info/?l=linux-arm-kernel&m=145262936504783&w=2

> Please can you try the following patch. If this works, i can add it to
> mainline. The issue we might run into is that somebody else wants
> serial not MMC....

I use mainline kernel only, and I also think the default should be SD
like it used to be with legacy boot...

A.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* mvsdio not working on OpenRD
  2016-01-15 18:03   ` Aaro Koskinen
@ 2016-01-15 19:22     ` Martin Michlmayr
  2016-01-15 22:00       ` Aaro Koskinen
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Michlmayr @ 2016-01-15 19:22 UTC (permalink / raw)
  To: linux-arm-kernel

* Aaro Koskinen <aaro.koskinen@iki.fi> [2016-01-15 20:03]:
> On Sun, Jan 10, 2016 at 04:38:43PM +0100, Andrew Lunn wrote:
> > If i remember correctly, the OpenRD has some odd muxing going on with
> > MMC and the second serial port. This fits the error message:

Andrew, your memory is good!  I looked at the old board file and
noticed there used to be a kw_openrd_init_uart1 kernel option to
choose.  The default was MMC (this was not a Debian choice, but one
from kernel.org), so I think that should become the default again.

See https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/diff/arch/arm/mach-kirkwood/openrd-setup.c?id=ba364fc752daeded072a5ef31e43b84cb1f9e5fd

Rick Thomas did some tests we came to the conclusion that MMC on DTB
doesn't work, even with your patch.  We established that the same
kernel (3.16) works with the board file but not with DTB.  I was about
to send an udpate when I saw Aaro's email.

I suggested we put in both of these patches.  I'll produce a test
kernel for Rick with Aaro's patch.

> In addition, the UART/SD selection GPIO needs to be set up. I sent a
> patch proposal for this:
> 	http://marc.info/?l=linux-arm-kernel&m=145262936504783&w=2

Thanks!

> I use mainline kernel only, and I also think the default should be SD
> like it used to be with legacy boot...

Agreed.  It's unfortunate that we found out so late about the change,
but I think MMC is the right choice and in line with what users expect.

-- 
Martin Michlmayr
http://www.cyrius.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* mvsdio not working on OpenRD
  2016-01-15 19:22     ` Martin Michlmayr
@ 2016-01-15 22:00       ` Aaro Koskinen
  2016-01-17 23:05         ` Martin Michlmayr
  0 siblings, 1 reply; 8+ messages in thread
From: Aaro Koskinen @ 2016-01-15 22:00 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Fri, Jan 15, 2016 at 11:22:17AM -0800, Martin Michlmayr wrote:
> * Aaro Koskinen <aaro.koskinen@iki.fi> [2016-01-15 20:03]:
> > On Sun, Jan 10, 2016 at 04:38:43PM +0100, Andrew Lunn wrote:
> > > If i remember correctly, the OpenRD has some odd muxing going on with
> > > MMC and the second serial port. This fits the error message:
> 
> Andrew, your memory is good!  I looked at the old board file and
> noticed there used to be a kw_openrd_init_uart1 kernel option to
> choose.  The default was MMC (this was not a Debian choice, but one
> from kernel.org), so I think that should become the default again.
> 
> See https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/diff/arch/arm/mach-kirkwood/openrd-setup.c?id=ba364fc752daeded072a5ef31e43b84cb1f9e5fd
> 
> Rick Thomas did some tests we came to the conclusion that MMC on DTB
> doesn't work, even with your patch.  We established that the same
> kernel (3.16) works with the board file but not with DTB.  I was about
> to send an udpate when I saw Aaro's email.
> 
> I suggested we put in both of these patches.  I'll produce a test
> kernel for Rick with Aaro's patch.
> 
> > In addition, the UART/SD selection GPIO needs to be set up. I sent a
> > patch proposal for this:
> > 	http://marc.info/?l=linux-arm-kernel&m=145262936504783&w=2
> 
> Thanks!

BTW, the GPIO hogging binding used in the patch might not be supported
by the old Debian 3.16 kernel. :-(

One workaround would be to setup the GPIO from userspace using sysfs,
but that would need replug of the SD card (unbind/bind, or if the driver
a module unload/reload, might work), but that's quite clumsy...

A.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* mvsdio not working on OpenRD
  2016-01-10 15:38 ` Andrew Lunn
  2016-01-10 21:19   ` Rick Thomas
  2016-01-15 18:03   ` Aaro Koskinen
@ 2016-01-17 22:42   ` Martin Michlmayr
  2 siblings, 0 replies; 8+ messages in thread
From: Martin Michlmayr @ 2016-01-17 22:42 UTC (permalink / raw)
  To: linux-arm-kernel

* Andrew Lunn <andrew@lunn.ch> [2016-01-10 16:38]:
> Please can you try the following patch. If this works, i can add it to
> mainline. The issue we might run into is that somebody else wants
> serial not MMC....

This works fine on the OpenRD-Base (together with Aaro's patch), as
tested by Rick Thomas.

Reported-by: Rick Thomas <rbthomas@pobox.com>
Tested-by: Rick Thomas <rbthomas@pobox.com>
Reviewed-by: Martin Michlmayr <tbm@cyrius.com>

>        Andrew
> 
> diff --git a/arch/arm/boot/dts/kirkwood-openrd-base.dts b/arch/arm/boot/dts/kirkwood-openrd-base.dts
> index 8af58999606d..883bd416ba0b 100644
> --- a/arch/arm/boot/dts/kirkwood-openrd-base.dts
> +++ b/arch/arm/boot/dts/kirkwood-openrd-base.dts
> @@ -18,11 +18,6 @@
>  / {
>         model = "OpenRD Base";
>         compatible = "marvell,openrd-base", "marvell,openrd", "marvell,kirkwood-88f6281", "marvell,kirkwood";
> -
> -       ocp at f1000000 {
> -               serial at 12100 {
> -                       status = "okay";
> -               };
>         };
>  };

-- 
Martin Michlmayr
http://www.cyrius.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* mvsdio not working on OpenRD
  2016-01-15 22:00       ` Aaro Koskinen
@ 2016-01-17 23:05         ` Martin Michlmayr
  0 siblings, 0 replies; 8+ messages in thread
From: Martin Michlmayr @ 2016-01-17 23:05 UTC (permalink / raw)
  To: linux-arm-kernel

* Aaro Koskinen <aaro.koskinen@iki.fi> [2016-01-16 00:00]:
> BTW, the GPIO hogging binding used in the patch might not be
> supported by the old Debian 3.16 kernel. :-(

We don't actually care about 3.16.  Debian's 3.16 uses the board file
anyway, so none of these bugs show up.  (However, 3.16 is often a good
way to test since it has support both for board file and DTB.)

-- 
Martin Michlmayr
http://www.cyrius.com/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-01-17 23:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-10  4:26 mvsdio not working on OpenRD Martin Michlmayr
2016-01-10 15:38 ` Andrew Lunn
2016-01-10 21:19   ` Rick Thomas
2016-01-15 18:03   ` Aaro Koskinen
2016-01-15 19:22     ` Martin Michlmayr
2016-01-15 22:00       ` Aaro Koskinen
2016-01-17 23:05         ` Martin Michlmayr
2016-01-17 22:42   ` Martin Michlmayr

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.