2013-09-12 15:42:23

by Koen Kooi

[permalink] [raw]
Subject: [PATCHv3 0/2] ARM: dts: Beaglebone MMC fixes

Here are two patches to fix MMC on beaglebone, one fixes card detect on BBW,
the other adds the eMMC entry for BBB and its fixed regulator. After that mmc1
gets a nice speed boost by moving to 4-bit mode and LED triggers get assigned.

This series depends on:

http://comments.gmane.org/gmane.linux.kernel.stable/63648
https://lkml.org/lkml/2013/9/10/454
http://comments.gmane.org/gmane.linux.kernel.mmc/22381

Or as git-cherry would put it:

[koen@rrMBP patches]$ git cherry -v
+ 53aafdbc63c9b30c23f562855c8f359c0893bc40 ARM: OMAP2+: am335x-bone*: add DT for BeagleBone Black
+ 084f262cb1058e00cf082739cf7ee93cb70761c9 ARM: EDMA: Fix clearing of unused list for DT DMA resources
+ 6080eee0ef0ee3ab235cc267a69a0a7d3673266e ARM: dts: add AM33XX EDMA support
+ 7312f68fb49202b65498865bd64680c95ec2f7ea ARM: dts: add AM33XX SPI DMA support
+ 5580c3d400cefad5a1eb3c5a8e467353e22d526e ARM: dts: add AM33XX MMC support and documentation
+ a11eddaa0a89c24d2b9768a82519ac096bb793f1 arm: bone: dts: add CD for mmc1
+ b1e87bfc52775c2666b6c4a89d409193319d33f2 am335x-boneblack: add eMMC DT entry
+ 090e095b74ba211b2cfbd2c87ae06c52d151453d ARM: am335x-bone-common: switch mmc1 to 4-bit mode
+ 39f747078f0b01724cfa94ce19fd2e6029ac0bee ARM: dts: am335x-bone-common: add cpu0 and mmc1 triggers

Also available as a git branch at https://github.com/koenkooi/linux/commits/mainline

Changes since v2:
Missing pinmux entries for eMMC added

Changes since v1:
Removed ti,non-removable entry from eMMC node, see http://marc.info/?l=linux-arm-kernel&m=137889435710552&w=2
---

Alexander Holler (1):
arm: bone: dts: add CD for mmc1

Koen Kooi (3):
am335x-boneblack: add eMMC DT entry
ARM: am335x-bone-common: switch mmc1 to 4-bit mode
ARM: dts: am335x-bone-common: add cpu0 and mmc1 triggers

arch/arm/boot/dts/am335x-bone-common.dtsi | 39 +++++++++++++++++++++++++++++++
arch/arm/boot/dts/am335x-bone.dts | 4 ----
arch/arm/boot/dts/am335x-boneblack.dts | 14 +++++++++++
3 files changed, 53 insertions(+), 4 deletions(-)

--
1.8.2.1


2013-09-12 15:42:29

by Koen Kooi

[permalink] [raw]
Subject: [PATCH 2/4] am335x-boneblack: add eMMC DT entry

The pinmux is specified in am335x-bone-common.dtsi to be reused by the eMMC cape.

Signed-off-by: Koen Kooi <[email protected]>
---

Changes since v2:
add missing pinmux entries

Changes since v1:
dropped the ti,non-removable entry per Sekhars request

arch/arm/boot/dts/am335x-bone-common.dtsi | 22 ++++++++++++++++++++++
arch/arm/boot/dts/am335x-boneblack.dts | 14 ++++++++++++++
2 files changed, 36 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
index ced256c..cfec441 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -112,6 +112,21 @@
0x160 (PIN_INPUT | MUX_MODE7) /* GPIO0_6 */
>;
};
+
+ emmc_pins: pinmux_emmc_pins {
+ pinctrl-single,pins = <
+ 0x80 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk, INPUT_PULLUP | MODE2 */
+ 0x84 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_csn2.mmc1_cmd, INPUT_PULLUP | MODE2 */
+ 0x00 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0, INPUT_PULLUP | MODE1 */
+ 0x04 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1, INPUT_PULLUP | MODE1 */
+ 0x08 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2, INPUT_PULLUP | MODE1 */
+ 0x0c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3, INPUT_PULLUP | MODE1 */
+ 0x10 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad4.mmc1_dat4, INPUT_PULLUP | MODE1 */
+ 0x14 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad5.mmc1_dat5, INPUT_PULLUP | MODE1 */
+ 0x18 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad6.mmc1_dat6, INPUT_PULLUP | MODE1 */
+ 0x1c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7, INPUT_PULLUP | MODE1 */
+ >;
+ };
};

