diff mbox

[2/5] arm: dts: lpc32xx: fix improper usage of ranges property

Message ID 1444694045-22000-3-git-send-email-vz@mleia.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vladimir Zapolskiy Oct. 12, 2015, 11:54 p.m. UTC
The change corrects invalid custom translations to 1:1 translations,
otherwise during initialization there are too many failed attempts to
translate addresses from subnodes, which anyway result in fallback 1:1
translations, also it is found that due to this problem proper usage
of ranges property in subnodes (e.g. for defining flash partitions)
can not be done.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
---
 arch/arm/boot/dts/lpc32xx.dtsi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Arnd Bergmann Oct. 13, 2015, 12:44 p.m. UTC | #1
On Tuesday 13 October 2015 02:54:02 Vladimir Zapolskiy wrote:
> The change corrects invalid custom translations to 1:1 translations,
> otherwise during initialization there are too many failed attempts to
> translate addresses from subnodes, which anyway result in fallback 1:1
> translations, also it is found that due to this problem proper usage
> of ranges property in subnodes (e.g. for defining flash partitions)
> can not be done.
> 
> Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
> 

I don't get it. What kind of errors do you see? The existing
version looks cleaner than the new one, as it only translates
the MMIO areas that are actually used.

	Arnd
Arnd Bergmann Oct. 13, 2015, 7:36 p.m. UTC | #2
On Tuesday 13 October 2015 18:51:24 Vladimir Zapolskiy wrote:
> On 13.10.2015 15:44, Arnd Bergmann wrote:
> > I don't get it. What kind of errors do you see? The existing
> > version looks cleaner than the new one, as it only translates
> > the MMIO areas that are actually used.
> > 
> 
> The problem is found when I add PL175 device node to lpc32xx.dtsi and
> expand the node in my board file. The external memory controller manages
> up to 4 memory devices, which by means of the controller are mapped into
> physical memory starting from address 0xe0000000.
> 
> Below are my declarations, similar to one found in lpc18xx.dtsi.
> 
> lpc32xx.dtsi change common for all LPC32xx boards:
> 
> emc: emc@31080000 {
> 	compatible = "arm,pl175", "arm,primecell";
> 	reg = <0x31080000 0x1000>;
> 	clocks = <&scf LPC32XX_CLK_DDRAM>;
> 	clock-names = "mpmcclk";
> 
> 	#address-cells = <1>;
> 	#size-cells = <1>;
> 	ranges = <0 0xe0000000 0x01000000>,
> 		 <1 0xe1000000 0x01000000>,
> 		 <2 0xe2000000 0x01000000>,
> 		 <3 0xe3000000 0x01000000>;
> 	status = "disabled";
> };
> 

Ok, got it.

> Support of EMC device node will be added to lpc32xx.dtsi, when this kind
> of problem is fixed.

As I see it, the problem is that you now have ranges that are not
for devices inside of the device but that are external. As the
memory-controller node needs both its own registers and the translation
for the external ones, we unfortunately can't just put it in the root
node, which would avoid the issue.

Instead, I would suggest adding a range for the 0xe0000000 area.


	Arnd
diff mbox

Patch

diff --git a/arch/arm/boot/dts/lpc32xx.dtsi b/arch/arm/boot/dts/lpc32xx.dtsi
index f35e982..3ef804c 100644
--- a/arch/arm/boot/dts/lpc32xx.dtsi
+++ b/arch/arm/boot/dts/lpc32xx.dtsi
@@ -31,7 +31,7 @@ 
 		#address-cells = <1>;
 		#size-cells = <1>;
 		compatible = "simple-bus";
-		ranges = <0x20000000 0x20000000 0x30000000>;
+		ranges;
 
 		/*
 		 * Enable either SLC or MLC
@@ -89,7 +89,7 @@ 
 			#address-cells = <1>;
 			#size-cells = <1>;
 			compatible = "simple-bus";
-			ranges = <0x20000000 0x20000000 0x30000000>;
+			ranges;
 
 			ssp0: ssp@20084000 {
 				compatible = "arm,pl022", "arm,primecell";
@@ -207,7 +207,7 @@ 
 			#address-cells = <1>;
 			#size-cells = <1>;
 			compatible = "simple-bus";
-			ranges = <0x20000000 0x20000000 0x30000000>;
+			ranges;
 
 			/*
 			 * MIC Interrupt controller includes: