summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2011-10-18 22:06:02 +0000
committerAmaury Pouly <pamaury@rockbox.org>2011-10-18 22:06:02 +0000
commit96f0464796639e241074a98b0a5dd7f07305d142 (patch)
treeee205c7bc0827e3dc2b1a594df39abe432001c14
parent43673e9e28f6fad84e279ec8e6ded7544a135a76 (diff)
downloadrockbox-96f0464796639e241074a98b0a5dd7f07305d142.tar.gz
rockbox-96f0464796639e241074a98b0a5dd7f07305d142.zip
imx233/fuze+: implement hw info debug screen to show dma channels state
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30797 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/imx233/debug-imx233.c58
1 files changed, 57 insertions, 1 deletions
diff --git a/firmware/target/arm/imx233/debug-imx233.c b/firmware/target/arm/imx233/debug-imx233.c
index 4cfddb3de8..afdc6d0565 100644
--- a/firmware/target/arm/imx233/debug-imx233.c
+++ b/firmware/target/arm/imx233/debug-imx233.c
@@ -21,10 +21,66 @@
21 21
22#include "system.h" 22#include "system.h"
23#include "debug-target.h" 23#include "debug-target.h"
24#include "dma-imx233.h"
25#include "action.h"
26#include "lcd.h"
27#include "font.h"
28
29static struct
30{
31 const char *name;
32 unsigned chan;
33} dbg_channels[] =
34{
35 { "i2c", APB_I2C },
36 { "dac", APB_AUDIO_DAC },
37 { "ssp1", APB_SSP(1) },
38 { "ssp2", APB_SSP(2) },
39};
40
41bool dbg_hw_info_dma(void)
42{
43 lcd_setfont(FONT_SYSFIXED);
44
45 while(1)
46 {
47 int button = get_action(CONTEXT_STD, HZ / 25);
48 switch(button)
49 {
50 case ACTION_STD_NEXT:
51 case ACTION_STD_PREV:
52 case ACTION_STD_OK:
53 case ACTION_STD_MENU:
54 lcd_setfont(FONT_UI);
55 return true;
56 case ACTION_STD_CANCEL:
57 lcd_setfont(FONT_UI);
58 return false;
59 }
60
61 lcd_clear_display();
62
63 lcd_putsf(0, 0, "I G F C E name bar apb ahb");
64 for(unsigned i = 0; i < ARRAYLEN(dbg_channels); i++)
65 {
66 struct imx233_dma_info_t info = imx233_dma_get_info(dbg_channels[i].chan, DMA_INFO_ALL);
67 lcd_putsf(0, i + 1, "%c %c %c %c %c %4s %x %x %x",
68 info.int_enabled ? 'i' : ' ',
69 info.gated ? 'g' : ' ',
70 info.freezed ? 'f' : ' ',
71 info.int_cmdcomplt ? 'c' : ' ',
72 info.int_error ? 'e' : ' ',
73 dbg_channels[i].name, info.bar, info.apb_bytes, info.ahb_bytes);
74 }
75
76 lcd_update();
77 yield();
78 }
79}
24 80
25bool dbg_hw_info(void) 81bool dbg_hw_info(void)
26{ 82{
27 return false; 83 return dbg_hw_info_dma() && dbg_hw_target_info();
28} 84}
29 85
30bool dbg_ports(void) 86bool dbg_ports(void)