summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tms320dm320/debug-dm320.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/tms320dm320/debug-dm320.c')
-rwxr-xr-xfirmware/target/arm/tms320dm320/debug-dm320.c70
1 files changed, 69 insertions, 1 deletions
diff --git a/firmware/target/arm/tms320dm320/debug-dm320.c b/firmware/target/arm/tms320dm320/debug-dm320.c
index 1a987b4dda..abfb5b09bc 100755
--- a/firmware/target/arm/tms320dm320/debug-dm320.c
+++ b/firmware/target/arm/tms320dm320/debug-dm320.c
@@ -27,18 +27,24 @@
27#include "sprintf.h" 27#include "sprintf.h"
28#include "font.h" 28#include "font.h"
29#include "debug-target.h" 29#include "debug-target.h"
30#include "lcd-target.h"
30 31
31bool __dbg_ports(void) 32bool __dbg_ports(void)
32{ 33{
33 return false; 34 return false;
34} 35}
35 36
37#ifndef CREATIVE_ZVM
36extern char r_buffer[5]; 38extern char r_buffer[5];
37extern int r_button; 39extern int r_button;
40#endif
38bool __dbg_hw_info(void) 41bool __dbg_hw_info(void)
39{ 42{
40 int line = 0, button, oldline; 43 int line = 0, oldline;
44 int button;
45#ifndef CREATIVE_ZVM
41 int *address=0x0; 46 int *address=0x0;
47#endif
42 bool done=false; 48 bool done=false;
43 char buf[100]; 49 char buf[100];
44 50
@@ -50,6 +56,7 @@ bool __dbg_hw_info(void)
50 lcd_puts(0, line++, "[Hardware info]"); 56 lcd_puts(0, line++, "[Hardware info]");
51 57
52 lcd_puts(0, line++, "Clock info:"); 58 lcd_puts(0, line++, "Clock info:");
59#if LCD_WIDTH > 320
53 snprintf(buf, sizeof(buf), "IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x", 60 snprintf(buf, sizeof(buf), "IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x",
54 IO_CLK_PLLA, IO_CLK_PLLB, IO_CLK_SEL0, IO_CLK_SEL1); lcd_puts(0, line++, buf); 61 IO_CLK_PLLA, IO_CLK_PLLB, IO_CLK_SEL0, IO_CLK_SEL1); lcd_puts(0, line++, buf);
55 snprintf(buf, sizeof(buf), "IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x", 62 snprintf(buf, sizeof(buf), "IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x",
@@ -58,12 +65,45 @@ bool __dbg_hw_info(void)
58 IO_CLK_DIV3, IO_CLK_DIV4, IO_CLK_BYP, IO_CLK_INV); lcd_puts(0, line++, buf); 65 IO_CLK_DIV3, IO_CLK_DIV4, IO_CLK_BYP, IO_CLK_INV); lcd_puts(0, line++, buf);
59 snprintf(buf, sizeof(buf), "IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x", 66 snprintf(buf, sizeof(buf), "IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x",
60 IO_CLK_MOD0, IO_CLK_MOD1, IO_CLK_MOD2, IO_CLK_LPCTL0); lcd_puts(0, line++, buf); 67 IO_CLK_MOD0, IO_CLK_MOD1, IO_CLK_MOD2, IO_CLK_LPCTL0); lcd_puts(0, line++, buf);
68#else
69 snprintf(buf, sizeof(buf), " IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x", IO_CLK_PLLA, IO_CLK_PLLB);
70 lcd_puts(0, line++, buf);
71 snprintf(buf, sizeof(buf), " IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x", IO_CLK_SEL0, IO_CLK_SEL1);
72 lcd_puts(0, line++, buf);
73 snprintf(buf, sizeof(buf), " IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x", IO_CLK_SEL2, IO_CLK_DIV0);
74 lcd_puts(0, line++, buf);
75 snprintf(buf, sizeof(buf), " IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x", IO_CLK_DIV1, IO_CLK_DIV2);
76 lcd_puts(0, line++, buf);
77 snprintf(buf, sizeof(buf), " IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x", IO_CLK_DIV3, IO_CLK_DIV4);
78 lcd_puts(0, line++, buf);
79 snprintf(buf, sizeof(buf), " IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x", IO_CLK_BYP, IO_CLK_INV);
80 lcd_puts(0, line++, buf);
81 snprintf(buf, sizeof(buf), " IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x ", IO_CLK_MOD0, IO_CLK_MOD1);
82 lcd_puts(0, line++, buf);
83 snprintf(buf, sizeof(buf), " IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x ", IO_CLK_MOD2, IO_CLK_LPCTL0);
84 lcd_puts(0, line++, buf);
85#endif
86
87 lcd_puts(0, line++, "Board revision:");
88 switch (IO_BUSC_REVR) {
89 case 0x0010:
90 lcd_puts(0, line++, " DM320 Rev. A");
91 break;
92 case 0x0011:
93 lcd_puts(0, line++, " DM320 Rev. B/C");
94 break;
95 default:
96 lcd_puts(0, line++, " Unknown DM320 Chip ID");
97 }
61 98
99#ifndef CREATIVE_ZVM
62 line++; 100 line++;
101#endif
63 oldline=line; 102 oldline=line;
64 while(!done) 103 while(!done)
65 { 104 {
66 line = oldline; 105 line = oldline;
106#ifndef CREATIVE_ZVM
67 button = button_get(false); 107 button = button_get(false);
68 button&=~BUTTON_REPEAT; 108 button&=~BUTTON_REPEAT;
69 if (button == BUTTON_POWER) 109 if (button == BUTTON_POWER)
@@ -81,14 +121,42 @@ bool __dbg_hw_info(void)
81 r_buffer[0], r_buffer[1], r_buffer[2], r_buffer[3],r_buffer[4] ); lcd_puts(0, line++, buf); 121 r_buffer[0], r_buffer[1], r_buffer[2], r_buffer[3],r_buffer[4] ); lcd_puts(0, line++, buf);
82 snprintf(buf, sizeof(buf), "Button: 0x%08x, HWread: 0x%08x", 122 snprintf(buf, sizeof(buf), "Button: 0x%08x, HWread: 0x%08x",
83 (unsigned int)button, r_button); lcd_puts(0, line++, buf); 123 (unsigned int)button, r_button); lcd_puts(0, line++, buf);
124#else
125 button = button_get(false);
126 if(button & BUTTON_POWER)
127 done = true;
128 else if(button & BUTTON_LEFT)
129 lcd_set_direct_fb(false);
130 else if(button & BUTTON_RIGHT)
131 lcd_set_direct_fb(true);
132
133 lcd_puts(0, line++, "PIC info:");
134 snprintf(buf, sizeof(buf), " Init value 1: 0x%04x", get_debug_info(1));
135 lcd_puts(0, line++, buf);
136 snprintf(buf, sizeof(buf), " Init value 2: 0x%04x", get_debug_info(2));
137 lcd_puts(0, line++, buf);
138 snprintf(buf, sizeof(buf), " Last button value: 0x%04x Raw value: 0x%04x", get_debug_info(3), button_read_device());
139 lcd_puts(0, line++, buf);
140 snprintf(buf, sizeof(buf), " Last button at: 0x%04x", get_debug_info(5));
141 lcd_puts(0, line++, buf);
142 snprintf(buf, sizeof(buf), " Dock values: 0x%04x", get_debug_info(4));
143 lcd_puts(0, line++, buf);
144 lcd_puts(0, line++, "LCD info:");
145 snprintf(buf, sizeof(buf), " LCD direct FB access? %s", (lcd_get_direct_fb() ? "yes" : "no"));
146 lcd_puts(0, line++, buf);
147 line++;
148#endif
149 lcd_puts(0, line++, "[Rockbox info]");
84 snprintf(buf, sizeof(buf), "current tick: %08x Seconds running: %08d", 150 snprintf(buf, sizeof(buf), "current tick: %08x Seconds running: %08d",
85 (unsigned int)current_tick, (unsigned int)current_tick/100); lcd_puts(0, line++, buf); 151 (unsigned int)current_tick, (unsigned int)current_tick/100); lcd_puts(0, line++, buf);
152#ifndef CREATIVE_ZVM
86 snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x", 153 snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x",
87 (unsigned int)address, *address); lcd_puts(0, line++, buf); 154 (unsigned int)address, *address); lcd_puts(0, line++, buf);
88 snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x", 155 snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x",
89 (unsigned int)(address+1), *(address+1)); lcd_puts(0, line++, buf); 156 (unsigned int)(address+1), *(address+1)); lcd_puts(0, line++, buf);
90 snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x", 157 snprintf(buf, sizeof(buf), "Address: 0x%08x Data: 0x%08x",
91 (unsigned int)(address+2), *(address+2)); lcd_puts(0, line++, buf); 158 (unsigned int)(address+2), *(address+2)); lcd_puts(0, line++, buf);
159#endif
92 160
93 lcd_update(); 161 lcd_update();
94 } 162 }