summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/debug-jz4740.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/debug-jz4740.c')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/debug-jz4740.c92
1 files changed, 39 insertions, 53 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/debug-jz4740.c b/firmware/target/mips/ingenic_jz47xx/debug-jz4740.c
index 07b3802bf2..f2b302e4c1 100644
--- a/firmware/target/mips/ingenic_jz47xx/debug-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/debug-jz4740.c
@@ -31,20 +31,6 @@
#include "timefuncs.h"
static int line = 0;
-static void printf(const char *format, ...)
-{
- int len;
- unsigned char *ptr;
- char printfbuf[256];
- va_list ap;
- va_start(ap, format);
-
- ptr = printfbuf;
- len = vsnprintf(ptr, sizeof(printfbuf), format, ap);
- va_end(ap);
-
- lcd_puts(0, line++, ptr);
-}
/*
* Clock Generation Module
@@ -59,39 +45,39 @@ static void display_clocks(void)
unsigned int div[] = {1, 2, 3, 4, 6, 8, 12, 16, 24, 32};
unsigned int od[4] = {1, 2, 2, 4};
- printf("CPPCR : 0x%08x", cppcr);
- printf("CPCCR : 0x%08x", cpccr);
- printf("PLL : %s", (cppcr & CPM_CPPCR_PLLEN) ? "ON" : "OFF");
- printf("m:n:o : %d:%d:%d",
+ lcd_putsf(0, line++, "CPPCR : 0x%08x", cppcr);
+ lcd_putsf(0, line++, "CPCCR : 0x%08x", cpccr);
+ lcd_putsf(0, line++, "PLL : %s", (cppcr & CPM_CPPCR_PLLEN) ? "ON" : "OFF");
+ lcd_putsf(0, line++, "m:n:o : %d:%d:%d",
__cpm_get_pllm() + 2,
__cpm_get_plln() + 2,
od[__cpm_get_pllod()]
);
- printf("C:H:M:P : %d:%d:%d:%d",
+ lcd_putsf(0, line++, "C:H:M:P : %d:%d:%d:%d",
div[__cpm_get_cdiv()],
div[__cpm_get_hdiv()],
div[__cpm_get_mdiv()],
div[__cpm_get_pdiv()]
);
- printf("U:L:I:P:M : %d:%d:%d:%d:%d",
+ lcd_putsf(0, line++, "U:L:I:P:M : %d:%d:%d:%d:%d",
__cpm_get_udiv() + 1,
__cpm_get_ldiv() + 1,
__cpm_get_i2sdiv()+1,
__cpm_get_pixdiv()+1,
__cpm_get_mscdiv()+1
);
- printf("PLL Freq: %3d.%02d MHz", TO_MHZ(__cpm_get_pllout()));
- printf("CCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_cclk()));
- printf("HCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_hclk()));
- printf("MCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_mclk()));
- printf("PCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_pclk()));
- printf("LCDCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_lcdclk()));
- printf("PIXCLK : %6d.%02d KHz", TO_KHZ(__cpm_get_pixclk()));
- printf("I2SCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_i2sclk()));
- printf("USBCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_usbclk()));
- printf("MSCCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_mscclk()));
- printf("EXTALCLK: %3d.%02d MHz", TO_MHZ(__cpm_get_extalclk()));
- printf("RTCCLK : %3d.%02d KHz", TO_KHZ(__cpm_get_rtcclk()));
+ lcd_putsf(0, line++, "PLL Freq: %3d.%02d MHz", TO_MHZ(__cpm_get_pllout()));
+ lcd_putsf(0, line++, "CCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_cclk()));
+ lcd_putsf(0, line++, "HCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_hclk()));
+ lcd_putsf(0, line++, "MCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_mclk()));
+ lcd_putsf(0, line++, "PCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_pclk()));
+ lcd_putsf(0, line++, "LCDCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_lcdclk()));
+ lcd_putsf(0, line++, "PIXCLK : %6d.%02d KHz", TO_KHZ(__cpm_get_pixclk()));
+ lcd_putsf(0, line++, "I2SCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_i2sclk()));
+ lcd_putsf(0, line++, "USBCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_usbclk()));
+ lcd_putsf(0, line++, "MSCCLK : %3d.%02d MHz", TO_MHZ(__cpm_get_mscclk()));
+ lcd_putsf(0, line++, "EXTALCLK: %3d.%02d MHz", TO_MHZ(__cpm_get_extalclk()));
+ lcd_putsf(0, line++, "RTCCLK : %3d.%02d KHz", TO_KHZ(__cpm_get_rtcclk()));
}
static void display_enabled_clocks(void)
@@ -99,47 +85,47 @@ static void display_enabled_clocks(void)
unsigned long lcr = REG_CPM_LCR;
unsigned long clkgr = REG_CPM_CLKGR;
- printf("Low Power Mode : %s",
+ lcd_putsf(0, line++, "Low Power Mode : %s",
((lcr & CPM_LCR_LPM_MASK) == CPM_LCR_LPM_IDLE) ?
"IDLE" : (((lcr & CPM_LCR_LPM_MASK) == CPM_LCR_LPM_SLEEP) ? "SLEEP" : "HIBERNATE")
);
- printf("Doze Mode : %s",
+ lcd_putsf(0, line++, "Doze Mode : %s",
(lcr & CPM_LCR_DOZE_ON) ? "ON" : "OFF");
if (lcr & CPM_LCR_DOZE_ON)
- printf(" duty : %d", (int)((lcr & CPM_LCR_DOZE_DUTY_MASK) >> CPM_LCR_DOZE_DUTY_BIT));
+ lcd_putsf(0, line++, " duty : %d", (int)((lcr & CPM_LCR_DOZE_DUTY_MASK) >> CPM_LCR_DOZE_DUTY_BIT));
- printf("IPU : %s",
+ lcd_putsf(0, line++, "IPU : %s",
(clkgr & CPM_CLKGR_IPU) ? "stopped" : "running");
- printf("DMAC : %s",
+ lcd_putsf(0, line++, "DMAC : %s",
(clkgr & CPM_CLKGR_DMAC) ? "stopped" : "running");
- printf("UHC : %s",
+ lcd_putsf(0, line++, "UHC : %s",
(clkgr & CPM_CLKGR_UHC) ? "stopped" : "running");
- printf("UDC : %s",
+ lcd_putsf(0, line++, "UDC : %s",
(clkgr & CPM_CLKGR_UDC) ? "stopped" : "running");
- printf("LCD : %s",
+ lcd_putsf(0, line++, "LCD : %s",
(clkgr & CPM_CLKGR_LCD) ? "stopped" : "running");
- printf("CIM : %s",
+ lcd_putsf(0, line++, "CIM : %s",
(clkgr & CPM_CLKGR_CIM) ? "stopped" : "running");
- printf("SADC : %s",
+ lcd_putsf(0, line++, "SADC : %s",
(clkgr & CPM_CLKGR_SADC) ? "stopped" : "running");
- printf("MSC : %s",
+ lcd_putsf(0, line++, "MSC : %s",
(clkgr & CPM_CLKGR_MSC) ? "stopped" : "running");
- printf("AIC1 : %s",
+ lcd_putsf(0, line++, "AIC1 : %s",
(clkgr & CPM_CLKGR_AIC1) ? "stopped" : "running");
- printf("AIC2 : %s",
+ lcd_putsf(0, line++, "AIC2 : %s",
(clkgr & CPM_CLKGR_AIC2) ? "stopped" : "running");
- printf("SSI : %s",
+ lcd_putsf(0, line++, "SSI : %s",
(clkgr & CPM_CLKGR_SSI) ? "stopped" : "running");
- printf("I2C : %s",
+ lcd_putsf(0, line++, "I2C : %s",
(clkgr & CPM_CLKGR_I2C) ? "stopped" : "running");
- printf("RTC : %s",
+ lcd_putsf(0, line++, "RTC : %s",
(clkgr & CPM_CLKGR_RTC) ? "stopped" : "running");
- printf("TCU : %s",
+ lcd_putsf(0, line++, "TCU : %s",
(clkgr & CPM_CLKGR_TCU) ? "stopped" : "running");
- printf("UART1 : %s",
+ lcd_putsf(0, line++, "UART1 : %s",
(clkgr & CPM_CLKGR_UART1) ? "stopped" : "running");
- printf("UART0 : %s",
+ lcd_putsf(0, line++, "UART0 : %s",
(clkgr & CPM_CLKGR_UART0) ? "stopped" : "running");
}
@@ -165,12 +151,12 @@ bool __dbg_hw_info(void)
display_enabled_clocks();
#ifdef HAVE_TOUCHSCREEN
btn = button_read_device(&touch);
- printf("X: %d Y: %d BTN: 0x%X", touch>>16, touch&0xFFFF, btn);
+ lcd_putsf(0, line++, "X: %d Y: %d BTN: 0x%X", touch>>16, touch&0xFFFF, btn);
#else
btn = button_read_device();
#endif
cur_time = get_time();
- printf("%02d/%02d/%04d %02d:%02d:%02d", cur_time->tm_mday,
+ lcd_putsf(0, line++, "%02d/%02d/%04d %02d:%02d:%02d", cur_time->tm_mday,
cur_time->tm_mon, cur_time->tm_year, cur_time->tm_hour,
cur_time->tm_min, cur_time->tm_sec);
lcd_update();