summaryrefslogtreecommitdiffstats
path: root/bootloader
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-10-05 20:01:25 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-10-05 20:01:25 +0000
commit2d5e6e1a8792c71c765e2c8f6956cf71e6178b01 (patch)
tree1841b69b63954ab6daa89d3d9de0223d3063c202 /bootloader
parent4450d3c9fe3cb21f1e5f3f3c839aa5d17d6fdcb8 (diff)
downloadrockbox-2d5e6e1a8792c71c765e2c8f6956cf71e6178b01.tar.gz
rockbox-2d5e6e1a8792c71c765e2c8f6956cf71e6178b01.tar.bz2
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.c29
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)
void main(void)
{
+ char mystring[64];
+ int tmpval;
+
+ /* set clock to 200 MHz */
+ CLKCON = 0x00800080;
+ CLKCON2= 0x00;
+ PLL0PMS = 0x1ad200;
+ PLLCON = 1;
+ while (!(PLLLOCK & 1)) ;
+ CLKCON = 0x20802080;
+
+ /* mask all interrupts
+ this is done, because the lcd framebuffer
+ overwrites some stuff, which leads to a freeze
+ when an irq is generated after the dfu upload.
+ crt0 should have disabled irqs,
+ but the bootrom hands us execution in
+ user mode so we can't switch interrupts off */
+ INTMSK = 0;
+
//Set backlight pin to output and enable
int oldval = PCON0;
PCON0 = ((oldval & ~(3 << 4)) | (1 << 4));
@@ -110,6 +130,15 @@ void main(void)
oldval = PCON1;
PCON1 = ((oldval & ~(0xf << 16)) | (0 << 16));
+ asm volatile("mrs %0, cpsr \n\t"
+ : "=r" (tmpval)
+ );
+
+ lcd_init();
+ snprintf(mystring, 64, "tmpval: %x", tmpval);
+ lcd_putsxy(0,0,mystring);
+ lcd_update();
+
init_qt1106();
// Wait for play to be pressed