Skip to contentSkip to conversation

ARM: ux500: Increase the size of the PRCMU's TCPM size

PATCH In review Lee Jones 2 participants 29 messages Apr 2, 2013 – Apr 24, 2013

Subsystems (5)
lore
Share & tools
lore

Lee Jones

author
#0 lore raw

PATCH 1/9 ARM: ux500: Increase the size of the PRCMU's TCPM size

The Tightly Coupled Program Memory location is actually 32kB in size, rather than the originally depicted 4kB.

---
 arch/arm/mach-ux500/devices-db8500.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-ux500/devices-db8500.c +1 -1
index f3d9419..afa5b04 100644
@@ -225,7 +225,7 @@ static struct resource db8500_prcmu_res[] = {
 	{
 		.name  = "prcmu-tcpm",
 		.start = U8500_PRCMU_TCPM_BASE,
-		.end   = U8500_PRCMU_TCPM_BASE + SZ_4K - 1,
+		.end   = U8500_PRCMU_TCPM_BASE + SZ_32K - 1,
 		.flags = IORESOURCE_MEM,
 	},
 };
Signature · 1 line
1.7.10.4
author
#1 lore raw

PATCH 2/9 ARM: ux500: Remove incorrect DB9540 PRCMU TCDM base location

The Tightly Coupled Data Memory for the DB9540 is actually in the same place as the DB8500's. This definition is just plain wrong.

---
 arch/arm/mach-ux500/include/mach/db8500-regs.h |    1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-ux500/include/mach/db8500-regs.h +0 -1
index 1530d49..856e584 100644
@@ -102,7 +102,6 @@
 #define U8500_PRCMU_BASE	(U8500_PER4_BASE + 0x07000)
 #define U9540_DMC1_BASE		(U8500_PER4_BASE + 0x0A000)
 #define U8500_PRCMU_TCDM_BASE	(U8500_PER4_BASE + 0x68000)
-#define U9540_PRCMU_TCDM_BASE	(U8500_PER4_BASE + 0x6A000)
 #define U8500_PRCMU_TCPM_BASE   (U8500_PER4_BASE + 0x60000)
 #define U8500_PRCMU_TIMER_3_BASE (U8500_PER4_BASE + 0x07338)
 #define U8500_PRCMU_TIMER_4_BASE (U8500_PER4_BASE + 0x07450)
Signature · 1 line
1.7.10.4
#2 lore raw

Re: [PATCH 2/9] ARM: ux500: Remove incorrect DB9540 PRCMU TCDM base location

Quoted 4 lines · Lee Jones

The Tightly Coupled Data Memory for the DB9540 is actually in the same place as the DB8500's. This definition is just plain wrong.

Patch applied.

Yours,
Linus Walleij

author
#3 lore raw

PATCH 3/9 ARM: ux500: Supply a DTS file for the u8540 platform

In reply to Lee Jones

This is a skeleton DTS file which only enables serial. Just using this simple file yields a terminal when booting u8540.

---
 arch/arm/boot/dts/u8540.dts |   36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 arch/arm/boot/dts/u8540.dts
arch/arm/boot/dts/u8540.dts new file +36 -0
new file mode 100644
index 0000000..02e8e1a
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2013 ST-Ericsson AB
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "dbx5x0.dtsi"
+
+/ {
+	model = "ST-Ericsson U8540 platform with Device Tree";
+	compatible = "st-ericsson,u8540";
+
+	memory {
+		reg = <0x00000000 0x20000000>;
+	};
+
+	soc-u9500 {
+		uart at 80120000 {
+			status = "okay";
+		};
+
+		uart at 80121000 {
+			status = "okay";
+		};
+
+		uart at 80007000 {
+			status = "okay";
+		};
+	};
+};
Signature · 1 line
1.7.10.4
#4 lore raw

Re: [PATCH 3/9] ARM: ux500: Supply a DTS file for the u8540 platform

Quoted 6 lines · Lee Jones

This is a skeleton DTS file which only enables serial. Just using this simple file yields a terminal when booting u8540.

---
 arch/arm/boot/dts/u8540.dts |   36 ++++++++++++++++++++++++++++++++++++

