blob: 3c70e5be17de5ef752cc53a7a8e18c9462df26a3 [file] [log] [blame]
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2004 by Linus Nielsen Feltzing
11 *
Daniel Stenberg2acc0ac2008-06-28 18:10:04 +000012 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +000016 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22
23#include "cpu.h"
24#include "lcd.h"
25#include "kernel.h"
26#include "thread.h"
27#include <string.h>
28#include <stdlib.h>
29#include "file.h"
30#include "debug.h"
31#include "system.h"
32#include "font.h"
33#include "bidi.h"
34
Jens Arnoldcb9e3162006-03-17 15:42:06 +000035static bool display_on = false; /* is the display turned on? */
36static bool display_flipped = false;
37static int xoffset = 0; /* needed for flip */
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +000038
39/* register defines */
40#define R_START_OSC 0x00
41#define R_DRV_OUTPUT_CONTROL 0x01
42#define R_DRV_WAVEFORM_CONTROL 0x02
43#define R_ENTRY_MODE 0x03
44#define R_COMPARE_REG1 0x04
45#define R_COMPARE_REG2 0x05
46
47#define R_DISP_CONTROL1 0x07
48#define R_DISP_CONTROL2 0x08
49#define R_DISP_CONTROL3 0x09
50
51#define R_FRAME_CYCLE_CONTROL 0x0b
52#define R_EXT_DISP_IF_CONTROL 0x0c
53
54#define R_POWER_CONTROL1 0x10
55#define R_POWER_CONTROL2 0x11
56#define R_POWER_CONTROL3 0x12
57#define R_POWER_CONTROL4 0x13
58
59#define R_RAM_ADDR_SET 0x21
60#define R_WRITE_DATA_2_GRAM 0x22
61
62#define R_GAMMA_FINE_ADJ_POS1 0x30
63#define R_GAMMA_FINE_ADJ_POS2 0x31
64#define R_GAMMA_FINE_ADJ_POS3 0x32
65#define R_GAMMA_GRAD_ADJ_POS 0x33
66
67#define R_GAMMA_FINE_ADJ_NEG1 0x34
68#define R_GAMMA_FINE_ADJ_NEG2 0x35
69#define R_GAMMA_FINE_ADJ_NEG3 0x36
70#define R_GAMMA_GRAD_ADJ_NEG 0x37
71
72#define R_GAMMA_AMP_ADJ_RES_POS 0x38
73#define R_GAMMA_AMP_AVG_ADJ_RES_NEG 0x39
74
75#define R_GATE_SCAN_POS 0x40
76#define R_VERT_SCROLL_CONTROL 0x41
77#define R_1ST_SCR_DRV_POS 0x42
78#define R_2ND_SCR_DRV_POS 0x43
79#define R_HORIZ_RAM_ADDR_POS 0x44
80#define R_VERT_RAM_ADDR_POS 0x45
81
Jens Arnoldc5a309a2006-08-08 13:44:43 +000082#define LCD_CMD (*(volatile unsigned short *)0xf0000000)
83#define LCD_DATA (*(volatile unsigned short *)0xf0000002)
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +000084
Jens Arnold99f95502007-10-14 23:05:56 +000085#define R_ENTRY_MODE_HORZ 0x7030
86#define R_ENTRY_MODE_VERT 0x7038
87
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +000088/* called very frequently - inline! */
Jens Arnoldf3857ab2006-02-05 00:24:08 +000089static inline void lcd_write_reg(int reg, int val)
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +000090{
Jens Arnoldc5a309a2006-08-08 13:44:43 +000091 LCD_CMD = reg;
92 LCD_DATA = val;
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +000093}
94
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +000095/* called very frequently - inline! */
Jens Arnoldf3857ab2006-02-05 00:24:08 +000096static inline void lcd_begin_write_gram(void)
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +000097{
Jens Arnoldc5a309a2006-08-08 13:44:43 +000098 LCD_CMD = R_WRITE_DATA_2_GRAM;
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +000099}
100
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000101/*** hardware configuration ***/
102
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000103void lcd_set_contrast(int val)
104{
105 (void)val;
106}
107
108void lcd_set_invert_display(bool yesno)
109{
110 (void)yesno;
111}
112
Jens Arnoldcb9e3162006-03-17 15:42:06 +0000113static void flip_lcd(bool yesno)
114{
115 if (yesno)
116 {
117 lcd_write_reg(R_DRV_OUTPUT_CONTROL, 0x031b); /* 224 lines, GS=SS=1 */
118 lcd_write_reg(R_GATE_SCAN_POS, 0x0002); /* 16 lines offset */
119 lcd_write_reg(R_1ST_SCR_DRV_POS, 0xdf04); /* 4..223 */
120 }
121 else
122 {
123 lcd_write_reg(R_DRV_OUTPUT_CONTROL, 0x001b); /* 224 lines, GS=SS=0 */
124 lcd_write_reg(R_GATE_SCAN_POS, 0x0000);
125 lcd_write_reg(R_1ST_SCR_DRV_POS, 0xdb00); /* 0..219 */
126 }
127}
128
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000129/* turn the display upside down (call lcd_update() afterwards) */
130void lcd_set_flip(bool yesno)
131{
Jens Arnoldcb9e3162006-03-17 15:42:06 +0000132 display_flipped = yesno;
133 xoffset = yesno ? 4 : 0;
134
135 if (display_on)
136 flip_lcd(yesno);
137}
138
139static void _display_on(void)
140{
141 /** Sequence according to datasheet, p. 132 **/
142
143 lcd_write_reg(R_START_OSC, 0x0001); /* Start Oscilation */
144 sleep(1);
145
146 /* zero everything*/
147 lcd_write_reg(R_POWER_CONTROL1, 0x0000); /* STB = 0, SLP = 0 */
148 lcd_write_reg(R_DISP_CONTROL1, 0x0000); /* GON = 0, DTE = 0, D1-0 = 00b */
149 lcd_write_reg(R_POWER_CONTROL3, 0x0000); /* PON = 0 */
150 lcd_write_reg(R_POWER_CONTROL4, 0x0000); /* VCOMG = 0 */
151 sleep(1);
152
153 /* initialise power supply */
154
155 /* DC12-10 = 000b: Step-up1 = clock/8,
156 * DC02-00 = 000b: Step-up2 = clock/16,
157 * VC2-0 = 010b: VciOUT = 0.87 * VciLVL */
158 lcd_write_reg(R_POWER_CONTROL2, 0x0002);
159
160 /* VRH3-0 = 1000b: Vreg1OUT = REGP * 1.90 */
161 lcd_write_reg(R_POWER_CONTROL3, 0x0008);
162
163 /* VDV4-0 = 00110b: VcomA = Vreg1OUT * 0.76,
164 * VCM4-0 = 10000b: VcomH = Vreg1OUT * 0.70*/
165 lcd_write_reg(R_POWER_CONTROL4, 0x0610);
166
167 lcd_write_reg(R_POWER_CONTROL1, 0x0044); /* AP2-0 = 100b, DK = 1 */
168 lcd_write_reg(R_POWER_CONTROL3, 0x0018); /* PON = 1 */
169
170 sleep(4); /* Step-up circuit stabilising time */
171
172 /* start power supply */
173
174 lcd_write_reg(R_POWER_CONTROL1, 0x0540); /* BT2-0 = 101b, DK = 0 */
175 lcd_write_reg(R_POWER_CONTROL4, 0x2610); /* VCOMG = 1 */
176
177 /* other settings */
178
179 /* B/C = 1: n-line inversion form
180 * EOR = 1: polarity inversion occurs by applying an EOR to odd/even
181 * frame select signal and an n-line inversion signal.
182 * FLD = 01b: 1 field interlaced scan, external display iface */
183 lcd_write_reg(R_DRV_WAVEFORM_CONTROL, 0x0700);
184
185 /* Address counter updated in vertical direction; left to right;
186 * vertical increment horizontal increment.
187 * data format for 8bit transfer or spi = 65k (5,6,5)
188 * Reverse order of RGB to BGR for 18bit data written to GRAM
189 * Replace data on writing to GRAM */
190 lcd_write_reg(R_ENTRY_MODE, 0x7038);
191
192 flip_lcd(display_flipped);
193
194 lcd_write_reg(R_2ND_SCR_DRV_POS, 0x0000);
195 lcd_write_reg(R_VERT_SCROLL_CONTROL, 0x0000);
196
197 /* 19 clocks,no equalization */
198 lcd_write_reg(R_FRAME_CYCLE_CONTROL, 0x0002);
199
200 /* Transfer mode for RGB interface disabled
201 * internal clock operation;
202 * System interface/VSYNC interface */
203 lcd_write_reg(R_EXT_DISP_IF_CONTROL, 0x0003);
204
205 /* Front porch lines: 8; Back porch lines: 8; */
206 lcd_write_reg(R_DISP_CONTROL2, 0x0808);
207
208 /* Scan mode by the gate driver in the non-display area: disabled;
209 * Cycle of scan by the gate driver - set to 31frames(518ms),
210 * disabled by above setting */
211 lcd_write_reg(R_DISP_CONTROL3, 0x003f);
212
213 lcd_write_reg(R_GAMMA_FINE_ADJ_POS1, 0x0003);
214 lcd_write_reg(R_GAMMA_FINE_ADJ_POS2, 0x0707);
215 lcd_write_reg(R_GAMMA_FINE_ADJ_POS3, 0x0007);
216 lcd_write_reg(R_GAMMA_GRAD_ADJ_POS, 0x0705);
217 lcd_write_reg(R_GAMMA_FINE_ADJ_NEG1, 0x0007);
218 lcd_write_reg(R_GAMMA_FINE_ADJ_NEG2, 0x0000);
219 lcd_write_reg(R_GAMMA_FINE_ADJ_NEG3, 0x0407);
220 lcd_write_reg(R_GAMMA_GRAD_ADJ_NEG, 0x0507);
221 lcd_write_reg(R_GAMMA_AMP_ADJ_RES_POS, 0x1d09);
222 lcd_write_reg(R_GAMMA_AMP_AVG_ADJ_RES_NEG, 0x0303);
223
224 display_on=true; /* must be done before calling lcd_update() */
225 lcd_update();
226
227 sleep(4); /* op-amp stabilising time */
228
229 /** Sequence according to datasheet, p. 130 **/
230
231 lcd_write_reg(R_POWER_CONTROL1, 0x4540); /* SAP2-0=100, BT2-0=101, AP2-0=100 */
232 lcd_write_reg(R_DISP_CONTROL1, 0x0005); /* GON=0, DTE=0, REV=1, D1-0=01 */
233 sleep(2);
234
235 lcd_write_reg(R_DISP_CONTROL1, 0x0025); /* GON=1, DTE=0, REV=1, D1-0=01 */
236 lcd_write_reg(R_DISP_CONTROL1, 0x0027); /* GON=1, DTE=0, REV=1, D1-0=11 */
237 sleep(2);
238
239 lcd_write_reg(R_DISP_CONTROL1, 0x0037); /* GON=1, DTE=1, REV=1, D1-0=11 */
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000240}
241
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000242/* LCD init */
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000243void lcd_init_device(void)
244{
245 /* GPO46 is LCD RESET */
246 or_l(0x00004000, &GPIO1_OUT);
247 or_l(0x00004000, &GPIO1_ENABLE);
248 or_l(0x00004000, &GPIO1_FUNCTION);
249
250 /* Reset LCD */
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000251 and_l(~0x00004000, &GPIO1_OUT);
252 sleep(1);
253 or_l(0x00004000, &GPIO1_OUT);
254 sleep(1);
255
Jens Arnoldcb9e3162006-03-17 15:42:06 +0000256 _display_on();
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +0000257}
258
259void lcd_enable(bool on)
260{
261 if(display_on!=on)
Jens Arnoldcb9e3162006-03-17 15:42:06 +0000262 {
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +0000263 if(on)
264 {
Jens Arnoldcb9e3162006-03-17 15:42:06 +0000265 _display_on();
Michael Sevakisadf2e4c2008-05-28 10:17:16 +0000266 lcd_call_enable_hook();
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +0000267 }
268 else
269 {
Jens Arnoldcb9e3162006-03-17 15:42:06 +0000270 /** Off sequence according to datasheet, p. 130 **/
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +0000271
Jens Arnoldcb9e3162006-03-17 15:42:06 +0000272 lcd_write_reg(R_FRAME_CYCLE_CONTROL, 0x0002); /* EQ=0, 18 clks/line */
273 lcd_write_reg(R_DISP_CONTROL1, 0x0036); /* GON=1, DTE=1, REV=1, D1-0=10 */
274 sleep(2);
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +0000275
Jens Arnoldcb9e3162006-03-17 15:42:06 +0000276 lcd_write_reg(R_DISP_CONTROL1, 0x0026); /* GON=1, DTE=0, REV=1, D1-0=10 */
277 sleep(2);
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +0000278
Jens Arnoldcb9e3162006-03-17 15:42:06 +0000279 lcd_write_reg(R_DISP_CONTROL1, 0x0000); /* GON=0, DTE=0, D1-0=00 */
280
281 lcd_write_reg(R_POWER_CONTROL1, 0x0000); /* SAP2-0=000, AP2-0=000 */
282 lcd_write_reg(R_POWER_CONTROL3, 0x0000); /* PON=0 */
283 lcd_write_reg(R_POWER_CONTROL4, 0x0000); /* VCOMG=0 */
284
285 /* datasheet p. 131 */
286 lcd_write_reg(R_POWER_CONTROL1, 0x0001); /* STB=1: standby mode */
287
Hristo Kovachev9cf52702006-01-09 16:11:19 +0000288 display_on=false;
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +0000289 }
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +0000290 }
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000291}
292
Michael Sevakis60b01fa2007-07-31 12:43:06 +0000293bool lcd_enabled(void)
294{
295 return display_on;
296}
297
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000298/*** update functions ***/
299
Jens Arnold9af13c32006-08-23 17:30:51 +0000300/* Line write helper function for lcd_yuv_blit. Write two lines of yuv420.
Jens Arnold99f95502007-10-14 23:05:56 +0000301 * y should have two lines of Y back to back, 2nd line first.
302 * c should contain the Cb and Cr data for the two lines of Y back to back.
Jens Arnoldf8b1da22006-11-04 00:42:18 +0000303 * Needs EMAC set to saturated, signed integer mode.
Jens Arnold9af13c32006-08-23 17:30:51 +0000304 */
305extern void lcd_write_yuv420_lines(const unsigned char *y,
Jens Arnold99f95502007-10-14 23:05:56 +0000306 const unsigned char *c, int cwidth);
Jens Arnoldc5a309a2006-08-08 13:44:43 +0000307
Jens Arnold9af13c32006-08-23 17:30:51 +0000308/* Performance function to blit a YUV bitmap directly to the LCD
309 * src_x, src_y, width and height should be even
310 * x, y, width and height have to be within LCD bounds
311 */
Jens Arnold68a21682008-03-24 00:35:53 +0000312void lcd_blit_yuv(unsigned char * const src[3],
Jens Arnoldc5a309a2006-08-08 13:44:43 +0000313 int src_x, int src_y, int stride,
314 int x, int y, int width, int height)
315{
Jens Arnoldf8b1da22006-11-04 00:42:18 +0000316 /* IRAM Y, Cb and Cb buffers. */
Jens Arnold9af13c32006-08-23 17:30:51 +0000317 unsigned char y_ibuf[LCD_WIDTH*2];
Jens Arnold99f95502007-10-14 23:05:56 +0000318 unsigned char c_ibuf[LCD_WIDTH];
Jens Arnold9af13c32006-08-23 17:30:51 +0000319 const unsigned char *ysrc, *usrc, *vsrc;
320 const unsigned char *ysrc_max;
321
322 if (!display_on)
323 return;
324
325 width &= ~1; /* stay on the safe side */
326 height &= ~1;
327
Jens Arnold99f95502007-10-14 23:05:56 +0000328 lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_HORZ);
Jens Arnold9af13c32006-08-23 17:30:51 +0000329 /* Set start position and window */
Jens Arnold99f95502007-10-14 23:05:56 +0000330 lcd_write_reg(R_VERT_RAM_ADDR_POS, ((xoffset + 219) << 8) | xoffset);
Jens Arnold9af13c32006-08-23 17:30:51 +0000331
332 ysrc = src[0] + src_y * stride + src_x;
333 usrc = src[1] + (src_y * stride >> 2) + (src_x >> 1);
334 vsrc = src[2] + (src_y * stride >> 2) + (src_x >> 1);
335 ysrc_max = ysrc + height * stride;
336
Jens Arnoldf8b1da22006-11-04 00:42:18 +0000337 coldfire_set_macsr(EMAC_SATURATE);
Jens Arnold9af13c32006-08-23 17:30:51 +0000338 do
Jens Arnoldc5a309a2006-08-08 13:44:43 +0000339 {
Jens Arnold99f95502007-10-14 23:05:56 +0000340 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, ((y + 1) << 8) | y);
341 lcd_write_reg(R_RAM_ADDR_SET, ((x+xoffset) << 8) | y);
342 lcd_begin_write_gram();
343
344 memcpy(y_ibuf + width, ysrc, width);
345 memcpy(y_ibuf, ysrc + stride, width);
346 memcpy(c_ibuf, usrc, width >> 1);
347 memcpy(c_ibuf + (width >> 1), vsrc, width >> 1);
348 lcd_write_yuv420_lines(y_ibuf, c_ibuf, width >> 1);
349
350 y += 2;
Jens Arnold9af13c32006-08-23 17:30:51 +0000351 ysrc += 2 * stride;
352 usrc += stride >> 1;
353 vsrc += stride >> 1;
Jens Arnoldc5a309a2006-08-08 13:44:43 +0000354 }
Jens Arnold9af13c32006-08-23 17:30:51 +0000355 while (ysrc < ysrc_max);
Jens Arnoldc5a309a2006-08-08 13:44:43 +0000356}
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000357
358/* Update the display.
359 This must be called after all other LCD functions that change the display. */
360void lcd_update(void) ICODE_ATTR;
361void lcd_update(void)
362{
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +0000363 if(display_on){
Jens Arnold99f95502007-10-14 23:05:56 +0000364 lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_VERT);
365 /* set start position window */
366 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, 175 << 8);
Jens Arnoldcb9e3162006-03-17 15:42:06 +0000367 lcd_write_reg(R_VERT_RAM_ADDR_POS,((xoffset+219)<<8) | xoffset);
Jens Arnoldcb9e3162006-03-17 15:42:06 +0000368 lcd_write_reg(R_RAM_ADDR_SET, xoffset << 8);
Jens Arnold99f95502007-10-14 23:05:56 +0000369
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +0000370 lcd_begin_write_gram();
Jens Arnold83aded92006-11-02 20:50:50 +0000371
372 DAR3 = 0xf0000002;
373 SAR3 = (unsigned long)lcd_framebuffer;
374 BCR3 = LCD_WIDTH*LCD_HEIGHT*2;
375 DCR3 = DMA_AA | DMA_BWC(1)
376 | DMA_SINC | DMA_SSIZE(DMA_SIZE_LINE)
377 | DMA_DSIZE(DMA_SIZE_WORD) | DMA_START;
378
379 while (!(DSR3 & 1));
380 DSR3 = 1;
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +0000381 }
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000382}
383
Jens Arnoldf8b1da22006-11-04 00:42:18 +0000384
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000385/* Update a fraction of the display. */
386void lcd_update_rect(int, int, int, int) ICODE_ATTR;
387void lcd_update_rect(int x, int y, int width, int height)
388{
Jens Arnold83aded92006-11-02 20:50:50 +0000389 unsigned long dma_addr;
390
Jens Arnoldc5a309a2006-08-08 13:44:43 +0000391 if(display_on) {
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000392
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +0000393 if(x + width > LCD_WIDTH)
394 width = LCD_WIDTH - x;
Jens Arnold83aded92006-11-02 20:50:50 +0000395 if(width <= 0) /* nothing to do */
396 return;
397 if(y + height > LCD_HEIGHT)
398 height = LCD_HEIGHT - y;
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000399
Jens Arnold99f95502007-10-14 23:05:56 +0000400 lcd_write_reg(R_ENTRY_MODE, R_ENTRY_MODE_VERT);
Jens Arnold83aded92006-11-02 20:50:50 +0000401 /* set update window */
Jens Arnold99f95502007-10-14 23:05:56 +0000402 lcd_write_reg(R_HORIZ_RAM_ADDR_POS, 175 << 8);
Jens Arnoldcb9e3162006-03-17 15:42:06 +0000403 lcd_write_reg(R_VERT_RAM_ADDR_POS,((x+xoffset+width-1) << 8) | (x+xoffset));
404 lcd_write_reg(R_RAM_ADDR_SET, ((x+xoffset) << 8) | y);
Jens Arnold83aded92006-11-02 20:50:50 +0000405 lcd_begin_write_gram();
406
407 DAR3 = 0xf0000002;
408 dma_addr = (unsigned long)&lcd_framebuffer[y][x];
409 width *= 2;
Linus Nielsen Feltzing6ddfac02005-12-11 00:30:15 +0000410
Jens Arnold83aded92006-11-02 20:50:50 +0000411 for (; height > 0; height--)
412 {
413 SAR3 = dma_addr;
414 BCR3 = width;
415 DCR3 = DMA_AA | DMA_BWC(1)
416 | DMA_SINC | DMA_SSIZE(DMA_SIZE_LINE)
417 | DMA_DSIZE(DMA_SIZE_WORD) | DMA_START;
418
419 dma_addr += LCD_WIDTH*2;
420
421 while (!(DSR3 & 1));
422 DSR3 = 1;
423 }
Linus Nielsen Feltzing67f00222005-12-20 23:15:27 +0000424 }
Linus Nielsen Feltzingdbc8c2c2005-11-14 20:41:49 +0000425}