From 11cca264ff57ad0b234bd1cd2c9a2366b967feb7 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Fri, 23 Apr 2010 15:32:50 +0000 Subject: i.MX31/Gigabeat S: Implement frequency and voltage scaling-- 1.6V for 528MHz, and 1.35V for 264MHz and 132MHz. Keep DPTC overdrive ( > 400MHz) voltage scaling off for now because of uncertainties. Simplify the (working) mess later. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25699 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/imx31/debug-imx31.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'firmware/target/arm/imx31/debug-imx31.c') diff --git a/firmware/target/arm/imx31/debug-imx31.c b/firmware/target/arm/imx31/debug-imx31.c index dc3c293495..d854c9bc36 100644 --- a/firmware/target/arm/imx31/debug-imx31.c +++ b/firmware/target/arm/imx31/debug-imx31.c @@ -29,6 +29,7 @@ #include "mc13783.h" #include "adc.h" #include "ccm-imx31.h" +#include "dvfs_dptc-imx31.h" bool __dbg_hw_info(void) { @@ -39,6 +40,9 @@ bool __dbg_hw_info(void) unsigned int freq; uint32_t regval; + extern volatile unsigned int dvfs_nr_dn, dvfs_nr_up, dvfs_nr_pnc; + extern volatile unsigned int dptc_nr_dn, dptc_nr_up, dptc_nr_pnc; + lcd_clear_display(); lcd_setfont(FONT_SYSFIXED); @@ -52,11 +56,11 @@ bool __dbg_hw_info(void) spctl = CCM_SPCTL; upctl = CCM_UPCTL; - pllref = ccm_get_pll_ref_clk(); + pllref = ccm_get_pll_ref_clk_rate(); - mcu_pllfreq = ccm_get_pll(PLL_MCU); - ser_pllfreq = ccm_get_pll(PLL_SERIAL); - usb_pllfreq = ccm_get_pll(PLL_USB); + mcu_pllfreq = ccm_calc_pll_rate(pllref, mpctl); + ser_pllfreq = ccm_calc_pll_rate(pllref, spctl); + usb_pllfreq = ccm_calc_pll_rate(pllref, upctl); lcd_putsf(0, line++, "pll_ref_clk: %u", pllref); line++; @@ -107,10 +111,29 @@ bool __dbg_hw_info(void) freq = usb_pllfreq / (((CCM_PDR0 >> 16) & 0x1f) + 1); lcd_putsf(0, line++, " ipg_per_baud: %u", freq); + + line++; + lcd_putsf(0, line++, "PMCR0: %08lX", CCM_PMCR0); + + line++; + lcd_putsf(0, line++, "cpu_frequency: %ld Hz", cpu_frequency); + + lcd_putsf(0, line++, "dvfs_level: %u", dvfs_get_level()); + lcd_putsf(0, line++, "dvfs d|u|p: %u %u %u", dvfs_nr_dn, dvfs_nr_up, dvfs_nr_pnc); + regval = dvfs_dptc_get_voltage(); + lcd_putsf(0, line++, "cpu_voltage: %d.%03d V", regval / 1000, + regval % 1000); + + lcd_putsf(0, line++, "dptc_wp: %u", dptc_get_wp()); + lcd_putsf(0, line++, "dptc d|u|p: %u %u %u", dptc_nr_dn, dptc_nr_up, dptc_nr_pnc); + lcd_putsf(0, line++, "DVCR0,1: %08lX %08lX", CCM_DCVR0, CCM_DCVR1); + lcd_putsf(0, line++, "DVCR2,3: %08lX %08lX", CCM_DCVR2, CCM_DCVR3); + lcd_putsf(0, line++, "SWITCHERS0: %08lX", mc13783_read(MC13783_SWITCHERS0)); + lcd_putsf(0, line++, "SWITCHERS1: %08lX", mc13783_read(MC13783_SWITCHERS1)); lcd_update(); - if (button_get(true) == (DEBUG_CANCEL|BUTTON_REL)) + if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) return false; } } -- cgit v1.2.3