summaryrefslogtreecommitdiff
path: root/bootloader/ondavx747.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader/ondavx747.c')
-rwxr-xr-x[-rw-r--r--]bootloader/ondavx747.c55
1 files changed, 16 insertions, 39 deletions
diff --git a/bootloader/ondavx747.c b/bootloader/ondavx747.c
index 13c537b9be..0695dc0190 100644..100755
--- a/bootloader/ondavx747.c
+++ b/bootloader/ondavx747.c
@@ -21,11 +21,15 @@
21 21
22#include <stdio.h> 22#include <stdio.h>
23#include <stdarg.h> 23#include <stdarg.h>
24#include <string.h>
24#include "config.h" 25#include "config.h"
25#include "jz4740.h" 26#include "jz4740.h"
26#include "backlight.h" 27#include "backlight.h"
27#include "font.h" 28#include "font.h"
28#include "lcd.h" 29#include "lcd.h"
30#include "ata.h"
31#include "usb.h"
32#include "storage.h"
29#include "system.h" 33#include "system.h"
30#include "button.h" 34#include "button.h"
31#include "timefuncs.h" 35#include "timefuncs.h"
@@ -33,14 +37,9 @@
33#include "common.h" 37#include "common.h"
34#include "mipsregs.h" 38#include "mipsregs.h"
35 39
36static void audiotest(void) 40#ifdef ONDA_VX747P
37{ 41 #define ONDA_VX747
38 __i2s_internal_codec(); 42#endif
39 __aic_enable();
40 __aic_reset();
41 __aic_select_i2s();
42 __aic_enable_loopback();
43}
44 43
45int main(void) 44int main(void)
46{ 45{
@@ -54,12 +53,16 @@ int main(void)
54 53
55 backlight_init(); 54 backlight_init();
56 55
56#if 0 /* Enable this when multi storage works */
57 storage_init(); 57 storage_init();
58#else
59 ata_init();
60#endif
58 61
59 int touch, btn; 62 int touch, btn;
60 char datetime[30]; 63 char datetime[30];
61 reset_screen(); 64 reset_screen();
62 printf("Rockbox bootloader v0.000001"); 65 printf("Rockbox bootloader v0.0001");
63 printf("REG_EMC_SACR0: 0x%x", REG_EMC_SACR0); 66 printf("REG_EMC_SACR0: 0x%x", REG_EMC_SACR0);
64 printf("REG_EMC_SACR1: 0x%x", REG_EMC_SACR1); 67 printf("REG_EMC_SACR1: 0x%x", REG_EMC_SACR1);
65 printf("REG_EMC_SACR2: 0x%x", REG_EMC_SACR2); 68 printf("REG_EMC_SACR2: 0x%x", REG_EMC_SACR2);
@@ -85,46 +88,20 @@ int main(void)
85 if(read_c0_config1() & (1 << 6)) printf(" * CP2 available"); 88 if(read_c0_config1() & (1 << 6)) printf(" * CP2 available");
86 printf("C0_STATUS: 0x%x", read_c0_status()); 89 printf("C0_STATUS: 0x%x", read_c0_status());
87 90
88#if 0 91 lcd_puts_scroll(0, 25, "This is a very very long scrolling line.... VERY LONG VERY LONG VERY LONG VERY LONG VERY LONG VERY LONG!!!!!");
89 unsigned char testdata[4096]; 92
90 char msg[30];
91 int j = 1;
92 while(1)
93 {
94 memset(testdata, 0, 4096);
95 reset_screen();
96 jz_nand_read(0, j, &testdata);
97 printf("Page %d", j);
98 int i;
99 for(i=0; i<768; i+=16)
100 {
101 snprintf(msg, 30, "%02x%02x%02x%02x%02x%02x%02x%02x %02x%02x%02x%02x%02x%02x%02x%02x",
102 testdata[i], testdata[i+1], testdata[i+2], testdata[i+3], testdata[i+4], testdata[i+5], testdata[i+6], testdata[i+7],
103 testdata[i+8], testdata[i+9], testdata[i+10], testdata[i+11], testdata[i+12], testdata[i+13], testdata[i+14], testdata[i+15]
104 );
105 printf(msg);
106 }
107 while(!((btn = button_read_device(&touch)) & (BUTTON_VOL_UP|BUTTON_VOL_DOWN)));
108 if(btn & BUTTON_VOL_UP)
109 j++;
110 if(btn & BUTTON_VOL_DOWN)
111 j--;
112 if(j<0)
113 j = 0;
114 }
115#endif
116 while(1) 93 while(1)
117 { 94 {
118#ifdef ONDA_VX747 95#ifdef ONDA_VX747
119#if 1 96#if 1
120 btn = button_get(false); 97 btn = button_get(false);
121 touch = button_get_data(); 98 touch = button_get_data();
122#else 99#else /* button_get() has performance issues */
123 btn = button_read_device(&touch); 100 btn = button_read_device(&touch);
124#endif 101#endif
125#else 102#else
126 btn = button_read_device(); 103 btn = button_read_device();
127#endif 104#endif /* ONDA_VX747 */
128#define KNOP(x,y) lcd_set_foreground(LCD_BLACK); \ 105#define KNOP(x,y) lcd_set_foreground(LCD_BLACK); \
129 if(btn & x) \ 106 if(btn & x) \
130 lcd_set_foreground(LCD_WHITE); \ 107 lcd_set_foreground(LCD_WHITE); \