diff mbox

[U-Boot,2/2] tegra: enable LCD on PAZ00

Message ID 90d2bb4745f6305239fe7a270350c5180a914113.1353878614.git.marvin24@gmx.de
State Superseded
Delegated to: Tom Warren
Headers show

Commit Message

Marc Dietrich Nov. 25, 2012, 9:26 p.m. UTC
This adds LCD panel descriptions to the device tree of PAZ00 and
enables LCD support in the configuration.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
---
 board/compal/dts/tegra20-paz00.dts |   32 ++++++++++++++++++++++++++++++++
 board/compal/paz00/paz00.c         |   11 +++++++++++
 include/configs/paz00.h            |   15 +++++++++++++++
 3 files changed, 58 insertions(+)

Comments

Stephen Warren Nov. 26, 2012, 7 p.m. UTC | #1
On 11/25/2012 02:26 PM, Marc Dietrich wrote:
> This adds LCD panel descriptions to the device tree of PAZ00 and
> enables LCD support in the configuration.

> diff --git a/include/configs/paz00.h b/include/configs/paz00.h

> +#define CONFIG_BOARD_LATE_INIT

What's that for? I don't think any of the other Tegra boards have it.

>  
>  /* SD/MMC */
>  #define CONFIG_MMC
> @@ -71,6 +72,20 @@
>  #define CONFIG_CMD_NET
>  #define CONFIG_CMD_DHCP
>  
> +#undef TEGRA_DEVICE_SETTINGS
> +#define TEGRA_DEVICE_SETTINGS	\
> +	"stdin=serial\0"	\
> +	"stdout=serial,lcd\0"	\
> +	"stderr=serial,lcd\0"

Why not extend tegra-common-post.h's automatic calculation of
TEGRA_DEVICE_SETTINGS to support the lcd case too? Allen Martin's recent
change "tegra: move TEGRA_DEVICE_SETTINGS to tegra-common-post.h" should
make it easy to do that.
Marc Dietrich Nov. 26, 2012, 9 p.m. UTC | #2
On Monday 26 November 2012 12:00:51 Stephen Warren wrote:
> On 11/25/2012 02:26 PM, Marc Dietrich wrote:
> > This adds LCD panel descriptions to the device tree of PAZ00 and
> > enables LCD support in the configuration.
> > 
> > diff --git a/include/configs/paz00.h b/include/configs/paz00.h
> > 
> > +#define CONFIG_BOARD_LATE_INIT
> 
> What's that for? I don't think any of the other Tegra boards have it.

No, all board defining CONFIG_LCD have this (seaboard, avionics). You may ask 
Simon why it is required. Without it, backlight will not come up on PAZ00 at 
least.

> >  /* SD/MMC */
> >  #define CONFIG_MMC
> > 
> > @@ -71,6 +72,20 @@
> > 
> >  #define CONFIG_CMD_NET
> >  #define CONFIG_CMD_DHCP
> > 
> > +#undef TEGRA_DEVICE_SETTINGS
> > +#define TEGRA_DEVICE_SETTINGS	\
> > +	"stdin=serial\0"	\
> > +	"stdout=serial,lcd\0"	\
> > +	"stderr=serial,lcd\0"
> 
> Why not extend tegra-common-post.h's automatic calculation of
> TEGRA_DEVICE_SETTINGS to support the lcd case too? Allen Martin's recent
> change "tegra: move TEGRA_DEVICE_SETTINGS to tegra-common-post.h" should
> make it easy to do that.

Yes, I have such a patch in my gitorious tree for some time now. Allen's patch 
is not in any u-boot-tegra branch yet. I can fix it up when it has landed.

Marc
Tom Warren Nov. 27, 2012, 12:07 a.m. UTC | #3
TEGRA_DEVICE_SETTINGS patch is assigned to Marek and waiting on him to
pull 'em thru the USB tree.

Tom

