Skip to contentSkip to conversation

mvsdio not working on OpenRD

DISCUSSION Martin Michlmayr 4 participants 8 messages Jan 10, 2016 – Jan 17, 2016 Device tree bindings

lore
Share & tools
lore
#0 lore raw

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]

Signature · 2 lines
Martin Michlmayr
http://www.cyrius.com/
#1 lore raw
Quoted 10 lines · Martin Michlmayr

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

Quoted 12 lines

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]

Signature · 2 lines
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

arch/arm/boot/dts/kirkwood-openrd-base.dts +0 -5
index 8af58999606d..883bd416ba0b 100644
@@ -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";
-               };
        };
 };
#2 lore raw
Quoted 59 lines · Andrew Lunn
Quoted 10 lines · Martin Michlmayr

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

Quoted 12 lines

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]

Signature · 2 lines
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

arch/arm/boot/dts/kirkwood-openrd-base.dts +0 -0
index 8af58999606d..883bd416ba0b 100644

arch/arm/boot/dts/kirkwood-openrd-base.dts line 22

Quoted 10 lines
arch/arm/boot/dts/kirkwood-openrd-base.dts +0 -5
@@ -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

#3 lore raw
In reply to Andrew Lunn

Hi,

Quoted 16 lines · Andrew Lunn

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";
			};
Quoted 5 lines

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
Quoted 3 lines

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.

#4 lore raw
Quoted 3 lines · Aaro Koskinen
Quoted 2 lines · Andrew Lunn

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.

Quoted 3 lines

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!

Quoted 2 lines

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.

Signature · 2 lines
Martin Michlmayr
http://www.cyrius.com/
#5 lore raw

Hi,

Quoted 17 lines · Martin Michlmayr
Quoted 3 lines · Aaro Koskinen
Quoted 2 lines · Andrew Lunn

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.

Quoted 8 lines

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

Quoted 3 lines

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.

author Tested-by Rick Thomas Reviewed-by
#7 lore raw
In reply to Andrew Lunn
Quoted 3 lines · Andrew Lunn

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.

Quoted 17 lines

Andrew

arch/arm/boot/dts/kirkwood-openrd-base.dts +0 -5
index 8af58999606d..883bd416ba0b 100644
@@ -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";
-               };
        };
 };
Signature · 2 lines
Martin Michlmayr
http://www.cyrius.com/
#6 lore raw
In reply to Aaro Koskinen
Quoted 2 lines · Aaro Koskinen

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

Signature · 2 lines
Martin Michlmayr
http://www.cyrius.com/