Please rename this DTS file ccu8540.dts.

Yours,
Linus Walleij

author
#5 lore raw

PATCH 1/1 ARM: ux500: Supply a DTS file for the u8540 platform

This is a skeleton DTS file which only enables serial. Just using this simple file yields a terminal when booting u8540.

---
 arch/arm/boot/dts/ccu8540.dts |   36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 arch/arm/boot/dts/ccu8540.dts
arch/arm/boot/dts/ccu8540.dts new file +36 -0
new file mode 100644
index 0000000..02e8e1a
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2013 ST-Ericsson AB
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/dts-v1/;
+/include/ "dbx5x0.dtsi"
+
+/ {
+  model = "ST-Ericsson U8540 platform with Device Tree";
+  compatible = "st-ericsson,u8540";
+
+	memory {
+	       reg = <0x00000000 0x20000000>;
+	       };
+
+	soc-u9500 {
+		  uart at 80120000 {
+					status = "okay";
+					       };
+
+		uart at 80121000 {
+				status = "okay";
+				       };
+
+		uart at 80007000 {
+				status = "okay";
+				       };
+				       };
+};
Signature · 1 line
1.7.10.4
#6 lore raw

Re: [PATCH] ARM: ux500: Supply a DTS file for the u8540 platform

Quoted 4 lines · Lee Jones

This is a skeleton DTS file which only enables serial. Just using this simple file yields a terminal when booting u8540.

I've queued this patch for v3.11.

Yours,
Linus Walleij

#7 lore raw

Re: [PATCH] ARM: ux500: Supply a DTS file for the u8540 platform

In reply to Lee Jones
Quoted 4 lines · Lee Jones

This is a skeleton DTS file which only enables serial. Just using this simple file yields a terminal when booting u8540.

Now, wait... this doesn't work.

arch/arm/boot/dts/ccu8540.dts line 21

Quoted 7 lines
arch/arm/boot/dts/ccu8540.dts new file +7 -0
+/ {
+  model = "ST-Ericsson U8540 platform with Device Tree";
+  compatible = "st-ericsson,u8540";
+
+       memory {
+              reg = <0x00000000 0x20000000>;
+              };

Funny whitespace. Use tabs ...

Quoted 1 line

+ soc-u9500 {

Please rename this not just "soc"

arch/arm/boot/dts/ccu8540.dts line 36

Quoted 13 lines
arch/arm/boot/dts/ccu8540.dts new file +13 -0
+                 uart at 80120000 {
+                                       status = "okay";
+                                              };
+
+               uart at 80121000 {
+                               status = "okay";
+                                      };
+
+               uart at 80007000 {
+                               status = "okay";
+                                      };
+                                      };
+};

The whitespace looks a bit funny compared to the old patch, what happened here?

It also has the side effect that patch 5/9 does not apply... By the way, since I already applied 4/9, please squash 5/9 into this patch to avoid problems.

Finally, please patch arch/arm/boot/dts/Makefile in the obvious way so that the DTB gets compiled.

Yours,
Linus Walleij

author
#8 lore raw

Re: [PATCH] ARM: ux500: Supply a DTS file for the u8540 platform

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

This is a skeleton DTS file which only enables serial. Just using this simple file yields a terminal when booting u8540.

Now, wait... this doesn't work.

This is very strange and not what I see in my branch.

Quoted 9 lines

arch/arm/boot/dts/ccu8540.dts line 21

Quoted 7 lines
arch/arm/boot/dts/ccu8540.dts new file +7 -0
+/ {
+  model = "ST-Ericsson U8540 platform with Device Tree";
+  compatible = "st-ericsson,u8540";
+
+       memory {
+              reg = <0x00000000 0x20000000>;
+              };

Funny whitespace. Use tabs ...

This a single tab in my branch/editor.

Quoted 3 lines
Quoted 1 line

+ soc-u9500 {

Please rename this not just "soc"

Done.

Quoted 17 lines

arch/arm/boot/dts/ccu8540.dts line 36

Quoted 13 lines
arch/arm/boot/dts/ccu8540.dts new file +13 -0
+                 uart at 80120000 {
+                                       status = "okay";
+                                              };
+
+               uart at 80121000 {
+                               status = "okay";
+                                      };
+
+               uart at 80007000 {
+                               status = "okay";
+                                      };
+                                      };
+};