ocp {
@@ -241,6 +256,13 @@
regulator-always-on;
};
};
+
+ vmmcsd_fixed: fixedregulator@0 {
+ compatible = "regulator-fixed";
+ regulator-name = "vmmcsd_fixed";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ };
};

&cpsw_emac0 {
diff --git a/arch/arm/boot/dts/am335x-boneblack.dts b/arch/arm/boot/dts/am335x-boneblack.dts
index 197cadf..f4703cf 100644
--- a/arch/arm/boot/dts/am335x-boneblack.dts
+++ b/arch/arm/boot/dts/am335x-boneblack.dts
@@ -15,3 +15,17 @@
regulator-max-microvolt = <1800000>;
regulator-always-on;
};
+
+&mmc1 {
+ vmmc-supply = <&vmmcsd_fixed>;
+};
+
+&mmc2 {
+ vmmc-supply = <&vmmcsd_fixed>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&emmc_pins>;
+ bus-width = <8>;
+ status = "okay";
+ ti,vcc-aux-disable-is-sleep;
+};
+
--
1.8.2.1

2013-09-12 15:42:52

by Koen Kooi

[permalink] [raw]
Subject: [PATCH 4/4] ARM: dts: am335x-bone-common: add cpu0 and mmc1 triggers

This matches the vendor 3.8.x configuration that is shipping with the boards.

The LED layout is now:

USR0: heartbeat
USR1: mmc0 (micro-SD slot)
USR2: cpu0
USR3: mmc1 (eMMC)

The cpu0 triggers was put inbetween the mmc triggers to make is easier to see
where the disk activity is.

Signed-off-by: Koen Kooi <[email protected]>
---
arch/arm/boot/dts/am335x-bone-common.dtsi | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
index 80407ff..3057f30 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -203,12 +203,14 @@
led@4 {
label = "beaglebone:green:usr2";
gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "cpu0";
default-state = "off";
};

led@5 {
label = "beaglebone:green:usr3";
gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;
+ linux,default-trigger = "mmc1";
default-state = "off";
};
};
--
1.8.2.1

2013-09-12 15:43:37

by Koen Kooi

[permalink] [raw]
Subject: [PATCH 1/4] arm: bone: dts: add CD for mmc1

From: Alexander Holler <[email protected]>

This enables the use of MMC cards even when no card was inserted at boot.

Signed-off-by: Alexander Holler <[email protected]>
Signed-off-by: Koen Kooi <[email protected]>
---

Changes since v2:
None, again a simple repost

Changes since v1:
None, simple repost

arch/arm/boot/dts/am335x-bone-common.dtsi | 14 ++++++++++++++
arch/arm/boot/dts/am335x-bone.dts | 4 ----
2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
index 2f66ded..ced256c 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -107,6 +107,11 @@
0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
>;
};
+ mmc1_pins: pinmux_mmc1_pins {
+ pinctrl-single,pins = <
+ 0x160 (PIN_INPUT | MUX_MODE7) /* GPIO0_6 */
+ >;
+ };
};

ocp {
@@ -260,3 +265,12 @@
pinctrl-0 = <&davinci_mdio_default>;
pinctrl-1 = <&davinci_mdio_sleep>;
};
+
+&mmc1 {
+ status = "okay";
+ vmmc-supply = <&ldo3_reg>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc1_pins>;
+ cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
+ cd-inverted;
+};
diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
index d5f43fe..d34469c 100644
--- a/arch/arm/boot/dts/am335x-bone.dts
+++ b/arch/arm/boot/dts/am335x-bone.dts
@@ -16,7 +16,3 @@
regulator-always-on;
};

-&mmc1 {
- status = "okay";
- vmmc-supply = <&ldo3_reg>;
-};
--
1.8.2.1

2013-09-12 15:43:35

by Koen Kooi

[permalink] [raw]
Subject: [PATCH 3/4] ARM: am335x-bone-common: switch mmc1 to 4-bit mode

The micro-SD slot hooks up all four data pins so lets' use them.

Signed-off-by: Koen Kooi <[email protected]>
---
arch/arm/boot/dts/am335x-bone-common.dtsi | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
index cfec441..80407ff 100644
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
@@ -290,6 +290,7 @@

