diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-03-28 01:53:42 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-03-28 01:53:42 +0000 |
commit | 7cd24fa13dbd7834a0898a591c08e9bb1951eac8 (patch) | |
tree | 456ffd1aeedd5d540f1346d0e4bd129a682af628 /firmware/target/arm | |
parent | c689496e0458596f180ebfb75f05d42213b94510 (diff) | |
download | rockbox-7cd24fa13dbd7834a0898a591c08e9bb1951eac8.tar.gz rockbox-7cd24fa13dbd7834a0898a591c08e9bb1951eac8.zip |
Fuzev2: fix lcd
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25360 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r-- | firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c b/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c index 4a5948a512..fb33104882 100644 --- a/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c +++ b/firmware/target/arm/as3525/sansa-fuzev2/lcd-fuzev2.c | |||
@@ -83,7 +83,6 @@ static bool display_on = false; /* is the display turned on? */ | |||
83 | static unsigned short r_entry_mode = R_ENTRY_MODE_HORZ_NORMAL; | 83 | static unsigned short r_entry_mode = R_ENTRY_MODE_HORZ_NORMAL; |
84 | #define R_ENTRY_MODE_VERT 0x7038 | 84 | #define R_ENTRY_MODE_VERT 0x7038 |
85 | #define R_ENTRY_MODE_SOLID_VERT 0x1038 | 85 | #define R_ENTRY_MODE_SOLID_VERT 0x1038 |
86 | /* FIXME */ | ||
87 | #define R_ENTRY_MODE_VIDEO_NORMAL 0x7038 | 86 | #define R_ENTRY_MODE_VIDEO_NORMAL 0x7038 |
88 | #define R_ENTRY_MODE_VIDEO_FLIPPED 0x7018 | 87 | #define R_ENTRY_MODE_VIDEO_FLIPPED 0x7018 |
89 | 88 | ||
@@ -101,34 +100,10 @@ static inline void lcd_delay(int x) | |||
101 | } while (x--); | 100 | } while (x--); |
102 | } | 101 | } |
103 | 102 | ||
104 | #define REG(x) (*(volatile unsigned long*)(x)) | ||
105 | typedef unsigned long reg; | ||
106 | |||
107 | static void as3525_dbop_init(void) | 103 | static void as3525_dbop_init(void) |
108 | { | 104 | { |
109 | #if 0 | 105 | CCU_IO |= 1<<12; |
110 | CGU_DBOP = (1<<3) | AS3525_DBOP_DIV; | 106 | CGU_DBOP |= (1<<4) | (1<<3) | AS3525_DBOP_DIV; |
111 | |||
112 | DBOP_TIMPOL_01 = 0xe167e167; | ||
113 | DBOP_TIMPOL_23 = 0xe167006e; | ||
114 | |||
115 | /* short count: 16 | output data width: 16 | readstrobe line */ | ||
116 | DBOP_CTRL = (1<<18|1<<12|1<<3); | ||
117 | |||
118 | GPIOB_AFSEL = 0xfc; | ||
119 | GPIOC_AFSEL = 0xff; | ||
120 | |||
121 | DBOP_TIMPOL_23 = 0x6000e; | ||
122 | |||
123 | /* short count: 16|enable write|output data width: 16|read strobe line */ | ||
124 | DBOP_CTRL = (1<<18|1<<16|1<<12|1<<3); | ||
125 | DBOP_TIMPOL_01 = 0x6e167; | ||
126 | DBOP_TIMPOL_23 = 0xa167e06f; | ||
127 | |||
128 | /* TODO: The OF calls some other functions here, but maybe not important */ | ||
129 | #endif | ||
130 | REG(0xC810000C) |= 0x1000; /* CCU_IO |= 1<<12 */ | ||
131 | CGU_DBOP |= /*(1<<3)*/ 0x18 | AS3525_DBOP_DIV; | ||
132 | DBOP_TIMPOL_01 = 0xE12FE12F; | 107 | DBOP_TIMPOL_01 = 0xE12FE12F; |
133 | DBOP_TIMPOL_23 = 0xE12F0036; | 108 | DBOP_TIMPOL_23 = 0xE12F0036; |
134 | DBOP_CTRL = 0x41004; | 109 | DBOP_CTRL = 0x41004; |
@@ -136,7 +111,6 @@ static void as3525_dbop_init(void) | |||
136 | DBOP_CTRL = 0x51004; | 111 | DBOP_CTRL = 0x51004; |
137 | DBOP_TIMPOL_01 = 0x60036; | 112 | DBOP_TIMPOL_01 = 0x60036; |
138 | DBOP_TIMPOL_23 = 0xA12FE037; | 113 | DBOP_TIMPOL_23 = 0xA12FE037; |
139 | /* OF sets up dma and more after here */ | ||
140 | } | 114 | } |
141 | 115 | ||
142 | static inline void dbop_set_mode(int mode) | 116 | static inline void dbop_set_mode(int mode) |
@@ -188,15 +162,6 @@ static void dbop_write_data(const int16_t* p_bytes, int count) | |||
188 | 162 | ||
189 | static void lcd_write_cmd(short cmd) | 163 | static void lcd_write_cmd(short cmd) |
190 | { | 164 | { |
191 | #if 0 | ||
192 | /* Write register */ | ||
193 | DBOP_TIMPOL_23 = 0xa167006e; | ||
194 | dbop_write_data(&cmd, 1); | ||
195 | |||
196 | lcd_delay(4); | ||
197 | |||
198 | DBOP_TIMPOL_23 = 0xa167e06f; | ||
199 | #elif 1 | ||
200 | volatile int i; | 165 | volatile int i; |
201 | for(i=0;i<20;i++) nop; | 166 | for(i=0;i<20;i++) nop; |
202 | 167 | ||
@@ -213,14 +178,6 @@ static void lcd_write_cmd(short cmd) | |||
213 | while ((DBOP_STAT & (1<<10)) == 0); | 178 | while ((DBOP_STAT & (1<<10)) == 0); |
214 | for(i=0;i<20;i++) nop; | 179 | for(i=0;i<20;i++) nop; |
215 | DBOP_TIMPOL_23 = 0xA12FE037; | 180 | DBOP_TIMPOL_23 = 0xA12FE037; |
216 | #else | ||
217 | int i; | ||
218 | DBOP_TIMPOL_23 = 0xA12F0036; | ||
219 | for(i=0;i<20;i++) nop; | ||
220 | dbop_write_data(&cmd, 1); | ||
221 | for(i=0;i<20;i++) nop; | ||
222 | DBOP_TIMPOL_23 = 0xA12FE037; | ||
223 | #endif | ||
224 | } | 181 | } |
225 | 182 | ||
226 | static void lcd_write_reg(int reg, int value) | 183 | static void lcd_write_reg(int reg, int value) |
@@ -320,7 +277,6 @@ void lcd_init_device(void) | |||
320 | GPIOA_PIN(0) = 1; | 277 | GPIOA_PIN(0) = 1; |
321 | GPIOA_PIN(4) = 0; | 278 | GPIOA_PIN(4) = 0; |
322 | 279 | ||
323 | CCU_IO &= ~(0x1000); | ||
324 | GPIOB_DIR |= 0x2f; | 280 | GPIOB_DIR |= 0x2f; |
325 | GPIOB_PIN(0) = 1<<0; | 281 | GPIOB_PIN(0) = 1<<0; |
326 | GPIOB_PIN(1) = 1<<1; | 282 | GPIOB_PIN(1) = 1<<1; |
@@ -491,7 +447,6 @@ void lcd_update(void) | |||
491 | lcd_write_cmd(R_WRITE_DATA_2_GRAM); | 447 | lcd_write_cmd(R_WRITE_DATA_2_GRAM); |
492 | 448 | ||
493 | lcd_update_rect(0,0, LCD_WIDTH, LCD_HEIGHT); | 449 | lcd_update_rect(0,0, LCD_WIDTH, LCD_HEIGHT); |
494 | //dbop_write_data((fb_data*)lcd_framebuffer, LCD_WIDTH*LCD_HEIGHT); | ||
495 | } | 450 | } |
496 | 451 | ||
497 | /* Update a fraction of the display. */ | 452 | /* Update a fraction of the display. */ |