The whitespace looks a bit funny compared to the old patch, what happened here?

Quoted 3 lines

It also has the side effect that patch 5/9 does not apply... By the way, since I already applied 4/9, please squash 5/9 into this patch to avoid problems.

It's quite common for issues to occur when patches are taken out-of-order. As I work with topic branches, my preference would normally be to fix issues with the patch-set as a whole until Acks are obtained for all of the patches, then either send a pull-request or to have all of the patches taken from the MLs in order.

Quoted 2 lines

Finally, please patch arch/arm/boot/dts/Makefile in the obvious way so that the DTB gets compiled.

Ah yes. Good spot.

Signature · 4 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
author
#9 lore raw

PATCH 4/9 ARM: ux500: Move Snowball's thermal DT node into existing PRCMU one

In reply to Lee Jones

When the thermal DT node was inserted a new PRCMU node was created; however, one already exists in the Snowball DTS file. Here we amalgamate the two into a single consolidated node.

---
 arch/arm/boot/dts/snowball.dts |   53 +++++++++++++++++++---------------------
 1 file changed, 25 insertions(+), 28 deletions(-)
arch/arm/boot/dts/snowball.dts +25 -28
index d3ec32f..cc99447 100644
@@ -99,33 +99,6 @@
 			status = "okay";
 		};
 
