linux-ti335x-psp 3.1: hack in DVI support for beaglebone
authorKoen Kooi <koen@dominion.thruhere.net>
Mon, 31 Oct 2011 19:16:06 +0000 (20:16 +0100)
committerKoen Kooi <koen@dominion.thruhere.net>
Tue, 1 Nov 2011 06:11:10 +0000 (07:11 +0100)
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
recipes-kernel/linux/linux-ti33x-psp-3.1/0001-ARM-OMAP2-beaglebone-hack-in-DVI-support.patch [new file with mode: 0644]
recipes-kernel/linux/linux-ti33x-psp_3.1.bb

diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.1/0001-ARM-OMAP2-beaglebone-hack-in-DVI-support.patch b/recipes-kernel/linux/linux-ti33x-psp-3.1/0001-ARM-OMAP2-beaglebone-hack-in-DVI-support.patch
new file mode 100644 (file)
index 0000000..a357ee8
--- /dev/null
@@ -0,0 +1,230 @@
+From 53f68267a95eac46ee91a692ef8a9b144102b3ec Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Mon, 31 Oct 2011 20:14:46 +0100
+Subject: [PATCH] ARM: OMAP2+: beaglebone: hack in DVI support
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ arch/arm/mach-omap2/board-am335xevm.c |  124 ++++++++++++++++++++++++++++++---
+ drivers/video/da8xx-fb.c              |   14 ++++
+ 2 files changed, 127 insertions(+), 11 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
+index eb18fb9..3d60530 100644
+--- a/arch/arm/mach-omap2/board-am335xevm.c
++++ b/arch/arm/mach-omap2/board-am335xevm.c
+@@ -144,6 +144,36 @@ struct da8xx_lcdc_platform_data TFC_S9700RTWV35TR_01B_pdata = {
+       .type                   = "TFC_S9700RTWV35TR_01B",
+ };
++static const struct display_panel dvi_panel = {
++      WVGA,
++      16,
++      16,
++      COLOR_ACTIVE,
++};
++
++static struct lcd_ctrl_config dvi_cfg = {
++      &dvi_panel,
++      .ac_bias                = 255,
++      .ac_bias_intrpt         = 0,
++      .dma_burst_sz           = 16,
++      .bpp                    = 16,
++      .fdd                    = 0x80,
++      .tft_alt_mode           = 0,
++      .stn_565_mode           = 0,
++      .mono_8bit_mode         = 0,
++      .invert_line_clock      = 1,
++      .invert_frm_clock       = 1,
++      .sync_edge              = 0,
++      .sync_ctrl              = 1,
++      .raster_order           = 0,
++};
++
++struct da8xx_lcdc_platform_data dvi_pdata = {
++      .manu_name              = "BBToys",
++      .controller_data        = &dvi_cfg,
++      .type                   = "1024x768@60",
++};
++
+ /* TSc controller */
+ #include <linux/input/ti_tscadc.h>
+@@ -369,6 +399,50 @@ static struct pinmux_config lcdc_pin_mux[] = {
+       {NULL, 0},
+ };
++/* Module pin mux for DVI board */
++static struct pinmux_config dvi_pin_mux[] = {
++      {"lcd_data0.lcd_data0",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data1.lcd_data1",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data2.lcd_data2",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data3.lcd_data3",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data4.lcd_data4",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data5.lcd_data5",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data6.lcd_data6",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data7.lcd_data7",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data8.lcd_data8",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data9.lcd_data9",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data10.lcd_data10",       OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data11.lcd_data11",       OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data12.lcd_data12",       OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data13.lcd_data13",       OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data14.lcd_data14",       OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_data15.lcd_data15",       OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT
++        | AM33XX_PULL_DISA},
++      {"lcd_vsync.lcd_vsync",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
++      {"lcd_hsync.lcd_hsync",         OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
++      {"lcd_pclk.lcd_pclk",           OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT},
++      {"lcd_ac_bias_en.lcd_ac_bias_en", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, //DVIEN
++      {"gpmc_a2.rgmii2_td3", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT}, // USR0 LED
++      {"gpmc_a3.rgmii2_td2", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT}, // USR1 LED
++      {"gpmc_ad7.gpmc_ad7", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT}, // DVI PDn
++      {NULL, 0},
++};
++
+ static struct pinmux_config tsc_pin_mux[] = {
+       {"ain0.ain0",           OMAP_MUX_MODE0 | AM33XX_INPUT_EN},
+       {"ain1.ain1",           OMAP_MUX_MODE0 | AM33XX_INPUT_EN},
+@@ -659,6 +733,9 @@ static struct pinmux_config usb1_pin_mux[] = {
+ #define BEAGLEBONE_USR3_LED  GPIO_TO_PIN(1, 23)
+ #define BEAGLEBONE_USR4_LED  GPIO_TO_PIN(1, 24)
++#define BEAGLEBONEDVI_USR0_LED  GPIO_TO_PIN(1, 18)
++#define BEAGLEBONEDVI_USR1_LED  GPIO_TO_PIN(1, 19)
++
+ static struct gpio_led gpio_leds[] = {
+       {
+               .name                   = "beaglebone::usr0",
+@@ -678,6 +755,16 @@ static struct gpio_led gpio_leds[] = {
+               .name           = "beaglebone::usr3",
+               .gpio           = BEAGLEBONE_USR4_LED,
+       },
++      {
++              .name                   = "dvi::usr0",
++              .default_trigger        = "heartbeat",
++              .gpio                   = BEAGLEBONEDVI_USR0_LED,
++      },
++      {
++              .name           = "dvi::usr1",
++              .default_trigger        = "mmc0",
++              .gpio           = BEAGLEBONEDVI_USR1_LED,
++      },
+ };
+ static struct gpio_led_platform_data gpio_led_info = {
+@@ -693,10 +780,6 @@ static struct platform_device leds_gpio = {
+       },
+ };
+-static struct platform_device *bone_devices[] __initdata = {
+-                  &leds_gpio,
+-};
+-
+ static struct pinmux_config bone_pin_mux[] = {
+       /* User LED gpios (gpio1_21 to gpio1_24) */
+     {"gpmc_a5.rgmii2_td0", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},
+@@ -806,6 +889,26 @@ static void lcdc_init(int evm_id, int profile)
+       return;
+ }
++#define BEAGLEBONEDVI_PDn  GPIO_TO_PIN(1, 7)
++
++static void dvi_init(int evm_id, int profile)
++{
++    setup_pin_mux(dvi_pin_mux);
++      gpio_request(BEAGLEBONEDVI_PDn, "DVI_PDn");
++      gpio_direction_output(BEAGLEBONEDVI_PDn, 1);
++
++      // we are being stupid and setting pixclock from here instead of da8xx-fb.c
++      if (conf_disp_pll(560000000)) {
++              pr_info("Failed to set pixclock to 56000000, not attempting to"
++                              "register DVI adapter\n");
++              return;
++      }
++      
++      if (am33xx_register_lcdc(&dvi_pdata))
++              pr_info("Failed to register BeagleBoardToys DVI adapter\n");
++      return;
++}
++
+ static void tsc_init(int evm_id, int profile)
+ {
+       int err;
+@@ -815,16 +918,14 @@ static void tsc_init(int evm_id, int profile)
+               pr_err("failed to register touchscreen device\n");
+ }
+-/*
+- * Initialization of BeagleBone specific devices
+- */
+-static void bone_init(int evm_id, int profil )
++
++static void boneleds_init(int evm_id, int profile )
+ {
+       int err;
+       setup_pin_mux(bone_pin_mux);
+-      err = platform_add_devices(bone_devices, ARRAY_SIZE(bone_devices));
++      err = platform_device_register(&leds_gpio);
+       if (err)
+-              pr_err("failed to register LEDS\n");
++              pr_err("failed to register BeagleBone LEDS\n");
+ }
+ static void rgmii1_init(int evm_id, int profile)
+@@ -1297,10 +1398,11 @@ static struct evm_dev_cfg ip_phn_evm_dev_cfg[] = {
+ /* Beaglebone */
+ static struct evm_dev_cfg beaglebone_dev_cfg[] = {
+       {rmii1_init,    DEV_ON_BASEBOARD, PROFILE_NONE},
++      {dvi_init,      DEV_ON_BASEBOARD, PROFILE_ALL},
+       {usb0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
+       {usb1_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
+       {mmc0_init,     DEV_ON_BASEBOARD, PROFILE_NONE},
+-      {bone_init,     DEV_ON_BASEBOARD, PROFILE_ALL},
++      {boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL},
+       {NULL, 0, 0},
+ };
+diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
+index 4347421..9619518 100644
+--- a/drivers/video/da8xx-fb.c
++++ b/drivers/video/da8xx-fb.c
+@@ -266,6 +266,20 @@ static struct da8xx_panel known_lcd_panels[] = {
+               .pxl_clk = 30000000,
+               .invert_pxl_clk = 0,
+       },
++      [3] = {
++               /* 1024 x 768 @ 60 Hz  Reduced blanking VESA CVT 0.79M3-R */ 
++              .name = "1024x768@60",
++              .width = 1024,
++              .height = 768,
++              .hfp = 48,
++              .hbp = 80,
++              .hsw = 32,
++              .vfp = 3,
++              .vbp = 15,
++              .vsw = 4,
++              .pxl_clk = 56000000,
++              .invert_pxl_clk = 0,
++      },
+ };
+ /* Enable the Raster Engine of the LCD Controller */
+-- 
+1.6.6.1
+
index b90f4b36ccc442dc78080595ae1d18e8ba51e6f6..cf0a11819439dbc8623dce3e085575fba0cc0c45 100644 (file)
@@ -11,7 +11,7 @@ MULTI_CONFIG_BASE_SUFFIX = ""
 
 BRANCH = "master"
 SRCREV = "fd97d5068496ab770991a263e9046781ca2441a5"
-MACHINE_KERNEL_PR_append = "l+gitr${SRCREV}"
+MACHINE_KERNEL_PR_append = "m+gitr${SRCREV}"
 
 COMPATIBLE_MACHINE = "(ti33x)"
 
@@ -30,6 +30,7 @@ PATCHES_OVER_PSP = " \
        file://0001-am335x-Check-return-value-of-omap_mux_init_signal.patch \
        file://0002-at24-Add-ability-to-dynamically-reconfigure-chip-inf.patch \
        file://0003-am335x-evm-Reconfigure-EEPROM-with-new-eeprom_info-in.patch \
+       file://0001-ARM-OMAP2-beaglebone-hack-in-DVI-support.patch \
        "
 
 SRC_URI += "${@base_contains('DISTRO_FEATURES', 'tipspkernel', "", "${PATCHES_OVER_PSP}", d)}"