tegra: display: add board pinmux
Subsystems (2)
PATCH 1/2 tegra: display: add board pinmux
Boards may require a different pinmux setup for DISPALY than the default one. Add a way to call into board specific code to set this up.
--- arch/arm/include/asm/arch-tegra/board.h | 7 ++++--- board/nvidia/common/board.c | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-)
arch/arm/include/asm/arch-tegra/board.h +4 -3
@@ -41,8 +41,9 @@ void gpio_early_init(void); /* overrideable GPIO config */* an empty stub function will be called. */ -void pin_mux_usb (void );/* overrideable USB pinmux setup */ -void pin_mux_spi (void );/* overrideable SPI pinmux setup */ -void pin_mux_nand (void );/* overrideable NAND pinmux setup */ +void pin_mux_usb (void );/* overrideable USB pinmux setup */ +void pin_mux_spi (void );/* overrideable SPI pinmux setup */ +void pin_mux_nand (void );/* overrideable NAND pinmux setup */ +void pin_mux_display (void );/* overrideable DISPLAY pinmux setup */ #endif
board/nvidia/common/board.c +7 -0
@@ -87,6 +87,12 @@ void __pin_mux_nand(void)void pin_mux_nand (void ) __attribute__((weak,alias ("__pin_mux_nand" ))); +void __pin_mux_display (void ) +{ +} + +void pin_mux_display (void ) __attribute__((weak,alias ("__pin_mux_display" ))); +/* * Routine: power_det_init * Description: turn off power detects
@@ -126,6 +132,7 @@ int board_init(void)debug ("%s: Failed to init pwm\n" , __func__);#endif #ifdef CONFIG_LCD +pin_mux_display ();tegra_lcd_check_next_stage (gd->fdt_blob,0 );#endif /* boot param addr */
Signature · 1 line
1.7.9.5
PATCH 2/2 tegra: enable LCD on PAZ00
This adds LCD panel descriptions to the device tree of PAZ00 and enables LCD support in the configuration.
--- board/compal/dts/tegra20-paz00.dts | 32 ++++++++++++++++++++++++++++++++ board/compal/paz00/paz00.c | 11 +++++++++++ include/configs/paz00.h | 15 +++++++++++++++ 3 files changed, 58 insertions(+)
board/compal/dts/tegra20-paz00.dts +32 -0
@@ -54,4 +54,36 @@ usb at c5004000 { status = "disabled"; }; + + host1x { + status = "okay"; + dc at 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>; + }; };
board/compal/paz00/paz00.c +11 -0
@@ -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
include/configs/paz00.h +15 -0
@@ -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 */
Signature · 1 line
1.7.9.5
PATCH 2/2 tegra: enable LCD on PAZ00
include/configs/paz00.h line 39
Quoted 6 lines · Marc Dietrich
This adds LCD panel descriptions to the device tree of PAZ00 and enables LCD support in the configuration.
include/configs/paz00.h +1
-0+#define CONFIG_BOARD_LATE_INIT
What's that for? I don't think any of the other Tegra boards have it.
include/configs/paz00.h line 79
Quoted 12 lines
/* SD/MMC */
#defineCONFIG_MMCinclude/configs/paz00.h +5
-0@@ -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.
PATCH 2/2 tegra: enable LCD on PAZ00
Quoted 9 lines · On Monday 26 November 2012 12:00:51 Stephen Warren wrote:
include/configs/paz00.h line 39
Quoted 6 lines · Marc Dietrich
This adds LCD panel descriptions to the device tree of PAZ00 and enables LCD support in the configuration.
include/configs/paz00.h +1
-0+#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.
Quoted 8 lines
Quoted 8 lines
/* SD/MMC */
#defineCONFIG_MMCinclude/configs/paz00.h +0
-0@@ -71,6 +72,20 @@#define CONFIG_CMD_NET #define CONFIG_CMD_DHCP
Quoted 10 lines
include/configs/paz00.h line 79
Quoted 5 lines
include/configs/paz00.h +5
-0+#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_SETTINGSto support the lcd case too? Allen Martin's recent change "tegra: moveTEGRA_DEVICE_SETTINGStotegra-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
PATCH 2/2 tegra: enable LCD on PAZ00
TEGRA_DEVICE_SETTINGS patch is assigned to Marek and waiting on him to pull 'em thru the USB tree.
Tom
Quoted 39 lines · Marc Dietrich
Quoted 9 lines · On Monday 26 November 2012 12:00:51 Stephen Warren wrote:
include/configs/paz00.h line 39
Quoted 6 lines · Marc Dietrich
This adds LCD panel descriptions to the device tree of PAZ00 and enables LCD support in the configuration.
include/configs/paz00.h +1
-0+#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_LCDhave this (seaboard, avionics). You may ask Simon why it is required. Without it, backlight will not come up on PAZ00 at least.Quoted 8 lines
Quoted 8 lines
/* SD/MMC */
#defineCONFIG_MMCinclude/configs/paz00.h +0
-0@@ -71,6 +72,20 @@#define CONFIG_CMD_NET #define CONFIG_CMD_DHCP Quoted 10 lines
include/configs/paz00.h line 79
Quoted 5 lines
include/configs/paz00.h +5
-0+#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_SETTINGSto support the lcd case too? Allen Martin's recent change "tegra: moveTEGRA_DEVICE_SETTINGStotegra-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
PATCH 2/2 tegra: enable LCD on PAZ00
Quoted 2 lines · Tom Warren
TEGRA_DEVICE_SETTINGSpatch 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.
PATCH 2/2 tegra: enable LCD on PAZ00
Quoted 6 lines · Stephen Warren
Quoted 2 lines · Tom Warren
TEGRA_DEVICE_SETTINGSpatch 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.
Quoted 8 lines
(we really need a linux-next for U-Boot to hide all the pull latency)
So, I'd propose that
paz00.hcan add the config options to enable LCD support right now, but that changes toTEGRA_DEVICE_SETTINGSshould instead be implemented generically as a change to the logic integra-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.
PATCH 2/2 tegra: enable LCD on PAZ00
Dear Stephen Warren,
Quoted 16 lines · Stephen Warren
Quoted 6 lines · Tom Warren
Quoted 2 lines
TEGRA_DEVICE_SETTINGSpatch 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.
Quoted 8 lines
(we really need a linux-next for U-Boot to hide all the pull latency)
So, I'd propose that
paz00.hcan add the config options to enable LCD support right now, but that changes toTEGRA_DEVICE_SETTINGSshould instead be implemented generically as a change to the logic integra-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.
Quoted 4 lines
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 theTEGRA_DEVICE_SETTINGSpatch makes its way from u-boot-usb to u-boot-tegra.
Wasn't u-boot-usb pulled just recently?
Best regards,
Marek Vasut
PATCH 1/2 tegra: display: add board pinmux
In reply to Marc DietrichMarc,
Quoted 1 line
Boards may require a different pinmux setup for DISPALY than the default one.
s/b 'DISPLAY'
arch/arm/include/asm/arch-tegra/board.h void gpio_early_init(void); /* overrideable GPIO config */ · line 47
Quoted 7 lines
arch/arm/include/asm/arch-tegra/board.h +4
-3-void pin_mux_usb (void );/* overrideable USB pinmux setup */ -void pin_mux_spi (void );/* overrideable SPI pinmux setup */ -void pin_mux_nand (void );/* overrideable NAND pinmux setup */ +void pin_mux_usb (void );/* overrideable USB pinmux setup */ +void pin_mux_spi (void );/* overrideable SPI pinmux setup */ +void pin_mux_nand (void );/* overrideable NAND pinmux setup */ +void pin_mux_display (void );/* overrideable DISPLAY pinmux setup */
Don't pad the end of the other comments just to match up with your new DISPLAY proto comment. Had to look at this twice to see what you were really doing here.
Otherwise this patchset LGTM. I'll apply it to tegra/next once you've fixed these nits.
Tom
Quoted 54 lines · Marc Dietrich
Boards may require a different pinmux setup for DISPALY than the default one. Add a way to call into board specific code to set this up.
Signed-off-by Marc Dietrich <[email protected]>--- arch/arm/include/asm/arch-tegra/board.h | 7 ++++--- board/nvidia/common/board.c | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-)arch/arm/include/asm/arch-tegra/board.h +4
-3@@ -41,8 +41,9 @@ void gpio_early_init(void); /* overrideable GPIO config */* an empty stub function will be called. */ -void pin_mux_usb (void );/* overrideable USB pinmux setup */ -void pin_mux_spi (void );/* overrideable SPI pinmux setup */ -void pin_mux_nand (void );/* overrideable NAND pinmux setup */ +void pin_mux_usb (void );/* overrideable USB pinmux setup */ +void pin_mux_spi (void );/* overrideable SPI pinmux setup */ +void pin_mux_nand (void );/* overrideable NAND pinmux setup */ +void pin_mux_display (void );/* overrideable DISPLAY pinmux setup */ #endif board/nvidia/common/board.c +7
-1@@ -87,6 +87,12 @@ void __pin_mux_nand(void)void pin_mux_nand (void ) __attribute__((weak,alias ("__pin_mux_nand" ))); +void __pin_mux_display (void ) +{ +} + +void pin_mux_display (void ) __attribute__((weak,alias ("__pin_mux_display" ))); +/* * Routine: power_det_init * Description: turn off power detects @@ -126,6 +132,7 @@ int board_init(void)debug ("%s: Failed to init pwm\n" , __func__);#endif #ifdef CONFIG_LCD +pin_mux_display ();tegra_lcd_check_next_stage (gd->fdt_blob,0 );#endif /* boot param addr */ --1.7.9.5
PATCH 1/2 tegra: display: add board pinmux
Hi Tom,
Quoted 3 lines · On Monday 26 November 2012 09:55:49 Tom Warren wrote:
Quoted 2 lines
Boards may require a different pinmux setup for DISPALY than the default one.
s/b 'DISPLAY'
ups.
Quoted 11 lines
arch/arm/include/asm/arch-tegra/board.h void gpio_early_init(void); /* overrideable GPIO config */ · line 47
Quoted 7 lines
arch/arm/include/asm/arch-tegra/board.h +4
-3-void pin_mux_usb (void );/* overrideable USB pinmux setup */ -void pin_mux_spi (void );/* overrideable SPI pinmux setup */ -void pin_mux_nand (void );/* overrideable NAND pinmux setup */ +void pin_mux_usb (void );/* overrideable USB pinmux setup */ +void pin_mux_spi (void );/* overrideable SPI pinmux setup */ +void pin_mux_nand (void );/* overrideable NAND pinmux setup */ +void pin_mux_display (void );/* overrideable DISPLAY pinmux setup */ Don't pad the end of the other comments just to match up with your new DISPLAY proto comment. Had to look at this twice to see what you were really doing here.
yeah, I had to decide whether to create an ugly patch or an ugly comment. Will choose the other solution then.
Marc
Quoted 72 lines
Otherwise this patchset LGTM. I'll apply it to tegra/next once you've fixed these nits.
Tom
Quoted 66 lines · Marc Dietrich
Boards may require a different pinmux setup for DISPALY than the default one. Add a way to call into board specific code to set this up.
Signed-off-by Marc Dietrich <[email protected]>---
arch/arm/include/asm/arch-tegra/board.h | 7 ++++--- board/nvidia/common/board.c | 7 +++++++ 2 files changed, 11 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/arch/arm/include/asm/arch-tegra/board.hindex be6bf25..3db0d93 100644arch/arm/include/asm/arch-tegra/board.h +4
-3@@ -41,8 +41,9 @@ void gpio_early_init(void); /* overrideable GPIO config */> * an empty stub function will be called. */ -void pin_mux_usb (void );/* overrideable USB pinmux setup */ -void pin_mux_spi (void );/* overrideable SPI pinmux setup */ -void pin_mux_nand (void );/* overrideable NAND pinmux setup */ +void pin_mux_usb (void );/* overrideable USB pinmux setup */ +void pin_mux_spi (void );/* overrideable SPI pinmux setup */ +void pin_mux_nand (void );/* overrideable NAND pinmux setup */ +void pin_mux_display (void );/* overrideable DISPLAY pinmux setup */ #endif
board/nvidia/common/board.c +5
-0@@ -87,6 +87,12 @@ void __pin_mux_nand(void)void pin_mux_nand (void ) __attribute__((weak,alias ("__pin_mux_nand" ))); +void __pin_mux_display (void ) +{ +} + +void pin_mux_display(void) __attribute__((weak,
alias("__pin_mux_display"))); +/*
* Routine:
power_det_init
* Description: turn off power detectsboard/nvidia/common/board.c +1
-0@@ -126,6 +132,7 @@ int board_init(void)debug ("%s: Failed to init pwm\n" , __func__);#endif #ifdef CONFIG_LCD +pin_mux_display ();tegra_lcd_check_next_stage(gd->fdt_blob, 0);#endif
/* boot param addr */--
1.7.9.5