-		prcmu at 80157000 {
-			thermal at 801573c0 {
-				num-trips = <4>;
-
-				trip0-temp = <70000>;
-				trip0-type = "active";
-				trip0-cdev-num = <1>;
-				trip0-cdev-name0 = "thermal-cpufreq-0";
-
-				trip1-temp = <75000>;
-				trip1-type = "active";
-				trip1-cdev-num = <1>;
-				trip1-cdev-name0 = "thermal-cpufreq-0";
-
-				trip2-temp = <80000>;
-				trip2-type = "active";
-				trip2-cdev-num = <1>;
-				trip2-cdev-name0 = "thermal-cpufreq-0";
-
-				trip3-temp = <85000>;
-				trip3-type = "critical";
-				trip3-cdev-num = <0>;
-
-				status = "okay";
-			 };
-		};
-
 		external-bus at 50000000 {
 			status = "okay";
 
@@ -296,7 +269,31 @@
 				db8500_esram34_ret_reg: db8500_esram34_ret {
 					regulator-name = "db8500-esram34-ret";
 				};
-			};
+
+			thermal at 801573c0 {
+				num-trips = <4>;
+
+				trip0-temp = <70000>;
+				trip0-type = "active";
+				trip0-cdev-num = <1>;
+				trip0-cdev-name0 = "thermal-cpufreq-0";
+
+				trip1-temp = <75000>;
+				trip1-type = "active";
+				trip1-cdev-num = <1>;
+				trip1-cdev-name0 = "thermal-cpufreq-0";
+
+				trip2-temp = <80000>;
+				trip2-type = "active";
+				trip2-cdev-num = <1>;
+				trip2-cdev-name0 = "thermal-cpufreq-0";
+
+				trip3-temp = <85000>;
+				trip3-type = "critical";
+				trip3-cdev-num = <0>;
+
+				status = "okay";
+			 };
 
 			ab8500 {
 				ab8500-regulators {
Signature · 1 line
1.7.10.4
#10 lore raw

Re: [PATCH 4/9] ARM: ux500: Move Snowball's thermal DT node into existing PRCMU one

Quoted 5 lines · Lee Jones

When the thermal DT node was inserted a new PRCMU node was created; however, one already exists in the Snowball DTS file. Here we amalgamate the two into a single consolidated node.

Patch applied.

Thanks,
Linus Walleij

#11 lore raw

Re: [PATCH 4/9] ARM: ux500: Move Snowball's thermal DT node into existing PRCMU one

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

When the thermal DT node was inserted a new PRCMU node was created; however, one already exists in the Snowball DTS file. Here we amalgamate the two into a single consolidated node.

Patch applied.

After applying this I get this:

DTC arch/arm/boot/dts/snowball.dtb
Error: /home/elinwal/linux-stericsson/arch/arm/boot/dts/snowball.dts:351.3-352.1 syntax error
FATAL ERROR: Unable to parse input tree
make[3]: *** [arch/arm/boot/dts/snowball.dtb] Error 1
make[2]: *** [dtbs] Error 2
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/elinwal/linux-stericsson'
make: *** [build-dtbs] Error 2

Does not appear prior to applying patch.

It doesn't quiet apply cleanly either, what is this based on?

Yours,
Linus Walleij

#12 lore raw

Re: [PATCH 4/9] ARM: ux500: Move Snowball's thermal DT node into existing PRCMU one

Quoted 23 lines · Linus Walleij
Quoted 9 lines · Linus Walleij
Quoted 5 lines · Lee Jones

When the thermal DT node was inserted a new PRCMU node was created; however, one already exists in the Snowball DTS file. Here we amalgamate the two into a single consolidated node.

Patch applied.

After applying this I get this:

DTC arch/arm/boot/dts/snowball.dtb
Error: /home/elinwal/linux-stericsson/arch/arm/boot/dts/snowball.dts:351.3-352.1 syntax error
FATAL ERROR: Unable to parse input tree
make[3]: *** [arch/arm/boot/dts/snowball.dtb] Error 1
make[2]: *** [dtbs] Error 2
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/elinwal/linux-stericsson'
make: *** [build-dtbs] Error 2

Quoted 3 lines

Does not appear prior to applying patch.

It doesn't quiet apply cleanly either, what is this based on?

Hm looking closer at this there are even more problems in DT-land.

The fixes that were sent to Torvalds for -rc5, i.e. this stuff:
http://marc.info/?l=linux-arm-kernel&m=136441825019562&w=2

Will conflict with
stuff that is already in ARM SoC, i.e. this stuff:
http://marc.info/?l=linux-arm-kernel&m=136217923611845&w=2

That in turn both conflicts with this new stuff.

I will hold off any DT patches until I have some kind of baseline in ARM SoC that has e.g. merged in the RC fixes with the other device tree stuff and got it to compile.

I'll just not take any more DT stuff except for fixes until after the v3.10 merge window to cool things down. I think there will be enough trouble as it is. There is no point in keepin a finger on the fast-forward button all the time, this can surely wait for v3.11 unless someone suggests something else.

Yours,
Linus Walleij

author
#13 lore raw

Re: [PATCH 4/9] ARM: ux500: Move Snowball's thermal DT node into existing PRCMU one

In reply to Linus Walleij
Quoted 23 lines · Linus Walleij
Quoted 9 lines · Linus Walleij
Quoted 5 lines · Lee Jones

When the thermal DT node was inserted a new PRCMU node was created; however, one already exists in the Snowball DTS file. Here we amalgamate the two into a single consolidated node.

Patch applied.

After applying this I get this:

DTC arch/arm/boot/dts/snowball.dtb
Error: /home/elinwal/linux-stericsson/arch/arm/boot/dts/snowball.dts:351.3-352.1 syntax error
FATAL ERROR: Unable to parse input tree
make[3]: *** [arch/arm/boot/dts/snowball.dtb] Error 1
make[2]: *** [dtbs] Error 2
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/elinwal/linux-stericsson'
make: *** [build-dtbs] Error 2

Quoted 1 line

Does not appear prior to applying patch.

That doesn't really tell me anything.

Can you paste the hunk to which the error is referring please?

Quoted 1 line

It doesn't quiet apply cleanly either, what is this based on?

It's based on 'arm-soc/fixes', which should be appearing in Mainline rc:s any day now.

Signature · 4 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
author
#14 lore raw

PATCH 5/9 ARM: ux500: Over-ride TCDM size when booting the DB8540 platform

In reply to Lee Jones

The PRCMU's Tightly Coupled Data Memory on the DB8540 platform is 8kB larger than it's predecessor's. We need to reflect that in its Device Tree. By re-specifying the address and size of the device we effectively over-ride the previous values with more accurate ones.

---
 arch/arm/boot/dts/u8540.dts |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/u8540.dts +5 -0
index 02e8e1a..f829689 100644
@@ -21,6 +21,11 @@
 	};
 
 	soc-u9500 {
+		prcmu at 80157000 {
+			reg = <0x80157000 0x2000>, <0x801b0000 0x8000>, <0x801b8000 0x3000>;
+			reg-names = "prcmu", "prcmu-tcpm-per4", "prcmu-tcdm-per4";
+		};
+
 		uart at 80120000 {
 			status = "okay";
 		};
Signature · 1 line
1.7.10.4
#15 lore raw

Re: [PATCH 5/9] ARM: ux500: Over-ride TCDM size when booting the DB8540 platform

Quoted 7 lines · Lee Jones

The PRCMU's Tightly Coupled Data Memory on the DB8540 platform is 8kB larger than it's predecessor's. We need to reflect that in its Device Tree. By re-specifying the address and size of the device we effectively over-ride the previous values with more accurate ones.

Need to change the name of the file it hits to ccu8540 before it applies...

Yours,
Linus Walleij

author
#16 lore raw

PATCH 1/1 ARM: ux500: Over-ride TCDM size when booting the DB8540 platform

The PRCMU's Tightly Coupled Data Memory on the DB8540 platform is 8kB larger than it's predecessor's. We need to reflect that in its Device Tree. By re-specifying the address and size of the device we effectively over-ride the previous values with more accurate ones.

---
 arch/arm/boot/dts/ccu8540.dts |    5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/ccu8540.dts +5 -0
index 02e8e1a..f829689 100644
@@ -21,6 +21,11 @@
 	};
 
 	soc-u9500 {
+		prcmu at 80157000 {
+			reg = <0x80157000 0x2000>, <0x801b0000 0x8000>, <0x801b8000 0x3000>;
+			reg-names = "prcmu", "prcmu-tcpm-per4", "prcmu-tcdm-per4";
+		};
+
 		uart at 80120000 {
 			status = "okay";
 		};
Signature · 1 line
1.7.10.4
#17 lore raw

Re: [PATCH] ARM: ux500: Over-ride TCDM size when booting the DB8540 platform

Quoted 7 lines · Lee Jones

The PRCMU's Tightly Coupled Data Memory on the DB8540 platform is 8kB larger than it's predecessor's. We need to reflect that in its Device Tree. By re-specifying the address and size of the device we effectively over-ride the previous values with more accurate ones.

As mentioned this patch does not apply. Some whitespace trouble.

And please squash it into the patch adding the ccu8540, 3/9.

Yours,
Linus Walleij

author
#18 lore raw

Re: [PATCH] ARM: ux500: Over-ride TCDM size when booting the DB8540 platform

Quoted 8 lines · Linus Walleij
Quoted 6 lines · Lee Jones

The PRCMU's Tightly Coupled Data Memory on the DB8540 platform is 8kB larger than it's predecessor's. We need to reflect that in its Device Tree. By re-specifying the address and size of the device we effectively over-ride the previous values with more accurate ones.

Quoted 5 lines
Quoted 1 line

As mentioned this patch does not apply. Some whitespace trouble.

And please squash it into the patch adding the ccu8540, 3/9.

I'm not sure what's going on with all this whitespace stuff, my branch looks fine. Any chance I can just supply you with a branch to take instead?

Signature · 4 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
author
#19 lore raw

PATCH 6/9 ARM: ux500: Create a new of_dev_auxdata structure for u8540 enablement

In reply to Lee Jones

If we attempt to use the existing u8500 of_dev_auxdata struct to boot the u8540, we fail to obtain a console, due to a lack of DMA support on the platform.

---
 arch/arm/mach-ux500/cpu-db8500.c |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)
arch/arm/mach-ux500/cpu-db8500.c +17 -2
index f1a5818..e027865 100644
@@ -297,6 +297,16 @@ static struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
 	{},
 };
 
