atmel-mci device tree support
Subsystems (6)
v5 cover atmel-mci device tree support
From: Ludovic Desroches <[email protected]>
Hello,
I resend this set of patches because patches 2, 3 and 4 were acked by Jean-Christophe. Patch 1 was also acked by Jean-Christophe excepted for cd-inverted property since it was redundant with gpio bindings.
I thought we were agree to go ahead since it was a common binding already documented and it will concern all drivers.
Chris are you agree to take patch 1/4? Others patches may go to at91 tree, isn't it?
By the way, I have updated documentation in patch 1/4 in the same way as you did with the patch 'mmc: dt: Deduplicate binding docs by referencing mmc.txt'. I didn't remove common properties from slot part because I think it is not obvious to use these properties into the slot node.
Regards
Ludovic
v5:
- cleanup
- split dts commit: one for SOCs, one for boards
v4:
- cleanup
- add extra chips and boards for atmel-mci dt support
v3:
- use cd-inverted instead of cd-invert to follow mmc common binding.
- don't assign a pointer to pdev->dev.platform.
- add mci controller nodes to other chips and boards.
- put all dts file changes together.
v2:
- squash patch v1 2/4 and 3/4.
- change atmci_get_of_slots to atmci_of_init and manage pdata allocation into it.
- correct potential issue (e.g. having only one slot which is not slot0 into the dt) about slots by adding a reg property corresponding to the slot id.
Ludovic Desroches (4):
mmc: atmel-mci: add device tree support
ARM: at91: add clocks for DT entries
ARM: dts: add nodes for atmel hsmci controllers for atmel SOCs
ARM: dts: add nodes for atmel hsmci controllers for atmel boards
.../devicetree/bindings/mmc/atmel-hsmci.txt | 68 ++++++++++++++++ arch/arm/boot/dts/at91sam9260.dtsi | 9 ++ arch/arm/boot/dts/at91sam9263.dtsi | 18 ++++ arch/arm/boot/dts/at91sam9263ek.dts | 10 +++ arch/arm/boot/dts/at91sam9g20ek_2mmc.dts | 12 +++ arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 9 ++ arch/arm/boot/dts/at91sam9g25ek.dts | 18 ++++ arch/arm/boot/dts/at91sam9g45.dtsi | 18 ++++ arch/arm/boot/dts/at91sam9m10g45ek.dts | 19 +++++ arch/arm/boot/dts/at91sam9n12.dtsi | 9 ++ arch/arm/boot/dts/at91sam9n12ek.dts | 9 ++ arch/arm/boot/dts/at91sam9x5.dtsi | 18 ++++ arch/arm/mach-at91/at91sam9260.c | 1 + arch/arm/mach-at91/at91sam9263.c | 2 + arch/arm/mach-at91/at91sam9g45.c | 2 + arch/arm/mach-at91/at91sam9n12.c | 1 + arch/arm/mach-at91/at91sam9x5.c | 2 + drivers/mmc/host/atmel-mci.c | 85 +++++++++++++++++++- 18 files changed, 308 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/atmel-hsmci.txt
Signature · 1 line
1.7.5.4
PATCH v5 1/4 mmc: atmel-mci: add device tree support
From: Ludovic Desroches <[email protected]>
--- .../devicetree/bindings/mmc/atmel-hsmci.txt | 68 ++++++++++++++++ drivers/mmc/host/atmel-mci.c | 85 +++++++++++++++++++- 2 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/mmc/atmel-hsmci.txt
Documentation/devicetree/bindings/mmc/atmel-hsmci.txt new file +68 -0
@@ -0,0 +1,68 @@ +* Atmel High Speed MultiMedia Card Interface + +This controller on atmel products provides an interface for MMC, SD and SDIO +types of memory cards. + +This file documents differences between the core properties described +by mmc.txt and the properties used by the atmel-mci driver. + +1) MCI node + +Required properties: +- compatible: should be "atmel,hsmci" +- #address-cells: should be one. The cell is the slot id. +- #size-cells: should be zero. +- at least one slot node + +The node contains child nodes for each slot that the platform uses + +Example MCI node: + +mmc0: mmc at f0008000 { + compatible = "atmel,hsmci"; + reg = <0xf0008000 0x600>; + interrupts = <12 4>; + #address-cells = <1>; + #size-cells = <0>; + + [ child node definitions...] +}; + +2) slot nodes + +Required properties: +- reg: should contain the slot id. +- bus-width: number of data lines connected to the controller + +Optional properties: +- cd-gpios: specify GPIOs for card detection +- cd-inverted: invert the value of external card detect gpio line +- wp-gpios: specify GPIOs for write protection + +Example slot node: + +slot at 0 { + reg = <0>; + bus-width = <4>; + cd-gpios = <&pioD 15 0> + cd-inverted; +}; + +Example full MCI node: +mmc0: mmc at f0008000 { + compatible = "atmel,hsmci"; + reg = <0xf0008000 0x600>; + interrupts = <12 4>; + #address-cells = <1>; + #size-cells = <0>; + slot at 0 { + reg = <0>; + bus-width = <4>; + cd-gpios = <&pioD 15 0> + cd-inverted; + }; + slot at 1 { + reg = <1>; + bus-width = <4>; + }; +};
drivers/mmc/host/atmel-mci.c +83 -2
115 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v5 2/4 ARM: at91: add clocks for DT entries
In reply to ludovic.desroches at atmel.comFrom: Ludovic Desroches <[email protected]>
Add clocks to clock lookup table for DT entries.
--- arch/arm/mach-at91/at91sam9260.c | 1 + arch/arm/mach-at91/at91sam9263.c | 2 ++ arch/arm/mach-at91/at91sam9g45.c | 2 ++ arch/arm/mach-at91/at91sam9n12.c | 1 + arch/arm/mach-at91/at91sam9x5.c | 2 ++ 5 files changed, 8 insertions(+), 0 deletions(-)
arch/arm/mach-at91/at91sam9260.c +1 -0
@@ -226,6 +226,7 @@ static struct clk_lookup periph_clocks_lookups[] = {CLKDEV_CON_DEV_ID ("t1_clk" ,"fffdc000.timer" , &tc4_clk),CLKDEV_CON_DEV_ID ("t2_clk" ,"fffdc000.timer" , &tc5_clk),CLKDEV_CON_DEV_ID ("hclk" ,"500000.ohci" , &ohci_clk), +CLKDEV_CON_DEV_ID ("mci_clk" ,"fffa8000.mmc" , &mmc_clk),/* fake hclk clock */ CLKDEV_CON_DEV_ID ("hclk" ,"at91_ohci" , &ohci_clk), CLKDEV_CON_ID("pioA", &pioA_clk),
arch/arm/mach-at91/at91sam9263.c +2 -0
@@ -209,6 +209,8 @@ static struct clk_lookup periph_clocks_lookups[] = {CLKDEV_CON_DEV_ID ("hclk" ,"a00000.ohci" , &ohci_clk),CLKDEV_CON_DEV_ID ("spi_clk" ,"fffa4000.spi" , &spi0_clk),CLKDEV_CON_DEV_ID ("spi_clk" ,"fffa8000.spi" , &spi1_clk), +CLKDEV_CON_DEV_ID ("mci_clk" ,"fff80000.mmc" , &mmc0_clk), + CLKDEV_CON_DEV_ID("mci_clk", "fff84000.mmc", &mmc1_clk), }; static struct clk_lookup usart_clocks_lookups[] = {
arch/arm/mach-at91/at91sam9g45.c +2 -0
@@ -242,6 +242,8 @@ static struct clk_lookup periph_clocks_lookups[] = {CLKDEV_CON_DEV_ID ("t0_clk" ,"fffd4000.timer" , &tcb0_clk),CLKDEV_CON_DEV_ID ("hclk" ,"700000.ohci" , &uhphs_clk),CLKDEV_CON_DEV_ID ("ehci_clk" ,"800000.ehci" , &uhphs_clk), +CLKDEV_CON_DEV_ID ("mci_clk" ,"fff80000.mmc" , &mmc0_clk), +CLKDEV_CON_DEV_ID ("mci_clk" ,"fffd0000.mmc" , &mmc1_clk),/* fake hclk clock */ CLKDEV_CON_DEV_ID ("hclk" ,"at91_ohci" , &uhphs_clk), CLKDEV_CON_ID("pioA", &pioA_clk),
arch/arm/mach-at91/at91sam9n12.c +1 -0
@@ -168,6 +168,7 @@ static struct clk_lookup periph_clocks_lookups[] = {CLKDEV_CON_DEV_ID ("usart" ,"f8028000.serial" , &usart3_clk),CLKDEV_CON_DEV_ID ("t0_clk" ,"f8008000.timer" , &tcb_clk),CLKDEV_CON_DEV_ID ("t0_clk" ,"f800c000.timer" , &tcb_clk), +CLKDEV_CON_DEV_ID ("mci_clk" ,"f0008000.mmc" , &mmc_clk),CLKDEV_CON_DEV_ID ("dma_clk" ,"ffffec00.dma-controller" , &dma_clk),CLKDEV_CON_ID ("pioA" , &pioAB_clk), CLKDEV_CON_ID("pioB", &pioAB_clk),
arch/arm/mach-at91/at91sam9x5.c +2 -0
@@ -231,6 +231,8 @@ static struct clk_lookup periph_clocks_lookups[] = {CLKDEV_CON_DEV_ID ("t0_clk" ,"f800c000.timer" , &tcb0_clk),CLKDEV_CON_DEV_ID ("dma_clk" ,"ffffec00.dma-controller" , &dma0_clk),CLKDEV_CON_DEV_ID ("dma_clk" ,"ffffee00.dma-controller" , &dma1_clk), +CLKDEV_CON_DEV_ID ("mci_clk" ,"f0008000.mmc" , &mmc0_clk), +CLKDEV_CON_DEV_ID ("mci_clk" ,"f000c000.mmc" , &mmc1_clk),CLKDEV_CON_ID ("pioA" , &pioAB_clk),CLKDEV_CON_ID ("pioB" , &pioAB_clk), CLKDEV_CON_ID("pioC", &pioCD_clk),
Signature · 1 line
1.7.5.4
PATCH v5 3/4 ARM: dts: add nodes for atmel hsmci controllers for atmel SOCs
In reply to ludovic.desroches at atmel.comFrom: Ludovic Desroches <[email protected]>
Add mci controller nodes to atmel SOCs.
--- arch/arm/boot/dts/at91sam9260.dtsi | 9 +++++++++ arch/arm/boot/dts/at91sam9263.dtsi | 18 ++++++++++++++++++ arch/arm/boot/dts/at91sam9g45.dtsi | 18 ++++++++++++++++++ arch/arm/boot/dts/at91sam9n12.dtsi | 9 +++++++++ arch/arm/boot/dts/at91sam9x5.dtsi | 18 ++++++++++++++++++ 5 files changed, 72 insertions(+), 0 deletions(-)
arch/arm/boot/dts/at91sam9260.dtsi +9 -0
@@ -198,6 +198,15 @@ status = "disabled"; }; + mmc0: mmc at fffa8000 { + compatible = "atmel,hsmci"; + reg = <0xfffa800 0x600>; + interrupts = <9 4>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + adc0: adc at fffe0000 { compatible = "atmel,at91sam9260-adc"; reg = <0xfffe0000 0x100>;
arch/arm/boot/dts/at91sam9263.dtsi +18 -0
@@ -179,6 +179,24 @@ interrupts = <24 4>; status = "disabled"; }; + + mmc0: mmc at fff80000 { + compatible = "atmel,hsmci"; + reg = <0xfff80000 0x600>; + interrupts = <10 4>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + mmc1: mmc at fff84000 { + compatible = "atmel,hsmci"; + reg = <0xfff84000 0x600>; + interrupts = <11 4>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; }; nand0: nand at 40000000 {
arch/arm/boot/dts/at91sam9g45.dtsi +18 -0
@@ -236,6 +236,24 @@ trigger-value = <0x6>; }; }; + + mmc0: mmc at fff80000 { + compatible = "atmel,hsmci"; + reg = <0xfff80000 0x600>; + interrupts = <11 4>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + mmc1: mmc at fffd0000 { + compatible = "atmel,hsmci"; + reg = <0xfffd0000 0x600>; + interrupts = <29 4>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; }; nand0: nand at 40000000 {
arch/arm/boot/dts/at91sam9n12.dtsi +9 -0
@@ -82,6 +82,15 @@ reg = <0xfffffe10 0x10>; }; + mmc0: mmc at f0008000 { + compatible = "atmel,hsmci"; + reg = <0xf0008000 0x600>; + interrupts = <12 4>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + tcb0: timer at f8008000 { compatible = "atmel,at91sam9x5-tcb"; reg = <0xf8008000 0x100>;
arch/arm/boot/dts/at91sam9x5.dtsi +18 -0
@@ -228,6 +228,24 @@ trigger-value = <0x6>; }; }; + + mmc0: mmc at f0008000 { + compatible = "atmel,hsmci"; + reg = <0xf0008000 0x600>; + interrupts = <12 4>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; + + mmc1: mmc at f000c000 { + compatible = "atmel,hsmci"; + reg = <0xf000c000 0x600>; + interrupts = <26 4>; + status = "disabled"; + #address-cells = <1>; + #size-cells = <0>; + }; }; nand0: nand at 40000000 {
Signature · 1 line
1.7.5.4
PATCH v5 4/4 ARM: dts: add nodes for atmel hsmci controllers for atmel boards
In reply to ludovic.desroches at atmel.comFrom: Ludovic Desroches <[email protected]>
Add mci controller nodes to atmel boards.
--- arch/arm/boot/dts/at91sam9263ek.dts | 10 ++++++++++ arch/arm/boot/dts/at91sam9g20ek_2mmc.dts | 12 ++++++++++++ arch/arm/boot/dts/at91sam9g20ek_common.dtsi | 9 +++++++++ arch/arm/boot/dts/at91sam9g25ek.dts | 18 ++++++++++++++++++ arch/arm/boot/dts/at91sam9m10g45ek.dts | 19 +++++++++++++++++++ arch/arm/boot/dts/at91sam9n12ek.dts | 9 +++++++++ 6 files changed, 77 insertions(+), 0 deletions(-)
arch/arm/boot/dts/at91sam9263ek.dts +10 -0
@@ -50,6 +50,16 @@ atmel,vbus-gpio = <&pioA 25 0>; status = "okay"; }; + + mmc0: mmc at fff80000 { + status = "okay"; + slot at 0 { + reg = <0>; + bus-width = <4>; + cd-gpios = <&pioE 18 0>; + wp-gpios = <&pioE 19 0>; + }; + }; }; nand0: nand at 40000000 {
arch/arm/boot/dts/at91sam9g20ek_2mmc.dts +12 -0
@@ -12,6 +12,18 @@ model = "Atmel at91sam9g20ek 2 mmc"; compatible = "atmel,at91sam9g20ek_2mmc", "atmel,at91sam9g20", "atmel,at91sam9"; + ahb { + apb{ + mmc0: mmc at fffa8000 { + slot at 0 { + reg = <0>; + bus-width = <4>; + cd-gpios = <&pioC 2 0>; + }; + }; + }; + }; + leds { compatible = "gpio-leds";
arch/arm/boot/dts/at91sam9g20ek_common.dtsi +9 -0
@@ -51,6 +51,15 @@ atmel,vbus-gpio = <&pioC 5 0>; status = "okay"; }; + + mmc0: mmc at fffa8000 { + status = "okay"; + slot at 1 { + reg = <1>; + bus-width = <4>; + cd-gpios = <&pioC 9 0>; + }; + }; }; nand0: nand at 40000000 {
arch/arm/boot/dts/at91sam9g25ek.dts +18 -0
@@ -32,6 +32,24 @@ phy-mode = "rmii"; status = "okay"; }; + + mmc0: mmc at f0008000 { + status = "okay"; + slot at 0 { + reg = <0>; + bus-width = <4>; + cd-gpios = <&pioD 15 0>; + }; + }; + + mmc1: mmc at f000c000 { + status = "okay"; + slot at 0 { + reg = <0>; + bus-width = <4>; + cd-gpios = <&pioD 14 0>; + }; + }; }; usb0: ohci at 00600000 {
arch/arm/boot/dts/at91sam9m10g45ek.dts +19 -0
@@ -46,6 +46,25 @@ phy-mode = "rmii"; status = "okay"; }; + + mmc0: mmc at fff80000 { + status = "okay"; + slot at 0 { + reg = <0>; + bus-width = <4>; + cd-gpios = <&pioD 10 0>; + }; + }; + + mmc1: mmc at fffd0000 { + status = "okay"; + slot at 0 { + reg = <0>; + bus-width = <4>; + cd-gpios = <&pioD 11 0>; + wp-gpios = <&pioD 29 0>; + }; + }; }; nand0: nand at 40000000 {
arch/arm/boot/dts/at91sam9n12ek.dts +9 -0
@@ -37,6 +37,15 @@ dbgu: serial at fffff200 { status = "okay"; }; + + mmc0: mmc at f0008000 { + status = "okay"; + slot at 0 { + reg = <0>; + bus-width = <4>; + cd-gpios = <&pioA 7 0>; + }; + }; }; nand0: nand at 40000000 {
Signature · 1 line
1.7.5.4
v5 cover atmel-mci device tree support
In reply to ludovic.desroches at atmel.comQuoted 6 lines · ludovic.desroches at atmel.com
I resend this set of patches because patches 2, 3 and 4 were acked by Jean-Christophe. Patch 1 was also acked by Jean-Christophe excepted for cd-inverted property since it was redundant with gpio bindings.
I thought we were agree to go ahead since it was a common binding already documented and it will concern all drivers.
I just looked at the patches for the first time, but it looks all great, so
Quoted 6 lines
Chris are you agree to take patch 1/4? Others patches may go to at91 tree, isn't it?
By the way, I have updated documentation in patch 1/4 in the same way as you did with the patch 'mmc: dt: Deduplicate binding docs by referencing mmc.txt'. I didn't remove common properties from slot part because I think it is not obvious to use these properties into the slot node.
If you want to take it all through the mmc tree, that's also fine with me.
Arnd
v5 cover atmel-mci device tree support
In reply to ludovic.desroches at atmel.comHi,
Quoted 7 lines · ludovic.desroches at atmel.com
From: Ludovic Desroches <[email protected]>
Hello,
I resend this set of patches because patches 2, 3 and 4 were acked by Jean-Christophe. Patch 1 was also acked by Jean-Christophe excepted for cd-inverted property since it was redundant with gpio bindings.
In future, it's helpful for me if you can add the Acked-by lines you receive into the patches when you resend them. Thanks!
Quoted 2 lines
I thought we were agree to go ahead since it was a common binding already documented and it will concern all drivers.
Agreed. It's a documented core MMC binding, it's fine to use it.
Quoted 2 lines
Chris are you agree to take patch 1/4? Others patches may go to at91 tree, isn't it?
Yes, let's do that. I've applied patch 1/4 to mmc-next for 3.7, and you can send the others via the at91 tree with the ACK that Arnd gave.
Thanks,
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child
v5 cover atmel-mci device tree support
Le 08/08/2012 05:14 AM, Chris Ball a ?crit :
Quoted 5 lines
Hi,
Quoted 2 lines · ludovic.desroches at atmel.com
From: Ludovic Desroches <[email protected]>
Quoted 9 lines
Quoted 5 lines
Hello,
I resend this set of patches because patches 2, 3 and 4 were acked by Jean-Christophe. Patch 1 was also acked by Jean-Christophe excepted for cd-inverted property since it was redundant with gpio bindings.
In future, it's helpful for me if you can add the Acked-by lines you receive into the patches when you resend them. Thanks!
Ok.
Quoted 10 lines
Quoted 2 lines
I thought we were agree to go ahead since it was a common binding already documented and it will concern all drivers.
Agreed. It's a documented core MMC binding, it's fine to use it.
Quoted 2 lines
Chris are you agree to take patch 1/4? Others patches may go to at91 tree, isn't it?
Yes, let's do that. I've applied patch 1/4 to mmc-next for 3.7, and you can send the others via the at91 tree with the ACK that Arnd gave.
Thanks Chris.
Ludovic
Quoted 5 lines
Thanks,
- Chris.