On Mon, Nov 26, 2012 at 2:00 PM, Marc Dietrich <marvin24@gmx.de> wrote:
> On Monday 26 November 2012 12:00:51 Stephen Warren wrote:
>> On 11/25/2012 02:26 PM, Marc Dietrich wrote:
>> > This adds LCD panel descriptions to the device tree of PAZ00 and
>> > enables LCD support in the configuration.
>> >
>> > diff --git a/include/configs/paz00.h b/include/configs/paz00.h
>> >
>> > +#define CONFIG_BOARD_LATE_INIT
>>
>> What's that for? I don't think any of the other Tegra boards have it.
>
> No, all board defining CONFIG_LCD have this (seaboard, avionics). You may ask
> Simon why it is required. Without it, backlight will not come up on PAZ00 at
> least.
>
>> >  /* SD/MMC */
>> >  #define CONFIG_MMC
>> >
>> > @@ -71,6 +72,20 @@
>> >
>> >  #define CONFIG_CMD_NET
>> >  #define CONFIG_CMD_DHCP
>> >
>> > +#undef TEGRA_DEVICE_SETTINGS
>> > +#define TEGRA_DEVICE_SETTINGS      \
>> > +   "stdin=serial\0"        \
>> > +   "stdout=serial,lcd\0"   \
>> > +   "stderr=serial,lcd\0"
>>
>> Why not extend tegra-common-post.h's automatic calculation of
>> TEGRA_DEVICE_SETTINGS to support the lcd case too? Allen Martin's recent
>> change "tegra: move TEGRA_DEVICE_SETTINGS to tegra-common-post.h" should
>> make it easy to do that.
>
> Yes, I have such a patch in my gitorious tree for some time now. Allen's patch
> is not in any u-boot-tegra branch yet. I can fix it up when it has landed.
>
> Marc
>
Stephen Warren Nov. 27, 2012, 5:42 p.m. UTC | #4
On 11/26/2012 05:07 PM, Tom Warren wrote:
> TEGRA_DEVICE_SETTINGS patch is assigned to Marek and waiting on him to
> pull 'em thru the USB tree.

It looks like the patch has been in u-boot-usb/master for about a week.

(we really need a linux-next for U-Boot to hide all the pull latency)

So, I'd propose that paz00.h can add the config options to enable LCD
support right now, but that changes to TEGRA_DEVICE_SETTINGS should
instead be implemented generically as a change to the logic in
tegra-common-post.h (and hence support all boards not just paz00),
either applied to u-boot-usb/master right now, or u-boot-tegra/master
once the dependencies are enabled there.
Stephen Warren Nov. 27, 2012, 7:53 p.m. UTC | #5
On 11/27/2012 10:42 AM, Stephen Warren wrote:
> On 11/26/2012 05:07 PM, Tom Warren wrote:
>> TEGRA_DEVICE_SETTINGS patch is assigned to Marek and waiting on him to
>> pull 'em thru the USB tree.
> 
> It looks like the patch has been in u-boot-usb/master for about a week.
> 
> (we really need a linux-next for U-Boot to hide all the pull latency)
> 
> So, I'd propose that paz00.h can add the config options to enable LCD
> support right now, but that changes to TEGRA_DEVICE_SETTINGS should
> instead be implemented generically as a change to the logic in
> tegra-common-post.h (and hence support all boards not just paz00),
> either applied to u-boot-usb/master right now, or u-boot-tegra/master
> once the dependencies are enabled there.

It's been pointed out that Seaboard already uses this method to override
TEGRA_DEVICE_SETTINGS. Given that precedent, I withdraw any objection.
We'll just have to remember to fix this all up once the
TEGRA_DEVICE_SETTINGS patch makes its way from u-boot-usb to u-boot-tegra.
Marek Vasut Nov. 27, 2012, 9:59 p.m. UTC | #6
Dear Stephen Warren,

> On 11/27/2012 10:42 AM, Stephen Warren wrote:
> > On 11/26/2012 05:07 PM, Tom Warren wrote:
> >> TEGRA_DEVICE_SETTINGS patch is assigned to Marek and waiting on him to
> >> pull 'em thru the USB tree.
> > 
> > It looks like the patch has been in u-boot-usb/master for about a week.
> > 
> > (we really need a linux-next for U-Boot to hide all the pull latency)
> > 
> > So, I'd propose that paz00.h can add the config options to enable LCD
> > support right now, but that changes to TEGRA_DEVICE_SETTINGS should
> > instead be implemented generically as a change to the logic in
> > tegra-common-post.h (and hence support all boards not just paz00),
> > either applied to u-boot-usb/master right now, or u-boot-tegra/master
> > once the dependencies are enabled there.
> 
> It's been pointed out that Seaboard already uses this method to override
> TEGRA_DEVICE_SETTINGS. Given that precedent, I withdraw any objection.
> We'll just have to remember to fix this all up once the
> TEGRA_DEVICE_SETTINGS patch makes its way from u-boot-usb to u-boot-tegra.