+static struct of_dev_auxdata u8540_auxdata_lookup[] __initdata = {
+	/* Requires DMA bindings. */
+	OF_DEV_AUXDATA("arm,pl011", 0x80120000, "uart0", NULL),
+	OF_DEV_AUXDATA("arm,pl011", 0x80121000, "uart1", NULL),
+	OF_DEV_AUXDATA("arm,pl011", 0x80007000, "uart2", NULL),
+	OF_DEV_AUXDATA("stericsson,db8500-prcmu", 0x80157000, "db8500-prcmu",
+			&db8500_prcmu_pdata),
+	{},
+};
+
 static const struct of_device_id u8500_local_bus_nodes[] = {
 	/* only create devices below soc node */
 	{ .compatible = "stericsson,db8500", },
@@ -323,8 +333,13 @@ static void __init u8500_init_machine(void)
 	/* TODO: Export SoC, USB, cpu-freq and DMA40 */
 	parent = u8500_of_init_devices();
 
-	/* automatically probe child nodes of db8500 device */
-	of_platform_populate(NULL, u8500_local_bus_nodes, u8500_auxdata_lookup, parent);
+	/* automatically probe child nodes of dbx5x0 devices */
+	if (of_machine_is_compatible("st-ericsson,u8540"))
+		of_platform_populate(NULL, u8500_local_bus_nodes,
+				     u8540_auxdata_lookup, parent);
+	else
+		of_platform_populate(NULL, u8500_local_bus_nodes,
+				     u8500_auxdata_lookup, parent);
 }
 
 static const char * stericsson_dt_platform_compat[] = {
Signature · 1 line
1.7.10.4
#20 lore raw

Re: [PATCH 6/9] ARM: ux500: Create a new of_dev_auxdata structure for u8540 enablement

Quoted 5 lines · Lee Jones

If we attempt to use the existing u8500 of_dev_auxdata struct to boot the u8540, we fail to obtain a console, due to a lack of DMA support on the platform.

Patch applied.

Thanks,
Linus Walleij

author
#21 lore raw

PATCH 7/9 ARM: ux500: Add a VQMMC (level-shifting) regulator DT node for Snowball

In reply to Lee Jones

Until recently platform code took care of all MMCI level-shifting by way of an ios_handler() call-back. Now it is the driver's responsibility to handle. In order to so that we need to provide the VQMMC regulator reference in Device Tree. This patch takes care of that.

---
 arch/arm/boot/dts/snowball.dts |    8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/snowball.dts +8 -0
index cc99447..6b4f8b9 100644
@@ -119,6 +119,13 @@
 			};
 		};
 
