diff options
author | Peng Fan <peng.fan@nxp.com> | 2016-02-23 10:14:34 +0800 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2017-04-05 14:04:28 +0800 |
commit | 79a86adf2279336617ad7d4f0813f040b17318d4 (patch) | |
tree | 0e1a0a8af665bb83a40552091f6464bb0d93fc82 /include/lcd.h | |
parent | 27e20dc28570d710ecaa0db9db508c8ee750d1ae (diff) | |
download | u-boot-imx-79a86adf2279336617ad7d4f0813f040b17318d4.zip u-boot-imx-79a86adf2279336617ad7d4f0813f040b17318d4.tar.gz u-boot-imx-79a86adf2279336617ad7d4f0813f040b17318d4.tar.bz2 |
MLK-12425-2: video: epdc: introduce epdc support
Support EPDC.
E-Ink feature is supported by i.MX6DL/SL and i.MX7D.
For now this driver only supports i.MX6DL/SL, because the
i.MX7D EPDC driver needs pxp support which is not included
in U-Boot.
Support user defined logo file, if there is no logo file, it will
draw a black border around a white screen.
If need to enable EPDC, a waveform file is required to let all
work.
Since we need LCD_MONOCHROME mode for EPDC, we introduce LCD_MONOCHROME
support.
Please refer to Linux Reference Manual for how to flash WAVEFORM file.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Robby Cai <R63905@freescale.com>
Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
Signed-off-by: Ye.Li <B37916@freescale.com>
(cherry picked from commit a7244f279cc3c3994bcd103f5e9a183b1075ae71)
Diffstat (limited to 'include/lcd.h')
-rw-r--r-- | include/lcd.h | 78 |
1 files changed, 77 insertions, 1 deletions
diff --git a/include/lcd.h b/include/lcd.h index f76fca7..37d26f9 100644 --- a/include/lcd.h +++ b/include/lcd.h @@ -31,6 +31,7 @@ extern struct vidinfo panel_info; void lcd_ctrl_init(void *lcdbase); void lcd_enable(void); void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue); +void lcd_initcolregs (void); /** * Set whether we need to flush the dcache when changing the LCD image. This @@ -49,6 +50,64 @@ void lcd_set_flush_dcache(int flush); #include <atmel_lcd.h> #elif defined(CONFIG_EXYNOS_FB) #include <exynos_lcd.h> +#elif defined(CONFIG_MXC_EPDC) + +struct waveform_modes { + int mode_init; + int mode_du; + int mode_gc4; + int mode_gc8; + int mode_gc16; + int mode_gc32; +}; + +struct epdc_timing_params { + int vscan_holdoff; + int sdoed_width; + int sdoed_delay; + int sdoez_width; + int sdoez_delay; + int gdclk_hp_offs; + int gdsp_offs; + int gdoe_offs; + int gdclk_offs; + int num_ce; +}; + +struct epdc_data_struct { + /* EPDC buffer pointers */ + u_long working_buf_addr; + u_long waveform_buf_addr; + + /* Waveform mode definitions */ + struct waveform_modes wv_modes; + struct epdc_timing_params epdc_timings; +}; + +typedef struct vidinfo { + u_long vl_refresh; /* Refresh Rate Hz */ + u_long vl_row; /* resolution in x */ + u_long vl_col; /* resolution in y */ + u_long vl_rot; + u_long vl_pixclock; /* pixel clock in picoseconds */ + u_long vl_left_margin; /* Horizontal back porch */ + u_long vl_right_margin; /* Horizontal front porch */ + u_long vl_upper_margin; /* Vertical back porch */ + u_long vl_lower_margin; /* Vertical front porch */ + u_long vl_hsync; /* Horizontal sync pulse length */ + u_long vl_vsync; /* Vertical sync pulse length */ + u_long vl_sync; /* Polarity on data enable */ + u_long vl_mode; /* Video Mode */ + u_long vl_flag; + u_char vl_bpix; + ushort *cmap; + struct epdc_data_struct epdc_data; +} vidinfo_t; + +static __maybe_unused ushort *configuration_get_cmap(void) +{ + return panel_info.cmap; +} #else typedef struct vidinfo { ushort vl_col; /* Number of columns (i.e. 160) */ @@ -165,6 +224,16 @@ void lcd_sync(void); #define LCD_BPP LCD_COLOR8 #endif +#if LCD_BPP == LCD_MONOCHROME +# define COLOR_MASK(c) ((c) | (c) << 1 | (c) << 2 | (c) << 3 | \ + (c) << 4 | (c) << 5 | (c) << 6 | (c) << 7) +#elif (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) || \ + (LCD_BPP == LCD_COLOR32) +# define COLOR_MASK(c) (c) +#else +#error Unsupported LCD BPP. +#endif + #ifndef LCD_DF #define LCD_DF 1 #endif @@ -173,7 +242,14 @@ void lcd_sync(void); #define NBITS(bit_code) (1 << (bit_code)) #define NCOLORS(bit_code) (1 << NBITS(bit_code)) -#if LCD_BPP == LCD_COLOR8 +#if LCD_BPP == LCD_MONOCHROME +/* + * Simple black/white definitions + */ +# define CONSOLE_COLOR_BLACK 0 +# define CONSOLE_COLOR_WHITE 1 /* Must remain last / highest */ + +#elif LCD_BPP == LCD_COLOR8 # define CONSOLE_COLOR_BLACK 0 # define CONSOLE_COLOR_RED 1 # define CONSOLE_COLOR_GREEN 2 |