&mmc1 {
status = "okay";
+ bus-width = <0x4>;
vmmc-supply = <&ldo3_reg>;
pinctrl-names = "default";
pinctrl-0 = <&mmc1_pins>;
--
1.8.2.1

2013-09-12 16:16:49

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH 1/4] arm: bone: dts: add CD for mmc1

nitpick minor comment:
$subject: ARM: dts: am335x-bone: add card detect for mmc1

btw, please use V3 in $subject next time. --subject-prefix "PATCH V3"
when generating patch should do the job.

On 09/12/2013 10:42 AM, Koen Kooi wrote:
> From: Alexander Holler <[email protected]>
>
> This enables the use of MMC cards even when no card was inserted at boot.
>
> Signed-off-by: Alexander Holler <[email protected]>
> Signed-off-by: Koen Kooi <[email protected]>
> ---
>
> Changes since v2:
> None, again a simple repost
>
> Changes since v1:
> None, simple repost
>
> arch/arm/boot/dts/am335x-bone-common.dtsi | 14 ++++++++++++++
> arch/arm/boot/dts/am335x-bone.dts | 4 ----
> 2 files changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
> index 2f66ded..ced256c 100644
> --- a/arch/arm/boot/dts/am335x-bone-common.dtsi
> +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
> @@ -107,6 +107,11 @@
> 0x14c (PIN_INPUT_PULLDOWN | MUX_MODE7)
> >;
> };

An EOL here would be nice to separate the nodes.

> + mmc1_pins: pinmux_mmc1_pins {
> + pinctrl-single,pins = <
> + 0x160 (PIN_INPUT | MUX_MODE7) /* GPIO0_6 */
> + >;
> + };
> };
>
> ocp {
> @@ -260,3 +265,12 @@
> pinctrl-0 = <&davinci_mdio_default>;
> pinctrl-1 = <&davinci_mdio_sleep>;
> };
> +
> +&mmc1 {
> + status = "okay";
> + vmmc-supply = <&ldo3_reg>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&mmc1_pins>;
> + cd-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
> + cd-inverted;
> +};
> diff --git a/arch/arm/boot/dts/am335x-bone.dts b/arch/arm/boot/dts/am335x-bone.dts
> index d5f43fe..d34469c 100644
> --- a/arch/arm/boot/dts/am335x-bone.dts
> +++ b/arch/arm/boot/dts/am335x-bone.dts
> @@ -16,7 +16,3 @@
> regulator-always-on;
> };
>
> -&mmc1 {
> - status = "okay";
> - vmmc-supply = <&ldo3_reg>;
> -};
>


--
Regards,
Nishanth Menon

2013-09-12 16:19:09

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH 2/4] am335x-boneblack: add eMMC DT entry

Nitpick minor comment:
$subject:
ARM: dts: am335x-boneblack: add eMMC DT entry

On 09/12/2013 10:42 AM, Koen Kooi wrote:
> The pinmux is specified in am335x-bone-common.dtsi to be reused by the eMMC cape.
>
Also might want to state that vmmcsd_fixed 3.3 voltage rail is present
in BeagleBone White and Black, however used for emmc in bone-black.