+		vmmci: regulator-gpio {
+			gpios = <&gpio6 25 0x4>;
+			enable-gpio = <&gpio7 4 0x4>;
+
+			status = "okay";
+		};
+
 		// External Micro SD slot
 		sdi0_per1 at 80126000 {
 			arm,primecell-periphid = <0x10480180>;
@@ -126,6 +133,7 @@
 			bus-width = <4>;
 			mmc-cap-mmc-highspeed;
 			vmmc-supply = <&ab8500_ldo_aux3_reg>;
+			vqmmc-supply = <&vmmci>;
 
 			cd-gpios  = <&gpio6 26 0x4>; // 218
 			cd-inverted;
Signature · 1 line
1.7.10.4
#22 lore raw

Re: [PATCH 7/9] ARM: ux500: Add a VQMMC (level-shifting) regulator DT node for Snowball

Quoted 6 lines · Lee Jones

Until recently platform code took care of all MMCI level-shifting by way of an ios_handler() call-back. Now it is the driver's responsibility to handle. In order to so that we need to provide the VQMMC regulator reference in Device Tree. This patch takes care of that.

Patch applied, thanks!

Yours,
Linus Walleij

author
#23 lore raw

PATCH 8/9 mfd: db8500-prcmu: Return early if the TCPM cannot be located

In reply to Lee Jones

Currently we check to see if we obtained the Tightly Coupled Program Memory (TCPM) base and only execute the code within the check if we have it. It's more traditional to return early if we don't have it. This way we can flatten most of the function's code down to a single tab spacing.

Cc Samuel Ortiz <[email protected]>
---
 drivers/mfd/db8500-prcmu.c |   40 +++++++++++++++++++++-------------------
 1 file changed, 21 insertions(+), 19 deletions(-)
drivers/mfd/db8500-prcmu.c +21 -19
index 21f261b..1c4edbf8 100644
@@ -2794,6 +2794,7 @@ static void dbx500_fw_version_init(struct platform_device *pdev,
 {
 	struct resource *res;
 	void __iomem *tcpm_base;
+	u32 version;
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
 					   "prcmu-tcpm");
@@ -2803,26 +2804,27 @@ static void dbx500_fw_version_init(struct platform_device *pdev,
 		return;
 	}
 	tcpm_base = ioremap(res->start, resource_size(res));
-	if (tcpm_base != NULL) {
-		u32 version;
-
-		version = readl(tcpm_base + version_offset);
-		fw_info.version.project = (version & 0xFF);
-		fw_info.version.api_version = (version >> 8) & 0xFF;
-		fw_info.version.func_version = (version >> 16) & 0xFF;
-		fw_info.version.errata = (version >> 24) & 0xFF;
-		strncpy(fw_info.version.project_name,
-			fw_project_name(fw_info.version.project),
-			PRCMU_FW_PROJECT_NAME_LEN);
-		fw_info.valid = true;
-		pr_info("PRCMU firmware: %s(%d), version %d.%d.%d\n",
-			fw_info.version.project_name,
-			fw_info.version.project,
-			fw_info.version.api_version,
-			fw_info.version.func_version,
-			fw_info.version.errata);
-		iounmap(tcpm_base);
+	if (!tcpm_base) {
+		dev_err(&pdev->dev, "no prcmu tcpm mem region provided\n");
+		return;
 	}
+
+	version = readl(tcpm_base + version_offset);
+	fw_info.version.project = (version & 0xFF);
+	fw_info.version.api_version = (version >> 8) & 0xFF;
+	fw_info.version.func_version = (version >> 16) & 0xFF;
+	fw_info.version.errata = (version >> 24) & 0xFF;
+	strncpy(fw_info.version.project_name,
+		fw_project_name(fw_info.version.project),
+		PRCMU_FW_PROJECT_NAME_LEN);
+	fw_info.valid = true;
+	pr_info("PRCMU firmware: %s(%d), version %d.%d.%d\n",
+		fw_info.version.project_name,
+		fw_info.version.project,
+		fw_info.version.api_version,
+		fw_info.version.func_version,
+		fw_info.version.errata);
+	iounmap(tcpm_base);
 }
 
 void __init db8500_prcmu_early_init(void)
Signature · 1 line
1.7.10.4
Acked-by on v1 8/9
#24 lore raw

Re: [PATCH 8/9] mfd: db8500-prcmu: Return early if the TCPM cannot be located

Quoted 8 lines · Lee Jones

Currently we check to see if we obtained the Tightly Coupled Program Memory (TCPM) base and only execute the code within the check if we have it. It's more traditional to return early if we don't have it. This way we can flatten most of the function's code down to a single tab spacing.

Cc Samuel Ortiz <[email protected]>

This should go in through the MFD tree.

Yours,
Linus Walleij

author
#25 lore raw

PATCH 9/9 mfd: db8500-prcmu: Support platform dependant device selection

In reply to Lee Jones

The main aim for this cycle is to have the u8540 booting to a console. However, the u8540 doesn't support all of the u8500 platform devices yet. After this stage is complete we can then fill in the inadequacies, such as specific clock support at a later date. To achieve this we're placing devices supported by all platforms into a common device structure and the remaining ones into a platform specific one.

Cc Samuel Ortiz <[email protected]>
---
 drivers/mfd/db8500-prcmu.c |   45 ++++++++++++++++++++++++++++----------------
 1 file changed, 29 insertions(+), 16 deletions(-)
drivers/mfd/db8500-prcmu.c +29 -16
index 1c4edbf8..5a03b5d 100644
@@ -3107,19 +3107,7 @@ static struct ux500_wdt_data db8500_wdt_pdata = {
 	.has_28_bits_resolution = true,
 };
 
-static struct mfd_cell db8500_prcmu_devs[] = {
-	{
-		.name = "db8500-prcmu-regulators",
-		.of_compatible = "stericsson,db8500-prcmu-regulator",
-		.platform_data = &db8500_regulators,
-		.pdata_size = sizeof(db8500_regulators),
-	},
-	{
-		.name = "cpufreq-ux500",
-		.of_compatible = "stericsson,cpufreq-ux500",
-		.platform_data = &db8500_cpufreq_table,
-		.pdata_size = sizeof(db8500_cpufreq_table),
-	},
+static struct mfd_cell common_prcmu_devs[] = {
 	{
 		.name = "ux500_wdt",
 		.platform_data = &db8500_wdt_pdata,
@@ -3135,6 +3123,21 @@ static struct mfd_cell db8500_prcmu_devs[] = {
 	},
 };
 
+static struct mfd_cell db8500_prcmu_devs[] = {
+	{
+		.name = "db8500-prcmu-regulators",
+		.of_compatible = "stericsson,db8500-prcmu-regulator",
+		.platform_data = &db8500_regulators,
+		.pdata_size = sizeof(db8500_regulators),
+	},
+	{
+		.name = "cpufreq-ux500",
+		.of_compatible = "stericsson,cpufreq-ux500",
+		.platform_data = &db8500_cpufreq_table,
+		.pdata_size = sizeof(db8500_cpufreq_table),
+	},
+};
+
 static void db8500_prcmu_update_cpufreq(void)
 {
 	if (prcmu_has_arm_maxopp()) {
@@ -3184,7 +3187,7 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
 
 	db8500_irq_init(np);
 
-	for (i = 0; i < ARRAY_SIZE(db8500_prcmu_devs); i++) {
+	for (i = 0; i < ARRAY_SIZE(common_prcmu_devs); i++) {
 		if (!strcmp(db8500_prcmu_devs[i].name, "ab8500-core")) {
 			db8500_prcmu_devs[i].platform_data = pdata->ab_platdata;
 			db8500_prcmu_devs[i].pdata_size = sizeof(struct ab8500_platform_data);
@@ -3195,13 +3198,23 @@ static int db8500_prcmu_probe(struct platform_device *pdev)
 
 	db8500_prcmu_update_cpufreq();
 
-	err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs,
-			      ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, NULL);
+	err = mfd_add_devices(&pdev->dev, 0, common_prcmu_devs,
+			      ARRAY_SIZE(common_prcmu_devs), NULL, 0, NULL);
 	if (err) {
 		pr_err("prcmu: Failed to add subdevices\n");
 		return err;
 	}
 
+	/* TODO: Remove restriction when clk definitions are available. */
+	if (!of_machine_is_compatible("st-ericsson,u8540")) {
+		err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs,
+				      ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, NULL);
+		if (err) {
+			pr_err("prcmu: Failed to add subdevices\n");
+			return err;
+		}
+	}
+
 	pr_info("DB8500 PRCMU initialized\n");
 
 no_irq_return:
Signature · 1 line
1.7.10.4
Acked-by on v1 9/9
#26 lore raw

Re: [PATCH 9/9] mfd: db8500-prcmu: Support platform dependant device selection

Quoted 10 lines · Lee Jones

The main aim for this cycle is to have the u8540 booting to a console. However, the u8540 doesn't support all of the u8500 platform devices yet. After this stage is complete we can then fill in the inadequacies, such as specific clock support at a later date. To achieve this we're placing devices supported by all platforms into a common device structure and the remaining ones into a platform specific one.

Cc Samuel Ortiz <[email protected]>

This should also go through the MFD tree.

Yours,
Linus Walleij

author
#27 lore raw

Re: [PATCH 9/9] mfd: db8500-prcmu: Support platform dependant device selection

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

The main aim for this cycle is to have the u8540 booting to a console. However, the u8540 doesn't support all of the u8500 platform devices yet. After this stage is complete we can then fill in the inadequacies, such as specific clock support at a later date. To achieve this we're placing devices supported by all platforms into a common device structure and the remaining ones into a platform specific one.

Quoted 6 lines
Quoted 2 lines
Cc Samuel Ortiz <[email protected]>

This should also go through the MFD tree.

Right. I'll add your Ack and resubmit.

Signature · 4 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog