[U-Boot] [PATCH 1/2 v2] tegra: display: add board pinmux

Boards may require a different pinmux setup for DISPLAY than the default one. Add a way to call into board specific code to set this up.
Signed-off-by: Marc Dietrich marvin24@gmx.de --- changes in V2: - fix comment padding
arch/arm/include/asm/arch-tegra/board.h | 1 + board/nvidia/common/board.c | 7 +++++++ 2 files changed, 8 insertions(+)
diff --git a/arch/arm/include/asm/arch-tegra/board.h b/arch/arm/include/asm/arch-tegra/board.h index be6bf25..7453dcd 100644 --- a/arch/arm/include/asm/arch-tegra/board.h +++ b/arch/arm/include/asm/arch-tegra/board.h @@ -44,5 +44,6 @@ void gpio_early_init(void); /* overrideable GPIO config */ 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 diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c index 76ec687..819c120 100644 --- a/board/nvidia/common/board.c +++ b/board/nvidia/common/board.c @@ -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 */

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 --- I'll create a patch to add LCD support to common TEGRA_DEVICE_SETTINGS once the tegra tree is rebased.
changes in V2: - s/DISPALY/DISPLAY/ - removed W0 gpio which is not used - set all panel-timings to 0
board/compal/dts/tegra20-paz00.dts | 31 +++++++++++++++++++++++++++++++ board/compal/paz00/paz00.c | 11 +++++++++++ include/configs/paz00.h | 15 +++++++++++++++ 3 files changed, 57 insertions(+)
diff --git a/board/compal/dts/tegra20-paz00.dts b/board/compal/dts/tegra20-paz00.dts index 9e3e169..8c258ff 100644 --- a/board/compal/dts/tegra20-paz00.dts +++ b/board/compal/dts/tegra20-paz00.dts @@ -54,4 +54,35 @@ 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,panel-vdd-gpios = <&gpio 4 0>; /* PA4 */ + nvidia,panel-timings = <0 0 0 0>; + }; }; 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 */

Thanks, Marc.
This series applied to u-boot-tegra/next.
Tom
On Tue, Nov 27, 2012 at 9:55 AM, Marc Dietrich marvin24@gmx.de wrote:
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
I'll create a patch to add LCD support to common TEGRA_DEVICE_SETTINGS once the tegra tree is rebased.
changes in V2: - s/DISPALY/DISPLAY/ - removed W0 gpio which is not used - set all panel-timings to 0
board/compal/dts/tegra20-paz00.dts | 31 +++++++++++++++++++++++++++++++ board/compal/paz00/paz00.c | 11 +++++++++++ include/configs/paz00.h | 15 +++++++++++++++ 3 files changed, 57 insertions(+)
diff --git a/board/compal/dts/tegra20-paz00.dts b/board/compal/dts/tegra20-paz00.dts index 9e3e169..8c258ff 100644 --- a/board/compal/dts/tegra20-paz00.dts +++ b/board/compal/dts/tegra20-paz00.dts @@ -54,4 +54,35 @@ 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,panel-vdd-gpios = <&gpio 4 0>; /* PA4 */
nvidia,panel-timings = <0 0 0 0>;
};
}; 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 */
1.7.9.5
participants (2)
-
Marc Dietrich
-
Tom Warren