summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233
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 /firmware/target/arm/imx233
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
Diffstat (limited to 'firmware/target/arm/imx233')
-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 @@
#include "system.h"
#include "debug-target.h"
+#include "dma-imx233.h"
+#include "action.h"
+#include "lcd.h"
+#include "font.h"
+
+static struct
+{
+ const char *name;
+ unsigned chan;
+} dbg_channels[] =
+{
+ { "i2c", APB_I2C },
+ { "dac", APB_AUDIO_DAC },
+ { "ssp1", APB_SSP(1) },
+ { "ssp2", APB_SSP(2) },
+};
+
+bool dbg_hw_info_dma(void)
+{
+ lcd_setfont(FONT_SYSFIXED);
+
+ while(1)
+ {
+ int button = get_action(CONTEXT_STD, HZ / 25);
+ switch(button)
+ {
+ case ACTION_STD_NEXT:
+ case ACTION_STD_PREV:
+ case ACTION_STD_OK:
+ case ACTION_STD_MENU:
+ lcd_setfont(FONT_UI);
+ return true;
+ case ACTION_STD_CANCEL:
+ lcd_setfont(FONT_UI);
+ return false;
+ }
+
+ lcd_clear_display();
+
+ lcd_putsf(0, 0, "I G F C E name bar apb ahb");
+ for(unsigned i = 0; i < ARRAYLEN(dbg_channels); i++)
+ {
+ struct imx233_dma_info_t info = imx233_dma_get_info(dbg_channels[i].chan, DMA_INFO_ALL);
+ lcd_putsf(0, i + 1, "%c %c %c %c %c %4s %x %x %x",
+ info.int_enabled ? 'i' : ' ',
+ info.gated ? 'g' : ' ',
+ info.freezed ? 'f' : ' ',
+ info.int_cmdcomplt ? 'c' : ' ',
+ info.int_error ? 'e' : ' ',
+ dbg_channels[i].name, info.bar, info.apb_bytes, info.ahb_bytes);
+ }
+
+ lcd_update();
+ yield();
+ }
+}
bool dbg_hw_info(void)
{
- return false;
+ return dbg_hw_info_dma() && dbg_hw_target_info();
}
bool dbg_ports(void)