summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Nikolaus Schaller <hns@goldelico.com>2011-04-22 18:16:44 +0200
committerH. Nikolaus Schaller <hns@goldelico.com>2011-04-22 18:16:44 +0200
commitc1671686345db42706aa40dee7b9c5ce491b7ca2 (patch)
treec8993339abb386f01039e139c1a35a57097c9df0
parent9ea48d8b7f2dec77064c73e82730ef24df1e2ffe (diff)
downloadbootable_bootloader_goldelico_gta04-c1671686345db42706aa40dee7b9c5ce491b7ca2.zip
bootable_bootloader_goldelico_gta04-c1671686345db42706aa40dee7b9c5ce491b7ca2.tar.gz
bootable_bootloader_goldelico_gta04-c1671686345db42706aa40dee7b9c5ce491b7ca2.tar.bz2
made DSS initialization more flexible
-rw-r--r--board/goldelico/gta04/TD028TTEC1.c26
-rw-r--r--board/goldelico/gta04/dssfb.c48
-rw-r--r--board/goldelico/gta04/dssfb.h4
-rw-r--r--board/goldelico/gta04/jbt6k74.c51
4 files changed, 68 insertions, 61 deletions
diff --git a/board/goldelico/gta04/TD028TTEC1.c b/board/goldelico/gta04/TD028TTEC1.c
index 066362e..94667a3 100644
--- a/board/goldelico/gta04/TD028TTEC1.c
+++ b/board/goldelico/gta04/TD028TTEC1.c
@@ -37,16 +37,6 @@
#include <asm/mach-types.h>
#include "TD028TTEC1.h"
-#if 0
-#define DEBUGP(x, args...) printf("%s: " x, __FUNCTION__, ## args);
-#define DEBUGPC(x, args...) printf(x, ## args);
-#define VERIFY(VAL) if(SPI_READ() != (VAL)) { printf("expected: %d found: %d\n", VAL, SPI_READ()); return 1; }
-#else
-#define DEBUGP(x, args...) do { } while (0)
-#define DEBUGPC(x, args...) do { } while (0)
-#define VERIFY(VAL) if(SPI_READ() != (VAL)) { return 1; }
-#endif
-
#ifdef CONFIG_OMAP3_BEAGLE
#ifdef CONFIG_OMAP3_GTA04
@@ -116,8 +106,8 @@ static int jbt_spi_xfer(int wordnum, int bitlen, u_int16_t *dout)
u_int16_t tmpdout = 0;
int i, j;
- DEBUGP("spi_xfer: dout %08X wordnum %u bitlen %d\n",
- *(uint *)dout, wordnum, bitlen);
+// DEBUGP("spi_xfer: dout %08X wordnum %u bitlen %d\n",
+// *(uint *)dout, wordnum, bitlen);
SPI_CS(0);
@@ -128,21 +118,21 @@ static int jbt_spi_xfer(int wordnum, int bitlen, u_int16_t *dout)
SPI_SCL(0);
if (tmpdout & (1 << (bitlen-1))) {
SPI_SDA(1);
- DEBUGPC("1");
- VERIFY(1);
+// DEBUGPC("1");
+// VERIFY(1);
} else {
SPI_SDA(0);
- DEBUGPC("0");
- VERIFY(0);
+// DEBUGPC("0");
+// VERIFY(0);
}
SPI_DELAY();
SPI_SCL(1);
SPI_DELAY();
tmpdout <<= 1;
}
- DEBUGPC(" ");
+// DEBUGPC(" ");
}
- DEBUGPC("\n");
+// DEBUGPC("\n");
SPI_CS(1);
diff --git a/board/goldelico/gta04/dssfb.c b/board/goldelico/gta04/dssfb.c
index 9ad530c..639451f 100644
--- a/board/goldelico/gta04/dssfb.c
+++ b/board/goldelico/gta04/dssfb.c
@@ -28,56 +28,20 @@
#include <asm/arch/sys_proto.h>
#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)
-
-// configure beagle board DSS for the TD28TTEC1
-
-#define DSS1_FCLK 432000000 // see figure 15-65
-#define PIXEL_CLOCK 22000000 // approx. 22 MHz (will be divided from 432 MHz)
-
-// all values are min ratings
-
-#define VDISP 640 // vertical active area
-#define VFP 4 // vertical front porch
-#define VS 2 // VSYNC pulse width (negative going)
-#define VBP 2 // vertical back porch
-#define VDS (VS+VBP) // vertical data start
-#define VBL (VS+VBP+VFP) // vertical blanking period
-#define VP (VDISP+VBL) // vertical cycle
-
-#define HDISP 480 // horizontal active area
-#define HFP 24 // horizontal front porch
-#define HS 8 // HSYNC pulse width (negative going)
-#define HBP 8 // horizontal back porch
-#define HDS (HS+HBP) // horizontal data start
-#define HBL (HS+HBP+HFP) // horizontal blanking period
-#define HP (HDISP+HBL) // horizontal cycle
+#include "dssfb.h"
#if 0
#define DEBUGP(x, args...) printf("%s: " x, __FUNCTION__, ## args);
#define DEBUGPC(x, args...) printf(x, ## args);
+#define VERIFY(VAL) if(SPI_READ() != (VAL)) { printf("expected: %d found: %d\n", VAL, SPI_READ()); return 1; }
#else
#define DEBUGP(x, args...) do { } while (0)
#define DEBUGPC(x, args...) do { } while (0)
+#define VERIFY(VAL) if(SPI_READ() != (VAL)) { return 1; }
#endif
-static const struct panel_config lcm_cfg =
-{
-.timing_h = ((HBP-1)<<20) | ((HFP-1)<<8) | ((HS-1)<<0), /* Horizantal timing */
-.timing_v = ((VBP+0)<<20) | ((VFP+0)<<8) | ((VS-1)<<0), /* Vertical timing */
-.pol_freq = (1<<17)|(0<<16)|(0<<15)|(1<<14)|(1<<13)|(1<<12)|0x28, /* Pol Freq */
-.divisor = (0x0001<<16)|(DSS1_FCLK/PIXEL_CLOCK), /* Pixel Clock divisor from dss1_fclk */
-.lcd_size = ((HDISP-1)<<0) | ((VDISP-1)<<16), /* as defined by LCM */
-.panel_type = 0x01, /* TFT */
-.data_lines = 0x03, /* 24 Bit RGB */
-.load_mode = 0x02, /* Frame Mode */
-.panel_color = DVI_BACKGROUND_COLOR
-};
-
void omap3_dss_go(void)
{ // push changes from shadow register to display controller
struct dispc_regs *dispc = (struct dispc_regs *) OMAP3_DISPC_BASE;
@@ -256,7 +220,7 @@ static const struct panel_config dvid_cfg = {
.panel_color = DVI_BEAGLE_ORANGE_COL /* ORANGE */
};
-void dssfb_init(void)
+void dssfb_init(const struct panel_config *lcm_cfg)
{
#ifdef CONFIG_OMAP3_GTA04A2 /* delayed on GTA04A2 */
struct prcm *prcm_base = (struct prcm *)PRCM_BASE;
@@ -272,9 +236,11 @@ void dssfb_init(void)
printf("ick_cam_on\n");
// sr32(&prcm_base->iclken_cam, 0, 32, ICK_CAM_ON);
sdelay(1000);
+#else
+ // FIXME: restore original code
#endif
printf("dss panel config\n");
- omap3_dss_panel_config(&lcm_cfg); // set new config
+ 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/dssfb.h b/board/goldelico/gta04/dssfb.h
index b4755dd..a71b193 100644
--- a/board/goldelico/gta04/dssfb.h
+++ b/board/goldelico/gta04/dssfb.h
@@ -21,7 +21,9 @@
*
*/
-void dssfb_init(void);
+#include <asm/arch/dss.h>
+
+void dssfb_init(const struct panel_config *lcm_cfg);
void omap3_dss_go(void);
diff --git a/board/goldelico/gta04/jbt6k74.c b/board/goldelico/gta04/jbt6k74.c
index 8c5aaea..8df6184 100644
--- a/board/goldelico/gta04/jbt6k74.c
+++ b/board/goldelico/gta04/jbt6k74.c
@@ -37,6 +37,55 @@
#include "dssfb.h"
#include "jbt6k74.h"
+// FIXME: we have somehow mixed up the file names...
+
+// configure beagle board DSS for the TD28TTEC1
+
+#define DVI_BACKGROUND_COLOR 0x00fadc29 // rgb(250, 220, 41)
+
+#define DSS1_FCLK 432000000 // see figure 15-65
+#define PIXEL_CLOCK 22000000 // approx. 22 MHz (will be divided from 432 MHz)
+
+// all values are min ratings
+
+#define VDISP 640 // vertical active area
+#define VFP 4 // vertical front porch
+#define VS 2 // VSYNC pulse width (negative going)
+#define VBP 2 // vertical back porch
+#define VDS (VS+VBP) // vertical data start
+#define VBL (VS+VBP+VFP) // vertical blanking period
+#define VP (VDISP+VBL) // vertical cycle
+
+#define HDISP 480 // horizontal active area
+#define HFP 24 // horizontal front porch
+#define HS 8 // HSYNC pulse width (negative going)
+#define HBP 8 // horizontal back porch
+#define HDS (HS+HBP) // horizontal data start
+#define HBL (HS+HBP+HFP) // horizontal blanking period
+#define HP (HDISP+HBL) // horizontal cycle
+
+#if 0
+#define DEBUGP(x, args...) printf("%s: " x, __FUNCTION__, ## args);
+#define DEBUGPC(x, args...) printf(x, ## args);
+#else
+#define DEBUGP(x, args...) do { } while (0)
+#define DEBUGPC(x, args...) do { } while (0)
+#endif
+
+static const struct panel_config lcm_cfg =
+{
+ .timing_h = ((HBP-1)<<20) | ((HFP-1)<<8) | ((HS-1)<<0), /* Horizantal timing */
+ .timing_v = ((VBP+0)<<20) | ((VFP+0)<<8) | ((VS-1)<<0), /* Vertical timing */
+ .pol_freq = (1<<17)|(0<<16)|(0<<15)|(1<<14)|(1<<13)|(1<<12)|0x28, /* Pol Freq */
+ .divisor = (0x0001<<16)|(DSS1_FCLK/PIXEL_CLOCK), /* Pixel Clock divisor from dss1_fclk */
+ .lcd_size = ((HDISP-1)<<0) | ((VDISP-1)<<16), /* as defined by LCM */
+ .panel_type = 0x01, /* TFT */
+ .data_lines = 0x03, /* 24 Bit RGB */
+ .load_mode = 0x02, /* Frame Mode */
+ .panel_color = DVI_BACKGROUND_COLOR
+};
+
+
#if 1
#define DEBUGP(x, args...) printf("%s: " x, __FUNCTION__, ## args);
#define DEBUGPC(x, args...) printf(x, ## args);
@@ -329,7 +378,7 @@ int board_video_init(GraphicDevice *pGD)
printf("No LCM connected\n");
return 1;
}
- dssfb_init();
+ dssfb_init(&lcm_cfg);
printf("did board_video_init()\n");
return 0;