diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2008-10-05 20:01:25 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2008-10-05 20:01:25 +0000 |
commit | 2d5e6e1a8792c71c765e2c8f6956cf71e6178b01 (patch) | |
tree | 1841b69b63954ab6daa89d3d9de0223d3063c202 /bootloader | |
parent | 4450d3c9fe3cb21f1e5f3f3c839aa5d17d6fdcb8 (diff) | |
download | rockbox-2d5e6e1a8792c71c765e2c8f6956cf71e6178b01.tar.gz rockbox-2d5e6e1a8792c71c765e2c8f6956cf71e6178b01.zip |
LCD driver for meizu M3, new type (older M3s are not yet supported)
Thanks to Denes Balatoni
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18719 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader')
-rw-r--r-- | bootloader/meizu_m3.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/bootloader/meizu_m3.c b/bootloader/meizu_m3.c index cc9fbab88d..1c1f45a40a 100644 --- a/bootloader/meizu_m3.c +++ b/bootloader/meizu_m3.c | |||
@@ -101,6 +101,26 @@ void bl_debug_int(unsigned int input,unsigned int count) | |||
101 | 101 | ||
102 | void main(void) | 102 | void main(void) |
103 | { | 103 | { |
104 | char mystring[64]; | ||
105 | int tmpval; | ||
106 | |||
107 | /* set clock to 200 MHz */ | ||
108 | CLKCON = 0x00800080; | ||
109 | CLKCON2= 0x00; | ||
110 | PLL0PMS = 0x1ad200; | ||
111 | PLLCON = 1; | ||
112 | while (!(PLLLOCK & 1)) ; | ||
113 | CLKCON = 0x20802080; | ||
114 | |||
115 | /* mask all interrupts | ||
116 | this is done, because the lcd framebuffer | ||
117 | overwrites some stuff, which leads to a freeze | ||
118 | when an irq is generated after the dfu upload. | ||
119 | crt0 should have disabled irqs, | ||
120 | but the bootrom hands us execution in | ||
121 | user mode so we can't switch interrupts off */ | ||
122 | INTMSK = 0; | ||
123 | |||
104 | //Set backlight pin to output and enable | 124 | //Set backlight pin to output and enable |
105 | int oldval = PCON0; | 125 | int oldval = PCON0; |
106 | PCON0 = ((oldval & ~(3 << 4)) | (1 << 4)); | 126 | PCON0 = ((oldval & ~(3 << 4)) | (1 << 4)); |
@@ -110,6 +130,15 @@ void main(void) | |||
110 | oldval = PCON1; | 130 | oldval = PCON1; |
111 | PCON1 = ((oldval & ~(0xf << 16)) | (0 << 16)); | 131 | PCON1 = ((oldval & ~(0xf << 16)) | (0 << 16)); |
112 | 132 | ||
133 | asm volatile("mrs %0, cpsr \n\t" | ||
134 | : "=r" (tmpval) | ||
135 | ); | ||
136 | |||
137 | lcd_init(); | ||
138 | snprintf(mystring, 64, "tmpval: %x", tmpval); | ||
139 | lcd_putsxy(0,0,mystring); | ||
140 | lcd_update(); | ||
141 | |||
113 | init_qt1106(); | 142 | init_qt1106(); |
114 | 143 | ||
115 | // Wait for play to be pressed | 144 | // Wait for play to be pressed |