aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Kocialkowski2015-01-24 17:26:32 +0100
committerPaul Kocialkowski2015-07-15 15:07:27 +0200
commit15158a0a666577cce5f804d3c53008a510c5924e (patch)
tree7124f325631f9ad743dbb7df535fce0d59c3c5b2
parent92828fe7f7de3bee617f9ca1fa5a611eb753555c (diff)
WIP: first batch of video pruning
-rwxr-xr-xboard/lge/sniper/hub_dpi.c242
-rwxr-xr-xboard/lge/sniper/panel-hub.c224
-rw-r--r--board/lge/sniper/sniper.c13
-rw-r--r--include/configs/sniper.h5
4 files changed, 5 insertions, 479 deletions
diff --git a/board/lge/sniper/hub_dpi.c b/board/lge/sniper/hub_dpi.c
index ad7c75db648..568a8736fa2 100755
--- a/board/lge/sniper/hub_dpi.c
+++ b/board/lge/sniper/hub_dpi.c
@@ -20,144 +20,6 @@
#include <asm/arch/sys_proto.h>
#include "hub_dss.h"
-
-#define LCD_XRES 480
-#define LCD_YRES 800
-
-/* [skykrkrk@lge.com] 2010-01-14, optimized clock speed : 26.585MHz. if 24700 is selected, pixel-clock will be 24.686MHz */
-#define LCD_PIXCLOCK_OPT 26583
-#define LCD_PIXCLOCK_MIN 24700 /* NEC MIN PIX Clock is 21.8MHz */
-#define LCD_PIXCLOCK_TYP 26000 /* Typical PIX clock is 23.8MHz */
-#define LCD_PIXCLOCK_MAX 27300 /* Maximum is 25.7MHz */
-
-/* Current Pixel clock */
-#define LCD_PIXEL_CLOCK LCD_PIXCLOCK_OPT
-
-//PAULK: not used
-static struct omap_video_timings hub_panel_timings = {
- /* LGE_CHANGE_S [HEAVEN:FW:tosungmin@lge.com] 2009-09-07, lcd drivers */
- .x_res = LCD_XRES,
- .y_res = LCD_YRES,
- .pixel_clock = LCD_PIXEL_CLOCK,
- .hfp = 1, //right_margin - 1
- .hsw = 1, //hsync_len - 1
- .hbp = 1, //left_margin - 1
- .vfp = 0, //lower_margin
- .vsw = 1, //vsync_len - 1
- .vbp = 0, //upper_margin
-
-};
-
-static u32 hub_config = (OMAP_DSS_LCD_TFT | OMAP_DSS_LCD_IVS |OMAP_DSS_LCD_IHS);
-static u8 data_lines = 24;
-static int hub_acbi = 0; /* ac-bias pin transitions per interrupt */
-/* Unit: line clocks */
-static int hub_acb = 0; /* ac-bias pin frequency */
-static int dss_state = OMAP_DSS_DISPLAY_DISABLED;
-
-static int dpi_set_dsi_clk(bool is_tft, unsigned long pck_req,
- unsigned long *fck, int *lck_div, int *pck_div)
-{
- struct dsi_clock_info cinfo;
- int r;
-
- r = dsi_pll_calc_pck(is_tft, pck_req, &cinfo);
- if (r)
- return r;
-
- r = dsi_pll_program(&cinfo);
- if (r)
- return r;
-
- dss_select_clk_source(0, 1);
-
- dispc_set_lcd_divisor(cinfo.lck_div, cinfo.pck_div);
-
- *fck = cinfo.dsi1_pll_fclk;
- *lck_div = cinfo.lck_div;
- *pck_div = cinfo.pck_div;
-
- return 0;
-}
-
-static int dpi_set_dispc_clk(bool is_tft, unsigned long pck_req,
- unsigned long *fck, int *lck_div, int *pck_div)
-{
- struct dispc_clock_info cinfo;
- int r;
-
- r = dispc_calc_clock_div(is_tft, pck_req, &cinfo);
- if (r)
- return r;
-
- r = dispc_set_clock_div(&cinfo);
- if (r)
- return r;
-
- *fck = cinfo.fck;
- *lck_div = cinfo.lck_div;
- *pck_div = cinfo.pck_div;
-
- return 0;
-}
-
-//PAULK: Not called
-static int dpi_set_mode(void)
-{
- int lck_div, pck_div;
- unsigned long fck;
- unsigned long pck;
- bool is_tft;
- int r = 0;
-
- //dss_clk_enable(1);
-
- dispc_set_pol_freq(hub_config, hub_acbi, hub_acb);
-
- is_tft = (hub_config & OMAP_DSS_LCD_TFT) != 0;
-
- r = dpi_set_dsi_clk(is_tft, hub_panel_timings.pixel_clock * 1000,
- &fck, &lck_div, &pck_div);
- //r = dpi_set_dispc_clk(is_tft, hub_panel_timings.pixel_clock * 1000,
- // &fck, &lck_div, &pck_div);
- if (r)
- goto err0;
-
- pck = fck / lck_div / pck_div / 1000;
-
- if (pck != hub_panel_timings.pixel_clock) {
-#if 0
- DSSWARN("Could not find exact pixel clock. "
- "Requested %d kHz, got %lu kHz\n",
- t->pixel_clock, pck);
-#endif
- hub_panel_timings.pixel_clock = pck;
- }
-
- dispc_set_lcd_timings(&hub_panel_timings);
- return 0;
-
-err0:
- //dss_clk_enable(0);
- printf("dpi_set_mode_err0\n");
- return r;
-}
-
-// PAULK: NOT ACTUALLY CALLED
-static int dpi_basic_init(void)
-{
- bool is_tft;
-
- is_tft = (hub_config & OMAP_DSS_LCD_TFT) != 0;
-
- dispc_set_parallel_interface_mode(OMAP_DSS_PARALLELMODE_BYPASS);
- dispc_set_lcd_display_type(is_tft ? OMAP_DSS_LCD_DISPLAY_TFT :
- OMAP_DSS_LCD_DISPLAY_STN);
- dispc_set_tft_data_lines(data_lines);
-
- return 0;
-}
-
int dss_clk_enable(bool enable)
{
//#define FCK_DSS_ON 0x00000005 /* tv+dss1 (not dss2) */
@@ -179,107 +41,3 @@ int dss_clk_enable(bool enable)
return 0;
}
-
-// PAULK: NOT ACTUALLY CALLED
-static int dpi_display_enable(void)
-{
- static int r;
-
- //dss_clk_enable(1);
-
- r = dpi_basic_init();
- if (r)
- goto err0;
-
- //dss_clk_enable(1);
-
- r = dsi_pll_init(1, 1);
-
- //r = dpi_set_mode();
- //if (r)
- // goto err0;
-
- mdelay(2);
-
- //dispc_enable_lcd_out(1);
-
- //dss_state = OMAP_DSS_DISPLAY_ACTIVE;
-
- return 0;
-
-err0:
- //dispc_enable_lcd_out(0);
- //dss_clk_enable(0);
- printf("kyungtae_dpi_display_enable_err0");
- return r;
-}
-
-//PAULK: never called
-static void dpi_set_timings(struct omap_video_timings *timings)
-{
- if (dss_state == OMAP_DSS_DISPLAY_ACTIVE) {
- dpi_set_mode();
- dispc_go(OMAP_DSS_CHANNEL_LCD);
- }
-}
-
-static int dpi_check_timings(struct omap_video_timings *timings)
-{
- bool is_tft;
- int r;
- int lck_div, pck_div;
- unsigned long fck;
- unsigned long pck;
-
- if (!dispc_lcd_timings_ok(timings))
- return -EINVAL;
-
- if (timings->pixel_clock == 0)
- return -EINVAL;
-
- is_tft = (hub_config & OMAP_DSS_LCD_TFT) != 0;
- {
- struct dsi_clock_info cinfo;
- r = dsi_pll_calc_pck(is_tft, timings->pixel_clock * 1000,
- &cinfo);
-
- if (r)
- return r;
-
- fck = cinfo.dsi1_pll_fclk;
- lck_div = cinfo.lck_div;
- pck_div = cinfo.pck_div;
- }
-#if 0
- {
- struct dispc_clock_info cinfo;
- r = dispc_calc_clock_div(is_tft, timings->pixel_clock * 1000,
- &cinfo);
-
- if (r)
- return r;
-
- fck = cinfo.fck;
- lck_div = cinfo.lck_div;
- pck_div = cinfo.pck_div;
- }
-#endif
- pck = fck / lck_div / pck_div / 1000;
-
- timings->pixel_clock = pck;
-
- return 0;
-}
-
-static void dpi_get_timings(struct omap_video_timings *timings)
-{
- *timings = hub_panel_timings;
-}
-
-//PAULK: not actually called
-int dpi_init(void)
-{
- dpi_display_enable();
- return 0;
-}
-
diff --git a/board/lge/sniper/panel-hub.c b/board/lge/sniper/panel-hub.c
index be22f5c2412..eef3e690c85 100755
--- a/board/lge/sniper/panel-hub.c
+++ b/board/lge/sniper/panel-hub.c
@@ -279,31 +279,6 @@ u8 lcd_command_for_mipi[][22] = {
#define LCD_DAT(a) (&lcd_command_for_mipi[(a)][2])
#define LCD_LEN(a) (lcd_command_for_mipi[(a)][1])
-struct hub_panel_data {
- unsigned long hw_guard_end; /* next value of jiffies when we can
- * issue the next sleep in/out command
- */
- unsigned long hw_guard_wait; /* max guard time in jiffies */
-#if 0//kyungtae
- struct omap_dss_device *dssdev;
-#endif
- bool enabled;
- u8 rotate;
- bool mirror;
-
- bool te_enabled;
- bool use_ext_te;
- //struct completion te_completion;
-
- bool use_dsi_bl;
-
- bool intro_printed;
-#if 0//kyungtae
- struct workqueue_struct *esd_wq;
- struct delayed_work esd_work;
-#endif
-};
-
extern void dsi_hs_enable(int value);
int dsi_vc_send_bta_sync(int channel);
@@ -336,26 +311,7 @@ int hub_panel_dcs_write_1(u8 dcs_cmd, u8 param)
return dsi_vc_dcs_write(TCH, buf, 2);
}
-#if 0////
-static int hub_panel_sleep_in(struct hub_panel_data *td)
-{
- int r;
-
- //hw_guard_wait(td);
- mdelay(120);//kyungtae
-
- r = hub_panel_dcs_write_1(DCS_SLEEP_IN, 0);
- if (r)
- return r;
-
- //hw_guard_start(td, 120);
- mdelay(50);
-
- return 0;
-}
-#endif////
-
-static int hub_panel_sleep_out(struct hub_panel_data *td)
+static int hub_panel_sleep_out(void)
{
int r;
@@ -372,94 +328,6 @@ static int hub_panel_sleep_out(struct hub_panel_data *td)
return 0;
}
-#if 0////
-static int hub_panel_get_id(u8 *buf)
-{
- int r;
-
- r = dsi_vc_dcs_read(TCH, DCS_GET_ID, buf, 3);
- if (r)
- return r;
-
- return 0;
-}
-
-static int hub_panel_set_addr_mode(u8 rotate, bool mirror)
-{
- int r;
- u8 mode;
- int b5, b6, b7;
-
- r = hub_panel_dcs_read_1(DCS_READ_MADCTL, &mode);
-
- if (r)
- return r;
-
- switch (rotate) {
- default:
- case 0:
- b7 = 0;
- b6 = 0;
- b5 = 0;
- break;
- case 1:
- b7 = 0;
- b6 = 1;
- b5 = 1;
- break;
- case 2:
- b7 = 1;
- b6 = 1;
- b5 = 0;
- break;
- case 3:
- b7 = 1;
- b6 = 0;
- b5 = 1;
- break;
- }
-
- if (mirror)
- b6 = !b6;
-
- mode &= ~((1<<7) | (1<<6) | (1<<5));
- mode |= (b7 << 7) | (b6 << 6) | (b5 << 5);
-
- return hub_panel_dcs_write_1(DCS_MEM_ACC_CTRL, mode);
-}
-
-int hub_panel_set_update_window(u16 x, u16 y, u16 w, u16 h)
-{
- int r;
- u16 x1 = x;
- u16 x2 = x + w - 1;
- u16 y1 = y;
- u16 y2 = y + h - 1;
-
- u8 buf[5];
- buf[0] = DCS_COLUMN_ADDR;
- buf[1] = (x1 >> 8) & 0xff;
- buf[2] = (x1 >> 0) & 0xff;
- buf[3] = (x2 >> 8) & 0xff;
- buf[4] = (x2 >> 0) & 0xff;
-
- r = dsi_vc_dcs_write_nosync(TCH, buf, sizeof(buf));
- if (r)
- return r;
-
- buf[0] = DCS_PAGE_ADDR;
- buf[1] = (y1 >> 8) & 0xff;
- buf[2] = (y1 >> 0) & 0xff;
- buf[3] = (y2 >> 8) & 0xff;
- buf[4] = (y2 >> 0) & 0xff;
-
- r = dsi_vc_dcs_write_nosync(TCH, buf, sizeof(buf));
- if (r)
- return r;
- dsi_vc_send_bta_sync(TCH);
- return r;
-}
-#endif////
static int hub_panel_enable_te(bool enable)
{
@@ -510,7 +378,6 @@ static int lcd_present(void)
int hub_panel_enable(void)
{
int i, r;
- struct hub_panel_data *td;
hub_panel_reset_lcd();
@@ -524,7 +391,7 @@ int hub_panel_enable(void)
}
dsi_hs_enable(1);
- r = hub_panel_sleep_out(td);
+ r = hub_panel_sleep_out();
hub_panel_dcs_write_1(DCS_DISPLAY_ON, 0);
//// hub_panel_enable_te(1);
@@ -549,93 +416,6 @@ int hub_panel_init_lcd(void)
printf("LCD IS present at this point\n");
}
-/*
- val = *((volatile unsigned int *)0x48005000) | (1<<13);
- *((volatile unsigned int *)0x48005000) = val;
- val = *((volatile unsigned int *)0x48005010) | (1<<13);
- *((volatile unsigned int *)0x48005010) = val;
-
- omap_set_gpio_direction(HUB_PANEL_LCD_CS,0);
- omap_set_gpio_dataout(HUB_PANEL_LCD_CS, 1);
- hub_panel_enable();
- if (!lcd_present())
- hub_add_bootargs(" nolcd");
-*/
-
-// u8 mode;
-
-// hub_panel_dcs_read_1(DCS_READ_MADCTL, &mode);
-// printf("skykrkrk MADCTL 0x%02x\n", mode);
-
return 0;
}
-#if 0////
-static void hub_panel_setup_update(u16 x, u16 y, u16 w, u16 h)
-{
- hub_panel_set_update_window(x, y, w, h);
-}
-
-static int hub_panel_memory_read(void *buf, size_t size,
- u16 x, u16 y, u16 w, u16 h)
-{
- int r;
- int first = 1;
- int plen;
- unsigned buf_used = 0;
-
- if (size < w * h * 3)
- return -ENOMEM;
-
- size = min(w * h * 3, LCD_XRES * LCD_YRES * 3);
-
- /* plen 1 or 2 goes into short packet. until checksum error is fixed,
- * use short packets. plen 32 works, but bigger packets seem to cause
- * an error. */
- if (size % 2)
- plen = 1;
- else
- plen = 2;
-
- hub_panel_setup_update(x, y, w, h);
-
- r = dsi_vc_set_max_rx_packet_size(TCH, plen);
- if (r)
- return r;
-
- while (buf_used < size) {
- u8 dcs_cmd = first ? 0x2e : 0x3e;
- first = 0;
-
- r = dsi_vc_dcs_read(TCH, dcs_cmd,
- buf + buf_used, size - buf_used);
-
- if (r < 0) {
- //dev_err(&dssdev->dev, "read error\n");
- goto err;
- }
-
- buf_used += r;
-#if 0
- if (r < plen) {
- dev_err(&dssdev->dev, "short read\n");
- break;
- }
-
- if (signal_pending(current)) {
- dev_err(&dssdev->dev, "signal pending, "
- "aborting memory read\n");
- r = -ERESTARTSYS;
- goto err;
- }
-#endif
- }
-
- r = buf_used;
-
-err:
- dsi_vc_set_max_rx_packet_size(TCH, 1);
-
- return r;
-}
-#endif////
diff --git a/board/lge/sniper/sniper.c b/board/lge/sniper/sniper.c
index b4200861eb4..b165b436481 100644
--- a/board/lge/sniper/sniper.c
+++ b/board/lge/sniper/sniper.c
@@ -246,17 +246,6 @@ int board_video_init(void)
- hub_panel_init_lcd();
- dsi_init(); //20100906 kyungtae.oh@lge.com for Factory test at LCD off
- dsi_display_update(0, 0, 480, 800); // PAULK: that's totally useless
- configure_dispc();
- dispc_configure_image(NULL);
-
- hub_load_rle565_image(lg_boot_logo, CONFIG_FB_ADDRESS, 480*800);
-
- dispc_enable_lcd_out(1);
- dsi_update_screen_dispc(0,0,480,800);
-
return 0;
}
#endif
@@ -364,7 +353,7 @@ int misc_init_r(void)
dsi_display_update(0, 0, 480, 800); // PAULK: that's totally useless
configure_dispc();
- dispc_configure_image(NULL);
+ dispc_configure_image(NULL); // use fbaddress
hub_load_rle565_image(lg_boot_logo, CONFIG_FB_ADDRESS, 480*800);
dispc_enable_lcd_out(1);
dsi_update_screen_dispc(0,0,480,800);
diff --git a/include/configs/sniper.h b/include/configs/sniper.h
index f5f1649988a..bbae5cfe952 100644
--- a/include/configs/sniper.h
+++ b/include/configs/sniper.h
@@ -258,9 +258,8 @@
*/
#define CONFIG_BOOTCOMMAND \
- "i2c dev 1; i2c md 0x44 0x00 0x10; i2c mw 0x44 0x03 0x00; i2c md 0x44 0x00 0x10; i2c dev 0;" \
- "load mmc 0 0x82000000 recovery.img;" \
- "bootm 0x82000000;"
+ "i2c dev 1; i2c md 0x44 0x00 0x10; i2c mw 0x44 0x03 0x00; i2c md 0x44 0x00 0x10; i2c dev 0;"
+
/*
"i2c dev 1; i2c md 0x44 0x00 0x10; i2c mw 0x44 0x03 0x00; i2c md 0x44 0x00 0x10; i2c dev 0; fastboot;" \
"load mmc 0 0x82000000 recovery.img;" \