From d405026ca8bc4c63d8fcd5d63cef02341182774b Mon Sep 17 00:00:00 2001 From: Cástor Muñoz Date: Thu, 12 May 2016 03:16:27 +0200 Subject: iPod Nano2G: add HAVE_SERIAL Change-Id: I46dca69c6708d3e6189f66e70badf0a594bac00b --- firmware/target/arm/s5l8700/debug-s5l8700.c | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'firmware/target/arm/s5l8700/debug-s5l8700.c') diff --git a/firmware/target/arm/s5l8700/debug-s5l8700.c b/firmware/target/arm/s5l8700/debug-s5l8700.c index e318dbf2da..ecb15df5d0 100644 --- a/firmware/target/arm/s5l8700/debug-s5l8700.c +++ b/firmware/target/arm/s5l8700/debug-s5l8700.c @@ -32,6 +32,10 @@ #include "pmu-target.h" #include "nand-target.h" #endif +#ifdef HAVE_SERIAL +#include "uart-target.h" +#include "uc870x.h" +#endif #define DEBUG_CANCEL BUTTON_MENU @@ -49,7 +53,11 @@ bool dbg_hw_info(void) int i; #ifdef IPOD_NANO2G unsigned int state = 0; +#ifdef UC870X_DEBUG + const unsigned int max_states=3; +#else const unsigned int max_states=2; +#endif int nand_bank_count; struct storage_info info; const struct nand_device_info_type *nand_devicetype[4]; @@ -123,6 +131,37 @@ bool dbg_hw_info(void) _DEBUG_PRINTF("backlight: %s", pmu_read(0x29) ? "on" : "off"); _DEBUG_PRINTF("brightness value: %d", pmu_read(0x28)); } +#ifdef UC870X_DEBUG + else if(state==2) + { + extern struct uartc_port ser_port; + int tx_stat, rx_stat, tx_speed, rx_speed; + char line_cfg[4]; + int abr_stat; + uint32_t abr_cnt; + char *abrstatus[] = {"Idle", "Launched", "Counting", "Abnormal"}; + + uartc_port_get_line_info(&ser_port, + &tx_stat, &rx_stat, &tx_speed, &rx_speed, line_cfg); + abr_stat = uartc_port_get_abr_info(&ser_port, &abr_cnt); + + _DEBUG_PRINTF("UART %d:", ser_port.id); + line++; + _DEBUG_PRINTF("line: %s", line_cfg); + _DEBUG_PRINTF("Tx: %s, speed: %d", tx_stat ? "On":"Off", tx_speed); + _DEBUG_PRINTF("Rx: %s, speed: %d", rx_stat ? "On":"Off", rx_speed); + _DEBUG_PRINTF("ABR: %s, cnt: %u", abrstatus[abr_stat], abr_cnt); + line++; + _DEBUG_PRINTF("n_tx_bytes: %u", ser_port.n_tx_bytes); + _DEBUG_PRINTF("n_rx_bytes: %u", ser_port.n_rx_bytes); + _DEBUG_PRINTF("n_ovr_err: %u", ser_port.n_ovr_err); + _DEBUG_PRINTF("n_parity_err: %u", ser_port.n_parity_err); + _DEBUG_PRINTF("n_frame_err: %u", ser_port.n_frame_err); + _DEBUG_PRINTF("n_break_detect: %u", ser_port.n_break_detect); + _DEBUG_PRINTF("ABR n_abnormal: %u %u", + ser_port.n_abnormal0, ser_port.n_abnormal1); + } +#endif else { state=0; -- cgit v1.2.3