Re: [PATCH v2 03/12] arm: dts: mt7623: fix invalid memory node being generated

2018-05-11 Thread Sean Wang
On Fri, 2018-05-11 at 17:03 +0200, Matthias Brugger wrote:
> 
> On 04/11/2018 10:53 AM, sean.w...@mediatek.com wrote:
> > From: Sean Wang 
> > 
> > Below two wrong nodes in existing DTS files would cause a fail boot since
> > in fact the address 0 is not the correct place the memory device locates
> > at.
> > 
> > memory {
> > device_type = "memory";
> > reg = <0x0 0x0 0x0 0x0>;
> > };
> > 
> > memory@8000 {
> > reg = <0x0 0x8000 0x0 0x4000>;
> > };
> > 
> > In order to avoid having a memory node starting at address 0, we can't
> > include file skeleton64.dtsi and instead need to explicitly manually
> > define a few of properties the DTS relies on such as #address-cells
> > and #size-cells in root node and device_type in the node memory@8000.
> > 
> > Cc: sta...@vger.kernel.org
> > Fixes: 31ac0d69a1d4 ("ARM: dts: mediatek: add MT7623 basic support")
> > Signed-off-by: Sean Wang 
> > Cc: Rob Herring 
> > ---
> >  arch/arm/boot/dts/mt7623.dtsi | 3 ++-
> >  arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts | 1 +
> >  arch/arm/boot/dts/mt7623n-rfb.dtsi| 1 +
> >  3 files changed, 4 insertions(+), 1 deletion(-)
> > 
> 
> merged. We would need this at least for mt2701 as well, correct?
> Would you mind to provide a patch.
> 
> Regards,
> Matthias
> 

Thanks! I totally think the same problem could happen on mt2701, so I'm 
happy to come up with a patch for that.

Sean

> > diff --git a/arch/arm/boot/dts/mt7623.dtsi b/arch/arm/boot/dts/mt7623.dtsi
> > index fec4715..406a9f3 100644
> > --- a/arch/arm/boot/dts/mt7623.dtsi
> > +++ b/arch/arm/boot/dts/mt7623.dtsi
> > @@ -15,11 +15,12 @@
> >  #include 
> >  #include 
> >  #include 
> > -#include "skeleton64.dtsi"
> >  
> >  / {
> > compatible = "mediatek,mt7623";
> > interrupt-parent = <&sysirq>;
> > +   #address-cells = <2>;
> > +   #size-cells = <2>;
> >  
> > cpu_opp_table: opp-table {
> > compatible = "operating-points-v2";
> > diff --git a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts 
> > b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
> > index bbf56f8..5938e4c 100644
> > --- a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
> > +++ b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
> > @@ -109,6 +109,7 @@
> > };
> >  
> > memory@8000 {
> > +   device_type = "memory";
> > reg = <0 0x8000 0 0x4000>;
> > };
> >  };
> > diff --git a/arch/arm/boot/dts/mt7623n-rfb.dtsi 
> > b/arch/arm/boot/dts/mt7623n-rfb.dtsi
> > index a199ae7..343e8ef 100644
> > --- a/arch/arm/boot/dts/mt7623n-rfb.dtsi
> > +++ b/arch/arm/boot/dts/mt7623n-rfb.dtsi
> > @@ -40,6 +40,7 @@
> > };
> >  
> > memory@8000 {
> > +   device_type = "memory";
> > reg = <0 0x8000 0 0x4000>;
> > };
> >  
> > 




Re: [PATCH v2 03/12] arm: dts: mt7623: fix invalid memory node being generated

2018-05-11 Thread Matthias Brugger


On 04/11/2018 10:53 AM, sean.w...@mediatek.com wrote:
> From: Sean Wang 
> 
> Below two wrong nodes in existing DTS files would cause a fail boot since
> in fact the address 0 is not the correct place the memory device locates
> at.
> 
> memory {
> device_type = "memory";
> reg = <0x0 0x0 0x0 0x0>;
> };
> 
> memory@8000 {
> reg = <0x0 0x8000 0x0 0x4000>;
> };
> 
> In order to avoid having a memory node starting at address 0, we can't
> include file skeleton64.dtsi and instead need to explicitly manually
> define a few of properties the DTS relies on such as #address-cells
> and #size-cells in root node and device_type in the node memory@8000.
> 
> Cc: sta...@vger.kernel.org
> Fixes: 31ac0d69a1d4 ("ARM: dts: mediatek: add MT7623 basic support")
> Signed-off-by: Sean Wang 
> Cc: Rob Herring 
> ---
>  arch/arm/boot/dts/mt7623.dtsi | 3 ++-
>  arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts | 1 +
>  arch/arm/boot/dts/mt7623n-rfb.dtsi| 1 +
>  3 files changed, 4 insertions(+), 1 deletion(-)
> 

