diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2010-04-23 15:32:50 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2010-04-23 15:32:50 +0000 |
commit | 11cca264ff57ad0b234bd1cd2c9a2366b967feb7 (patch) | |
tree | 7693e7150d5abc9687966cc248bfbd550d356964 /firmware/target/arm/imx31/debug-imx31.c | |
parent | 6cee7579dbdc4d41c4df08c9395cf96c952ebab1 (diff) | |
download | rockbox-11cca264ff57ad0b234bd1cd2c9a2366b967feb7.tar.gz rockbox-11cca264ff57ad0b234bd1cd2c9a2366b967feb7.zip |
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
Diffstat (limited to 'firmware/target/arm/imx31/debug-imx31.c')
-rw-r--r-- | firmware/target/arm/imx31/debug-imx31.c | 33 |
1 files changed, 28 insertions, 5 deletions
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 @@ | |||
29 | #include "mc13783.h" | 29 | #include "mc13783.h" |
30 | #include "adc.h" | 30 | #include "adc.h" |
31 | #include "ccm-imx31.h" | 31 | #include "ccm-imx31.h" |
32 | #include "dvfs_dptc-imx31.h" | ||
32 | 33 | ||
33 | bool __dbg_hw_info(void) | 34 | bool __dbg_hw_info(void) |
34 | { | 35 | { |
@@ -39,6 +40,9 @@ bool __dbg_hw_info(void) | |||
39 | unsigned int freq; | 40 | unsigned int freq; |
40 | uint32_t regval; | 41 | uint32_t regval; |
41 | 42 | ||
43 | extern volatile unsigned int dvfs_nr_dn, dvfs_nr_up, dvfs_nr_pnc; | ||
44 | extern volatile unsigned int dptc_nr_dn, dptc_nr_up, dptc_nr_pnc; | ||
45 | |||
42 | lcd_clear_display(); | 46 | lcd_clear_display(); |
43 | lcd_setfont(FONT_SYSFIXED); | 47 | lcd_setfont(FONT_SYSFIXED); |
44 | 48 | ||
@@ -52,11 +56,11 @@ bool __dbg_hw_info(void) | |||
52 | spctl = CCM_SPCTL; | 56 | spctl = CCM_SPCTL; |
53 | upctl = CCM_UPCTL; | 57 | upctl = CCM_UPCTL; |
54 | 58 | ||
55 | pllref = ccm_get_pll_ref_clk(); | 59 | pllref = ccm_get_pll_ref_clk_rate(); |
56 | 60 | ||
57 | mcu_pllfreq = ccm_get_pll(PLL_MCU); | 61 | mcu_pllfreq = ccm_calc_pll_rate(pllref, mpctl); |
58 | ser_pllfreq = ccm_get_pll(PLL_SERIAL); | 62 | ser_pllfreq = ccm_calc_pll_rate(pllref, spctl); |
59 | usb_pllfreq = ccm_get_pll(PLL_USB); | 63 | usb_pllfreq = ccm_calc_pll_rate(pllref, upctl); |
60 | 64 | ||
61 | lcd_putsf(0, line++, "pll_ref_clk: %u", pllref); | 65 | lcd_putsf(0, line++, "pll_ref_clk: %u", pllref); |
62 | line++; | 66 | line++; |
@@ -107,10 +111,29 @@ bool __dbg_hw_info(void) | |||
107 | 111 | ||
108 | freq = usb_pllfreq / (((CCM_PDR0 >> 16) & 0x1f) + 1); | 112 | freq = usb_pllfreq / (((CCM_PDR0 >> 16) & 0x1f) + 1); |
109 | lcd_putsf(0, line++, " ipg_per_baud: %u", freq); | 113 | lcd_putsf(0, line++, " ipg_per_baud: %u", freq); |
114 | |||
115 | line++; | ||
116 | lcd_putsf(0, line++, "PMCR0: %08lX", CCM_PMCR0); | ||
117 | |||
118 | line++; | ||
119 | lcd_putsf(0, line++, "cpu_frequency: %ld Hz", cpu_frequency); | ||
120 | |||
121 | lcd_putsf(0, line++, "dvfs_level: %u", dvfs_get_level()); | ||
122 | lcd_putsf(0, line++, "dvfs d|u|p: %u %u %u", dvfs_nr_dn, dvfs_nr_up, dvfs_nr_pnc); | ||
123 | regval = dvfs_dptc_get_voltage(); | ||
124 | lcd_putsf(0, line++, "cpu_voltage: %d.%03d V", regval / 1000, | ||
125 | regval % 1000); | ||
126 | |||
127 | lcd_putsf(0, line++, "dptc_wp: %u", dptc_get_wp()); | ||
128 | lcd_putsf(0, line++, "dptc d|u|p: %u %u %u", dptc_nr_dn, dptc_nr_up, dptc_nr_pnc); | ||
129 | lcd_putsf(0, line++, "DVCR0,1: %08lX %08lX", CCM_DCVR0, CCM_DCVR1); | ||
130 | lcd_putsf(0, line++, "DVCR2,3: %08lX %08lX", CCM_DCVR2, CCM_DCVR3); | ||
131 | lcd_putsf(0, line++, "SWITCHERS0: %08lX", mc13783_read(MC13783_SWITCHERS0)); | ||
132 | lcd_putsf(0, line++, "SWITCHERS1: %08lX", mc13783_read(MC13783_SWITCHERS1)); | ||
110 | 133 | ||
111 | lcd_update(); | 134 | lcd_update(); |
112 | 135 | ||
113 | if (button_get(true) == (DEBUG_CANCEL|BUTTON_REL)) | 136 | if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL)) |
114 | return false; | 137 | return false; |
115 | } | 138 | } |
116 | } | 139 | } |