summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/debug-imx31.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx31/debug-imx31.c')
-rw-r--r--firmware/target/arm/imx31/debug-imx31.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/firmware/target/arm/imx31/debug-imx31.c b/firmware/target/arm/imx31/debug-imx31.c
index ab8db78063..7f1c9166d6 100644
--- a/firmware/target/arm/imx31/debug-imx31.c
+++ b/firmware/target/arm/imx31/debug-imx31.c
@@ -24,6 +24,7 @@
24#include "sprintf.h" 24#include "sprintf.h"
25#include "font.h" 25#include "font.h"
26#include "debug-target.h" 26#include "debug-target.h"
27#include "mc13783.h"
27 28
28bool __dbg_hw_info(void) 29bool __dbg_hw_info(void)
29{ 30{
@@ -34,6 +35,43 @@ bool __dbg_ports(void)
34{ 35{
35 char buf[50]; 36 char buf[50];
36 int line; 37 int line;
38 int i;
39
40 static const char pmic_regset[] =
41 {
42 MC13783_INTERRUPT_STATUS0,
43 MC13783_INTERRUPT_SENSE0,
44 MC13783_INTERRUPT_STATUS1,
45 MC13783_INTERRUPT_SENSE1,
46 MC13783_RTC_TIME,
47 MC13783_RTC_ALARM,
48 MC13783_RTC_DAY,
49 MC13783_RTC_DAY_ALARM,
50 MC13783_ADC0,
51 MC13783_ADC1,
52 MC13783_ADC2,
53 MC13783_ADC3,
54 MC13783_ADC4,
55 };
56
57 static const char *pmic_regnames[ARRAYLEN(pmic_regset)] =
58 {
59 "Int Stat0 ",
60 "Int Sense0",
61 "Int Stat1 ",
62 "Int Sense1",
63 "RTC Time ",
64 "RTC Alarm ",
65 "RTC Day ",
66 "RTC Day Al",
67 "ADC0 ",
68 "ADC1 ",
69 "ADC2 ",
70 "ADC3 ",
71 "ADC4 ",
72 };
73
74 uint32_t pmic_regs[ARRAYLEN(pmic_regset)];
37 75
38 lcd_setmargins(0, 0); 76 lcd_setmargins(0, 0);
39 lcd_clear_display(); 77 lcd_clear_display();
@@ -84,6 +122,16 @@ bool __dbg_ports(void)
84 snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO3_ISR); 122 snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO3_ISR);
85 lcd_puts(0, line++, buf); line++; 123 lcd_puts(0, line++, buf); line++;
86 124
125 lcd_puts(0, line++, "PMIC Registers"); line++;
126
127 mc13783_read_regset(pmic_regset, pmic_regs, ARRAYLEN(pmic_regs));
128
129 for (i = 0; i < (int)ARRAYLEN(pmic_regs); i++)
130 {
131 snprintf(buf, sizeof(buf), "%s: %08lx", pmic_regnames[i], pmic_regs[i]);
132 lcd_puts(0, line++, buf);
133 }
134
87 lcd_update(); 135 lcd_update();
88 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) 136 if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
89 return false; 137 return false;