public inbox for linux-amlogic@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Enable the Amlogic Meson SDIO MMC controller
@ 2017-10-07 16:29 Martin Blumenstingl
  2017-10-07 16:29 ` [PATCH 1/2] ARM: dts: meson: add the " Martin Blumenstingl
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Martin Blumenstingl @ 2017-10-07 16:29 UTC (permalink / raw)
  To: linus-amlogic

Now that the SDIO MMC driver is queued for v4.15 we need to prepare
our platform so boards can actually use this driver.
This adds the Meson SDIO MMC controller to the .dts files and
enables the corresponding driver in the multi_v7_defconfig.

Below is an example to enable the SD card using "port 1" of
the SDIO MMC controller.
cd-gpios, cd-inverted and vmmc-supply need to be configured
based on the board design (as well as the "reg" property
if the SD card is not connected to the MMC controller's slot
called "port 0").

&sdio {
	status = "okay";

	pinctrl-0 = <&sd_b_pins>;
	pinctrl-names = "default";

	/* SD card */
	sd_card_slot: slot at 1 {
		compatible = "mmc-slot";
		reg = <1>;
		status = "okay";

		bus-width = <4>;
		no-sdio;
		cap-mmc-highspeed;
		cap-sd-highspeed;
		disable-wp;

		cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
		cd-inverted;

		vmmc-supply = <&vcc_3v3>;
	};
};


Martin Blumenstingl (2):
  ARM: dts: meson: add the SDIO MMC controller
  ARM: multi_v7_defconfig: enable the Meson MX SDIO/MMC controller

 arch/arm/boot/dts/meson.dtsi        | 9 +++++++++
 arch/arm/boot/dts/meson8.dtsi       | 6 ++++++
 arch/arm/boot/dts/meson8b.dtsi      | 6 ++++++
 arch/arm/configs/multi_v7_defconfig | 1 +
 4 files changed, 22 insertions(+)

-- 
2.14.2

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

* [PATCH 1/2] ARM: dts: meson: add the SDIO MMC controller
  2017-10-07 16:29 [PATCH 0/2] Enable the Amlogic Meson SDIO MMC controller Martin Blumenstingl
@ 2017-10-07 16:29 ` Martin Blumenstingl
  2017-10-07 16:29 ` [PATCH 2/2] ARM: multi_v7_defconfig: enable the Meson MX SDIO/MMC controller Martin Blumenstingl
  2017-10-12  0:20 ` [PATCH 0/2] Enable the Amlogic Meson SDIO MMC controller Kevin Hilman
  2 siblings, 0 replies; 5+ messages in thread
From: Martin Blumenstingl @ 2017-10-07 16:29 UTC (permalink / raw)
  To: linus-amlogic

Meson6, Meson8 and Meson8b are using the same MMC controller IP. This
adds the MMC controller node to meson.dtsi so it can be used by all
SoCs.

The controller itself is a bit special, because it has multiple slots.
Each slot is accessed through a sub-node of the controller. However,
currently the driver for this hardware only supports one slot.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 arch/arm/boot/dts/meson.dtsi   | 9 +++++++++
 arch/arm/boot/dts/meson8.dtsi  | 6 ++++++
 arch/arm/boot/dts/meson8b.dtsi | 6 ++++++
 3 files changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/meson.dtsi b/arch/arm/boot/dts/meson.dtsi
index 7ae30e780506..290a183e87c5 100644
--- a/arch/arm/boot/dts/meson.dtsi
+++ b/arch/arm/boot/dts/meson.dtsi
@@ -165,6 +165,15 @@
 				status = "disabled";
 			};
 
+			sdio: mmc at 8c20 {
+				compatible = "amlogic,meson-mx-sdio";
+				reg = <0x8c20 0x20>;
+				interrupts = <GIC_SPI 28 IRQ_TYPE_EDGE_RISING>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+				status = "disabled";
+			};
+
 			spifc: spi at 8c80 {
 				compatible = "amlogic,meson6-spifc";
 				reg = <0x8c80 0x80>;
diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi
index ada26f8116a8..e6abcc7a1084 100644
--- a/arch/arm/boot/dts/meson8.dtsi
+++ b/arch/arm/boot/dts/meson8.dtsi
@@ -299,6 +299,12 @@
 	clock-names = "clkin", "core", "sana";
 };
 
+&sdio {
+	compatible = "amlogic,meson8-sdio", "amlogic,meson-mx-sdio";
+	clocks = <&clkc CLKID_SDIO>, <&clkc CLKID_CLK81>;
+	clock-names = "core", "clkin";
+};
+
 &spifc {
 	clocks = <&clkc CLKID_CLK81>;
 };
diff --git a/arch/arm/boot/dts/meson8b.dtsi b/arch/arm/boot/dts/meson8b.dtsi
index bc4d4a237ea5..283c68c6b1f4 100644
--- a/arch/arm/boot/dts/meson8b.dtsi
+++ b/arch/arm/boot/dts/meson8b.dtsi
@@ -207,6 +207,12 @@
 	clock-names = "clkin", "core", "sana";
 };
 
+&sdio {
+	compatible = "amlogic,meson8b-sdio", "amlogic,meson-mx-sdio";
+	clocks = <&clkc CLKID_SDIO>, <&clkc CLKID_CLK81>;
+	clock-names = "core", "clkin";
+};
+
 &uart_AO {
 	clocks = <&clkc CLKID_CLK81>;
 };
-- 
2.14.2

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

