summaryrefslogtreecommitdiff
path: root/firmware/target/arm/lcd-ssd1815.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/lcd-ssd1815.c')
-rw-r--r--firmware/target/arm/lcd-ssd1815.c75
1 files changed, 0 insertions, 75 deletions
diff --git a/firmware/target/arm/lcd-ssd1815.c b/firmware/target/arm/lcd-ssd1815.c
index 891d4ef64d..028362f91c 100644
--- a/firmware/target/arm/lcd-ssd1815.c
+++ b/firmware/target/arm/lcd-ssd1815.c
@@ -144,81 +144,6 @@ void lcd_init_device(void)
144 lcd_write_command(LCD_SET_NORMAL_DISPLAY); 144 lcd_write_command(LCD_SET_NORMAL_DISPLAY);
145} 145}
146 146
147
148#elif defined(CPU_TCC77X)
149
150/* TCC77x specific defines */
151#define LCD_BASE 0x50000000
152#define LCD_CMD *(volatile unsigned char*)(LCD_BASE)
153#define LCD_DATA *(volatile unsigned char*)(LCD_BASE+1)
154
155void lcd_write_command(int byte)
156{
157 LCD_CMD = byte;
158
159 asm volatile (
160 "nop \n\t"
161 "nop \n\t"
162 "nop \n\t"
163 );
164}
165
166void lcd_write_data(const fb_data* p_bytes, int count)
167{
168 while (count--)
169 {
170 LCD_DATA = *(p_bytes++);
171
172 asm volatile (
173 "nop \n\t"
174 "nop \n\t"
175 "nop \n\t"
176 );
177 }
178}
179
180/* LCD init */
181void lcd_init_device(void)
182{
183 uint32_t bus_width;
184
185 /* Telechips init the same as the original firmware */
186 CSCFG1 &= 0xc3ffc000;
187 CSCFG1 |= 0x3400101a;
188 CSCFG1 |= (1 << 21);
189 CSCFG1 &= ~(1 << 21);
190
191 bus_width = ((MCFG >> 11) & 0x3) ^ 3;
192
193 CSCFG1 = (bus_width << 28) |
194 (3 << 26) | /* MTYPE = 3 */
195 ((LCD_BASE >> 28) << 22) | /* CSBASE = 0x5 */
196 (1 << 20) | /* Unknown */
197 (3 << 11) | /* Setup time = 3 cycles */
198 (3 << 3) | /* Pulse width = 3+1 cycles */
199 (1 << 0); /* Hold time = 1 cycle */
200
201 /* SSD1815 inits like the original firmware */
202 lcd_write_command(LCD_SET_DISPLAY_OFF);
203 lcd_set_flip(false);
204 lcd_write_command(LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO | 5);
205 lcd_set_contrast(lcd_default_contrast());
206 lcd_write_command(LCD_SET_POWER_CONTROL_REGISTER | 7);
207 /* power control register: op-amp=1, regulator=1, booster=1 */
208 lcd_write_command(LCD_SET_BIAS_TC_OSC);
209
210 /* 0xc2 = 110 000 10: Osc. Freq 110 - ???
211 TC value 000 - "-0.01%/C (TC0, POR)"
212 Bias ratio 10 - "1/9, 1/7 (POR)"
213 */
214 lcd_write_command(0xc2);
215 lcd_write_command(LCD_SET_DISPLAY_ON);
216
217 lcd_clear_display();
218 lcd_update();
219}
220
221/* End of TCC77x specific defines */
222#endif 147#endif
223 148
224 149