diff options
Diffstat (limited to 'firmware/target/arm/imx233/debug-imx233.c')
-rw-r--r-- | firmware/target/arm/imx233/debug-imx233.c | 66 |
1 files changed, 14 insertions, 52 deletions
diff --git a/firmware/target/arm/imx233/debug-imx233.c b/firmware/target/arm/imx233/debug-imx233.c index ff3313a59e..7cb217f40f 100644 --- a/firmware/target/arm/imx233/debug-imx233.c +++ b/firmware/target/arm/imx233/debug-imx233.c | |||
@@ -242,26 +242,10 @@ static struct | |||
242 | { CLK_XBUS, "xbus", false, false, true, false, true } | 242 | { CLK_XBUS, "xbus", false, false, true, false, true } |
243 | }; | 243 | }; |
244 | 244 | ||
245 | static struct | ||
246 | { | ||
247 | enum imx233_as_monitor_t monitor; | ||
248 | const char *name; | ||
249 | } dbg_as_monitor[] = | ||
250 | { | ||
251 | { AS_CPU_INSTR, "cpu inst" }, | ||
252 | { AS_CPU_DATA, "cpu data" }, | ||
253 | { AS_TRAFFIC, "traffic" }, | ||
254 | { AS_TRAFFIC_JAM, "traffic jam" }, | ||
255 | { AS_APBXDMA, "apbx" }, | ||
256 | { AS_APBHDMA, "apbh" }, | ||
257 | { AS_PXP, "pxp" }, | ||
258 | { AS_DCP, "dcp" } | ||
259 | }; | ||
260 | |||
261 | bool dbg_hw_info_clkctrl(void) | 245 | bool dbg_hw_info_clkctrl(void) |
262 | { | 246 | { |
263 | lcd_setfont(FONT_SYSFIXED); | 247 | lcd_setfont(FONT_SYSFIXED); |
264 | 248 | ||
265 | while(1) | 249 | while(1) |
266 | { | 250 | { |
267 | int button = get_action(CONTEXT_STD, HZ / 10); | 251 | int button = get_action(CONTEXT_STD, HZ / 10); |
@@ -277,7 +261,7 @@ bool dbg_hw_info_clkctrl(void) | |||
277 | lcd_setfont(FONT_UI); | 261 | lcd_setfont(FONT_UI); |
278 | return false; | 262 | return false; |
279 | } | 263 | } |
280 | 264 | ||
281 | lcd_clear_display(); | 265 | lcd_clear_display(); |
282 | 266 | ||
283 | /* 012345678901234567890123456789 */ | 267 | /* 012345678901234567890123456789 */ |
@@ -287,45 +271,23 @@ bool dbg_hw_info_clkctrl(void) | |||
287 | #define c dbg_clk[i] | 271 | #define c dbg_clk[i] |
288 | lcd_putsf(0, i + 1, "%4s", c.name); | 272 | lcd_putsf(0, i + 1, "%4s", c.name); |
289 | if(c.has_enable) | 273 | if(c.has_enable) |
290 | lcd_putsf(5, i + 1, "%2d", imx233_clkctrl_is_clock_enabled(c.clk)); | 274 | lcd_putsf(5, i + 1, "%2d", imx233_clkctrl_is_enabled(c.clk)); |
291 | if(c.has_bypass) | 275 | if(c.has_bypass) |
292 | lcd_putsf(8, i + 1, "%2d", imx233_clkctrl_get_bypass_pll(c.clk)); | 276 | lcd_putsf(8, i + 1, "%2d", imx233_clkctrl_get_bypass(c.clk)); |
293 | if(c.has_idiv && imx233_clkctrl_get_clock_divisor(c.clk) != 0) | 277 | if(c.has_idiv && imx233_clkctrl_get_div(c.clk) != 0) |
294 | lcd_putsf(10, i + 1, "%4d", imx233_clkctrl_get_clock_divisor(c.clk)); | 278 | lcd_putsf(10, i + 1, "%4d", imx233_clkctrl_get_div(c.clk)); |
295 | if(c.has_fdiv && imx233_clkctrl_get_fractional_divisor(c.clk) != 0) | 279 | if(c.has_fdiv && imx233_clkctrl_get_frac_div(c.clk) != 0) |
296 | lcd_putsf(16, i + 1, "%4d", imx233_clkctrl_get_fractional_divisor(c.clk)); | 280 | lcd_putsf(16, i + 1, "%4d", imx233_clkctrl_get_frac_div(c.clk)); |
297 | if(c.has_freq) | 281 | if(c.has_freq) |
298 | lcd_putsf(21, i + 1, "%9d", imx233_clkctrl_get_clock_freq(c.clk)); | 282 | lcd_putsf(21, i + 1, "%9d", imx233_clkctrl_get_freq(c.clk)); |
299 | #undef c | 283 | #undef c |
300 | } | 284 | } |
301 | int line = ARRAYLEN(dbg_clk) + 1; | 285 | int line = ARRAYLEN(dbg_clk) + 1; |
302 | lcd_putsf(0, line, "as: %d/%d emi sync: %d", imx233_clkctrl_is_auto_slow_enabled(), | 286 | if(!imx233_clkctrl_is_auto_slow_enabled()) |
303 | 1 << imx233_clkctrl_get_auto_slow_divisor(), imx233_clkctrl_is_emi_sync_enabled()); | 287 | lcd_putsf(0, line++, "auto-slow: disabled"); |
304 | line++; | 288 | else |
305 | lcd_putsf(0, line, "as monitor: "); | 289 | lcd_putsf(0, line++, "auto-slow: 1/%d", 1 << imx233_clkctrl_get_auto_slow_div()); |
306 | int x_off = 12; | 290 | |
307 | bool first = true; | ||
308 | unsigned line_w = lcd_getwidth() / font_get_width(font_get(lcd_getfont()), ' '); | ||
309 | for(unsigned i = 0; i < ARRAYLEN(dbg_as_monitor); i++) | ||
310 | { | ||
311 | if(!imx233_clkctrl_is_auto_slow_monitor_enabled(dbg_as_monitor[i].monitor)) | ||
312 | continue; | ||
313 | if(!first) | ||
314 | { | ||
315 | lcd_putsf(x_off, line, ", "); | ||
316 | x_off += 2; | ||
317 | } | ||
318 | first = false; | ||
319 | if((x_off + strlen(dbg_as_monitor[i].name)) > line_w) | ||
320 | { | ||
321 | x_off = 1; | ||
322 | line++; | ||
323 | } | ||
324 | lcd_putsf(x_off, line, "%s", dbg_as_monitor[i].name); | ||
325 | x_off += strlen(dbg_as_monitor[i].name); | ||
326 | } | ||
327 | line++; | ||
328 | |||
329 | lcd_update(); | 291 | lcd_update(); |
330 | yield(); | 292 | yield(); |
331 | } | 293 | } |