summaryrefslogtreecommitdiffstats
path: root/board
diff options
context:
space:
mode:
authorH. Nikolaus Schaller <hns@goldelico.com>2010-12-21 11:47:25 +0100
committerH. Nikolaus Schaller <hns@goldelico.com>2010-12-21 11:47:25 +0100
commit30edeb21ebfc731ec1656c7a8727617f5a08438c (patch)
tree5e764d30b5ae5876f8410924ec730bbcaced3b9d /board
parentfe9af81721d7ffcbe0bbd4665fda5d245835df84 (diff)
downloadbootable_bootloader_goldelico_gta04-30edeb21ebfc731ec1656c7a8727617f5a08438c.zip
bootable_bootloader_goldelico_gta04-30edeb21ebfc731ec1656c7a8727617f5a08438c.tar.gz
bootable_bootloader_goldelico_gta04-30edeb21ebfc731ec1656c7a8727617f5a08438c.tar.bz2
made display initialization work
Diffstat (limited to 'board')
-rw-r--r--board/goldelico/gta04/TD028TTEC1.c61
-rw-r--r--board/goldelico/gta04/dssfb.c20
-rw-r--r--board/goldelico/gta04/gta04.h10
-rw-r--r--board/goldelico/gta04/jbt6k74.c2
4 files changed, 66 insertions, 27 deletions
diff --git a/board/goldelico/gta04/TD028TTEC1.c b/board/goldelico/gta04/TD028TTEC1.c
index 09bb1b8..167bebc 100644
--- a/board/goldelico/gta04/TD028TTEC1.c
+++ b/board/goldelico/gta04/TD028TTEC1.c
@@ -53,8 +53,8 @@
#define GPIO_CS 19
#define GPIO_SCL 12
-#define GPIO_DIN 20
-#define GPIO_DOUT 18
+#define GPIO_DIN 18
+#define GPIO_DOUT 20
#else /* Beagle Hybrid */
@@ -189,41 +189,42 @@ int jbt_reg_write16(struct jbt_info *jbt, u_int8_t reg, u_int16_t data)
return rc;
}
-int jbt_reg_init(void)
-{
+int jbt_check(void)
+{ // check if we have connectivity
#if defined(_BEAGLE_)
+ int err;
int i;
int failed=0;
+ int cnt0 = 0;
+ int cnt1 = 0;
printf("jbt_reg_init()\n");
- omap_request_gpio(GPIO_CS);
+ err = omap_request_gpio(GPIO_CS);
SPI_CS(1); // unselect
- omap_request_gpio(GPIO_SCL);
+ err |= omap_request_gpio(GPIO_SCL);
SPI_SCL(1); // default
- omap_request_gpio(GPIO_DOUT);
+ err |= omap_request_gpio(GPIO_DOUT);
SPI_SDA(0);
- omap_request_gpio(GPIO_DIN);
-#if 1 // should have been done by MUX settings!
+ err |= omap_request_gpio(GPIO_DIN);
+ if(err)
+ {
+ printf("jbt_reg_init() - could not get GPIOs\n");
+ return 1;
+ }
+#if 1 // should have already been done by MUX settings!
omap_set_gpio_direction(GPIO_CS, 0); // output
omap_set_gpio_direction(GPIO_SCL, 0); // output
omap_set_gpio_direction(GPIO_DOUT, 0); // output
- omap_set_gpio_direction(GPIO_DIN, 1); // input (for read back)
+ omap_set_gpio_direction(GPIO_DIN, 1); // input (for reading back)
#endif
-
+
// omap_free_gpio(GPIO_DIN);
// omap_free_gpio(GPIO_DOUT);
// omap_free_gpio(GPIO_CS);
// omap_free_gpio(GPIO_SCL);
-
-#endif
- /* according to data sheet: wait 50ms (Tpos of LCM). However, 50ms
- * seems unreliable with later LCM batches, increasing to 90ms */
- udelay(90000);
-
-#if defined(_BEAGLE_)
for(i=0; i<16; i++)
- { // check for connection between GPIO158 -> GPIO159; since we have 10 kOhm pse. make sure that the PUP/PDN is disabled in the MUX config!
+ { // check for connection between GPIO158 -> GPIO159; since we have 10 kOhm pse. make sure that the PUP/PDN is disabled on DIN in the MUX config!
int bit=i&1;
SPI_SDA(bit); // write bit
SPI_DELAY();
@@ -232,14 +233,32 @@ int jbt_reg_init(void)
#endif
if(SPI_READ() != bit) // did not read back
failed++;
+ if(SPI_READ())
+ cnt1++;
+ else
+ cnt0++;
}
if(failed > 0)
{
- printf("jbt_reg_init() - no correct response, assuming no connection between GPIO158 and GPIO159\n");
- return 1;
+ printf("jbt_reg_init() - no correct response, assuming no connection between GPIO_%d and GPIO_%d\n", GPIO_DOUT, GPIO_DIN);
+ if(cnt0 == 0)
+ printf(" DIN stuck at 0\n");
+ if(cnt1 == 0)
+ printf(" DIN stuck at 1\n");
+ return 1;
}
#endif
+ return 0;
+}
+
+int jbt_reg_init(void)
+{
+ if(jbt_check())
+ return 1; // some error
+ /* according to data sheet: wait 50ms (Tpos of LCM). However, 50ms
+ * seems unreliable with later LCM batches, increasing to 90ms */
+ udelay(90000);
printf("did jbt_reg_init()\n");
return 0;
}
diff --git a/board/goldelico/gta04/dssfb.c b/board/goldelico/gta04/dssfb.c
index 582afc7..b25c759 100644
--- a/board/goldelico/gta04/dssfb.c
+++ b/board/goldelico/gta04/dssfb.c
@@ -29,6 +29,8 @@
#include <asm/arch/gpio.h>
#include <asm/mach-types.h>
#include <asm/arch/dss.h>
+#include <asm/arch/clocks.h>
+#include <asm/arch/clocks_omap3.h>
#define DVI_BACKGROUND_COLOR 0x00fadc29 // rgb(250, 220, 41)
@@ -79,6 +81,7 @@ static const struct panel_config lcm_cfg =
void omap3_dss_go(void)
{ // push changes from shadow register to display controller
struct dispc_regs *dispc = (struct dispc_regs *) OMAP3_DISPC_BASE;
+
u32 l = 0;
l = readl(&dispc->control);
l |= GO_LCD | GO_DIG;
@@ -255,7 +258,24 @@ static const struct panel_config dvid_cfg = {
void dssfb_init(void)
{
+#ifdef CONFIG_OMAP3_GTA04A2 /* delayed on GTA04A2 */
+ struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
+ printf("prcm base = %08x\n", prcm_base);
+ printf("ick_dss_on\n");
+ sr32(&prcm_base->iclken_dss, 0, 32, ICK_DSS_ON);
+ sdelay(1000);
+ printf("fck_dss_on\n");
+ sr32(&prcm_base->fclken_dss, 0, 32, FCK_DSS_ON);
+ sdelay(1000);
+ printf("fck_cam_on\n");
+// sr32(&prcm_base->fclken_cam, 0, 32, FCK_CAM_ON);
+ printf("ick_cam_on\n");
+// sr32(&prcm_base->iclken_cam, 0, 32, ICK_CAM_ON);
+ sdelay(1000);
+#endif
+ printf("dss panel config\n");
omap3_dss_panel_config(&lcm_cfg); // set new config
+ printf("dss enable\n");
omap3_dss_enable(); // and (re)enable
}
diff --git a/board/goldelico/gta04/gta04.h b/board/goldelico/gta04/gta04.h
index 61f1398..91e738c 100644
--- a/board/goldelico/gta04/gta04.h
+++ b/board/goldelico/gta04/gta04.h
@@ -466,18 +466,18 @@ MUX_VAL(CP(MCBSP1_FSX), (IDIS | PTU | DIS | M1)) /*MCSPI4_CS0*/
* PTU - Pull type Up
* DIS - Pull type selection is inactive
* EN - Pull type selection is active
- * M0 - Mode 0
+ * M0 - Mode 0 (as defined by pin name)
* M4 - Mode 4 (GPIO)
*/
-// FIXME: GTA04A2 has different assignment from GTA04A3ff
+// FIXME: GTA04A3ff has some improved mux assignments
#define MUX_BEAGLE_GTA04() \
MUX_VAL(CP(ETK_CLK_ES2), (IDIS | PTU | EN | M4)) /*GPIO_12 - Display serial clock*/\
MUX_VAL(CP(ETK_CTL_ES2), (IDIS | PTU | EN | M4)) /*GPIO_13 - IrDA FIR-SEL*/\
-MUX_VAL(CP(ETK_D4_ES2), (IDIS | PTU | DIS | M4)) /*GPIO_18 - Display DIN*/\
-MUX_VAL(CP(ETK_D5_ES2), (IDIS | PTU | DIS | M4)) /*GPIO_19 - Display select*/\
-MUX_VAL(CP(ETK_D6_ES2), (IDIS | PTU | DIS | M4)) /*GPIO_20 - Display DOUT*/\
+MUX_VAL(CP(ETK_D4_ES2), (IEN | PTU | DIS | M4)) /*GPIO_18 - Display DIN*/\
+MUX_VAL(CP(ETK_D5_ES2), (IDIS | PTU | EN | M4)) /*GPIO_19 - Display chip select*/\
+MUX_VAL(CP(ETK_D6_ES2), (IDIS | PTU | EN | M4)) /*GPIO_20 - Display DOUT*/\
MUX_VAL(CP(ETK_D7_ES2), (IEN | PTU | EN | M4)) /*GPIO_21 - RS232 enable*/\
MUX_VAL(CP(GPMC_NCS6), (IDIS | PTD | DIS | M4)) /*GPIO_57/GPT_11 - Backlight enable*/\
MUX_VAL(CP(GPMC_WAIT3), (IDIS | PTU | DIS | M4)) /*GPIO_65 - AUX IN/OUT*/\
diff --git a/board/goldelico/gta04/jbt6k74.c b/board/goldelico/gta04/jbt6k74.c
index 4e6a2e0..8c5aaea 100644
--- a/board/goldelico/gta04/jbt6k74.c
+++ b/board/goldelico/gta04/jbt6k74.c
@@ -314,6 +314,7 @@ int jbt6k74_display_onoff(int on)
int board_video_init(GraphicDevice *pGD)
{
extern int get_board_revision(void);
+ backlight_init(); // initialize backlight
#define REVISION_XM 0
if(get_board_revision() == REVISION_XM) {
/* Set VAUX1 to 3.3V for GTA04E display board */
@@ -329,7 +330,6 @@ int board_video_init(GraphicDevice *pGD)
return 1;
}
dssfb_init();
- backlight_init(); // initialize backlight
printf("did board_video_init()\n");
return 0;