diff options
Diffstat (limited to 'firmware/target/arm/imx233/debug-imx233.c')
-rw-r--r-- | firmware/target/arm/imx233/debug-imx233.c | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/firmware/target/arm/imx233/debug-imx233.c b/firmware/target/arm/imx233/debug-imx233.c index 8553fd8509..fdad03ea78 100644 --- a/firmware/target/arm/imx233/debug-imx233.c +++ b/firmware/target/arm/imx233/debug-imx233.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include "pinctrl-imx233.h" | 34 | #include "pinctrl-imx233.h" |
35 | #include "ocotp-imx233.h" | 35 | #include "ocotp-imx233.h" |
36 | #include "string.h" | 36 | #include "string.h" |
37 | #include "stdio.h" | ||
37 | 38 | ||
38 | #define DEBUG_CANCEL BUTTON_BACK | 39 | #define DEBUG_CANCEL BUTTON_BACK |
39 | 40 | ||
@@ -150,21 +151,33 @@ bool dbg_hw_info_power(void) | |||
150 | lcd_clear_display(); | 151 | lcd_clear_display(); |
151 | 152 | ||
152 | struct imx233_power_info_t info = imx233_power_get_info(POWER_INFO_ALL); | 153 | struct imx233_power_info_t info = imx233_power_get_info(POWER_INFO_ALL); |
153 | lcd_putsf(0, 0, "VDDD: %d mV linreg: %d offset: %d", info.vddd, info.vddd_linreg, | 154 | int line = 0; |
154 | info.vddd_linreg_offset); | 155 | unsigned trg, bo; |
155 | lcd_putsf(0, 1, "VDDA: %d mV linreg: %d offset: %d", info.vdda, info.vdda_linreg, | 156 | bool en; |
156 | info.vdda_linreg_offset); | 157 | int linreg; |
157 | lcd_putsf(0, 2, "VDDIO: %d mV offset: %d", info.vddio, info.vddio_linreg_offset); | 158 | char buf[16]; |
158 | lcd_putsf(0, 3, "VDDMEM: %d mV linreg: %d", info.vddmem, info.vddmem_linreg); | 159 | |
159 | lcd_putsf(0, 4, "DC-DC: pll: %d freq: %d", info.dcdc_sel_pllclk, info.dcdc_freqsel); | 160 | lcd_putsf(0, line++, "name value bo linreg"); |
160 | lcd_putsf(0, 5, "charge: %d mA stop: %d mA", info.charge_current, info.stop_current); | 161 | #define DISP_REGULATOR(name) \ |
161 | lcd_putsf(0, 6, "charging: %d bat_adj: %d", info.charging, info.batt_adj); | 162 | imx233_power_get_regulator(REGULATOR_##name, &trg, &bo); \ |
162 | lcd_putsf(0, 7, "4.2: en: %d dcdc: %d", info._4p2_enable, info._4p2_dcdc); | 163 | imx233_power_get_regulator_linreg(REGULATOR_##name, &en, &linreg); \ |
163 | lcd_putsf(0, 8, "4.2: cmptrip: %d dropout: %d", info._4p2_cmptrip, info._4p2_dropout); | 164 | if(en) snprintf(buf, sizeof(buf), "%d", linreg); \ |
164 | lcd_putsf(0, 9, "5V: pwd_4.2_charge: %d", info._5v_pwd_charge_4p2); | 165 | else snprintf(buf, sizeof(buf), " "); \ |
165 | lcd_putsf(0, 10, "5V: chargelim: %d mA", info._5v_charge_4p2_limit); | 166 | lcd_putsf(0, line++, "%6s %4d %4d %s", #name, trg, bo, buf); \ |
166 | lcd_putsf(0, 11, "5V: dcdc: %d xfer: %d", info._5v_enable_dcdc, info._5v_dcdc_xfer); | 167 | |
167 | lcd_putsf(0, 12, "5V: thr: %d mV use: %d cmps: %d", info._5v_vbusvalid_thr, | 168 | DISP_REGULATOR(VDDD); |
169 | DISP_REGULATOR(VDDA); | ||
170 | DISP_REGULATOR(VDDIO); | ||
171 | DISP_REGULATOR(VDDMEM); | ||
172 | lcd_putsf(0, line++, "DC-DC: pll: %d freq: %d", info.dcdc_sel_pllclk, info.dcdc_freqsel); | ||
173 | lcd_putsf(0, line++, "charge: %d mA stop: %d mA", info.charge_current, info.stop_current); | ||
174 | lcd_putsf(0, line++, "charging: %d bat_adj: %d", info.charging, info.batt_adj); | ||
175 | lcd_putsf(0, line++, "4.2: en: %d dcdc: %d", info._4p2_enable, info._4p2_dcdc); | ||
176 | lcd_putsf(0, line++, "4.2: cmptrip: %d dropout: %d", info._4p2_cmptrip, info._4p2_dropout); | ||
177 | lcd_putsf(0, line++, "5V: pwd_4.2_charge: %d", info._5v_pwd_charge_4p2); | ||
178 | lcd_putsf(0, line++, "5V: chargelim: %d mA", info._5v_charge_4p2_limit); | ||
179 | lcd_putsf(0, line++, "5V: dcdc: %d xfer: %d", info._5v_enable_dcdc, info._5v_dcdc_xfer); | ||
180 | lcd_putsf(0, line++, "5V: thr: %d mV use: %d cmps: %d", info._5v_vbusvalid_thr, | ||
168 | info._5v_vbusvalid_detect, info._5v_vbus_cmps); | 181 | info._5v_vbusvalid_detect, info._5v_vbus_cmps); |
169 | 182 | ||
170 | lcd_update(); | 183 | lcd_update(); |
@@ -286,7 +299,8 @@ bool dbg_hw_info_clkctrl(void) | |||
286 | #undef c | 299 | #undef c |
287 | } | 300 | } |
288 | int line = ARRAYLEN(dbg_clk) + 1; | 301 | int line = ARRAYLEN(dbg_clk) + 1; |
289 | lcd_putsf(0, line, "auto slow: %d", imx233_clkctrl_is_auto_slow_enabled()); | 302 | lcd_putsf(0, line, "auto slow: %d emi sync: %d", imx233_clkctrl_is_auto_slow_enabled(), |
303 | imx233_clkctrl_is_emi_sync_enabled()); | ||
290 | line++; | 304 | line++; |
291 | lcd_putsf(0, line, "as monitor: "); | 305 | lcd_putsf(0, line, "as monitor: "); |
292 | int x_off = 12; | 306 | int x_off = 12; |