1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007, 2009 by Karl Kurbjun
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
31 #include "lcd-target.h"
33 #if defined(MROBE_500)
38 bool __dbg_ports(void)
40 #if defined(MROBE_500)
46 lcd_setfont(FONT_SYSFIXED
);
52 button
= button_get(false);
53 button
&=~BUTTON_REPEAT
;
54 if (button
== BUTTON_POWER
)
57 lcd_puts(0, line
++, "[USB Information]");
59 lcd_putsf(0, line
++, "TRN_CTRL: 0x%04x TRN_LNSTAT: 0x%04x",
60 M66591_TRN_CTRL
, M66591_TRN_LNSTAT
);
61 lcd_putsf(0, line
++, "HSFS: 0x%04x TESTMODE: 0x%04x",
62 M66591_HSFS
, M66591_TESTMODE
);
63 lcd_putsf(0, line
++, "PIN_CFG0: 0x%04x PIN_CFG1: 0x%04x",
64 M66591_PIN_CFG0
, M66591_PIN_CFG1
);
65 lcd_putsf(0, line
++, "PIN_CFG2: 0x%04x", M66591_PIN_CFG2
);
66 lcd_putsf(0, line
++, "DCP_CTRLEN: 0x%04x", M66591_DCP_CTRLEN
);
67 lcd_putsf(0, line
++, "CPORT_CTRL0: 0x%04x CPORT_CTRL1: 0x%04x",
68 M66591_CPORT_CTRL0
, M66591_CPORT_CTRL1
);
69 lcd_putsf(0, line
++, "CPORT_CTRL2: 0x%04x DPORT_CTRL0: 0x%04x",
70 M66591_CPORT_CTRL2
, M66591_DPORT_CTRL0
);
71 lcd_putsf(0, line
++, "DPORT_CTRL1: 0x%04x DPORT_CTRL2: 0x%04x",
72 M66591_DPORT_CTRL1
, M66591_DPORT_CTRL2
);
73 lcd_putsf(0, line
++, "INTCFG_MAIN: 0x%04x INTCFG_OUT: 0x%04x",
74 M66591_INTCFG_MAIN
, M66591_INTCFG_OUT
);
75 lcd_putsf(0, line
++, "INTCFG_RDY: 0x%04x INTCFG_NRDY: 0x%04x",
76 M66591_INTCFG_RDY
, M66591_INTCFG_NRDY
);
77 lcd_putsf(0, line
++, "INTCFG_EMP: 0x%04x INTSTAT_MAIN: 0x%04x",
78 M66591_INTCFG_EMP
, M66591_INTSTAT_MAIN
);
79 lcd_putsf(0, line
++, "INTSTAT_RDY: 0x%04x INTSTAT_NRDY: 0x%04x",
80 M66591_INTSTAT_RDY
, M66591_INTSTAT_NRDY
);
81 lcd_putsf(0, line
++, "INTSTAT_EMP: 0x%04x USB_ADDRESS: 0x%04x",
82 M66591_INTSTAT_EMP
, M66591_USB_ADDRESS
);
83 lcd_putsf(0, line
++, "USB_REQ0: 0x%04x USB_REQ1: 0x%04x",
84 M66591_USB_REQ0
, M66591_USB_REQ1
);
85 lcd_putsf(0, line
++, "USB_REQ2: 0x%04x USB_REQ3: 0x%04x",
86 M66591_USB_REQ2
, M66591_USB_REQ3
);
87 lcd_putsf(0, line
++, "DCP_CNTMD: 0x%04x DCP_MXPKSZ: 0x%04x",
88 M66591_DCP_CNTMD
, M66591_DCP_MXPKSZ
);
89 lcd_putsf(0, line
++, "DCPCTRL: 0x%04x", M66591_DCPCTRL
);
94 lcd_putsf(0, line
++, "PIPE_CFGSEL:0x%04x PIPE_CFGWND: 0x%04x",
95 M66591_PIPE_CFGSEL
, M66591_PIPE_CFGWND
);
99 lcd_putsf(0, line
++, "PIPECTRL1: 0x%04x PIPECTRL2: 0x%04x",
100 M66591_PIPECTRL1
, M66591_PIPECTRL2
);
101 lcd_putsf(0, line
++, "PIPECTRL3: 0x%04x PIPECTRL4: 0x%04x",
102 M66591_PIPECTRL3
, M66591_PIPECTRL4
);
103 lcd_putsf(0, line
++, "PIPECTRL5: 0x%04x PIPECTRL6: 0x%04x",
104 M66591_PIPECTRL5
, M66591_PIPECTRL6
);
106 lcd_putsf(0, line
++, "GIO_BITSET0: 0x%04x GIO_BITSET1: 0x%04x",
107 IO_GIO_BITSET0
, IO_GIO_BITSET1
);
109 lcd_putsf(0, line
++, "GIO_BITSET2: 0x%04x", IO_GIO_BITSET2
);
111 lcd_putsf(0, line
++, "SDRAM_SDMODE: 0x%04x SDRAM_REFCTL: 0x%04x",
112 IO_SDRAM_SDMODE
, IO_SDRAM_REFCTL
);
114 lcd_putsf(0, line
++, "EMIF_CS4CTRL1:0x%04x EMIF_CS4CTRL2:0x%04x",
115 IO_EMIF_CS4CTRL1
, IO_EMIF_CS4CTRL2
);
123 bool __dbg_hw_info(void)
125 int line
= 0, oldline
;
127 #if defined(MROBE_500)
132 lcd_setfont(FONT_SYSFIXED
);
135 /* Put all the static text befor the while loop */
136 lcd_puts(0, line
++, "[Hardware info]");
138 lcd_puts(0, line
++, "Clock info:");
140 lcd_putsf(0, line
++, "IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x "
141 "IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x",
142 IO_CLK_PLLA
, IO_CLK_PLLB
, IO_CLK_SEL0
, IO_CLK_SEL1
);
143 lcd_putsf(0, line
++, "IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x "
144 "IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x",
145 IO_CLK_SEL2
, IO_CLK_DIV0
, IO_CLK_DIV1
, IO_CLK_DIV2
);
146 lcd_putsf(0, line
++, "IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x "
147 "IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x",
148 IO_CLK_DIV3
, IO_CLK_DIV4
, IO_CLK_BYP
, IO_CLK_INV
);
149 lcd_putsf(0, line
++, "IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x "
150 "IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x",
151 IO_CLK_MOD0
, IO_CLK_MOD1
, IO_CLK_MOD2
, IO_CLK_LPCTL0
);
153 lcd_putsf(0, line
++, " IO_CLK_PLLA: 0x%04x IO_CLK_PLLB: 0x%04x",
154 IO_CLK_PLLA
, IO_CLK_PLLB
);
155 lcd_putsf(0, line
++, " IO_CLK_SEL0: 0x%04x IO_CLK_SEL1: 0x%04x",
156 IO_CLK_SEL0
, IO_CLK_SEL1
);
157 lcd_putsf(0, line
++, " IO_CLK_SEL2: 0x%04x IO_CLK_DIV0: 0x%04x",
158 IO_CLK_SEL2
, IO_CLK_DIV0
);
159 lcd_putsf(0, line
++, " IO_CLK_DIV1: 0x%04x IO_CLK_DIV2: 0x%04x",
160 IO_CLK_DIV1
, IO_CLK_DIV2
);
161 lcd_putsf(0, line
++, " IO_CLK_DIV3: 0x%04x IO_CLK_DIV4: 0x%04x",
162 IO_CLK_DIV3
, IO_CLK_DIV4
);
163 lcd_putsf(0, line
++, " IO_CLK_BYP : 0x%04x IO_CLK_INV : 0x%04x",
164 IO_CLK_BYP
, IO_CLK_INV
);
165 lcd_putsf(0, line
++, " IO_CLK_MOD0: 0x%04x IO_CLK_MOD1: 0x%04x ",
166 IO_CLK_MOD0
, IO_CLK_MOD1
);
167 lcd_putsf(0, line
++, " IO_CLK_MOD2: 0x%04x IO_CLK_LPCTL0: 0x%04x ",
168 IO_CLK_MOD2
, IO_CLK_LPCTL0
);
170 lcd_puts(0, line
++, "Interrupt info:");
171 lcd_putsf(0, line
++, " IO_INTC_EINT0: 0x%04x IO_INTC_EINT1: 0x%04x ",
172 IO_INTC_EINT0
, IO_INTC_EINT1
);
173 lcd_putsf(0, line
++, " IO_INTC_EINT2: 0x%04x IO_INTC_IRQ0: 0x%04x ",
174 IO_INTC_EINT2
, IO_INTC_IRQ0
);
175 lcd_putsf(0, line
++, " IO_INTC_IRQ1: 0x%04x IO_INTC_IRQ2: 0x%04x ",
176 IO_INTC_IRQ1
, IO_INTC_IRQ2
);
178 lcd_puts(0, line
++, "Board revision:");
179 switch (IO_BUSC_REVR
) {
181 lcd_puts(0, line
++, " DM320 Rev. A");
184 lcd_puts(0, line
++, " DM320 Rev. B/C");
187 lcd_puts(0, line
++, " Unknown DM320 Chip ID");
190 #if defined(MROBE_500)
197 #if defined(MROBE_500)
198 button
= button_get(false);
199 button
&=~BUTTON_REPEAT
;
200 if (button
== BUTTON_POWER
)
202 if(button
==BUTTON_RC_PLAY
)
204 else if (button
==BUTTON_RC_DOWN
)
206 else if (button
==BUTTON_RC_FF
)
208 else if (button
==BUTTON_RC_REW
)
211 button
= button_get(false);
212 if(button
& BUTTON_POWER
)
214 else if(button
& BUTTON_LEFT
)
215 lcd_set_direct_fb(false);
216 else if(button
& BUTTON_RIGHT
)
217 lcd_set_direct_fb(true);
219 lcd_puts(0, line
++, "LCD info:");
220 lcd_putsf(0, line
++, " LCD direct FB access? %s",
221 (lcd_get_direct_fb() ? "yes" : "no"));
224 lcd_puts(0, line
++, "[Rockbox info]");
225 lcd_putsf(0, line
++, "current tick: %08x Seconds running: %08d",
226 (unsigned int)current_tick
, (unsigned int)current_tick
/100);
227 #if defined(MROBE_500)
228 lcd_putsf(0, line
++, "Address: 0x%08x Data: 0x%08x",
229 (unsigned int)address
, *address
);
230 lcd_putsf(0, line
++, "Address: 0x%08x Data: 0x%08x",
231 (unsigned int)(address
+1), *(address
+1));
232 lcd_putsf(0, line
++, "Address: 0x%08x Data: 0x%08x",
233 (unsigned int)(address
+2), *(address
+2));