diff options
author | Marcoen Hirschberg <marcoen@gmail.com> | 2008-09-17 23:22:11 +0000 |
---|---|---|
committer | Marcoen Hirschberg <marcoen@gmail.com> | 2008-09-17 23:22:11 +0000 |
commit | 48e45f57516d24d8cf24f632ecf73fec95e3a785 (patch) | |
tree | 1f3df5f1557070f30dc1195f58524870c0411bf2 /bootloader | |
parent | 9407ae838e7696cd5f55c7a22b7cabb8d403fc17 (diff) | |
download | rockbox-48e45f57516d24d8cf24f632ecf73fec95e3a785.tar.gz rockbox-48e45f57516d24d8cf24f632ecf73fec95e3a785.zip |
add Meizu M6SP and M3 ports
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18544 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader')
-rw-r--r-- | bootloader/SOURCES | 4 | ||||
-rw-r--r-- | bootloader/meizu_m3.c | 142 | ||||
-rw-r--r-- | bootloader/meizu_m6sp.c | 123 |
3 files changed, 269 insertions, 0 deletions
diff --git a/bootloader/SOURCES b/bootloader/SOURCES index c1771ff24f..c54d1e16b1 100644 --- a/bootloader/SOURCES +++ b/bootloader/SOURCES | |||
@@ -31,6 +31,10 @@ mrobe500.c | |||
31 | telechips.c | 31 | telechips.c |
32 | #elif defined(MEIZU_M6SL) | 32 | #elif defined(MEIZU_M6SL) |
33 | meizu_m6sl.c | 33 | meizu_m6sl.c |
34 | #elif defined(MEIZU_M6SP) | ||
35 | meizu_m6sp.c | ||
36 | #elif defined(MEIZU_M3) | ||
37 | meizu_m3.c | ||
34 | #elif defined(ONDA_VX747) || defined(ONDA_VX767) | 38 | #elif defined(ONDA_VX747) || defined(ONDA_VX767) |
35 | ondavx747.c | 39 | ondavx747.c |
36 | #elif defined(CREATIVE_ZVx) | 40 | #elif defined(CREATIVE_ZVx) |
diff --git a/bootloader/meizu_m3.c b/bootloader/meizu_m3.c new file mode 100644 index 0000000000..cc9fbab88d --- /dev/null +++ b/bootloader/meizu_m3.c | |||
@@ -0,0 +1,142 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Greg White | ||
11 | * | ||
12 | * 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. | ||
16 | * | ||
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 <stdlib.h> | ||
24 | #include <stdio.h> | ||
25 | #include "inttypes.h" | ||
26 | #include "string.h" | ||
27 | #include "cpu.h" | ||
28 | #include "system.h" | ||
29 | #include "lcd.h" | ||
30 | #include "kernel.h" | ||
31 | #include "thread.h" | ||
32 | #include "ata.h" | ||
33 | #include "fat.h" | ||
34 | #include "disk.h" | ||
35 | #include "font.h" | ||
36 | #include "adc.h" | ||
37 | #include "backlight.h" | ||
38 | #include "backlight-target.h" | ||
39 | #include "button.h" | ||
40 | #include "panic.h" | ||
41 | #include "power.h" | ||
42 | #include "file.h" | ||
43 | #include "common.h" | ||
44 | #include "rbunicode.h" | ||
45 | #include "usb.h" | ||
46 | #include "qt1106.h" | ||
47 | |||
48 | #include <stdarg.h> | ||
49 | |||
50 | char version[] = APPSVERSION; | ||
51 | #define LONG_DELAY 200000 | ||
52 | #define SHORT_DELAY 50000 | ||
53 | #define PAUSE_DELAY 50000 | ||
54 | |||
55 | static inline void delay(int duration) | ||
56 | { | ||
57 | volatile int i; | ||
58 | for(i=0;i<duration;i++); | ||
59 | } | ||
60 | |||
61 | |||
62 | void bl_debug(bool bit) | ||
63 | { | ||
64 | if (bit) | ||
65 | { | ||
66 | PDAT0 ^= (1 << 2); //Toggle backlight | ||
67 | delay(LONG_DELAY); | ||
68 | PDAT0 ^= (1 << 2); //Toggle backlight | ||
69 | delay(LONG_DELAY); | ||
70 | } | ||
71 | else | ||
72 | { | ||
73 | PDAT0 ^= (1 << 2); //Toggle backlight | ||
74 | delay(SHORT_DELAY); | ||
75 | PDAT0 ^= (1 << 2); //Toggle backlight | ||
76 | delay(SHORT_DELAY); | ||
77 | } | ||
78 | } | ||
79 | |||
80 | void bl_debug_count(unsigned int input) | ||
81 | { | ||
82 | unsigned int i; | ||
83 | delay(SHORT_DELAY*3); | ||
84 | for (i = 0; i < input; i++) | ||
85 | { | ||
86 | PDAT0 ^= (1 << 2); //Toggle backlight | ||
87 | delay(SHORT_DELAY); | ||
88 | PDAT0 ^= (1 << 2); //Toggle backlight | ||
89 | delay(2*SHORT_DELAY); | ||
90 | } | ||
91 | } | ||
92 | void bl_debug_int(unsigned int input,unsigned int count) | ||
93 | { | ||
94 | unsigned int i; | ||
95 | for (i = 0; i < count; i++) | ||
96 | { | ||
97 | bl_debug(input>>i & 1); | ||
98 | } | ||
99 | delay(SHORT_DELAY*6); | ||
100 | } | ||
101 | |||
102 | void main(void) | ||
103 | { | ||
104 | //Set backlight pin to output and enable | ||
105 | int oldval = PCON0; | ||
106 | PCON0 = ((oldval & ~(3 << 4)) | (1 << 4)); | ||
107 | PDAT0 |= (1 << 2); | ||
108 | |||
109 | //Set PLAY to input | ||
110 | oldval = PCON1; | ||
111 | PCON1 = ((oldval & ~(0xf << 16)) | (0 << 16)); | ||
112 | |||
113 | init_qt1106(); | ||
114 | |||
115 | // Wait for play to be pressed | ||
116 | while(!(PDAT1 & (1 << 4))); | ||
117 | // Wait for play to be released | ||
118 | while((PDAT1 & (1 << 4))); | ||
119 | PDAT0 ^= (1 << 2); //Toggle backlight | ||
120 | delay(LONG_DELAY); | ||
121 | |||
122 | /* Calibrate the lot */ | ||
123 | qt1106_io(QT1106_MODE_FREE | QT1106_MOD_INF | QT1106_DI \ | ||
124 | | QT1106_SLD_SLIDER | QT1106_CAL_WHEEL | QT1106_CAL_KEYS | QT1106_RES_4); | ||
125 | |||
126 | /* Set to maximum sensitivity */ | ||
127 | qt1106_io(QT1106_CT | (0x00 << 8) ); | ||
128 | |||
129 | while(true) | ||
130 | { | ||
131 | qt1106_wait(); | ||
132 | |||
133 | int slider = qt1106_io(QT1106_MODE_FREE | QT1106_MOD_INF \ | ||
134 | | QT1106_DI | QT1106_SLD_SLIDER | QT1106_RES_4); | ||
135 | if(slider & 0x008000) | ||
136 | bl_debug_count(((slider&0xff)) + 1); | ||
137 | } | ||
138 | |||
139 | //power off | ||
140 | PDAT1&=~(1<<3); | ||
141 | } | ||
142 | |||
diff --git a/bootloader/meizu_m6sp.c b/bootloader/meizu_m6sp.c new file mode 100644 index 0000000000..7608c9bd30 --- /dev/null +++ b/bootloader/meizu_m6sp.c | |||
@@ -0,0 +1,123 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2006 by Greg White | ||
11 | * | ||
12 | * 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. | ||
16 | * | ||
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 <stdlib.h> | ||
24 | #include <stdio.h> | ||
25 | #include "inttypes.h" | ||
26 | #include "string.h" | ||
27 | #include "cpu.h" | ||
28 | #include "system.h" | ||
29 | #include "lcd.h" | ||
30 | #include "kernel.h" | ||
31 | #include "thread.h" | ||
32 | #include "ata.h" | ||
33 | #include "fat.h" | ||
34 | #include "disk.h" | ||
35 | #include "font.h" | ||
36 | #include "adc.h" | ||
37 | #include "backlight.h" | ||
38 | #include "backlight-target.h" | ||
39 | #include "button.h" | ||
40 | #include "panic.h" | ||
41 | #include "power.h" | ||
42 | #include "file.h" | ||
43 | #include "common.h" | ||
44 | #include "rbunicode.h" | ||
45 | #include "usb.h" | ||
46 | #include "qt1106.h" | ||
47 | |||
48 | #include <stdarg.h> | ||
49 | |||
50 | char version[] = APPSVERSION; | ||
51 | #define LONG_DELAY 200000 | ||
52 | #define SHORT_DELAY 50000 | ||
53 | #define PAUSE_DELAY 50000 | ||
54 | |||
55 | static inline void delay(int duration) | ||
56 | { | ||
57 | volatile int i; | ||
58 | for(i=0;i<duration;i++); | ||
59 | } | ||
60 | |||
61 | |||
62 | void bl_debug(bool bit) | ||
63 | { | ||
64 | if (bit) | ||
65 | { | ||
66 | PDAT0 ^= (1 << 2); //Toggle backlight | ||
67 | delay(LONG_DELAY); | ||
68 | PDAT0 ^= (1 << 2); //Toggle backlight | ||
69 | delay(LONG_DELAY); | ||
70 | } | ||
71 | else | ||
72 | { | ||
73 | PDAT0 ^= (1 << 2); //Toggle backlight | ||
74 | delay(SHORT_DELAY); | ||
75 | PDAT0 ^= (1 << 2); //Toggle backlight | ||
76 | delay(SHORT_DELAY); | ||
77 | } | ||
78 | } | ||
79 | |||
80 | void bl_debug_count(unsigned int input) | ||
81 | { | ||
82 | unsigned int i; | ||
83 | delay(SHORT_DELAY*3); | ||
84 | for (i = 0; i < input; i++) | ||
85 | { | ||
86 | PDAT0 ^= (1 << 2); //Toggle backlight | ||
87 | delay(SHORT_DELAY); | ||
88 | PDAT0 ^= (1 << 2); //Toggle backlight | ||
89 | delay(2*SHORT_DELAY); | ||
90 | } | ||
91 | } | ||
92 | void bl_debug_int(unsigned int input,unsigned int count) | ||
93 | { | ||
94 | unsigned int i; | ||
95 | for (i = 0; i < count; i++) | ||
96 | { | ||
97 | bl_debug(input>>i & 1); | ||
98 | } | ||
99 | delay(SHORT_DELAY*6); | ||
100 | } | ||
101 | |||
102 | void main(void) | ||
103 | { | ||
104 | //Set backlight pin to output and enable | ||
105 | int oldval = PCON0; | ||
106 | PCON0 = ((oldval & ~(3 << 4)) | (1 << 4)); | ||
107 | PDAT0 |= (1 << 2); | ||
108 | |||
109 | //Set PLAY to input | ||
110 | oldval = PCON1; | ||
111 | PCON1 = ((oldval & ~(0xf << 16)) | (0 << 16)); | ||
112 | |||
113 | // Wait for play to be pressed | ||
114 | while(!(PDAT1 & (1 << 4))); | ||
115 | // Wait for play to be released | ||
116 | while((PDAT1 & (1 << 4))); | ||
117 | PDAT0 ^= (1 << 2); //Toggle backlight | ||
118 | delay(LONG_DELAY); | ||
119 | |||
120 | //power off | ||
121 | PDAT1&=~(1<<3); | ||
122 | } | ||
123 | |||