diff options
-rw-r--r-- | apps/debug_menu.c | 25 | ||||
-rw-r--r-- | apps/main.c | 32 | ||||
-rw-r--r-- | firmware/rolo.c | 54 |
3 files changed, 0 insertions, 111 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index c56d4cc2c0..5f9c1a7bf9 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -1357,30 +1357,6 @@ bool dbg_save_roms(void) | |||
1357 | return false; | 1357 | return false; |
1358 | } | 1358 | } |
1359 | 1359 | ||
1360 | |||
1361 | /* test code, to be removed later */ | ||
1362 | extern union /* defined in main.c */ | ||
1363 | { | ||
1364 | unsigned char port8 [512]; | ||
1365 | unsigned short port16[256]; | ||
1366 | unsigned port32[128]; | ||
1367 | } startup_io; | ||
1368 | |||
1369 | bool dbg_save_io(void) /* dump the initial I/O space to disk */ | ||
1370 | { | ||
1371 | int fd; | ||
1372 | |||
1373 | fd = creat("/startup_io.bin", O_WRONLY); | ||
1374 | if(fd >= 0) | ||
1375 | { | ||
1376 | write(fd, (void *)&startup_io, sizeof(startup_io)); | ||
1377 | close(fd); | ||
1378 | } | ||
1379 | |||
1380 | return false; | ||
1381 | } | ||
1382 | /* end of test code */ | ||
1383 | |||
1384 | bool debug_menu(void) | 1360 | bool debug_menu(void) |
1385 | { | 1361 | { |
1386 | int m; | 1362 | int m; |
@@ -1388,7 +1364,6 @@ bool debug_menu(void) | |||
1388 | 1364 | ||
1389 | struct menu_items items[] = { | 1365 | struct menu_items items[] = { |
1390 | { "Dump ROM contents", dbg_save_roms }, | 1366 | { "Dump ROM contents", dbg_save_roms }, |
1391 | { "Dump startup I/O", dbg_save_io }, | ||
1392 | { "View I/O ports", dbg_ports }, | 1367 | { "View I/O ports", dbg_ports }, |
1393 | #ifdef HAVE_LCD_BITMAP | 1368 | #ifdef HAVE_LCD_BITMAP |
1394 | #ifdef HAVE_RTC | 1369 | #ifdef HAVE_RTC |
diff --git a/apps/main.c b/apps/main.c index d180067c9e..1a1c6711b9 100644 --- a/apps/main.c +++ b/apps/main.c | |||
@@ -54,16 +54,6 @@ | |||
54 | #include "screens.h" | 54 | #include "screens.h" |
55 | #include "power.h" | 55 | #include "power.h" |
56 | 56 | ||
57 | /* diagnostic, to be removed later: */ | ||
58 | /* snapshot of the I/O space on startup, to compare initialisations */ | ||
59 | union | ||
60 | { | ||
61 | unsigned char port8 [512]; | ||
62 | unsigned short port16[256]; | ||
63 | unsigned port32[128]; | ||
64 | } startup_io; | ||
65 | |||
66 | |||
67 | char appsversion[]=APPSVERSION; | 57 | char appsversion[]=APPSVERSION; |
68 | 58 | ||
69 | void init(void); | 59 | void init(void); |
@@ -235,28 +225,6 @@ void init(void) | |||
235 | 225 | ||
236 | int main(void) | 226 | int main(void) |
237 | { | 227 | { |
238 | /* diagnostic, to be removed later: dump I/O space */ | ||
239 | int i; | ||
240 | for (i = 0; i < 512; i++) | ||
241 | { // most can be read with 8 bit access | ||
242 | startup_io.port8[i] = *((volatile unsigned char*)0x5FFFE00 + i); | ||
243 | } | ||
244 | // some don't allow that, read with 32 bit if aligned | ||
245 | startup_io.port32[0x140/4] = *((volatile unsigned char*)0x5FFFF40); | ||
246 | startup_io.port32[0x144/4] = *((volatile unsigned char*)0x5FFFF44); | ||
247 | startup_io.port32[0x150/4] = *((volatile unsigned char*)0x5FFFF50); | ||
248 | startup_io.port32[0x154/4] = *((volatile unsigned char*)0x5FFFF54); | ||
249 | startup_io.port32[0x160/4] = *((volatile unsigned char*)0x5FFFF60); | ||
250 | startup_io.port32[0x170/4] = *((volatile unsigned char*)0x5FFFF70); | ||
251 | startup_io.port32[0x174/4] = *((volatile unsigned char*)0x5FFFF74); | ||
252 | |||
253 | // read the rest with 16 bit | ||
254 | startup_io.port16[0x14A/2] = *((volatile unsigned short*)0x5FFFF4A); | ||
255 | startup_io.port16[0x15A/2] = *((volatile unsigned short*)0x5FFFF5A); | ||
256 | startup_io.port16[0x16A/2] = *((volatile unsigned short*)0x5FFFF6A); | ||
257 | startup_io.port16[0x17A/2] = *((volatile unsigned short*)0x5FFFF7A); | ||
258 | /* end of diagnostic */ | ||
259 | |||
260 | app_main(); | 228 | app_main(); |
261 | 229 | ||
262 | while(1) { | 230 | while(1) { |
diff --git a/firmware/rolo.c b/firmware/rolo.c index e205c288f7..c5cfc5d77b 100644 --- a/firmware/rolo.c +++ b/firmware/rolo.c | |||
@@ -30,54 +30,6 @@ | |||
30 | 30 | ||
31 | #define IRQ0_EDGE_TRIGGER 0x80 | 31 | #define IRQ0_EDGE_TRIGGER 0x80 |
32 | 32 | ||
33 | /* test code, to be removed later */ | ||
34 | extern union /* defined in main.c */ | ||
35 | { | ||
36 | unsigned char port8 [512]; | ||
37 | unsigned short port16[256]; | ||
38 | unsigned port32[128]; | ||
39 | } startup_io; | ||
40 | |||
41 | |||
42 | bool rolo_io_load(char* filename) | ||
43 | { | ||
44 | int fd; | ||
45 | fd = open(filename, O_RDONLY); | ||
46 | if(fd >= 0) /* no complaint if it doesn't exit */ | ||
47 | { | ||
48 | read(fd, (void *)&startup_io, sizeof(startup_io)); | ||
49 | close(fd); | ||
50 | return true; /* success */ | ||
51 | } | ||
52 | return false; /* not found */ | ||
53 | } | ||
54 | |||
55 | void rolo_io_restore(void) | ||
56 | { | ||
57 | int i; | ||
58 | for (i = 0; i < 512; i++) | ||
59 | { /* most can be written with 8 bit access */ | ||
60 | *((volatile unsigned char*)0x5FFFE00 + i) = startup_io.port8[i]; | ||
61 | } | ||
62 | /* some don't allow that, write with 32 bit if aligned */ | ||
63 | *((volatile unsigned char*)0x5FFFF40) = startup_io.port32[0x140/4]; | ||
64 | *((volatile unsigned char*)0x5FFFF44) = startup_io.port32[0x144/4]; | ||
65 | *((volatile unsigned char*)0x5FFFF50) = startup_io.port32[0x150/4]; | ||
66 | *((volatile unsigned char*)0x5FFFF54) = startup_io.port32[0x154/4]; | ||
67 | *((volatile unsigned char*)0x5FFFF60) = startup_io.port32[0x160/4]; | ||
68 | *((volatile unsigned char*)0x5FFFF70) = startup_io.port32[0x170/4]; | ||
69 | *((volatile unsigned char*)0x5FFFF74) = startup_io.port32[0x174/4]; | ||
70 | |||
71 | /* write the rest with 16 bit */ | ||
72 | *((volatile unsigned short*)0x5FFFF4A) = startup_io.port16[0x14A/2]; | ||
73 | *((volatile unsigned short*)0x5FFFF5A) = startup_io.port16[0x15A/2]; | ||
74 | *((volatile unsigned short*)0x5FFFF6A) = startup_io.port16[0x16A/2]; | ||
75 | *((volatile unsigned short*)0x5FFFF7A) = startup_io.port16[0x17A/2]; | ||
76 | } | ||
77 | /* end of test code */ | ||
78 | |||
79 | |||
80 | |||
81 | static void rolo_error(char *text) | 33 | static void rolo_error(char *text) |
82 | { | 34 | { |
83 | lcd_clear_display(); | 35 | lcd_clear_display(); |
@@ -107,7 +59,6 @@ int rolo_load(char* filename) | |||
107 | unsigned long file_length; | 59 | unsigned long file_length; |
108 | unsigned short checksum,file_checksum; | 60 | unsigned short checksum,file_checksum; |
109 | unsigned char* ramstart = (void*)0x09000000; | 61 | unsigned char* ramstart = (void*)0x09000000; |
110 | bool restore_io; /* debug value */ | ||
111 | 62 | ||
112 | lcd_clear_display(); | 63 | lcd_clear_display(); |
113 | lcd_puts(0, 0, "ROLO..."); | 64 | lcd_puts(0, 0, "ROLO..."); |
@@ -165,8 +116,6 @@ int rolo_load(char* filename) | |||
165 | return -1; | 116 | return -1; |
166 | } | 117 | } |
167 | 118 | ||
168 | restore_io = rolo_io_load("/startup_io.bin"); /* test code */ | ||
169 | |||
170 | lcd_puts(0, 1, "Executing "); | 119 | lcd_puts(0, 1, "Executing "); |
171 | lcd_update(); | 120 | lcd_update(); |
172 | 121 | ||
@@ -183,9 +132,6 @@ int rolo_load(char* filename) | |||
183 | PAIOR = 0x0FA0; /* needed when flashed, probably model-specific */ | 132 | PAIOR = 0x0FA0; /* needed when flashed, probably model-specific */ |
184 | #endif | 133 | #endif |
185 | 134 | ||
186 | if (restore_io) /* test code */ | ||
187 | rolo_io_restore(); /* restore the I/Os from the file content */ | ||
188 | |||
189 | rolo_restart(mp3buf, ramstart, length); | 135 | rolo_restart(mp3buf, ramstart, length); |
190 | 136 | ||
191 | return 0; /* this is never reached */ | 137 | return 0; /* this is never reached */ |