diff options
Diffstat (limited to 'firmware/target/arm/s5l8702/debug-s5l8702.c')
-rw-r--r-- | firmware/target/arm/s5l8702/debug-s5l8702.c | 332 |
1 files changed, 166 insertions, 166 deletions
diff --git a/firmware/target/arm/s5l8702/debug-s5l8702.c b/firmware/target/arm/s5l8702/debug-s5l8702.c index 5001d61f70..f49595aa00 100644 --- a/firmware/target/arm/s5l8702/debug-s5l8702.c +++ b/firmware/target/arm/s5l8702/debug-s5l8702.c | |||
@@ -1,166 +1,166 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * __________ __ ___. | 2 | * __________ __ ___. |
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id: debug-s5l8700.c 28719 2010-12-01 18:35:01Z Buschel $ | 8 | * $Id: debug-s5l8700.c 28719 2010-12-01 18:35:01Z Buschel $ |
9 | * | 9 | * |
10 | * Copyright © 2008 Rafaël Carré | 10 | * Copyright © 2008 Rafaël Carré |
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 |
14 | * as published by the Free Software Foundation; either version 2 | 14 | * as published by the Free Software Foundation; either version 2 |
15 | * of the License, or (at your option) any later version. | 15 | * of the License, or (at your option) any later version. |
16 | * | 16 | * |
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
18 | * KIND, either express or implied. | 18 | * KIND, either express or implied. |
19 | * | 19 | * |
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | 21 | ||
22 | #include <stdbool.h> | 22 | #include <stdbool.h> |
23 | #include "config.h" | 23 | #include "config.h" |
24 | #include "kernel.h" | 24 | #include "kernel.h" |
25 | #include "debug-target.h" | 25 | #include "debug-target.h" |
26 | #include "button.h" | 26 | #include "button.h" |
27 | #include "lcd.h" | 27 | #include "lcd.h" |
28 | #include "font.h" | 28 | #include "font.h" |
29 | #include "storage.h" | 29 | #include "storage.h" |
30 | #include "power.h" | 30 | #include "power.h" |
31 | #include "pmu-target.h" | 31 | #include "pmu-target.h" |
32 | #include "pcm-target.h" | 32 | #include "pcm-target.h" |
33 | 33 | ||
34 | /* Skeleton for adding target specific debug info to the debug menu | 34 | /* Skeleton for adding target specific debug info to the debug menu |
35 | */ | 35 | */ |
36 | 36 | ||
37 | #define _DEBUG_PRINTF(a, varargs...) lcd_putsf(0, line++, (a), ##varargs); | 37 | #define _DEBUG_PRINTF(a, varargs...) lcd_putsf(0, line++, (a), ##varargs); |
38 | 38 | ||
39 | extern int lcd_type; | 39 | extern int lcd_type; |
40 | bool dbg_hw_info(void) | 40 | bool dbg_hw_info(void) |
41 | { | 41 | { |
42 | int line; | 42 | int line; |
43 | int i; | 43 | int i; |
44 | unsigned int state = 0; | 44 | unsigned int state = 0; |
45 | const unsigned int max_states=3; | 45 | const unsigned int max_states=3; |
46 | 46 | ||
47 | lcd_clear_display(); | 47 | lcd_clear_display(); |
48 | lcd_setfont(FONT_SYSFIXED); | 48 | lcd_setfont(FONT_SYSFIXED); |
49 | 49 | ||
50 | state=0; | 50 | state=0; |
51 | while(1) | 51 | while(1) |
52 | { | 52 | { |
53 | lcd_clear_display(); | 53 | lcd_clear_display(); |
54 | line = 0; | 54 | line = 0; |
55 | 55 | ||
56 | if(state == 0) | 56 | if(state == 0) |
57 | { | 57 | { |
58 | _DEBUG_PRINTF("CPU:"); | 58 | _DEBUG_PRINTF("CPU:"); |
59 | _DEBUG_PRINTF("current_tick: %d", (unsigned int)current_tick); | 59 | _DEBUG_PRINTF("current_tick: %d", (unsigned int)current_tick); |
60 | line++; | 60 | line++; |
61 | 61 | ||
62 | _DEBUG_PRINTF("LCD type: %d", lcd_type); | 62 | _DEBUG_PRINTF("LCD type: %d", lcd_type); |
63 | line++; | 63 | line++; |
64 | } | 64 | } |
65 | else if(state==1) | 65 | else if(state==1) |
66 | { | 66 | { |
67 | _DEBUG_PRINTF("PMU:"); | 67 | _DEBUG_PRINTF("PMU:"); |
68 | for(i=0;i<7;i++) | 68 | for(i=0;i<7;i++) |
69 | { | 69 | { |
70 | char *device[] = {"(unknown)", | 70 | char *device[] = {"(unknown)", |
71 | "(unknown)", | 71 | "(unknown)", |
72 | "(unknown)", | 72 | "(unknown)", |
73 | "(unknown)", | 73 | "(unknown)", |
74 | "(unknown)", | 74 | "(unknown)", |
75 | "(unknown)", | 75 | "(unknown)", |
76 | "(unknown)"}; | 76 | "(unknown)"}; |
77 | _DEBUG_PRINTF("ldo%d %s: %dmV %s",i, | 77 | _DEBUG_PRINTF("ldo%d %s: %dmV %s",i, |
78 | pmu_read(0x2e + (i << 1))?" on":"off", | 78 | pmu_read(0x2e + (i << 1))?" on":"off", |
79 | 900 + pmu_read(0x2d + (i << 1))*100, | 79 | 900 + pmu_read(0x2d + (i << 1))*100, |
80 | device[i]); | 80 | device[i]); |
81 | } | 81 | } |
82 | _DEBUG_PRINTF("cpu voltage: %dmV",625 + pmu_read(0x1e)*25); | 82 | _DEBUG_PRINTF("cpu voltage: %dmV",625 + pmu_read(0x1e)*25); |
83 | _DEBUG_PRINTF("memory voltage: %dmV",625 + pmu_read(0x22)*25); | 83 | _DEBUG_PRINTF("memory voltage: %dmV",625 + pmu_read(0x22)*25); |
84 | line++; | 84 | line++; |
85 | _DEBUG_PRINTF("charging: %s", charging_state() ? "true" : "false"); | 85 | _DEBUG_PRINTF("charging: %s", charging_state() ? "true" : "false"); |
86 | _DEBUG_PRINTF("backlight: %s", pmu_read(0x29) ? "on" : "off"); | 86 | _DEBUG_PRINTF("backlight: %s", pmu_read(0x29) ? "on" : "off"); |
87 | _DEBUG_PRINTF("brightness value: %d", pmu_read(0x28)); | 87 | _DEBUG_PRINTF("brightness value: %d", pmu_read(0x28)); |
88 | } | 88 | } |
89 | else if(state==2) | 89 | else if(state==2) |
90 | { | 90 | { |
91 | _DEBUG_PRINTF("Audio DMA:"); | 91 | _DEBUG_PRINTF("Audio DMA:"); |
92 | _DEBUG_PRINTF(">%08X %08X %08X %08X %08X", DMAC0C0CONFIG, DMAC0C0SRCADDR, | 92 | _DEBUG_PRINTF(">%08X %08X %08X %08X %08X", DMAC0C0CONFIG, DMAC0C0SRCADDR, |
93 | DMAC0C0DESTADDR, DMAC0C0NEXTLLI, DMAC0C0CONTROL); | 93 | DMAC0C0DESTADDR, DMAC0C0NEXTLLI, DMAC0C0CONTROL); |
94 | for(i = 0; i < PCM_LLICOUNT; i++) | 94 | for(i = 0; i < PCM_LLICOUNT; i++) |
95 | _DEBUG_PRINTF("%08X: %08X %08X %08X %08X", &pcm_lli[i], pcm_lli[i].srcaddr, | 95 | _DEBUG_PRINTF("%08X: %08X %08X %08X %08X", &pcm_lli[i], pcm_lli[i].srcaddr, |
96 | pcm_lli[i].dstaddr, pcm_lli[i].nextlli, pcm_lli[i].control); | 96 | pcm_lli[i].dstaddr, pcm_lli[i].nextlli, pcm_lli[i].control); |
97 | _DEBUG_PRINTF("chunk: %08X %08X", pcm_chunksize, pcm_remaining); | 97 | _DEBUG_PRINTF("chunk: %08X %08X", pcm_chunksize, pcm_remaining); |
98 | } | 98 | } |
99 | else | 99 | else |
100 | { | 100 | { |
101 | state=0; | 101 | state=0; |
102 | } | 102 | } |
103 | 103 | ||
104 | 104 | ||
105 | lcd_update(); | 105 | lcd_update(); |
106 | switch(button_get_w_tmo(HZ/20)) | 106 | switch(button_get_w_tmo(HZ/20)) |
107 | { | 107 | { |
108 | case BUTTON_SCROLL_BACK: | 108 | case BUTTON_SCROLL_BACK: |
109 | if(state!=0) state--; | 109 | if(state!=0) state--; |
110 | break; | 110 | break; |
111 | 111 | ||
112 | case BUTTON_SCROLL_FWD: | 112 | case BUTTON_SCROLL_FWD: |
113 | if(state!=max_states-1) | 113 | if(state!=max_states-1) |
114 | { | 114 | { |
115 | state++; | 115 | state++; |
116 | } | 116 | } |
117 | break; | 117 | break; |
118 | 118 | ||
119 | case DEBUG_CANCEL: | 119 | case DEBUG_CANCEL: |
120 | case BUTTON_REL: | 120 | case BUTTON_REL: |
121 | lcd_setfont(FONT_UI); | 121 | lcd_setfont(FONT_UI); |
122 | return false; | 122 | return false; |
123 | } | 123 | } |
124 | } | 124 | } |
125 | 125 | ||
126 | lcd_setfont(FONT_UI); | 126 | lcd_setfont(FONT_UI); |
127 | return false; | 127 | return false; |
128 | } | 128 | } |
129 | 129 | ||
130 | bool dbg_ports(void) | 130 | bool dbg_ports(void) |
131 | { | 131 | { |
132 | int line; | 132 | int line; |
133 | 133 | ||
134 | lcd_setfont(FONT_SYSFIXED); | 134 | lcd_setfont(FONT_SYSFIXED); |
135 | 135 | ||
136 | while(1) | 136 | while(1) |
137 | { | 137 | { |
138 | lcd_clear_display(); | 138 | lcd_clear_display(); |
139 | line = 0; | 139 | line = 0; |
140 | 140 | ||
141 | _DEBUG_PRINTF("GPIO 0: %08x",(unsigned int)PDAT(0)); | 141 | _DEBUG_PRINTF("GPIO 0: %08x",(unsigned int)PDAT(0)); |
142 | _DEBUG_PRINTF("GPIO 1: %08x",(unsigned int)PDAT(1)); | 142 | _DEBUG_PRINTF("GPIO 1: %08x",(unsigned int)PDAT(1)); |
143 | _DEBUG_PRINTF("GPIO 2: %08x",(unsigned int)PDAT(2)); | 143 | _DEBUG_PRINTF("GPIO 2: %08x",(unsigned int)PDAT(2)); |
144 | _DEBUG_PRINTF("GPIO 3: %08x",(unsigned int)PDAT(3)); | 144 | _DEBUG_PRINTF("GPIO 3: %08x",(unsigned int)PDAT(3)); |
145 | _DEBUG_PRINTF("GPIO 4: %08x",(unsigned int)PDAT(4)); | 145 | _DEBUG_PRINTF("GPIO 4: %08x",(unsigned int)PDAT(4)); |
146 | _DEBUG_PRINTF("GPIO 5: %08x",(unsigned int)PDAT(5)); | 146 | _DEBUG_PRINTF("GPIO 5: %08x",(unsigned int)PDAT(5)); |
147 | _DEBUG_PRINTF("GPIO 6: %08x",(unsigned int)PDAT(6)); | 147 | _DEBUG_PRINTF("GPIO 6: %08x",(unsigned int)PDAT(6)); |
148 | _DEBUG_PRINTF("GPIO 7: %08x",(unsigned int)PDAT(7)); | 148 | _DEBUG_PRINTF("GPIO 7: %08x",(unsigned int)PDAT(7)); |
149 | _DEBUG_PRINTF("GPIO 8: %08x",(unsigned int)PDAT(8)); | 149 | _DEBUG_PRINTF("GPIO 8: %08x",(unsigned int)PDAT(8)); |
150 | _DEBUG_PRINTF("GPIO 9: %08x",(unsigned int)PDAT(9)); | 150 | _DEBUG_PRINTF("GPIO 9: %08x",(unsigned int)PDAT(9)); |
151 | _DEBUG_PRINTF("GPIO 10: %08x",(unsigned int)PDAT(10)); | 151 | _DEBUG_PRINTF("GPIO 10: %08x",(unsigned int)PDAT(10)); |
152 | _DEBUG_PRINTF("GPIO 11: %08x",(unsigned int)PDAT(11)); | 152 | _DEBUG_PRINTF("GPIO 11: %08x",(unsigned int)PDAT(11)); |
153 | _DEBUG_PRINTF("GPIO 12: %08x",(unsigned int)PDAT(12)); | 153 | _DEBUG_PRINTF("GPIO 12: %08x",(unsigned int)PDAT(12)); |
154 | _DEBUG_PRINTF("GPIO 13: %08x",(unsigned int)PDAT(13)); | 154 | _DEBUG_PRINTF("GPIO 13: %08x",(unsigned int)PDAT(13)); |
155 | _DEBUG_PRINTF("GPIO 14: %08x",(unsigned int)PDAT(14)); | 155 | _DEBUG_PRINTF("GPIO 14: %08x",(unsigned int)PDAT(14)); |
156 | _DEBUG_PRINTF("GPIO 15: %08x",(unsigned int)PDAT(15)); | 156 | _DEBUG_PRINTF("GPIO 15: %08x",(unsigned int)PDAT(15)); |
157 | _DEBUG_PRINTF("USEC : %08x",(unsigned int)USEC_TIMER); | 157 | _DEBUG_PRINTF("USEC : %08x",(unsigned int)USEC_TIMER); |
158 | 158 | ||
159 | lcd_update(); | 159 | lcd_update(); |
160 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) | 160 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) |
161 | break; | 161 | break; |
162 | } | 162 | } |
163 | lcd_setfont(FONT_UI); | 163 | lcd_setfont(FONT_UI); |
164 | return false; | 164 | return false; |
165 | } | 165 | } |
166 | 166 | ||