> Signed-off-by: Koen Kooi <[email protected]>
> ---
>
> Changes since v2:
> add missing pinmux entries
>
> Changes since v1:
> dropped the ti,non-removable entry per Sekhars request
>
> arch/arm/boot/dts/am335x-bone-common.dtsi | 22 ++++++++++++++++++++++
> arch/arm/boot/dts/am335x-boneblack.dts | 14 ++++++++++++++
> 2 files changed, 36 insertions(+)
>
> diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
> index ced256c..cfec441 100644
> --- a/arch/arm/boot/dts/am335x-bone-common.dtsi
> +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
> @@ -112,6 +112,21 @@
> 0x160 (PIN_INPUT | MUX_MODE7) /* GPIO0_6 */
> >;
> };
> +
> + emmc_pins: pinmux_emmc_pins {
> + pinctrl-single,pins = <
> + 0x80 (PIN_INPUT_PULLUP | MUX_MODE2) /* gpmc_csn1.mmc1_clk, INPUT_PULLUP | MODE2 */
> + 0x84 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_csn2.mmc1_cmd, INPUT_PULLUP | MODE2 */
> + 0x00 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad0.mmc1_dat0, INPUT_PULLUP | MODE1 */
> + 0x04 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad1.mmc1_dat1, INPUT_PULLUP | MODE1 */
> + 0x08 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad2.mmc1_dat2, INPUT_PULLUP | MODE1 */
> + 0x0c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad3.mmc1_dat3, INPUT_PULLUP | MODE1 */
> + 0x10 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad4.mmc1_dat4, INPUT_PULLUP | MODE1 */
> + 0x14 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad5.mmc1_dat5, INPUT_PULLUP | MODE1 */
> + 0x18 (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad6.mmc1_dat6, INPUT_PULLUP | MODE1 */
> + 0x1c (PIN_INPUT_PULLUP | MUX_MODE1) /* gpmc_ad7.mmc1_dat7, INPUT_PULLUP | MODE1 */
> + >;
> + };
> };
>
> ocp {
> @@ -241,6 +256,13 @@
> regulator-always-on;
> };
> };
> +
> + vmmcsd_fixed: fixedregulator@0 {
> + compatible = "regulator-fixed";
> + regulator-name = "vmmcsd_fixed";
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3300000>;
> + };
> };
>
> &cpsw_emac0 {
> diff --git a/arch/arm/boot/dts/am335x-boneblack.dts b/arch/arm/boot/dts/am335x-boneblack.dts
> index 197cadf..f4703cf 100644
> --- a/arch/arm/boot/dts/am335x-boneblack.dts
> +++ b/arch/arm/boot/dts/am335x-boneblack.dts
> @@ -15,3 +15,17 @@
> regulator-max-microvolt = <1800000>;
> regulator-always-on;
> };
> +
> +&mmc1 {
> + vmmc-supply = <&vmmcsd_fixed>;
> +};
> +
> +&mmc2 {
> + vmmc-supply = <&vmmcsd_fixed>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&emmc_pins>;
> + bus-width = <8>;
> + status = "okay";
> + ti,vcc-aux-disable-is-sleep;
> +};
> +
>


--
Regards,
Nishanth Menon

2013-09-12 16:19:48

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH 3/4] ARM: am335x-bone-common: switch mmc1 to 4-bit mode

nitpick minor comment:
$subject: ARM: dts: am335x-bone-common: switch mmc1 to 4-bit mode

On 09/12/2013 10:42 AM, Koen Kooi wrote:
> The micro-SD slot hooks up all four data pins so lets' use them.
>
> Signed-off-by: Koen Kooi <[email protected]>
> ---
> arch/arm/boot/dts/am335x-bone-common.dtsi | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
> index cfec441..80407ff 100644
> --- a/arch/arm/boot/dts/am335x-bone-common.dtsi
> +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
> @@ -290,6 +290,7 @@
>
> &mmc1 {
> status = "okay";
> + bus-width = <0x4>;
> vmmc-supply = <&ldo3_reg>;
> pinctrl-names = "default";
> pinctrl-0 = <&mmc1_pins>;
>


--
Regards,
Nishanth Menon

2013-09-12 16:20:34

by Nishanth Menon

[permalink] [raw]
Subject: Re: [PATCH 4/4] ARM: dts: am335x-bone-common: add cpu0 and mmc1 triggers

On 09/12/2013 10:42 AM, Koen Kooi wrote:
> This matches the vendor 3.8.x configuration that is shipping with the boards.
>
> The LED layout is now:
>
> USR0: heartbeat
> USR1: mmc0 (micro-SD slot)
> USR2: cpu0
> USR3: mmc1 (eMMC)
>
> The cpu0 triggers was put inbetween the mmc triggers to make is easier to see
nitpick: sinbetween/in between/

> where the disk activity is.
>
> Signed-off-by: Koen Kooi <[email protected]>
> ---
> arch/arm/boot/dts/am335x-bone-common.dtsi | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi
> index 80407ff..3057f30 100644
> --- a/arch/arm/boot/dts/am335x-bone-common.dtsi
> +++ b/arch/arm/boot/dts/am335x-bone-common.dtsi
> @@ -203,12 +203,14 @@
> led@4 {
> label = "beaglebone:green:usr2";
> gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
> + linux,default-trigger = "cpu0";
> default-state = "off";
> };
>
> led@5 {
> label = "beaglebone:green:usr3";
> gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;
> + linux,default-trigger = "mmc1";
> default-state = "off";
> };
> };
>


--
Regards,
Nishanth Menon