[PATCH] ARMV7: OMAP3: BeagleBoard: Enable DSS driver

135 views
Skip to first unread message

Jason Kridner

unread,
Nov 5, 2010, 1:54:56 AM11/5/10
to beagl...@googlegroups.com, jkri...@beagleboard.org, Syed Mohammed Khasim
From: Syed Mohammed Khasim <kha...@ti.com>

Configures DSS to display color bar on Svideo
Configures DSS to display background color on DVID

Signed-off-by: Syed Mohammed Khasim <kha...@ti.com>
Signed-off-by: Jason Kridner <jkri...@beagleboard.org>
---
board/ti/beagle/beagle.c | 11 ++++++
board/ti/beagle/beagle.h | 75 ++++++++++++++++++++++++++++++++++++++++
include/configs/omap3_beagle.h | 1 +
3 files changed, 87 insertions(+), 0 deletions(-)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index 6074eca..2a53f76 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -152,6 +152,16 @@ unsigned int get_expansion_id(void)
}

/*
+ * Configure DSS to display background color on DVID
+ * Configure VENC to display color bar on S-Video
+ */
+void display_init(void)
+{
+ omap3_dss_venc_config(&venc_config_std_tv, VENC_HEIGHT, VENC_WIDTH);
+ omap3_dss_panel_config(&dvid_cfg);
+}
+
+/*
* Routine: misc_init_r
* Description: Configure board specific parts
*/
@@ -295,6 +305,7 @@ int misc_init_r(void)
GPIO15 | GPIO14 | GPIO13 | GPIO12, &gpio5_base->setdataout);

dieid_num_r();
+ omap3_dss_enable();

return 0;
}
diff --git a/board/ti/beagle/beagle.h b/board/ti/beagle/beagle.h
index fa893c4..7599905 100644
--- a/board/ti/beagle/beagle.h
+++ b/board/ti/beagle/beagle.h
@@ -23,6 +23,8 @@
#ifndef _BEAGLE_H_
#define _BEAGLE_H_

