diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2008-07-14 15:03:10 +0000 |
---|---|---|
committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2008-07-14 15:03:10 +0000 |
commit | 0709f0a5c60b5525ff98708887f5f1e5b0b570c2 (patch) | |
tree | 849fd125aa7b217228d584212d2930d8259ff5d8 /bootloader | |
parent | 4f199817488708ba60724accb6ce76886f855af8 (diff) | |
download | rockbox-0709f0a5c60b5525ff98708887f5f1e5b0b570c2.tar.gz rockbox-0709f0a5c60b5525ff98708887f5f1e5b0b570c2.zip |
Add preliminary support for the Onda VX747 (MIPS target)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18032 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader')
-rw-r--r-- | bootloader/SOURCES | 2 | ||||
-rwxr-xr-x | bootloader/ondavx747.c | 125 |
2 files changed, 127 insertions, 0 deletions
diff --git a/bootloader/SOURCES b/bootloader/SOURCES index 19e40e2fc3..9f8cf1c91c 100644 --- a/bootloader/SOURCES +++ b/bootloader/SOURCES | |||
@@ -31,4 +31,6 @@ 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(ONDA_VX747) | ||
35 | ondavx747.c | ||
34 | #endif | 36 | #endif |
diff --git a/bootloader/ondavx747.c b/bootloader/ondavx747.c new file mode 100755 index 0000000000..46e81cacad --- /dev/null +++ b/bootloader/ondavx747.c | |||
@@ -0,0 +1,125 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2008 by Maurus Cuelenaere | ||
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 | |||
22 | #include <stdio.h> | ||
23 | #include <stdarg.h> | ||
24 | #include <string.h> | ||
25 | #include "config.h" | ||
26 | #include "jz4740.h" | ||
27 | #include "backlight.h" | ||
28 | #include "font.h" | ||
29 | #include "lcd.h" | ||
30 | #include "system.h" | ||
31 | #include "mips.h" | ||
32 | #include "button.h" | ||
33 | |||
34 | int _line = 1; | ||
35 | char _printfbuf[256]; | ||
36 | |||
37 | /* This is all rather hacky, but it works... */ | ||
38 | void _printf(const char *format, ...) | ||
39 | { | ||
40 | int len; | ||
41 | unsigned char *ptr; | ||
42 | va_list ap; | ||
43 | va_start(ap, format); | ||
44 | |||
45 | ptr = _printfbuf; | ||
46 | len = vsnprintf(ptr, sizeof(_printfbuf), format, ap); | ||
47 | va_end(ap); | ||
48 | |||
49 | int i; | ||
50 | for(i=0; i<1; i++) | ||
51 | { | ||
52 | lcd_puts(0, _line++, ptr); | ||
53 | lcd_update(); | ||
54 | } | ||
55 | if(_line >= LCD_HEIGHT/SYSFONT_HEIGHT) | ||
56 | _line = 1; | ||
57 | } | ||
58 | |||
59 | void audiotest(void) | ||
60 | { | ||
61 | __i2s_internal_codec(); | ||
62 | __aic_enable(); | ||
63 | __aic_reset(); | ||
64 | __aic_select_i2s(); | ||
65 | __aic_enable_loopback(); | ||
66 | } | ||
67 | |||
68 | static void jz_store_icache(void) | ||
69 | { | ||
70 | unsigned long start; | ||
71 | unsigned long end; | ||
72 | |||
73 | start = KSEG0BASE; | ||
74 | end = start + CFG_ICACHE_SIZE; | ||
75 | while(start < end) | ||
76 | { | ||
77 | cache_unroll(start, 8); | ||
78 | start += CFG_CACHELINE_SIZE; | ||
79 | } | ||
80 | } | ||
81 | |||
82 | int main(void) | ||
83 | { | ||
84 | cli(); | ||
85 | |||
86 | write_c0_status(0x10000400); | ||
87 | |||
88 | memcpy((void *)A_K0BASE, (void *)0x80E00080, 0x20); | ||
89 | memcpy((void *)(A_K0BASE + 0x180), (void *)0x80E00080, 0x20); | ||
90 | memcpy((void *)(A_K0BASE + 0x200), (void *)0x80E00080, 0x20); | ||
91 | |||
92 | jz_flush_dcache(); | ||
93 | jz_store_icache(); | ||
94 | |||
95 | sti(); | ||
96 | |||
97 | kernel_init(); | ||
98 | lcd_init(); | ||
99 | font_init(); | ||
100 | lcd_setfont(FONT_SYSFIXED); | ||
101 | button_init(); | ||
102 | |||
103 | backlight_init(); | ||
104 | |||
105 | /* To make the Windows say "ding-dong".. */ | ||
106 | REG8(USB_REG_POWER) &= ~USB_POWER_SOFTCONN; | ||
107 | |||
108 | int touch; | ||
109 | lcd_clear_display(); | ||
110 | _printf("Rockbox bootloader v0.000001"); | ||
111 | while(1) | ||
112 | { | ||
113 | if(button_read_device(&touch) & BUTTON_VOL_DOWN) | ||
114 | _printf("BUTTON_VOL_DOWN"); | ||
115 | if(button_read_device(&touch) & BUTTON_MENU) | ||
116 | _printf("BUTTON_MENU"); | ||
117 | if(button_read_device(&touch) & BUTTON_VOL_UP) | ||
118 | _printf("BUTTON_VOL_UP"); | ||
119 | if(button_read_device(&touch) & BUTTON_POWER) | ||
120 | _printf("BUTTON_POWER"); | ||
121 | _printf("X: %d Y: %d", touch>>16, touch&0xFFFF); | ||
122 | } | ||
123 | |||
124 | return 0; | ||
125 | } | ||