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')
-rw-r--r--firmware/target/arm/tms320dm320/debug-dm320.c163
1 files changed, 130 insertions, 33 deletions
diff --git a/firmware/target/arm/tms320dm320/debug-dm320.c b/firmware/target/arm/tms320dm320/debug-dm320.c
index d4d478a007..9563a13302 100644
--- a/firmware/target/arm/tms320dm320/debug-dm320.c
+++ b/firmware/target/arm/tms320dm320/debug-dm320.c
@@ -7,7 +7,7 @@
7 * \/ \/ \/ \/ \/ 7 * \/ \/ \/ \/ \/
8 * $Id$ 8 * $Id$
9 * 9 *
10 * Copyright (C) 2007 by Karl Kurbjun 10 * Copyright (C) 2007, 2009 by Karl Kurbjun
11 * 11 *
12 * This program is free software; you can redistribute it and/or 12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License 13 * modify it under the terms of the GNU General Public License
@@ -31,12 +31,93 @@
31#include "font.h" 31#include "font.h"
32#include "lcd-target.h" 32#include "lcd-target.h"
33 33
34#ifndef CREATIVE_ZVx 34#if defined(MROBE_500)
35#include "tsc2100.h" 35#include "tsc2100.h"
36#include "m66591.h"
36#endif 37#endif
37 38
38bool __dbg_ports(void) 39bool __dbg_ports(void)
39{ 40{
41#if defined(MROBE_500)
42 int line = 0;
43 int i;
44 int button;
45 bool done=false;
46
47 lcd_setfont(FONT_SYSFIXED);
48 lcd_clear_display();
49
50 while(!done)
51 {
52 line = 0;
53 button = button_get(false);
54 button&=~BUTTON_REPEAT;
55 if (button == BUTTON_POWER)
56 done=true;
57
58 lcd_puts(0, line++, "[USB Information]");
59
60 lcd_putsf(0, line++, "TRN_CTRL: 0x%04x TRN_LNSTAT: 0x%04x",
61 M66591_TRN_CTRL, M66591_TRN_LNSTAT);
62 lcd_putsf(0, line++, "HSFS: 0x%04x TESTMODE: 0x%04x",
63 M66591_HSFS, M66591_TESTMODE);
64 lcd_putsf(0, line++, "PIN_CFG0: 0x%04x PIN_CFG1: 0x%04x",
65 M66591_PIN_CFG0, M66591_PIN_CFG1);
66 lcd_putsf(0, line++, "PIN_CFG2: 0x%04x", M66591_PIN_CFG2);
67 lcd_putsf(0, line++, "DCP_CTRLEN: 0x%04x", M66591_DCP_CTRLEN);
68 lcd_putsf(0, line++, "CPORT_CTRL0: 0x%04x CPORT_CTRL1: 0x%04x",
69 M66591_CPORT_CTRL0, M66591_CPORT_CTRL1);
70 lcd_putsf(0, line++, "CPORT_CTRL2: 0x%04x DPORT_CTRL0: 0x%04x",
71 M66591_CPORT_CTRL2, M66591_DPORT_CTRL0);
72 lcd_putsf(0, line++, "DPORT_CTRL1: 0x%04x DPORT_CTRL2: 0x%04x",
73 M66591_DPORT_CTRL1, M66591_DPORT_CTRL2);
74 lcd_putsf(0, line++, "INTCFG_MAIN: 0x%04x INTCFG_OUT: 0x%04x",
75 M66591_INTCFG_MAIN, M66591_INTCFG_OUT);
76 lcd_putsf(0, line++, "INTCFG_RDY: 0x%04x INTCFG_NRDY: 0x%04x",
77 M66591_INTCFG_RDY, M66591_INTCFG_NRDY);
78 lcd_putsf(0, line++, "INTCFG_EMP: 0x%04x INTSTAT_MAIN: 0x%04x",
79 M66591_INTCFG_EMP, M66591_INTSTAT_MAIN);
80 lcd_putsf(0, line++, "INTSTAT_RDY: 0x%04x INTSTAT_NRDY: 0x%04x",
81 M66591_INTSTAT_RDY, M66591_INTSTAT_NRDY);
82 lcd_putsf(0, line++, "INTSTAT_EMP: 0x%04x USB_ADDRESS: 0x%04x",
83 M66591_INTSTAT_EMP, M66591_USB_ADDRESS);
84 lcd_putsf(0, line++, "USB_REQ0: 0x%04x USB_REQ1: 0x%04x",
85 M66591_USB_REQ0, M66591_USB_REQ1);
86 lcd_putsf(0, line++, "USB_REQ2: 0x%04x USB_REQ3: 0x%04x",
87 M66591_USB_REQ2, M66591_USB_REQ3);
88 lcd_putsf(0, line++, "DCP_CNTMD: 0x%04x DCP_MXPKSZ: 0x%04x",
89 M66591_DCP_CNTMD, M66591_DCP_MXPKSZ);
90 lcd_putsf(0, line++, "DCPCTRL: 0x%04x", M66591_DCPCTRL);
91
92 line++;
93 for(i=1; i<6; i++) {
94 M66591_PIPE_CFGWND=i;
95 lcd_putsf(0, line++, "PIPE_CFGSEL:0x%04x PIPE_CFGWND: 0x%04x",
96 M66591_PIPE_CFGSEL, M66591_PIPE_CFGWND);
97 }
98 line++;
99
100 lcd_putsf(0, line++, "PIPECTRL1: 0x%04x PIPECTRL2: 0x%04x",
101 M66591_PIPECTRL1, M66591_PIPECTRL2);
102 lcd_putsf(0, line++, "PIPECTRL3: 0x%04x PIPECTRL4: 0x%04x",
103 M66591_PIPECTRL3, M66591_PIPECTRL4);
104 lcd_putsf(0, line++, "PIPECTRL5: 0x%04x PIPECTRL6: 0x%04x",
105 M66591_PIPECTRL5, M66591_PIPECTRL6);
106
107 lcd_putsf(0, line++, "GIO_BITSET0: 0x%04x GIO_BITSET1: 0x%04x",
108 IO_GIO_BITSET0, IO_GIO_BITSET1);
109
110 lcd_putsf(0, line++, "GIO_BITSET2: 0x%04x", IO_GIO_BITSET2);
111
112 lcd_putsf(0, line++, "SDRAM_SDMODE: 0x%04x SDRAM_REFCTL: 0x%04x",
113 IO_SDRAM_SDMODE, IO_SDRAM_REFCTL);
114
115 lcd_putsf(0, line++, "EMIF_CS4CTRL1:0x%04x EMIF_CS4CTRL2:0x%04x",
116 IO_EMIF_CS4CTRL1, IO_EMIF_CS4CTRL2);
117
118 lcd_update();
119 }
120#endif
40 return false; 121 return false;
41} 122}
42 123
@@ -44,7 +125,7 @@ bool __dbg_hw_info(void)
44{ 125{
45 int line = 0, oldline; 126 int line = 0, oldline;
46 int button; 127 int button;
47#ifndef CREATIVE_ZVx 128#if defined(MROBE_500)
48 int *address=0x0; 129 int *address=0x0;
49#endif 130#endif
50 bool done=false; 131 bool done=false;
@@ -57,28 +138,43 @@ bool __dbg_hw_info(void)
57 138
58 lcd_puts(0, line++, "Clock info:"); 139 lcd_puts(0, line++, "Clock info:");
59#if LCD_WIDTH > 320 140#if LCD_WIDTH > 320
60 lcd_putsf(0, line++, "IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x", 141 lcd_putsf(0, line++, "IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x "
142 "IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x",
61 IO_CLK_PLLA, IO_CLK_PLLB, IO_CLK_SEL0, IO_CLK_SEL1); 143 IO_CLK_PLLA, IO_CLK_PLLB, IO_CLK_SEL0, IO_CLK_SEL1);
62 lcd_putsf(0, line++, "IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x", 144 lcd_putsf(0, line++, "IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x "
145 "IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x",
63 IO_CLK_SEL2, IO_CLK_DIV0, IO_CLK_DIV1, IO_CLK_DIV2); 146 IO_CLK_SEL2, IO_CLK_DIV0, IO_CLK_DIV1, IO_CLK_DIV2);
64 lcd_putsf(0, line++, "IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x", 147 lcd_putsf(0, line++, "IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x "
148 "IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x",
65 IO_CLK_DIV3, IO_CLK_DIV4, IO_CLK_BYP, IO_CLK_INV); 149 IO_CLK_DIV3, IO_CLK_DIV4, IO_CLK_BYP, IO_CLK_INV);
66 lcd_putsf(0, line++, "IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x", 150 lcd_putsf(0, line++, "IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x "
151 "IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x",
67 IO_CLK_MOD0, IO_CLK_MOD1, IO_CLK_MOD2, IO_CLK_LPCTL0); 152 IO_CLK_MOD0, IO_CLK_MOD1, IO_CLK_MOD2, IO_CLK_LPCTL0);
68#else 153#else
69 lcd_putsf(0, line++, " IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x", IO_CLK_PLLA, IO_CLK_PLLB); 154 lcd_putsf(0, line++, " IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x",
70 lcd_putsf(0, line++, " IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x", IO_CLK_SEL0, IO_CLK_SEL1); 155 IO_CLK_PLLA, IO_CLK_PLLB);
71 lcd_putsf(0, line++, " IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x", IO_CLK_SEL2, IO_CLK_DIV0); 156 lcd_putsf(0, line++, " IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x",
72 lcd_putsf(0, line++, " IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x", IO_CLK_DIV1, IO_CLK_DIV2); 157 IO_CLK_SEL0, IO_CLK_SEL1);
73 lcd_putsf(0, line++, " IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x", IO_CLK_DIV3, IO_CLK_DIV4); 158 lcd_putsf(0, line++, " IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x",
74 lcd_putsf(0, line++, " IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x", IO_CLK_BYP, IO_CLK_INV); 159 IO_CLK_SEL2, IO_CLK_DIV0);
75 lcd_putsf(0, line++, " IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x ", IO_CLK_MOD0, IO_CLK_MOD1); 160 lcd_putsf(0, line++, " IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x",
76 lcd_putsf(0, line++, " IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x ", IO_CLK_MOD2, IO_CLK_LPCTL0); 161 IO_CLK_DIV1, IO_CLK_DIV2);
77 lcd_puts(0, line++, "Interrupt info:"); 162 lcd_putsf(0, line++, " IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x",
78 lcd_putsf(0, line++, " IO_INTC_EINT0: 0x%04x IO_INTC_EINT1: 0x%04x ", IO_INTC_EINT0, IO_INTC_EINT1); 163 IO_CLK_DIV3, IO_CLK_DIV4);
79 lcd_putsf(0, line++, " IO_INTC_EINT2: 0x%04x IO_INTC_IRQ0: 0x%04x ", IO_INTC_EINT2, IO_INTC_IRQ0); 164 lcd_putsf(0, line++, " IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x",
80 lcd_putsf(0, line++, " IO_INTC_IRQ1: 0x%04x IO_INTC_IRQ2: 0x%04x ", IO_INTC_IRQ1, IO_INTC_IRQ2); 165 IO_CLK_BYP, IO_CLK_INV);
166 lcd_putsf(0, line++, " IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x ",
167 IO_CLK_MOD0, IO_CLK_MOD1);
168 lcd_putsf(0, line++, " IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x ",
169 IO_CLK_MOD2, IO_CLK_LPCTL0);
81#endif 170#endif
171 lcd_puts(0, line++, "Interrupt info:");
172 lcd_putsf(0, line++, " IO_INTC_EINT0: 0x%04x IO_INTC_EINT1: 0x%04x ",
173 IO_INTC_EINT0, IO_INTC_EINT1);
174 lcd_putsf(0, line++, " IO_INTC_EINT2: 0x%04x IO_INTC_IRQ0: 0x%04x ",
175 IO_INTC_EINT2, IO_INTC_IRQ0);
176 lcd_putsf(0, line++, " IO_INTC_IRQ1: 0x%04x IO_INTC_IRQ2: 0x%04x ",
177 IO_INTC_IRQ1, IO_INTC_IRQ2);
82 178
83 lcd_puts(0, line++, "Board revision:"); 179 lcd_puts(0, line++, "Board revision:");
84 switch (IO_BUSC_REVR) { 180 switch (IO_BUSC_REVR) {
@@ -92,14 +188,14 @@ bool __dbg_hw_info(void)
92 lcd_puts(0, line++, " Unknown DM320 Chip ID"); 188 lcd_puts(0, line++, " Unknown DM320 Chip ID");
93 } 189 }
94 190
95#ifndef CREATIVE_ZVx 191#if defined(MROBE_500)
96 line++; 192 line++;
97#endif 193#endif
98 oldline=line; 194 oldline=line;
99 while(!done) 195 while(!done)
100 { 196 {
101 line = oldline; 197 line = oldline;
102#ifndef CREATIVE_ZVx 198#if defined(MROBE_500)
103 button = button_get(false); 199 button = button_get(false);
104 button&=~BUTTON_REPEAT; 200 button&=~BUTTON_REPEAT;
105 if (button == BUTTON_POWER) 201 if (button == BUTTON_POWER)
@@ -113,22 +209,23 @@ bool __dbg_hw_info(void)
113 else if (button==BUTTON_RC_REW) 209 else if (button==BUTTON_RC_REW)
114 address-=0x800; 210 address-=0x800;
115#else 211#else
116 button = button_get(false); 212 button = button_get(false);
117 if(button & BUTTON_POWER) 213 if(button & BUTTON_POWER)
118 done = true; 214 done = true;
119 else if(button & BUTTON_LEFT) 215 else if(button & BUTTON_LEFT)
120 lcd_set_direct_fb(false); 216 lcd_set_direct_fb(false);
121 else if(button & BUTTON_RIGHT) 217 else if(button & BUTTON_RIGHT)
122 lcd_set_direct_fb(true); 218 lcd_set_direct_fb(true);
123 219
124 lcd_puts(0, line++, "LCD info:"); 220 lcd_puts(0, line++, "LCD info:");
125 lcd_putsf(0, line++, " LCD direct FB access? %s", (lcd_get_direct_fb() ? "yes" : "no")); 221 lcd_putsf(0, line++, " LCD direct FB access? %s",
126 line++; 222 (lcd_get_direct_fb() ? "yes" : "no"));
223 line++;
127#endif 224#endif
128 lcd_puts(0, line++, "[Rockbox info]"); 225 lcd_puts(0, line++, "[Rockbox info]");
129 lcd_putsf(0, line++, "current tick: %08x Seconds running: %08d", 226 lcd_putsf(0, line++, "current tick: %08x Seconds running: %08d",
130 (unsigned int)current_tick, (unsigned int)current_tick/100); 227 (unsigned int)current_tick, (unsigned int)current_tick/100);
131#ifndef CREATIVE_ZVx 228#if defined(MROBE_500)
132 lcd_putsf(0, line++, "Address: 0x%08x Data: 0x%08x", 229 lcd_putsf(0, line++, "Address: 0x%08x Data: 0x%08x",
133 (unsigned int)address, *address); 230 (unsigned int)address, *address);
134 lcd_putsf(0, line++, "Address: 0x%08x Data: 0x%08x", 231 lcd_putsf(0, line++, "Address: 0x%08x Data: 0x%08x",