* [PATCH 2/2] ARM: multi_v7_defconfig: enable the Meson MX SDIO/MMC controller
  2017-10-07 16:29 [PATCH 0/2] Enable the Amlogic Meson SDIO MMC controller Martin Blumenstingl
  2017-10-07 16:29 ` [PATCH 1/2] ARM: dts: meson: add the " Martin Blumenstingl
@ 2017-10-07 16:29 ` Martin Blumenstingl
  2017-10-12  0:20 ` [PATCH 0/2] Enable the Amlogic Meson SDIO MMC controller Kevin Hilman
  2 siblings, 0 replies; 5+ messages in thread
From: Martin Blumenstingl @ 2017-10-07 16:29 UTC (permalink / raw)
  To: linus-amlogic

This enables the new Amlogic Meson MX SDIO/MMC controller driver, which
typically connects to the SD card and SDIO wifi module.
The driver is enabled as built-in to allow booting from the SD card.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 arch/arm/configs/multi_v7_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/configs/multi_v7_defconfig b/arch/arm/configs/multi_v7_defconfig
index 0cacdbf84a71..339f67463816 100644
--- a/arch/arm/configs/multi_v7_defconfig
+++ b/arch/arm/configs/multi_v7_defconfig
@@ -727,6 +727,7 @@ CONFIG_MMC_OMAP=y
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MMC_ATMELMCI=y
 CONFIG_MMC_SDHCI_MSM=y
+CONFIG_MMC_MESON_MX_SDIO=y
 CONFIG_MMC_MVSDIO=y
 CONFIG_MMC_SDHI=y
 CONFIG_MMC_DW=y
-- 
2.14.2

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

* [PATCH 0/2] Enable the Amlogic Meson SDIO MMC controller
  2017-10-07 16:29 [PATCH 0/2] Enable the Amlogic Meson SDIO MMC controller Martin Blumenstingl
  2017-10-07 16:29 ` [PATCH 1/2] ARM: dts: meson: add the " Martin Blumenstingl
  2017-10-07 16:29 ` [PATCH 2/2] ARM: multi_v7_defconfig: enable the Meson MX SDIO/MMC controller Martin Blumenstingl
@ 2017-10-12  0:20 ` Kevin Hilman
  2017-10-12 20:50   ` Martin Blumenstingl
  2 siblings, 1 reply; 5+ messages in thread
From: Kevin Hilman @ 2017-10-12  0:20 UTC (permalink / raw)
  To: linus-amlogic

Martin Blumenstingl <martin.blumenstingl@googlemail.com> writes:

> Now that the SDIO MMC driver is queued for v4.15 we need to prepare
> our platform so boards can actually use this driver.
> This adds the Meson SDIO MMC controller to the .dts files and
> enables the corresponding driver in the multi_v7_defconfig.

Just curious... were you able to test this on any meson8 platform?

[...]

> Martin Blumenstingl (2):
>   ARM: dts: meson: add the SDIO MMC controller

Applied to v4.15/dt

>   ARM: multi_v7_defconfig: enable the Meson MX SDIO/MMC controller

Applied to v4.15/defconfig

Thanks!

Kevin

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

* [PATCH 0/2] Enable the Amlogic Meson SDIO MMC controller
  2017-10-12  0:20 ` [PATCH 0/2] Enable the Amlogic Meson SDIO MMC controller Kevin Hilman
@ 2017-10-12 20:50   ` Martin Blumenstingl
  0 siblings, 0 replies; 5+ messages in thread
From: Martin Blumenstingl @ 2017-10-12 20:50 UTC (permalink / raw)
  To: linus-amlogic

Hi Kevin,

On Thu, Oct 12, 2017 at 2:20 AM, Kevin Hilman <khilman@baylibre.com> wrote:
> Martin Blumenstingl <martin.blumenstingl@googlemail.com> writes:
>
>> Now that the SDIO MMC driver is queued for v4.15 we need to prepare
>> our platform so boards can actually use this driver.
>> This adds the Meson SDIO MMC controller to the .dts files and
>> enables the corresponding driver in the multi_v7_defconfig.
>
> Just curious... were you able to test this on any meson8 platform?
I have two 32-bit Meson boards:
- Meson8m2 (S812) based Akaso M8S
- Meson8b based Endless Mini EC-100

I do not have any Meson8 (S805) based board, however I believe that
there aren't many differences between Meson8 and Meson8m2 in terms of
"peripherals" (they share the same mach-meson8 directory in Amlogic's
kernel sources).

most of my tests were done my Meson8m2 board, however I also did a
quick test on the EC-100 some time ago.

> [...]
>
>> Martin Blumenstingl (2):
>>   ARM: dts: meson: add the SDIO MMC controller
>
> Applied to v4.15/dt
>
>>   ARM: multi_v7_defconfig: enable the Meson MX SDIO/MMC controller
>
> Applied to v4.15/defconfig
Thank you!

> Thanks!
>
> Kevin


Martin

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

end of thread, other threads:[~2017-10-12 20:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-07 16:29 [PATCH 0/2] Enable the Amlogic Meson SDIO MMC controller Martin Blumenstingl
2017-10-07 16:29 ` [PATCH 1/2] ARM: dts: meson: add the " Martin Blumenstingl
2017-10-07 16:29 ` [PATCH 2/2] ARM: multi_v7_defconfig: enable the Meson MX SDIO/MMC controller Martin Blumenstingl
2017-10-12  0:20 ` [PATCH 0/2] Enable the Amlogic Meson SDIO MMC controller Kevin Hilman
2017-10-12 20:50   ` Martin Blumenstingl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox