Skip to contentSkip to conversation

Next round of DT enablement for ux500/Snowball

PATCH Superseded Lee Jones 7 participants 31 messages Apr 5, 2012 – May 14, 2012

Subsystems (7)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Lee Jones

author
#0 lore raw

cover Next round of DT enablement for ux500/Snowball

This patch-set lays some simple foundations which will ease the DT enablement process for future one-by-one device enablement. Then we have a second stab at enabling DT for mmci. Only this time keeping it simple and continuing to use current DMA initialisation code. We'll change that once the generic bindings for DMA have been mainlined. Finally we enable Snowball's GPIO controller.

 .../devicetree/bindings/gpio/gpio-nmk.txt          |   29 ++++++++++
 Documentation/devicetree/bindings/mmc/mmci.txt     |   19 +++++++
 arch/arm/boot/dts/db8500.dtsi                      |   18 ++++++
 arch/arm/boot/dts/snowball.dts                     |   39 +++++++++----
 arch/arm/mach-ux500/board-mop500-sdi.c             |    4 +-
 arch/arm/mach-ux500/board-mop500.c                 |   35 +++++++++++--
 arch/arm/mach-ux500/board-mop500.h                 |    4 ++
 arch/arm/mach-ux500/cpu-db8500.c                   |   22 ++++++++
 arch/arm/mach-ux500/include/mach/setup.h           |    3 +
 drivers/gpio/gpio-nomadik.c                        |   41 +++++++++++++-
 drivers/mmc/host/mmci.c                            |   58 ++++++++++++++++++--
 11 files changed, 247 insertions(+), 25 deletions(-)
author
#1 lore raw

PATCH 1/7 ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement

During Device Tree enablement it is necessary to remove snowball_<device>* platform_data segments one at at time, as and when particular devices are DT enabled. This patch provides a temporary solution. Once this new struct is empty it will be removed again.

---
 arch/arm/mach-ux500/board-mop500.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
arch/arm/mach-ux500/board-mop500.c +16 -2
index 77d03c1..29e0ade 100644
@@ -609,6 +609,13 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
 	&ab8500_device,
 };
 
+static struct platform_device *snowball_of_platform_devs[] __initdata = {
+	&snowball_led_dev,
+	&snowball_key_dev,
+	&snowball_sbnet_dev,
+	&ab8500_device,
+};
+
 static void __init mop500_init_machine(void)
 {
 	struct device *parent = NULL;
@@ -786,8 +793,15 @@ static void __init u8500_init_machine(void)
 		mop500_sdi_init(parent);
 	} else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
 		snowball_pins_init();
