diff mbox series

[2/2] arm: AT91: fix DT duplicate node name

Message ID 910fee2eb99b2d95e59fa6b997645b498f167022.1504037038.git.mirq-linux@rere.qmqm.pl
State New
Headers show
Series arm: AT91: device-tree fixes for AT91SAM9G45 | expand

Commit Message

Michał Mirosław Aug. 29, 2017, 8:08 p.m. UTC
Fix following warning at bootup:

device-tree: Duplicate name in fb@0x00500000, renamed to "display#1"

Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
---
 arch/arm/boot/dts/at91sam9m10g45ek.dts | 48 +++++++++++++++++-----------------
 1 file changed, 24 insertions(+), 24 deletions(-)

Comments

Nicolas Ferre Sept. 14, 2017, 4:53 p.m. UTC | #1
On 29/08/2017 at 22:08, Michał Mirosław wrote:
> Fix following warning at bootup:
> 
> device-tree: Duplicate name in fb@0x00500000, renamed to "display#1"
> 
> Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> ---
>  arch/arm/boot/dts/at91sam9m10g45ek.dts | 48 +++++++++++++++++-----------------
>  1 file changed, 24 insertions(+), 24 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/at91sam9m10g45ek.dts b/arch/arm/boot/dts/at91sam9m10g45ek.dts
> index 9cf1f5163fbd..272af5867403 100644
> --- a/arch/arm/boot/dts/at91sam9m10g45ek.dts
> +++ b/arch/arm/boot/dts/at91sam9m10g45ek.dts
> @@ -223,30 +223,6 @@
>  		fb0: fb@0x00500000 {
>  			display = <&display0>;
>  			status = "okay";
> -
> -			display0: display {

Michał, thanks for your patch.

Actually the DT binding requires this:
Documentation/devicetree/bindings/video/atmel,lcdc.txt

So it's somehow a bigger issue.
Moreover, several boards have exactly the same arrangement than the
at91sam9m10g45ek, so you probably need to modify them all at the same time.

After a brief look at drivers/video/fbdev/atmel_lcdfb.c it seems that
the name of the node is not so much important, so we can modify it
(something like display0: lcd-display {}) .

I suggest that you modify the binding, the board files affected and
re-submit a patch.

Best regards,

> -				bits-per-pixel = <32>;
> -				atmel,lcdcon-backlight;
> -				atmel,dmacon = <0x1>;
> -				atmel,lcdcon2 = <0x80008002>;
> -				atmel,guard-time = <9>;
> -				atmel,lcd-wiring-mode = "RGB";
> -
> -				display-timings {
> -					native-mode = <&timing0>;
> -					timing0: timing0 {
> -						clock-frequency = <9000000>;
> -						hactive = <480>;
> -						vactive = <272>;
> -						hback-porch = <1>;
> -						hfront-porch = <1>;
> -						vback-porch = <40>;
> -						vfront-porch = <1>;
> -						hsync-len = <45>;
> -						vsync-len = <1>;
> -					};
> -				};
> -			};
>  		};
>  
>  		nand0: nand@40000000 {
> @@ -293,6 +269,30 @@
>  		};
>  	};
>  
> +	display0: display {
> +		bits-per-pixel = <32>;
> +		atmel,lcdcon-backlight;
> +		atmel,dmacon = <0x1>;
> +		atmel,lcdcon2 = <0x80008002>;
> +		atmel,guard-time = <9>;
> +		atmel,lcd-wiring-mode = "RGB";
> +
> +		display-timings {
> +			native-mode = <&timing0>;
> +			timing0: 480x272 {
> +				clock-frequency = <9000000>;
> +				hactive = <480>;
> +				vactive = <272>;
> +				hback-porch = <1>;
> +				hfront-porch = <1>;
> +				vback-porch = <40>;
> +				vfront-porch = <1>;
> +				hsync-len = <45>;
> +				vsync-len = <1>;
> +			};
> +		};
> +	};
> +
>  	pwmleds {
>  		compatible = "pwm-leds";
>  
>
Michał Mirosław Oct. 4, 2017, 9:20 p.m. UTC | #2
On Thu, Sep 14, 2017 at 06:53:30PM +0200, Nicolas Ferre wrote:
> On 29/08/2017 at 22:08, Michał Mirosław wrote:
> > Fix following warning at bootup:
> > 
> > device-tree: Duplicate name in fb@0x00500000, renamed to "display#1"
> > 
> > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > ---
> >  arch/arm/boot/dts/at91sam9m10g45ek.dts | 48 +++++++++++++++++-----------------
> >  1 file changed, 24 insertions(+), 24 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/at91sam9m10g45ek.dts b/arch/arm/boot/dts/at91sam9m10g45ek.dts
> > index 9cf1f5163fbd..272af5867403 100644
> > --- a/arch/arm/boot/dts/at91sam9m10g45ek.dts
> > +++ b/arch/arm/boot/dts/at91sam9m10g45ek.dts
> > @@ -223,30 +223,6 @@
> >  		fb0: fb@0x00500000 {
> >  			display = <&display0>;
> >  			status = "okay";
> > -
> > -			display0: display {
> 
> Michał, thanks for your patch.
> 
> Actually the DT binding requires this:
> Documentation/devicetree/bindings/video/atmel,lcdc.txt
> 
> So it's somehow a bigger issue.
> Moreover, several boards have exactly the same arrangement than the
> at91sam9m10g45ek, so you probably need to modify them all at the same time.
> 
> After a brief look at drivers/video/fbdev/atmel_lcdfb.c it seems that
> the name of the node is not so much important, so we can modify it
> (something like display0: lcd-display {}) .
> 
> I suggest that you modify the binding, the board files affected and
> re-submit a patch.

It looks like the binding documentation is wrong. The driver code does

	of_parse_phandle(np, "display", 0);

so it expects a phandle, not a node.

Best Regards,
Michał Mirosław
diff mbox series

Patch

diff --git a/arch/arm/boot/dts/at91sam9m10g45ek.dts b/arch/arm/boot/dts/at91sam9m10g45ek.dts
index 9cf1f5163fbd..272af5867403 100644
--- a/arch/arm/boot/dts/at91sam9m10g45ek.dts
+++ b/arch/arm/boot/dts/at91sam9m10g45ek.dts
@@ -223,30 +223,6 @@ 
 		fb0: fb@0x00500000 {
 			display = <&display0>;
 			status = "okay";
-
-			display0: display {
-				bits-per-pixel = <32>;
-				atmel,lcdcon-backlight;
-				atmel,dmacon = <0x1>;
-				atmel,lcdcon2 = <0x80008002>;
-				atmel,guard-time = <9>;
-				atmel,lcd-wiring-mode = "RGB";
-
-				display-timings {
-					native-mode = <&timing0>;
-					timing0: timing0 {
-						clock-frequency = <9000000>;
-						hactive = <480>;
-						vactive = <272>;
-						hback-porch = <1>;
-						hfront-porch = <1>;
-						vback-porch = <40>;
-						vfront-porch = <1>;
-						hsync-len = <45>;
-						vsync-len = <1>;
-					};
-				};
-			};
 		};
 
 		nand0: nand@40000000 {
@@ -293,6 +269,30 @@ 
 		};
 	};
 
+	display0: display {
+		bits-per-pixel = <32>;
+		atmel,lcdcon-backlight;
+		atmel,dmacon = <0x1>;
+		atmel,lcdcon2 = <0x80008002>;
+		atmel,guard-time = <9>;
+		atmel,lcd-wiring-mode = "RGB";
+
+		display-timings {
+			native-mode = <&timing0>;
+			timing0: 480x272 {
+				clock-frequency = <9000000>;
+				hactive = <480>;
+				vactive = <272>;
+				hback-porch = <1>;
+				hfront-porch = <1>;
+				vback-porch = <40>;
+				vfront-porch = <1>;
+				hsync-len = <45>;
+				vsync-len = <1>;
+			};
+		};
+	};
+
 	pwmleds {
 		compatible = "pwm-leds";