Wasn't u-boot-usb pulled just recently?

Best regards,
Marek Vasut
diff mbox

Patch

diff --git a/board/compal/dts/tegra20-paz00.dts b/board/compal/dts/tegra20-paz00.dts
index 9e3e169..afebbe5 100644
--- a/board/compal/dts/tegra20-paz00.dts
+++ b/board/compal/dts/tegra20-paz00.dts
@@ -54,4 +54,36 @@ 
 	usb@c5004000 {
 		status = "disabled";
 	};
+
+	host1x {
+		status = "okay";
+		dc@54200000 {
+			status = "okay";
+			rgb {
+				status = "okay";
+				nvidia,panel = <&lcd_panel>;
+			};
+		};
+	};
+
+	lcd_panel: panel {
+		/* PAZ00 has 1024x600 */
+		clock = <54030000>;
+		xres = <1024>;
+		yres = <600>;
+		right-margin = <160>;
+		left-margin = <24>;
+		hsync-len = <136>;
+		upper-margin = <3>;
+		lower-margin = <61>;
+		vsync-len = <6>;
+		hsync-active-high;
+		nvidia,bits-per-pixel = <16>;
+		nvidia,pwm = <&pwm 0 0>;
+		nvidia,backlight-enable-gpios = <&gpio 164 0>;	/* PU4 */
+		nvidia,lvds-shutdown-gpios = <&gpio 102 0>;	/* PM6 */
+		nvidia,backlight-vdd-gpios = <&gpio 176 0>;	/* PW0 */
+		nvidia,panel-vdd-gpios = <&gpio 4 0>;		/* PA4 */
+		nvidia,panel-timings = <400 4 203 17 15>;
+	};
 };
diff --git a/board/compal/paz00/paz00.c b/board/compal/paz00/paz00.c
index 6492d41..1447f47 100644
--- a/board/compal/paz00/paz00.c
+++ b/board/compal/paz00/paz00.c
@@ -71,3 +71,14 @@  int board_mmc_init(bd_t *bd)
 	return 0;
 }
 #endif
+
+#ifdef CONFIG_LCD
+/* this is a weak define that we are overriding */
+void pin_mux_display(void)
+{
+	debug("init display pinmux\n");
+
+	/* EN_VDD_PANEL GPIO A4 */
+	pinmux_tristate_disable(PINGRP_DAP2);
+}
+#endif
diff --git a/include/configs/paz00.h b/include/configs/paz00.h
index 38c79cf..4a74d00 100644
--- a/include/configs/paz00.h
+++ b/include/configs/paz00.h
@@ -36,6 +36,7 @@ 
 #define CONFIG_MACH_TYPE		MACH_TYPE_PAZ00
 
 #define CONFIG_BOARD_EARLY_INIT_F
+#define CONFIG_BOARD_LATE_INIT
 
 /* SD/MMC */
 #define CONFIG_MMC
@@ -71,6 +72,20 @@ 
 #define CONFIG_CMD_NET
 #define CONFIG_CMD_DHCP
 
+#undef TEGRA_DEVICE_SETTINGS
+#define TEGRA_DEVICE_SETTINGS	\
+	"stdin=serial\0"	\
+	"stdout=serial,lcd\0"	\
+	"stderr=serial,lcd\0"
+
+/* LCD support */
+#define CONFIG_LCD
+#define CONFIG_PWM_TEGRA
+#define CONFIG_VIDEO_TEGRA
+#define LCD_BPP				LCD_COLOR16
+#define CONFIG_SYS_WHITE_ON_BLACK
+#define CONFIG_CONSOLE_SCROLL_LINES	10
+
 #include "tegra-common-post.h"
 
 #endif /* __CONFIG_H */