-		platform_add_devices(snowball_platform_devs,
-				ARRAY_SIZE(snowball_platform_devs));
+
+		/* Devices to be DT:ed:
+		     snowball_led_dev   = todo
+		     snowball_key_dev   = todo
+		     snowball_sbnet_dev = todo
+		     ab8500_device      = todo
+		*/
+		platform_add_devices(snowball_of_platform_devs,
+				ARRAY_SIZE(snowball_of_platform_devs));
 
 		snowball_sdi_init(parent);
 	} else if (of_machine_is_compatible("st-ericsson,hrefv60+")) {
Signature · 1 line
1.7.9.1
#2 lore raw

PATCH 1/7 ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement

Quoted 7 lines · Lee Jones

During Device Tree enablement it is necessary to remove snowball_<device>* platform_data segments one at at time, as and when particular devices are DT enabled. This patch provides a temporary solution. Once this new struct is empty it will be removed again.

This is not exactly elegant and I cannot quite see how the pieces fit together.

Quoted 9 lines

---
?arch/arm/mach-ux500/board-mop500.c | ? 18 ++++++++++++++++-- ?1 files changed, 16 insertions(+), 2 deletions(-)

arch/arm/mach-ux500/board-mop500.c +0 -0
index 77d03c1..29e0ade 100644

arch/arm/mach-ux500/board-mop500.c static struct platform_device *snowball_platform_devs[] __initdata = { · line 617

Quoted 9 lines
arch/arm/mach-ux500/board-mop500.c +6 -0
@@ -609,6 +609,13 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
 ? ? ? ?&ab8500_device,
 ?};
 
+static struct platform_device *snowball_of_platform_devs[] __initdata = {
+ ? ? ? &snowball_led_dev,
+ ? ? ? &snowball_key_dev,
+ ? ? ? &snowball_sbnet_dev,
+ ? ? ? &ab8500_device,
+};

So above this array is an identical array which is going to become unused, then why
not just rename the other array with _of_ or just skip the whole business altogether?

arch/arm/mach-ux500/board-mop500.c static void __init u8500_init_machine(void) · line 790

Quoted 10 lines
arch/arm/mach-ux500/board-mop500.c +1 -2
+
 ?static void __init mop500_init_machine(void)
 ?{
 ? ? ? ?struct device *parent = NULL;
@@ -786,8 +793,15 @@ static void __init u8500_init_machine(void)
 ? ? ? ? ? ? ? ?mop500_sdi_init(parent);
 ? ? ? ?} else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
 ? ? ? ? ? ? ? ?snowball_pins_init();
- ? ? ? ? ? ? ? platform_add_devices(snowball_platform_devs,
- ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ARRAY_SIZE(snowball_platform_devs));

So first you remove ths use of that array...

arch/arm/mach-ux500/board-mop500.c static void __init u8500_init_machine(void) · line 802

Quoted 7 lines
arch/arm/mach-ux500/board-mop500.c +7 -0
+
+ ? ? ? ? ? ? ? /* Devices to be DT:ed:
+ ? ? ? ? ? ? ? ? ? ?snowball_led_dev ? = todo
+ ? ? ? ? ? ? ? ? ? ?snowball_key_dev ? = todo
+ ? ? ? ? ? ? ? ? ? ?snowball_sbnet_dev = todo
+ ? ? ? ? ? ? ? ? ? ?ab8500_device ? ? ?= todo
+ ? ? ? ? ? ? ? */

/*
* Comment style
*/

arch/arm/mach-ux500/board-mop500.c static void __init u8500_init_machine(void) · line 804

Quoted 2 lines
arch/arm/mach-ux500/board-mop500.c +2 -0
+ ? ? ? ? ? ? ? platform_add_devices(snowball_of_platform_devs,
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ARRAY_SIZE(snowball_of_platform_devs));

And insert an identical array?

The only change is that you now have an *unused* array with all it's parents set and then an array with all parents set to NULL which you use. I don't get it ...

Yours,
Linus Walleij

author
#3 lore raw

PATCH 1/7 ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement

Quoted 25 lines · Linus Walleij
Quoted 7 lines · Lee Jones

During Device Tree enablement it is necessary to remove snowball_<device>* platform_data segments one at at time, as and when particular devices are DT enabled. This patch provides a temporary solution. Once this new struct is empty it will be removed again.

This is not exactly elegant and I cannot quite see how the pieces fit together.

Quoted 12 lines
---
  arch/arm/mach-ux500/board-mop500.c |   18 ++++++++++++++++--
  1 files changed, 16 insertions(+), 2 deletions(-)
arch/arm/mach-ux500/board-mop500.c +0 -0
index 77d03c1..29e0ade 100644
@@ -609,6 +609,13 @@ static struct platform_device *snowball_platform_devs[] __initdata = {
        &ab8500_device,
  };
 
Quoted 11 lines

arch/arm/mach-ux500/board-mop500.c static struct platform_device *snowball_platform_devs[] __initdata = { · line 617

Quoted 6 lines
arch/arm/mach-ux500/board-mop500.c +6 -0
+static struct platform_device *snowball_of_platform_devs[] __initdata = {
+&snowball_led_dev,
+&snowball_key_dev,
+&snowball_sbnet_dev,
+&ab8500_device,
+};

So above this array is an identical array which is going to become unused, then why
not just rename the other array with _of_ or just skip the whole business altogether?

Eh? No, that won't help. The other array needs to be kept fully intact for non-DT boots. The idea is that each element from the DT array will be removed sequentially as they are DT enabled. For instance, I already have a patch with enables the SMSC911x chip, which also removes the &snowball_sbnet_dev entry. After that something else will be enabled and its cohort will be subsequently removed too. Only when all these devices have been DT enabled can the struct be removed.

Quoted 21 lines

arch/arm/mach-ux500/board-mop500.c static void __init u8500_init_machine(void) · line 790

Quoted 10 lines
arch/arm/mach-ux500/board-mop500.c +1 -2
+
  static void __init mop500_init_machine(void)
  {
        struct device *parent = NULL;
@@ -786,8 +793,15 @@ static void __init u8500_init_machine(void)
                mop500_sdi_init(parent);
        } else if (of_machine_is_compatible("calaosystems,snowball-a9500")) {
                snowball_pins_init();
-               platform_add_devices(snowball_platform_devs,
-                               ARRAY_SIZE(snowball_platform_devs));

So first you remove ths use of that array...

arch/arm/mach-ux500/board-mop500.c static void __init u8500_init_machine(void) · line 802

Quoted 7 lines
arch/arm/mach-ux500/board-mop500.c +7 -0
+
+               /* Devices to be DT:ed:
+                    snowball_led_dev   = todo
+                    snowball_key_dev   = todo
+                    snowball_sbnet_dev = todo
+                    ab8500_device      = todo
+               */
Quoted 3 lines

/*
* Comment style
*/

No problem, I'll fix that.

Quoted 8 lines

arch/arm/mach-ux500/board-mop500.c static void __init u8500_init_machine(void) · line 804

Quoted 2 lines
arch/arm/mach-ux500/board-mop500.c +2 -0
+               platform_add_devices(snowball_of_platform_devs,
+                               ARRAY_SIZE(snowball_of_platform_devs));

And insert an identical array?

The only change is that you now have an *unused* array with all it's parents set and then an array with all parents set to NULL which you use. I don't get it ...

Nothing is unused. When DT is disabled snowball_platform_devs will be used to add the platform devices. This is, and will remain fully populated for non-DT boots. The DT'ed version will decrease in size until the final element is removed along with the definition.

I have ran this past Arnd, who thought this was a good idea. It's only a temporary solution which well aide us in enabling devices spanned over multiple submissions, rather than attempting to enable everything in a single patch-set - which isn't going to happen.

Kind regards,
Lee

Signature · 5 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#4 lore raw

PATCH 1/7 ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement

Quoted 4 lines · Lee Jones

Nothing is unused. When DT is disabled snowball_platform_devs will be used to add the platform devices. This is, and will remain fully populated for non-DT boots. The DT'ed version will decrease in size until the final element is removed along with the definition.

OK then..

Quoted 4 lines

I have ran this past Arnd, who thought this was a good idea. It's only a temporary solution which well aide us in enabling devices spanned over multiple submissions, rather than attempting to enable everything in a single patch-set - which isn't going to happen.

Sure so let's say that I add this patch immediately before the first patch removing atleast *one* of the entries, because until then it is certainly not needed.

Yours,
Linus Walleij

author
#5 lore raw

PATCH 1/7 ARM: ux500: New DT:ed snowball_platform_devs for one-by-one device enablement

Quoted 9 lines · Linus Walleij
Quoted 4 lines · Lee Jones

Nothing is unused. When DT is disabled snowball_platform_devs will be used to add the platform devices. This is, and will remain fully populated for non-DT boots. The DT'ed version will decrease in size until the final element is removed along with the definition.

OK then..

Quoted 8 lines
Quoted 4 lines

I have ran this past Arnd, who thought this was a good idea. It's only a temporary solution which well aide us in enabling devices spanned over multiple submissions, rather than attempting to enable everything in a single patch-set - which isn't going to happen.

Sure so let's say that I add this patch immediately before the first patch removing atleast *one* of the entries, because until then it is certainly not needed.

Sounds sensible, thanks.

Kind regards,
Lee

Signature · 5 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
author
#6 lore raw

PATCH 2/7 ARM: ux500: New DT:ed u8500_init_devices for one-by-one device enablement

In reply to Lee Jones

During Device Tree enablement it is necessary to remove <hw_component>_add_<device> calls one at at time, as and when particular devices are DT enabled. This patch provides a temporary solution. Once the new *of_init_devices function has been fully unpopulated it will be removed again.

---
 arch/arm/mach-ux500/board-mop500.c       |    2 +-
 arch/arm/mach-ux500/cpu-db8500.c         |   22 ++++++++++++++++++++++
 arch/arm/mach-ux500/include/mach/setup.h |    3 +++
 3 files changed, 26 insertions(+), 1 deletions(-)
arch/arm/mach-ux500/board-mop500.c +1 -1
index 29e0ade..4d4aeda 100644
@@ -772,7 +772,7 @@ static void __init u8500_init_machine(void)
 	int i2c0_devs;
 	int i;
 
-	parent = u8500_init_devices();
+	parent = u8500_of_init_devices();
 	i2c0_devs = ARRAY_SIZE(mop500_i2c0_devices);
 
 	for (i = 0; i < ARRAY_SIZE(mop500_platform_devs); i++)
arch/arm/mach-ux500/cpu-db8500.c +22 -0
index 9bd8163..c19c8b8 100644
@@ -206,3 +206,25 @@ struct device * __init u8500_init_devices(void)
 
 	return parent;
 }
+
+// TODO: Once all pieces are DT:ed, remove completely
+struct device * __init u8500_of_init_devices(void)
+{
+	struct device *parent;
+	int i;
+
+	parent = db8500_soc_device_init();
+
+	db8500_add_rtc(parent);
+	db8500_add_usb(parent, usb_db8500_rx_dma_cfg, usb_db8500_tx_dma_cfg);
+
+	platform_device_register_data(parent,
+		"cpufreq-u8500", -1, NULL, 0);
+
+	for (i = 0; i < ARRAY_SIZE(platform_devs); i++)
+		platform_devs[i]->dev.parent = parent;
+
+	platform_add_devices(platform_devs, ARRAY_SIZE(platform_devs));
+
+	return parent;
+}
arch/arm/mach-ux500/include/mach/setup.h +3 -0
index 3dc00ff..a792c2a 100644
@@ -21,6 +21,9 @@ extern void __init u8500_map_io(void);
 extern struct device * __init u5500_init_devices(void);
 extern struct device * __init u8500_init_devices(void);
 
+// TODO: Once all pieces are DT:ed, remove completely
+extern struct device * __init u8500_of_init_devices(void);
+
 extern void __init ux500_init_irq(void);
 
 extern void __init u5500_sdi_init(struct device *parent);
Signature · 1 line
1.7.9.1
#7 lore raw

PATCH 2/7 ARM: ux500: New DT:ed u8500_init_devices for one-by-one device enablement

Quoted 1 line · Lee Jones

+// TODO: Once all pieces are DT:ed, remove completely

/* Comment style, no C99 comments in the kernel */

Quoted 1 line

+// TODO: Once all pieces are DT:ed, remove completely

Dito.

arch/arm/mach-ux500/include/mach/setup.h extern void __init u8500_map_io(void); · line 26

Quoted 2 lines
arch/arm/mach-ux500/include/mach/setup.h +2 -0
+extern struct device * __init u8500_of_init_devices(void);
+

No cheating with external, add it to the header file instead.

Yours,
Linus Walleij

author
#8 lore raw

PATCH 3/7 drivers/gpio: gpio-nomadik: Apply Device Tree bindings

In reply to Lee Jones
---
 arch/arm/boot/dts/db8500.dtsi      |   18 +++++++++++++++
 arch/arm/boot/dts/snowball.dts     |   10 ++++----
 arch/arm/mach-ux500/board-mop500.c |   12 ++++++++++
 drivers/gpio/gpio-nomadik.c        |   41 +++++++++++++++++++++++++++++++++--
 4 files changed, 73 insertions(+), 8 deletions(-)
arch/arm/boot/dts/db8500.dtsi +18 -0
index d73dce6..b8591fa 100644
@@ -61,6 +61,8 @@
 			interrupts = <0 119 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <0>;
 		};
 
 		gpio1: gpio at 8012e080 {
@@ -70,6 +72,8 @@
 			interrupts = <0 120 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <1>;
 		};
 
 		gpio2: gpio at 8000e000 {
@@ -79,6 +83,8 @@
 			interrupts = <0 121 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <2>;
 		};
 
 		gpio3: gpio at 8000e080 {
@@ -88,6 +94,8 @@
 			interrupts = <0 122 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <3>;
 		};
 
 		gpio4: gpio at 8000e100 {
@@ -97,6 +105,8 @@
 			interrupts = <0 123 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <4>;
 		};
 
 		gpio5: gpio at 8000e180 {
@@ -106,6 +116,8 @@
 			interrupts = <0 124 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <5>;
 		};
 
 		gpio6: gpio at 8011e000 {
@@ -115,6 +127,8 @@
 			interrupts = <0 125 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <6>;
 		};
 
 		gpio7: gpio at 8011e080 {
@@ -124,6 +138,8 @@
 			interrupts = <0 126 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <7>;
 		};
 
 		gpio8: gpio at a03fe000 {
@@ -133,6 +149,8 @@
 			interrupts = <0 127 0x4>;
 			supports-sleepmode;
 			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-bank = <8>;
 		};
 
 		usb at a03e0000 {
arch/arm/boot/dts/snowball.dts +5 -5
index 359c6d6..738959d 100644
@@ -30,35 +30,35 @@
 			wakeup = <1>;
 			linux,code = <2>;
 			label = "userpb";
-			gpios = <&gpio1 0>;
+			gpios = <&gpio1 0 0>;
 		};
 		button at 2 {
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <3>;
 			label = "userpb";
-			gpios = <&gpio4 23>;
+			gpios = <&gpio4 23 0>;
 		};
 		button at 3 {
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <4>;
 			label = "userpb";
-			gpios = <&gpio4 23>;
+			gpios = <&gpio4 24 0>;
 		};
 		button at 4 {
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <5>;
 			label = "userpb";
-			gpios = <&gpio5 1>;
+			gpios = <&gpio5 1 0>;
 		};
 		button at 5 {
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <6>;
 			label = "userpb";
-			gpios = <&gpio5 2>;
+			gpios = <&gpio5 2 0>;
 		};
 	};
 
arch/arm/mach-ux500/board-mop500.c +12 -0
index 4d4aeda..a47d6bd 100644
@@ -753,10 +753,22 @@ MACHINE_END
 #ifdef CONFIG_MACH_UX500_DT
 
 struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
+	/* Requires DMA and call-back bindings. */
 	OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", &uart0_plat),
 	OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", &uart1_plat),
 	OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat),
+	/* Requires DMA bindings. */
 	OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0",  &ssp0_plat),
+	/* Requires clock name bindings. */
+	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
+	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
+	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8000e000, "gpio.2", NULL),
+	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8000e080, "gpio.3", NULL),
+	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8000e100, "gpio.4", NULL),
+	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8000e180, "gpio.5", NULL),
+	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8011e000, "gpio.6", NULL),
+	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8011e080, "gpio.7", NULL),
+	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0xa03fe000, "gpio.8", NULL),
 	{},
 };
 
drivers/gpio/gpio-nomadik.c +38 -3

89 lines not on this page · raw message

Signature · 1 line
1.7.9.1
#9 lore raw

PATCH 3/7 drivers/gpio: gpio-nomadik: Apply Device Tree bindings

Quoted 10 lines · Lee Jones

+ ? ? ? /* Requires clock name bindings. */
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8000e000, "gpio.2", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8000e080, "gpio.3", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8000e100, "gpio.4", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8000e180, "gpio.5", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8011e000, "gpio.6", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8011e080, "gpio.7", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0xa03fe000, "gpio.8", NULL),

Needs updating to use the st,foo prefix I guess.

Please use the defined block offset addresses from <mach/db8500-regs.h> U8500_GPIO0_BASE etc. instead of hardcoded values.

Yours,
Linus Walleij

#10 lore raw

PATCH 3/7 drivers/gpio: gpio-nomadik: Apply Device Tree bindings

Quoted 13 lines · Linus Walleij
Quoted 10 lines · Lee Jones

+ ? ? ? /* Requires clock name bindings. */
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8000e000, "gpio.2", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8000e080, "gpio.3", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8000e100, "gpio.4", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8000e180, "gpio.5", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8011e000, "gpio.6", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8011e080, "gpio.7", NULL),
+ ? ? ? OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0xa03fe000, "gpio.8", NULL),

Quoted 4 lines

Needs updating to use the st,foo prefix I guess.

Please use the defined block offset addresses from <mach/db8500-regs.h> U8500_GPIO0_BASE etc. instead of hardcoded values.

On second thought ignore that last thing. We already have the explicit address in
other auxdata and the goal is to get rid of the register file anyway.

Yours,
Linus Walleij

author
#11 lore raw

PATCH 4/7 drivers/gpio: gpio-nomadik: Provide documentation for Device Tree bindings

In reply to Lee Jones

Add required documentation for specific gpio-nomadik DT bindings.

---
 .../devicetree/bindings/gpio/gpio-nmk.txt          |   29 ++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-nmk.txt
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +29 -0
new file mode 100644
index 0000000..1555029
@@ -0,0 +1,29 @@
+Nomadik GPIO controller
+
+Required properties:
+- compatible           : Should be "stmicroelectronics,nomadik-gpio".
+- reg                  : Physical base address and length of the controller's registers.
+- interrupts           : The interrupt outputs from the controller.
+- #gpio-cells          : Should be two:
+                           The first cell is the pin number.
+                           The second cell is used to specify optional parameters:
+                             - bits[3:0] trigger type and level flags:
+                                 1 = low-to-high edge triggered.
+                                 2 = high-to-low edge triggered.
+                                 4 = active high level-sensitive.
+                                 8 = active low level-sensitive.
+- gpio-controller      : Marks the device node as a GPIO controller.
+- supports-sleepmode   : Specifies whether controller can sleep or not
+- gpio-bank            : Specifies which bank a controller owns.
+
+Example:
+
+                gpio1: gpio at 8012e080 {
+                        compatible = "stmicroelectronics,nomadik-gpio";
+                        reg =  <0x8012e080 0x80>;
+                        interrupts = <0 120 0x4>;
+                        #gpio-cells = <2>;
+                        gpio-controller;
+                        supports-sleepmode;
+                        gpio-bank = <1>;
+                };
Signature · 1 line
1.7.9.1
#12 lore raw

PATCH 4/7 drivers/gpio: gpio-nomadik: Provide documentation for Device Tree bindings

Quoted 14 lines · Lee Jones

Add required documentation for specific gpio-nomadik DT bindings.

---
 .../devicetree/bindings/gpio/gpio-nmk.txt          |   29 ++++++++++++++++++++
 1 files changed, 29 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/gpio/gpio-nmk.txt
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +0 -0
new file mode 100644
index 0000000..1555029

Documentation/devicetree/bindings/gpio/gpio-nmk.txt line 4

Quoted 4 lines
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +4 -0
@@ -0,0 +1,29 @@
+Nomadik GPIO controller
+
+Required properties:
+- compatible           : Should be "stmicroelectronics,nomadik-gpio".

"stmicroelectronics," is a really long prefix. You can use simply "st," here since it has already been defined and documented in Documentation/devicetree/bindings/vendor-prefixes.txt

Documentation/devicetree/bindings/gpio/gpio-nmk.txt line 14

Quoted 10 lines
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +10 -0
+- reg                  : Physical base address and length of the controller's registers.
+- interrupts           : The interrupt outputs from the controller.
+- #gpio-cells          : Should be two:
+                           The first cell is the pin number.
+                           The second cell is used to specify optional parameters:
+                             - bits[3:0] trigger type and level flags:
+                                 1 = low-to-high edge triggered.
+                                 2 = high-to-low edge triggered.
+                                 4 = active high level-sensitive.
+                                 8 = active low level-sensitive.

Those look like interrupt flags, not gpio flags. If the gpio lines can be used as generic irq input lines, then this node should also declare itself as an interrupt controller.

Documentation/devicetree/bindings/gpio/gpio-nmk.txt line 16

Quoted 2 lines
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +2 -0
+- gpio-controller      : Marks the device node as a GPIO controller.
+- supports-sleepmode   : Specifies whether controller can sleep or not

Typically, custom properites that are for a specific device should be prefixed with the manufacturer name. So, something like:
"st,has-sleepmode".

Documentation/devicetree/bindings/gpio/gpio-nmk.txt line 17

Quoted 1 line
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +1 -0
+- gpio-bank            : Specifies which bank a controller owns.

What is this for (how is it used)? It shouldn't be needed to specify a bank number.

Quoted 15 lines
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +12 -0
+
+Example:
+
+                gpio1: gpio at 8012e080 {
+                        compatible = "stmicroelectronics,nomadik-gpio";
+                        reg =  <0x8012e080 0x80>;
+                        interrupts = <0 120 0x4>;
+                        #gpio-cells = <2>;
+                        gpio-controller;
+                        supports-sleepmode;
+                        gpio-bank = <1>;
+                };
Signature · 1 line
1.7.9.1
Signature · 2 lines
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies,Ltd.
author
#13 lore raw

PATCH 4/7 drivers/gpio: gpio-nomadik: Provide documentation for Device Tree bindings

Quoted 9 lines · Grant Likely
Quoted 8 lines · Lee Jones

Add required documentation for specific gpio-nomadik DT bindings.

---
  .../devicetree/bindings/gpio/gpio-nmk.txt          |   29 ++++++++++++++++++++
  1 files changed, 29 insertions(+), 0 deletions(-)

create mode 100644 Documentation/devicetree/bindings/gpio/gpio-nmk.txt

Quoted 14 lines

Documentation/devicetree/bindings/gpio/gpio-nmk.txt line 4

Quoted 10 lines
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +4 -0
new file mode 100644
index 0000000..1555029
@@ -0,0 +1,29 @@
+Nomadik GPIO controller
+
+Required properties:
+- compatible           : Should be "stmicroelectronics,nomadik-gpio".

"stmicroelectronics," is a really long prefix. You can use simply "st," here since it has already been defined and documented in Documentation/devicetree/bindings/vendor-prefixes.txt

Absolutely.

Quoted 11 lines

Documentation/devicetree/bindings/gpio/gpio-nmk.txt line 14

Quoted 10 lines
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +10 -0
+- reg                  : Physical base address and length of the controller's registers.
+- interrupts           : The interrupt outputs from the controller.
+- #gpio-cells          : Should be two:
+                           The first cell is the pin number.
+                           The second cell is used to specify optional parameters:
+                             - bits[3:0] trigger type and level flags:
+                                 1 = low-to-high edge triggered.
+                                 2 = high-to-low edge triggered.
+                                 4 = active high level-sensitive.
+                                 8 = active low level-sensitive.
Quoted 3 lines

Those look like interrupt flags, not gpio flags. If the gpio lines can be used as generic irq input lines, then this node should also declare itself as an interrupt controller.

They can and it will do in an up-coming patch.

Quoted 6 lines

Documentation/devicetree/bindings/gpio/gpio-nmk.txt line 16

Quoted 2 lines
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +2 -0
+- gpio-controller      : Marks the device node as a GPIO controller.
+- supports-sleepmode   : Specifies whether controller can sleep or not

Typically, custom properites that are for a specific device should be prefixed with the manufacturer name. So, something like:
"st,has-sleepmode".

No problem.

Quoted 4 lines

Documentation/devicetree/bindings/gpio/gpio-nmk.txt line 17

Quoted 1 line
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +1 -0
+- gpio-bank            : Specifies which bank a controller owns.

What is this for (how is it used)? It shouldn't be needed to specify a bank number.

Briefly, it is used like this:

of_property_read_u32(np, "gpio-bank", &bank); chip->base = bank * NMK_GPIO_PER_CHIP; nmk_chip->bank = bank;

Is that wrong? If so, is there a better way to do it?

Thanks Grant.

Kind regards,
Lee

Quoted 16 lines
Quoted 15 lines
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +12 -1
+
+Example:
+
+                gpio1: gpio at 8012e080 {
+                        compatible = "stmicroelectronics,nomadik-gpio";
+                        reg =<0x8012e080 0x80>;
+                        interrupts =<0 120 0x4>;
+                        #gpio-cells =<2>;
+                        gpio-controller;
+                        supports-sleepmode;
+                        gpio-bank =<1>;
+                };
--

1.7.9.1

Signature · 5 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#14 lore raw

PATCH 4/7 drivers/gpio: gpio-nomadik: Provide documentation for Device Tree bindings

Quoted 58 lines · Lee Jones
Quoted 9 lines · Grant Likely
Quoted 8 lines · Lee Jones

Add required documentation for specific gpio-nomadik DT bindings.

---
  .../devicetree/bindings/gpio/gpio-nmk.txt          |   29 ++++++++++++++++++++
  1 files changed, 29 insertions(+), 0 deletions(-)

create mode 100644 Documentation/devicetree/bindings/gpio/gpio-nmk.txt

Quoted 14 lines

Documentation/devicetree/bindings/gpio/gpio-nmk.txt line 4

Quoted 10 lines
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +4 -0
new file mode 100644
index 0000000..1555029
@@ -0,0 +1,29 @@
+Nomadik GPIO controller
+
+Required properties:
+- compatible           : Should be "stmicroelectronics,nomadik-gpio".

"stmicroelectronics," is a really long prefix. You can use simply "st," here since it has already been defined and documented in Documentation/devicetree/bindings/vendor-prefixes.txt

Absolutely.

Quoted 11 lines

Documentation/devicetree/bindings/gpio/gpio-nmk.txt line 14

Quoted 10 lines
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +10 -0
+- reg                  : Physical base address and length of the controller's registers.
+- interrupts           : The interrupt outputs from the controller.
+- #gpio-cells          : Should be two:
+                           The first cell is the pin number.
+                           The second cell is used to specify optional parameters:
+                             - bits[3:0] trigger type and level flags:
+                                 1 = low-to-high edge triggered.
+                                 2 = high-to-low edge triggered.
+                                 4 = active high level-sensitive.
+                                 8 = active low level-sensitive.
Quoted 3 lines

Those look like interrupt flags, not gpio flags. If the gpio lines can be used as generic irq input lines, then this node should also declare itself as an interrupt controller.

They can and it will do in an up-coming patch.

Quoted 6 lines

Documentation/devicetree/bindings/gpio/gpio-nmk.txt line 16

Quoted 2 lines
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +2 -0
+- gpio-controller      : Marks the device node as a GPIO controller.
+- supports-sleepmode   : Specifies whether controller can sleep or not

Typically, custom properites that are for a specific device should be prefixed with the manufacturer name. So, something like:
"st,has-sleepmode".

No problem.

Quoted 4 lines

Documentation/devicetree/bindings/gpio/gpio-nmk.txt line 17

Quoted 1 line
Documentation/devicetree/bindings/gpio/gpio-nmk.txt new file +1 -0
+- gpio-bank            : Specifies which bank a controller owns.

What is this for (how is it used)? It shouldn't be needed to specify a bank number.

Quoted 7 lines

Briefly, it is used like this:

of_property_read_u32(np, "gpio-bank", &bank);
chip->base = bank * NMK_GPIO_PER_CHIP;
nmk_chip->bank = bank;

Is that wrong? If so, is there a better way to do it?

(sorry for the late reply on this, I've been tied up with other stuff. I know you've posted updated patches, but I haven't looked at them yet. This answer may be obsolete by now, but I'm sending it anyway for background).

It's not strictly wrong, but it looks a lot like the "cell-index" pattern which is appropriate sometimes, but always comes under scrutiny first. It makes me wonder what the driver needs it for. ie. Are the banks all part of a single GPIO device? If they are really independent, the the bank number should be irrelevant because the base address identifies how to control the device. Or, is there a shared resource that needs the bank number to access correctly?

If they a single device then a better binding might be a single node with #gpio-cells = <3> with the first cell specifying a bank and the second specifying the gpio number. Or if the GPIOs appear in a flat number space, then you could use the exact same numbering as found in the user-manual for the chip.

g.

#15 lore raw

PATCH 4/7 drivers/gpio: gpio-nomadik: Provide documentation for Device Tree bindings

Quoted 1 line · Grant Likely

Are the banks all part of a single GPIO device?

No. The banks are individual pieces of silicon instance, so they each have separate reset and clock lines for example.

Apart from that I just vaguely grasp what you're discussing here :-)

Yours,
Linus Walleij

#16 lore raw

PATCH 4/7 drivers/gpio: gpio-nomadik: Provide documentation for Device Tree bindings

Quoted 8 lines · Linus Walleij
Quoted 1 line · Grant Likely

Are the banks all part of a single GPIO device?

No. The banks are individual pieces of silicon instance, so they each have separate reset and clock lines for example.

Apart from that I just vaguely grasp what you're discussing here :-)

Don't worry about it. After reading further, it looks okay.

g.

author
#17 lore raw

PATCH 4/7 drivers/gpio: gpio-nomadik: Provide documentation for Device Tree bindings

Quoted 11 lines · Grant Likely
Quoted 8 lines · Linus Walleij
Quoted 1 line · Grant Likely

Are the banks all part of a single GPIO device?

No. The banks are individual pieces of silicon instance, so they each have separate reset and clock lines for example.

Apart from that I just vaguely grasp what you're discussing here :-)

Don't worry about it. After reading further, it looks okay.

Great. Thanks for checking Grant.

Kind regards,
Lee

Signature · 5 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
author
#18 lore raw

PATCH 5/7 ARM: ux500: Rename gpio_keys in the Device Tree file

In reply to Lee Jones

Ensure each button is individually identifiable by using their correct unique given device names.

---
 arch/arm/boot/dts/snowball.dts |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/snowball.dts +4 -4
index 738959d..0cec47b 100644
@@ -36,28 +36,28 @@
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <3>;
-			label = "userpb";
+			label = "extkb1";
 			gpios = <&gpio4 23 0>;
 		};
 		button at 3 {
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <4>;
-			label = "userpb";
+			label = "extkb2";
 			gpios = <&gpio4 24 0>;
 		};
 		button at 4 {
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <5>;
-			label = "userpb";
+			label = "extkb3";
 			gpios = <&gpio5 1 0>;
 		};
 		button at 5 {
 			debounce_interval = <50>;
 			wakeup = <1>;
 			linux,code = <6>;
-			label = "userpb";
+			label = "extkb4";
 			gpios = <&gpio5 2 0>;
 		};
 	};
Signature · 1 line
1.7.9.1
author
#20 lore raw

PATCH 6/7 MMC: mmci: Enable Device Tree support for ux500 variants

In reply to Lee Jones

Provide a means to collect attributes specific to ST-Ericsson's ux500 variant series. This patch registers itself as the AMBA driver to be called during the probe process. Once all attributes and ux500 specifics are are collected the normal mmci core probe is called.

---
 arch/arm/boot/dts/snowball.dts         |   21 ++++++++++--
 arch/arm/mach-ux500/board-mop500-sdi.c |    4 +-
 arch/arm/mach-ux500/board-mop500.c     |    3 +-
 arch/arm/mach-ux500/board-mop500.h     |    4 ++
 drivers/mmc/host/mmci.c                |   58 +++++++++++++++++++++++++++++--
 5 files changed, 80 insertions(+), 10 deletions(-)