merged. We would need this at least for mt2701 as well, correct?
Would you mind to provide a patch.

Regards,
Matthias

> diff --git a/arch/arm/boot/dts/mt7623.dtsi b/arch/arm/boot/dts/mt7623.dtsi
> index fec4715..406a9f3 100644
> --- a/arch/arm/boot/dts/mt7623.dtsi
> +++ b/arch/arm/boot/dts/mt7623.dtsi
> @@ -15,11 +15,12 @@
>  #include 
>  #include 
>  #include 
> -#include "skeleton64.dtsi"
>  
>  / {
>   compatible = "mediatek,mt7623";
>   interrupt-parent = <&sysirq>;
> + #address-cells = <2>;
> + #size-cells = <2>;
>  
>   cpu_opp_table: opp-table {
>   compatible = "operating-points-v2";
> diff --git a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts 
> b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
> index bbf56f8..5938e4c 100644
> --- a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
> +++ b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
> @@ -109,6 +109,7 @@
>   };
>  
>   memory@8000 {
> + device_type = "memory";
>   reg = <0 0x8000 0 0x4000>;
>   };
>  };
> diff --git a/arch/arm/boot/dts/mt7623n-rfb.dtsi 
> b/arch/arm/boot/dts/mt7623n-rfb.dtsi
> index a199ae7..343e8ef 100644
> --- a/arch/arm/boot/dts/mt7623n-rfb.dtsi
> +++ b/arch/arm/boot/dts/mt7623n-rfb.dtsi
> @@ -40,6 +40,7 @@
>   };
>  
>   memory@8000 {
> + device_type = "memory";
>   reg = <0 0x8000 0 0x4000>;
>   };
>  
> 


[PATCH v2 03/12] arm: dts: mt7623: fix invalid memory node being generated

2018-04-11 Thread sean.wang
From: Sean Wang 

Below two wrong nodes in existing DTS files would cause a fail boot since
in fact the address 0 is not the correct place the memory device locates
at.

memory {
device_type = "memory";
reg = <0x0 0x0 0x0 0x0>;
};

memory@8000 {
reg = <0x0 0x8000 0x0 0x4000>;
};

In order to avoid having a memory node starting at address 0, we can't
include file skeleton64.dtsi and instead need to explicitly manually
define a few of properties the DTS relies on such as #address-cells
and #size-cells in root node and device_type in the node memory@8000.

Cc: sta...@vger.kernel.org
Fixes: 31ac0d69a1d4 ("ARM: dts: mediatek: add MT7623 basic support")
Signed-off-by: Sean Wang 
Cc: Rob Herring 
---
 arch/arm/boot/dts/mt7623.dtsi | 3 ++-
 arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts | 1 +
 arch/arm/boot/dts/mt7623n-rfb.dtsi| 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/mt7623.dtsi b/arch/arm/boot/dts/mt7623.dtsi
index fec4715..406a9f3 100644
--- a/arch/arm/boot/dts/mt7623.dtsi
+++ b/arch/arm/boot/dts/mt7623.dtsi
@@ -15,11 +15,12 @@
 #include 
 #include 
 #include 
-#include "skeleton64.dtsi"
 
 / {
compatible = "mediatek,mt7623";
interrupt-parent = <&sysirq>;
+   #address-cells = <2>;
+   #size-cells = <2>;
 
cpu_opp_table: opp-table {
compatible = "operating-points-v2";
diff --git a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts 
b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
index bbf56f8..5938e4c 100644
--- a/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
+++ b/arch/arm/boot/dts/mt7623n-bananapi-bpi-r2.dts
@@ -109,6 +109,7 @@
};
 
memory@8000 {
+   device_type = "memory";
reg = <0 0x8000 0 0x4000>;
};
 };
diff --git a/arch/arm/boot/dts/mt7623n-rfb.dtsi 
b/arch/arm/boot/dts/mt7623n-rfb.dtsi
index a199ae7..343e8ef 100644
--- a/arch/arm/boot/dts/mt7623n-rfb.dtsi
+++ b/arch/arm/boot/dts/mt7623n-rfb.dtsi
@@ -40,6 +40,7 @@
};
 
memory@8000 {
+   device_type = "memory";
reg = <0 0x8000 0 0x4000>;
};
 
-- 
2.7.4