1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef _LCD_H_
14#define _LCD_H_
15#include <lcd_console.h>
16#if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
17#include <bmp_layout.h>
18#include <asm/byteorder.h>
19#endif
20
21int bmp_display(ulong addr, int x, int y);
22struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
23 void **alloc_addr);
24
25#ifndef CONFIG_DM_VIDEO
26
27extern char lcd_is_enabled;
28extern int lcd_line_length;
29extern struct vidinfo panel_info;
30
31void lcd_ctrl_init(void *lcdbase);
32void lcd_enable(void);
33void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue);
34
35
36
37
38
39
40
41void lcd_set_flush_dcache(int flush);
42
43#if defined CONFIG_MPC823
44#include <mpc823_lcd.h>
45#elif defined(CONFIG_CPU_PXA25X) || defined(CONFIG_CPU_PXA27X) || \
46 defined CONFIG_CPU_MONAHANS
47#include <pxa_lcd.h>
48#elif defined(CONFIG_ATMEL_LCD) || defined(CONFIG_ATMEL_HLCD)
49#include <atmel_lcd.h>
50#elif defined(CONFIG_EXYNOS_FB)
51#include <exynos_lcd.h>
52#else
53typedef struct vidinfo {
54 ushort vl_col;
55 ushort vl_row;
56 ushort vl_rot;
57 u_char vl_bpix;
58 ushort *cmap;
59 void *priv;
60} vidinfo_t;
61
62static __maybe_unused ushort *configuration_get_cmap(void)
63{
64 return panel_info.cmap;
65}
66#endif
67
68ushort *configuration_get_cmap(void);
69
70extern vidinfo_t panel_info;
71
72void lcd_putc(const char c);
73void lcd_puts(const char *s);
74void lcd_printf(const char *fmt, ...);
75void lcd_clear(void);
76int lcd_display_bitmap(ulong bmp_image, int x, int y);
77
78
79
80
81
82
83int lcd_get_pixel_width(void);
84
85
86
87
88
89
90int lcd_get_pixel_height(void);
91
92
93
94
95
96
97int lcd_get_screen_rows(void);
98
99
100
101
102
103
104int lcd_get_screen_columns(void);
105
106
107
108
109
110
111int lcd_getbgcolor(void);
112
113
114
115
116
117
118int lcd_getfgcolor(void);
119
120
121
122
123
124
125
126void lcd_position_cursor(unsigned col, unsigned row);
127
128
129void lcd_show_board_info(void);
130
131
132int lcd_get_size(int *line_length);
133
134
135void lcd_sync(void);
136
137
138
139
140
141
142#define CONFIG_SYS_HIGH 0
143#define CONFIG_SYS_LOW 1
144
145#define LCD_MONOCHROME 0
146#define LCD_COLOR2 1
147#define LCD_COLOR4 2
148#define LCD_COLOR8 3
149#define LCD_COLOR16 4
150#define LCD_COLOR32 5
151
152#if defined(CONFIG_LCD_INFO_BELOW_LOGO)
153#define LCD_INFO_X 0
154#define LCD_INFO_Y (BMP_LOGO_HEIGHT + VIDEO_FONT_HEIGHT)
155#elif defined(CONFIG_LCD_LOGO)
156#define LCD_INFO_X (BMP_LOGO_WIDTH + 4 * VIDEO_FONT_WIDTH)
157#define LCD_INFO_Y VIDEO_FONT_HEIGHT
158#else
159#define LCD_INFO_X VIDEO_FONT_WIDTH
160#define LCD_INFO_Y VIDEO_FONT_HEIGHT
161#endif
162
163
164#ifndef LCD_BPP
165#define LCD_BPP LCD_COLOR8
166#endif
167
168#ifndef LCD_DF
169#define LCD_DF 1
170#endif
171
172
173#define NBITS(bit_code) (1 << (bit_code))
174#define NCOLORS(bit_code) (1 << NBITS(bit_code))
175
176#if LCD_BPP == LCD_COLOR8
177# define CONSOLE_COLOR_BLACK 0
178# define CONSOLE_COLOR_RED 1
179# define CONSOLE_COLOR_GREEN 2
180# define CONSOLE_COLOR_YELLOW 3
181# define CONSOLE_COLOR_BLUE 4
182# define CONSOLE_COLOR_MAGENTA 5
183# define CONSOLE_COLOR_CYAN 6
184# define CONSOLE_COLOR_GREY 14
185# define CONSOLE_COLOR_WHITE 15
186#elif LCD_BPP == LCD_COLOR32
187#define CONSOLE_COLOR_RED 0x00ff0000
188#define CONSOLE_COLOR_GREEN 0x0000ff00
189#define CONSOLE_COLOR_YELLOW 0x00ffff00
190#define CONSOLE_COLOR_BLUE 0x000000ff
191#define CONSOLE_COLOR_MAGENTA 0x00ff00ff
192#define CONSOLE_COLOR_CYAN 0x0000ffff
193#define CONSOLE_COLOR_GREY 0x00aaaaaa
194#define CONSOLE_COLOR_BLACK 0x00000000
195#define CONSOLE_COLOR_WHITE 0x00ffffff
196#define NBYTES(bit_code) (NBITS(bit_code) >> 3)
197#else
198# define CONSOLE_COLOR_BLACK 0x0000
199# define CONSOLE_COLOR_RED 0xF800
200# define CONSOLE_COLOR_GREEN 0x07E0
201# define CONSOLE_COLOR_YELLOW 0xFFE0
202# define CONSOLE_COLOR_BLUE 0x001F
203# define CONSOLE_COLOR_MAGENTA 0xF81F
204# define CONSOLE_COLOR_CYAN 0x07FF
205# define CONSOLE_COLOR_GREY 0xC618
206# define CONSOLE_COLOR_WHITE 0xffff
207#endif
208
209#if LCD_BPP == LCD_COLOR16
210#define fbptr_t ushort
211#elif LCD_BPP == LCD_COLOR32
212#define fbptr_t u32
213#else
214#define fbptr_t uchar
215#endif
216
217#ifndef PAGE_SIZE
218#define PAGE_SIZE 4096
219#endif
220
221#endif
222
223#endif
224