arch/arm/boot/dts/snowball.dts +18 -3
index 0cec47b..8e2a609 100644
@@ -87,13 +87,28 @@
 			};
 		};
 
+		// External Micro SD slot
 		sdi at 80126000 {
-			status = "enabled";
-			cd-gpios = <&gpio6 26>;
+			arm,primecell-periphid = <0x10480180>;
+			clock-frequency = <50000000>;
+			bus-width = <8>;
+			mmc-cap-mmc-highspeed;
+
+			#gpio-cells = <1>;
+			cd-gpios  = <&gpio6 26>; // 218
+			cd-inverted;
+
+			status = "okay";
 		};
 
+		// On-board eMMC
 		sdi at 80114000 {
-			status = "enabled";
+			arm,primecell-periphid = <0x10480180>;
+		        clock-frequency = <50000000>;
+			bus-width = <8>;
+			mmc-cap-mmc-highspeed;
+
+			status = "okay";
 		};
 
 		uart at 80120000 {
arch/arm/mach-ux500/board-mop500-sdi.c +2 -2
index 920251c..18ff781 100644
@@ -80,7 +80,7 @@ static struct stedma40_chan_cfg mop500_sdi0_dma_cfg_tx = {
 };
 #endif
 
-static struct mmci_platform_data mop500_sdi0_data = {
+struct mmci_platform_data mop500_sdi0_data = {
 	.ios_handler	= mop500_sdi0_ios_handler,
 	.ocr_mask	= MMC_VDD_29_30,
 	.f_max		= 50000000,
@@ -227,7 +227,7 @@ static struct stedma40_chan_cfg mop500_sdi4_dma_cfg_tx = {
 };
 #endif
 
-static struct mmci_platform_data mop500_sdi4_data = {
+struct mmci_platform_data mop500_sdi4_data = {
 	.ocr_mask	= MMC_VDD_29_30,
 	.f_max		= 50000000,
 	.capabilities	= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
arch/arm/mach-ux500/board-mop500.c +2 -1
index a47d6bd..d2c3a5c 100644
@@ -759,6 +759,8 @@ struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", &uart2_plat),
 	/* Requires DMA bindings. */
 	OF_DEV_AUXDATA("arm,pl022", 0x80002000, "ssp0",  &ssp0_plat),
+	OF_DEV_AUXDATA("arm,pl18x", 0x80126000, "sdi0",  &mop500_sdi0_data),
+	OF_DEV_AUXDATA("arm,pl18x", 0x80114000, "sdi4",  &mop500_sdi4_data),
 	/* Requires clock name bindings. */
 	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8012e000, "gpio.0", NULL),
 	OF_DEV_AUXDATA("stmicroelectronics,nomadik-gpio", 0x8012e080, "gpio.1", NULL),
@@ -815,7 +817,6 @@ static void __init u8500_init_machine(void)
 		platform_add_devices(snowball_of_platform_devs,
 				ARRAY_SIZE(snowball_of_platform_devs));
 
-		snowball_sdi_init(parent);
 	} else if (of_machine_is_compatible("st-ericsson,hrefv60+")) {
 		/*
 		 * The HREFv60 board removed a GPIO expander and routed
arch/arm/mach-ux500/board-mop500.h +4 -0
index fdcfa87..384baf7 100644
@@ -7,6 +7,8 @@
 #ifndef __BOARD_MOP500_H
 #define __BOARD_MOP500_H
 
+#include <linux/amba/mmci.h>
+
 /* Snowball specific GPIO assignments, this board has no GPIO expander */
 #define SNOWBALL_ACCEL_INT1_GPIO	163
 #define SNOWBALL_ACCEL_INT2_GPIO	164
@@ -74,6 +76,8 @@
 #define SNOWBALL_EN_3V3_ETH_GPIO	MOP500_AB8500_PIN_GPIO(26)	/* GPIO26 */
 
 struct i2c_board_info;
+extern struct mmci_platform_data mop500_sdi0_data;
+extern struct mmci_platform_data mop500_sdi4_data;
 
 extern void mop500_sdi_init(struct device *parent);
 extern void snowball_sdi_init(struct device *parent);
drivers/mmc/host/mmci.c +54 -4

81 lines not on this page · raw message

Signature · 1 line
1.7.9.1
#21 lore raw

PATCH 6/7 MMC: mmci: Enable Device Tree support for ux500 variants

drivers/mmc/host/mmci.c static const struct mmc_host_ops mmci_ops = { · line 1221

Quoted 3 lines · Lee Jones
drivers/mmc/host/mmci.c +3 -0
+	of_property_read_u32(np, "clock-frequency", &pdata->f_max);
+	if (!pdata->f_max)
+		pr_warn("%s has no 'clock-frequency' property\n", np->full_name);

To be anal about this (which is what we should be about DT bindings) this is not a 'clock frequency' but a maximum clock frequency for the bus. Or to put it another way, a clock frequency limit.

A 'clock-frequency' property suggests (at least to me) that it's specifying the rate of the MCLK signal, which is not what it's doing.

author
#22 lore raw

PATCH 6/7 MMC: mmci: Enable Device Tree support for ux500 variants

Quoted 11 lines · Russell King - ARM Linux

drivers/mmc/host/mmci.c static const struct mmc_host_ops mmci_ops = { · line 1221

Quoted 3 lines · Lee Jones
drivers/mmc/host/mmci.c +3 -0
+	of_property_read_u32(np, "clock-frequency",&pdata->f_max);
+	if (!pdata->f_max)
+		pr_warn("%s has no 'clock-frequency' property\n", np->full_name);

To be anal about this (which is what we should be about DT bindings) this is not a 'clock frequency' but a maximum clock frequency for the bus. Or to put it another way, a clock frequency limit.

A 'clock-frequency' property suggests (at least to me) that it's specifying the rate of the MCLK signal, which is not what it's doing.

Sounds sensible.

I initially had it as 'f-max', but was told to change it to 'clock-frequency'. I'm happy to take other suggestions however.

Kind regards,
Lee

Signature · 5 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#23 lore raw

PATCH 6/7 MMC: mmci: Enable Device Tree support for ux500 variants

Quoted 10 lines · Lee Jones
Quoted 9 lines · Russell King - ARM Linux

drivers/mmc/host/mmci.c static const struct mmc_host_ops mmci_ops = { · line 1221

Quoted 3 lines · Lee Jones
drivers/mmc/host/mmci.c +3 -0
+	of_property_read_u32(np, "clock-frequency",&pdata->f_max);
+	if (!pdata->f_max)
+		pr_warn("%s has no 'clock-frequency' property\n", np->full_name);

To be anal about this (which is what we should be about DT bindings) this is not a 'clock frequency' but a maximum clock frequency for the bus. Or to put it another way, a clock frequency limit.

Quoted 7 lines
Quoted 2 lines

A 'clock-frequency' property suggests (at least to me) that it's specifying the rate of the MCLK signal, which is not what it's doing.

Sounds sensible.

I initially had it as 'f-max', but was told to change it to 'clock-frequency'. I'm happy to take other suggestions however.

Yes, "clock-frequency" already has established usage as an exact clock specification. If it is a maximum as you say then something like "max-frequency" makes more sense.

Someone was working on a common MMC DT binding. Really all of the MMC drivers should use the same binding for the common bits.

g.

#24 lore raw

PATCH 6/7 MMC: mmci: Enable Device Tree support for ux500 variants

Quoted 6 lines · Grant Likely

Yes, "clock-frequency" already has established usage as an exact clock specification. If it is a maximum as you say then something like "max-frequency" makes more sense.

Someone was working on a common MMC DT binding. Really all of the MMC drivers should use the same binding for the common bits.

Agreed.

Should we use max-frequency or clock-frequency for sdhci though? It looks like this is both the maximum frequency that it can use and the base frequency that the actual clock rate is derived from (can be a fraction).

Arnd

#25 lore raw

PATCH 6/7 MMC: mmci: Enable Device Tree support for ux500 variants

Hi,

Quoted 5 lines · Arnd Bergmann

Agreed.

Should we use max-frequency or clock-frequency for sdhci though? It looks like this is both the maximum frequency that it can use and the base frequency that the actual clock rate is derived from (can be a fraction).

This is ultimately setting the "f_max" ("maximum operating frequency") field in the MMC core, so I'm happy naming the property "max-frequency".

It's true that this doesn't explain the derivation to clock rate -- but we weren't doing that before the DT binding either, and I think that having a discrepancy between the DT property and the core's naming would lead to confusion/mistakes.

Thanks,

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
author
#26 lore raw

PATCH 7/7 MMC: mmci: Add required documentation for Device Tree bindings

In reply to Lee Jones

This provides full documentation detailing each compulsory, optional and device (variant) specific properties available for use within the MMCI Device Tree.

---
 Documentation/devicetree/bindings/mmc/mmci.txt |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mmc/mmci.txt
Documentation/devicetree/bindings/mmc/mmci.txt new file +19 -0
new file mode 100644
index 0000000..16502a2
@@ -0,0 +1,19 @@
+* ARM PrimeCell MultiMedia Card Interface (MMCI) PL180/1
+
+The ARM PrimeCell MMCI PL180 and PL181 provides and interface for
+reading and writing to MultiMedia and SD cards alike.
+
+Required properties:
+- compatible             : contains "arm,pl18x", "arm,primecell".
+- reg                    : contains pl18x registers and length.
+- interrupts             : contains the device IRQ(s).
+- arm,primecell-periphid : contains the PrimeCell Peripheral ID.
+
+Optional properties:
+- wp-gpios               : contains any write protect (ro) gpios
+- cd-gpios               : contains any card detection gpios
+- cd-inverted            : indicates whether the cd gpio is inverted
+- clock-frequency        : contains the maximum operating frequency
+- bus-width              : Number of data lines, can be <1>, <4>, or <8>
+- mmc-cap-mmc-highspeed  : indicates whether MMC is high speed capable
+- mmc-cap-sd-highspeed   : indicates whether SD is high speed capable
Signature · 1 line
1.7.9.1
#28 lore raw

PATCH 7/7 MMC: mmci: Add required documentation for Device Tree bindings

Hi Arnd,

Quoted 8 lines · Arnd Bergmann
Quoted 5 lines · Lee Jones

This provides full documentation detailing each compulsory, optional and device (variant) specific properties available for use within the MMCI Device Tree.

Did you really mean to ack this version or the newer one, with "max-frequency" instead of "clock-frequency"?

Pawe?

author
#29 lore raw

PATCH 7/7 MMC: mmci: Add required documentation for Device Tree bindings

Quoted 8 lines · Pawel Moll

Hi Arnd,

Quoted 5 lines · Arnd Bergmann
Quoted 4 lines · Lee Jones

This provides full documentation detailing each compulsory, optional and device (variant) specific properties available for use within the MMCI Device Tree.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Did you really mean to ack this version or the newer one, with "max-frequency" instead of "clock-frequency"?

He meant the newer one. :)

Signature · 5 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
M: +44 77 88 633 515
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#30 lore raw

PATCH 7/7 MMC: mmci: Add required documentation for Device Tree bindings

Quoted 9 lines · Lee Jones
Quoted 8 lines · Pawel Moll

Hi Arnd,

Quoted 5 lines · Arnd Bergmann
Quoted 4 lines · Lee Jones

This provides full documentation detailing each compulsory, optional and device (variant) specific properties available for use within the MMCI Device Tree.

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Did you really mean to ack this version or the newer one, with "max-frequency" instead of "clock-frequency"?

He meant the newer one. :)

Yes, of course. Sorry for the confusion.

Arnd