diff options
Diffstat (limited to 'firmware/target/arm/sandisk')
-rw-r--r-- | firmware/target/arm/sandisk/sansa-e200/lcd-e200.c | 58 |
1 files changed, 55 insertions, 3 deletions
diff --git a/firmware/target/arm/sandisk/sansa-e200/lcd-e200.c b/firmware/target/arm/sandisk/sansa-e200/lcd-e200.c index 2ee191faa5..c2829d11da 100644 --- a/firmware/target/arm/sandisk/sansa-e200/lcd-e200.c +++ b/firmware/target/arm/sandisk/sansa-e200/lcd-e200.c | |||
@@ -21,9 +21,7 @@ | |||
21 | * | 21 | * |
22 | ****************************************************************************/ | 22 | ****************************************************************************/ |
23 | #include "config.h" | 23 | #include "config.h" |
24 | #include "cpu.h" | ||
25 | #include "lcd.h" | 24 | #include "lcd.h" |
26 | #include "kernel.h" | ||
27 | #include "system.h" | 25 | #include "system.h" |
28 | 26 | ||
29 | #define LCD_DATA_IN_GPIO GPIOB_INPUT_VAL | 27 | #define LCD_DATA_IN_GPIO GPIOB_INPUT_VAL |
@@ -108,6 +106,29 @@ static inline void lcd_write_reg(unsigned int reg, unsigned int data) | |||
108 | lcd_send_msg(0x72, data); | 106 | lcd_send_msg(0x72, data); |
109 | } | 107 | } |
110 | 108 | ||
109 | static inline void cache_flush(void) | ||
110 | { | ||
111 | #ifndef BOOTLOADER | ||
112 | outl(inl(0xf000f044) | 0x2, 0xf000f044); | ||
113 | while ((inl(0x6000c000) & 0x8000) != 0) | ||
114 | { | ||
115 | } | ||
116 | #endif | ||
117 | } | ||
118 | |||
119 | /* The LCD controller gets passed the address of the framebuffer, but can only | ||
120 | use the physical, not the remapped, address. This is a quick and dirty way | ||
121 | of correcting it */ | ||
122 | static unsigned long phys_fb_address(unsigned long address) | ||
123 | { | ||
124 | if(address < 0x10000000) | ||
125 | { | ||
126 | return address + 0x10000000; | ||
127 | } else { | ||
128 | return address; | ||
129 | } | ||
130 | } | ||
131 | |||
111 | inline void lcd_init_device(void) | 132 | inline void lcd_init_device(void) |
112 | { | 133 | { |
113 | /* All this is magic worked out by MrH */ | 134 | /* All this is magic worked out by MrH */ |
@@ -158,7 +179,7 @@ inline void lcd_init_device(void) | |||
158 | LCD_REG_6 |= (1 << 4); | 179 | LCD_REG_6 |= (1 << 4); |
159 | 180 | ||
160 | LCD_REG_5 &= ~(1 << 7); | 181 | LCD_REG_5 &= ~(1 << 7); |
161 | LCD_FB_BASE_REG = (unsigned long)lcd_framebuffer; | 182 | LCD_FB_BASE_REG = phys_fb_address((unsigned long)lcd_framebuffer); |
162 | 183 | ||
163 | udelay(100000); | 184 | udelay(100000); |
164 | 185 | ||
@@ -228,6 +249,7 @@ inline void lcd_init_device(void) | |||
228 | 249 | ||
229 | inline void lcd_update(void) | 250 | inline void lcd_update(void) |
230 | { | 251 | { |
252 | cache_flush(); | ||
231 | if(!(LCD_REG_6 & 1)) | 253 | if(!(LCD_REG_6 & 1)) |
232 | LCD_REG_6 |= 1; | 254 | LCD_REG_6 |= 1; |
233 | } | 255 | } |
@@ -262,3 +284,33 @@ void lcd_set_flip(bool yesno) | |||
262 | /* TODO: Implement lcd_set_flip() */ | 284 | /* TODO: Implement lcd_set_flip() */ |
263 | (void)yesno; | 285 | (void)yesno; |
264 | } | 286 | } |
287 | |||
288 | /* Blitting functions */ | ||
289 | |||
290 | void lcd_blit(const fb_data* data, int x, int by, int width, | ||
291 | int bheight, int stride) | ||
292 | { | ||
293 | /* TODO: Implement lcd_blit() */ | ||
294 | (void)data; | ||
295 | (void)x; | ||
296 | (void)by; | ||
297 | (void)width; | ||
298 | (void)bheight; | ||
299 | (void)stride; | ||
300 | } | ||
301 | |||
302 | void lcd_yuv_blit(unsigned char * const src[3], | ||
303 | int src_x, int src_y, int stride, | ||
304 | int x, int y, int width, int height) | ||
305 | { | ||
306 | /* TODO: Implement lcd_blit() */ | ||
307 | (void)src; | ||
308 | (void)src_x; | ||
309 | (void)src_y; | ||
310 | (void)stride; | ||
311 | (void)x; | ||
312 | (void)y; | ||
313 | (void)width; | ||
314 | (void)height; | ||
315 | } | ||
316 | |||