+#include <asm/arch/dss.h>
+
const omap3_sysinfo sysinfo = {
DDR_STACKED,
"OMAP3 Beagle board",
@@ -457,4 +459,77 @@ const omap3_sysinfo sysinfo = {
MUX_VAL(CP(MCBSP1_DX), (IDIS | PTU | DIS | M1)) /*MCSPI4_SIMO*/\
MUX_VAL(CP(MCBSP1_DR), (IEN | PTU | EN | M1)) /*MCSPI4_SOMI*/\
MUX_VAL(CP(MCBSP1_FSX), (IDIS | PTU | DIS | M1)) /*MCSPI4_CS0*/
+
+/*
+ * Display Configuration
+ */
+
+#define DVI_BEAGLE_ORANGE_COL 0x00FF8000
+#define VENC_HEIGHT 0x00ef
+#define VENC_WIDTH 0x027f
+
+/*
+ * Configure VENC in DSS for Beagle to generate Color Bar
+ *
+ * Kindly refer to OMAP TRM for definition of these values.
+ */
+static const struct venc_regs venc_config_std_tv = {
+ .status = 0x0000001B,
+ .f_control = 0x00000040,
+ .vidout_ctrl = 0x00000000,
+ .sync_ctrl = 0x00008000,
+ .llen = 0x00008359,
+ .flens = 0x0000020C,
+ .hfltr_ctrl = 0x00000000,
+ .cc_carr_wss_carr = 0x043F2631,
+ .c_phase = 0x00000024,
+ .gain_u = 0x00000130,
+ .gain_v = 0x00000198,
+ .gain_y = 0x000001C0,
+ .black_level = 0x0000006A,
+ .blank_level = 0x0000005C,
+ .x_color = 0x00000000,
+ .m_control = 0x00000001,
+ .bstamp_wss_data = 0x0000003F,
+ .s_carr = 0x21F07C1F,
+ .line21 = 0x00000000,
+ .ln_sel = 0x00000015,
+ .l21__wc_ctl = 0x00001400,
+ .htrigger_vtrigger = 0x00000000,
+ .savid__eavid = 0x069300F4,
+ .flen__fal = 0x0016020C,
+ .lal__phase_reset = 0x00060107,
+ .hs_int_start_stop_x = 0x008D034E,
+ .hs_ext_start_stop_x = 0x000F0359,
+ .vs_int_start_x = 0x01A00000,
+ .vs_int_stop_x__vs_int_start_y = 0x020501A0,
+ .vs_int_stop_y__vs_ext_start_x = 0x01AC0024,
+ .vs_ext_stop_x__vs_ext_start_y = 0x020D01AC,
+ .vs_ext_stop_y = 0x00000006,
+ .avid_start_stop_x = 0x03480079,
+ .avid_start_stop_y = 0x02040024,
+ .fid_int_start_x__fid_int_start_y = 0x0001008A,
+ .fid_int_offset_y__fid_ext_start_x = 0x01AC0106,
+ .fid_ext_start_y__fid_ext_offset_y = 0x01060006,
+ .tvdetgp_int_start_stop_x = 0x00140001,
+ .tvdetgp_int_start_stop_y = 0x00010001,
+ .gen_ctrl = 0x00FF0000,
+ .output_control = 0x0000000D,
+ .dac_b__dac_c = 0x00000000
+};
+
+/*
+ * Configure Timings for DVI D
+ */
+static const struct panel_config dvid_cfg = {
+ .timing_h = 0x0ff03f31, /* Horizantal timing */
+ .timing_v = 0x01400504, /* Vertical timing */
+ .pol_freq = 0x00007028, /* Pol Freq */
+ .divisor = 0x00010006, /* 72Mhz Pixel Clock */
+ .lcd_size = 0x02ff03ff, /* 1024x768 */
+ .panel_type = 0x01, /* TFT */
+ .data_lines = 0x03, /* 24 Bit RGB */
+ .load_mode = 0x02, /* Frame Mode */
+ .panel_color = DVI_BEAGLE_ORANGE_COL /* ORANGE */
+};
#endif
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 076dd5a..4d1c786 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -138,6 +138,7 @@
#define CONFIG_CMD_I2C /* I2C serial bus support */
#define CONFIG_CMD_MMC /* MMC support */
#define CONFIG_CMD_NAND /* NAND support */
+#define CONFIG_VIDEO_OMAP3 /* DSS Support */

#undef CONFIG_CMD_FLASH /* flinfo, erase, protect */
#undef CONFIG_CMD_FPGA /* FPGA configuration Support */
--
1.5.6.4

Jason Kridner

unread,
Nov 5, 2010, 1:54:57 AM11/5/10
to beagl...@googlegroups.com, jkri...@beagleboard.org

Signed-off-by: Jason Kridner <jkri...@beagleboard.org>
---
board/ti/beagle/beagle.c | 13 ++++++++++++-
board/ti/beagle/beagle.h | 12 ++++++++++++
2 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index 2a53f76..e4dd5a3 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -158,7 +158,18 @@ unsigned int get_expansion_id(void)
void display_init(void)
{
omap3_dss_venc_config(&venc_config_std_tv, VENC_HEIGHT, VENC_WIDTH);
- omap3_dss_panel_config(&dvid_cfg);
+ switch (get_board_revision()) {
+ case REVISION_AXBX:
+ case REVISION_CX:
+ case REVISION_C4:
+ omap3_dss_panel_config(&dvid_cfg);
+ break;
+ case REVISION_XM_A:
+ case REVISION_XM_B:
+ default:
+ omap3_dss_panel_config(&dvid_cfg_xm);
+ break;
+ }
}

/*
diff --git a/board/ti/beagle/beagle.h b/board/ti/beagle/beagle.h
index 7599905..103a1fd 100644
--- a/board/ti/beagle/beagle.h
+++ b/board/ti/beagle/beagle.h
@@ -532,4 +532,16 @@ static const struct panel_config dvid_cfg = {


.load_mode = 0x02, /* Frame Mode */

.panel_color = DVI_BEAGLE_ORANGE_COL /* ORANGE */
};
+

+static const struct panel_config dvid_cfg_xm = {
+ .timing_h = 0x1a4024c9, /* Horizantal timing */
+ .timing_v = 0x02c00509, /* Vertical timing */


+ .pol_freq = 0x00007028, /* Pol Freq */

+ .divisor = 0x00010001, /* 96MHz Pixel Clock */


+ .lcd_size = 0x02ff03ff, /* 1024x768 */
+ .panel_type = 0x01, /* TFT */
+ .data_lines = 0x03, /* 24 Bit RGB */
+ .load_mode = 0x02, /* Frame Mode */
+ .panel_color = DVI_BEAGLE_ORANGE_COL /* ORANGE */
+};
#endif

--
1.5.6.4

Jason Kridner

unread,
Nov 5, 2010, 1:54:58 AM11/5/10
to beagl...@googlegroups.com, jkri...@beagleboard.org
Based on commit f1099c7c43caf5bac3bf6a65aa266fade4747072
Author: Greg Turner <gregt...@ti.com>
Date: Tue May 25 09:19:06 2010 -0500

New u-boot command for status of USER button on BeagleBoard-xM

Modified bootcmd to check the staus at boot time and set
filename of the boot script.

* Moved to a BeagleBoard specific file.
* Removed changes to default boot command from adding userbutton
command.
* Made to handle pre-xM boards.
* Flipped polarity of the return value to avoid confusion. Success (0)
is when the button is pressed. Failure (1) is when the button is NOT
pressed.
* Used latest revision getting function.
* Used latest macros for board revision.

Signed-off-by: Jason Kridner <jkri...@beagleboard.org>
---

board/ti/beagle/beagle.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index e4dd5a3..8eeb192 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -41,6 +41,7 @@
#include <asm/arch/gpio.h>
#include <asm/mach-types.h>
#include "beagle.h"
+#include <command.h>

#define TWL4030_I2C_BUS 0
#define EXPANSION_EEPROM_I2C_BUS 1
@@ -339,3 +340,57 @@ int board_mmc_init(bd_t *bis)
return 0;
}
#endif
+
+/*
+ * This command returns the status of the user button on beagle xM
+ * Input - none
+ * Returns - 1 if button is held down
+ * 0 if button is not held down
+ */
+int do_userbutton (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+ int button = 0;
+ int gpio;
+
+ /*
+ * pass address parameter as argv[0] (aka command name),
+ * and all remaining args
+ */


+ switch (get_board_revision()) {
+ case REVISION_AXBX:
+ case REVISION_CX:
+ case REVISION_C4:

+ gpio = 7;


+ break;
+ case REVISION_XM_A:
+ case REVISION_XM_B:
+ default:

+ gpio = 4;
+ break;
+ }
+ omap_request_gpio(gpio);
+ omap_set_gpio_direction(gpio, 1);
+ printf("The user button is currently ");
+ if(omap_get_gpio_datain(gpio))
+ {
+ button = 1;
+ printf("PRESSED.\n");
+ }
+ else
+ {
+ button = 0;
+ printf("NOT pressed.\n");
+ }
+
+ omap_free_gpio(gpio);
+
+ return !button;
+}
+
+/* -------------------------------------------------------------------- */
+
+U_BOOT_CMD(
+ userbutton, CONFIG_SYS_MAXARGS, 1, do_userbutton,
+ "Return the status of the BeagleBoard USER button",
+ ""
+);
--
1.5.6.4

Reply all
Reply to author
Forward
0 new messages