diff options
Diffstat (limited to 'firmware/target/arm/s5l8702/debug-s5l8702.c')
-rw-r--r-- | firmware/target/arm/s5l8702/debug-s5l8702.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/firmware/target/arm/s5l8702/debug-s5l8702.c b/firmware/target/arm/s5l8702/debug-s5l8702.c index a2c6c0b193..fe2044690d 100644 --- a/firmware/target/arm/s5l8702/debug-s5l8702.c +++ b/firmware/target/arm/s5l8702/debug-s5l8702.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #ifdef HAVE_SERIAL | 33 | #ifdef HAVE_SERIAL |
34 | #include "uc8702.h" | 34 | #include "uc8702.h" |
35 | #endif | 35 | #endif |
36 | #include "clocking-s5l8702.h" | ||
36 | 37 | ||
37 | #define DEBUG_CANCEL BUTTON_MENU | 38 | #define DEBUG_CANCEL BUTTON_MENU |
38 | 39 | ||
@@ -66,9 +67,10 @@ bool dbg_hw_info(void) | |||
66 | 67 | ||
67 | if(state == 0) | 68 | if(state == 0) |
68 | { | 69 | { |
70 | unsigned cpu_hz; | ||
71 | get_system_freqs(&cpu_hz, NULL, NULL); | ||
69 | _DEBUG_PRINTF("CPU:"); | 72 | _DEBUG_PRINTF("CPU:"); |
70 | _DEBUG_PRINTF("speed: %d MHz", ((CLKCON0 & 1) ? | 73 | _DEBUG_PRINTF("speed: %d MHz", cpu_hz / 1000000); |
71 | CPUFREQ_NORMAL : CPUFREQ_MAX) / 1000000); | ||
72 | _DEBUG_PRINTF("current_tick: %d", (unsigned int)current_tick); | 74 | _DEBUG_PRINTF("current_tick: %d", (unsigned int)current_tick); |
73 | uint32_t __res; | 75 | uint32_t __res; |
74 | asm volatile ("mrc p15, 0, %0, c0, c0, 0" : "=r"(__res)); | 76 | asm volatile ("mrc p15, 0, %0, c0, c0, 0" : "=r"(__res)); |
@@ -82,6 +84,31 @@ bool dbg_hw_info(void) | |||
82 | 84 | ||
83 | _DEBUG_PRINTF("capture HW: %d", rec_hw_ver); | 85 | _DEBUG_PRINTF("capture HW: %d", rec_hw_ver); |
84 | line++; | 86 | line++; |
87 | |||
88 | #ifdef CLOCKING_DEBUG | ||
89 | /* show all clocks */ | ||
90 | unsigned f_clk, c_clk, h_clk, p_clk, l_clk, s_clk; | ||
91 | |||
92 | f_clk = get_system_freqs(&c_clk, &h_clk, &p_clk); | ||
93 | s_clk = h_clk / soc_get_hsdiv(); | ||
94 | l_clk = h_clk >> ((LCD_CONFIG & 7) + 1); /* div = 2^(val+1) */ | ||
95 | |||
96 | #define MHZ 1000000 | ||
97 | #define TMHZ 100000 | ||
98 | _DEBUG_PRINTF("Clocks (MHz):"); | ||
99 | _DEBUG_PRINTF(" FClk: %d.%d", f_clk / MHZ, (f_clk % MHZ) / TMHZ); | ||
100 | _DEBUG_PRINTF(" CPU: %d.%d", c_clk / MHZ, (c_clk % MHZ) / TMHZ); | ||
101 | _DEBUG_PRINTF(" AHB: %d.%d", h_clk / MHZ, (h_clk % MHZ) / TMHZ); | ||
102 | _DEBUG_PRINTF(" SM1: %d.%d", s_clk / MHZ, (s_clk % MHZ) / TMHZ); | ||
103 | _DEBUG_PRINTF(" LCD: %d.%d", l_clk / MHZ, (l_clk % MHZ) / TMHZ); | ||
104 | _DEBUG_PRINTF(" APB: %d.%d", p_clk / MHZ, (p_clk % MHZ) / TMHZ); | ||
105 | line++; | ||
106 | _DEBUG_PRINTF("CG16_SEL_x (Hz):"); | ||
107 | _DEBUG_PRINTF(" OSC: %d", soc_get_oscsel_freq()); | ||
108 | for (int i = 0; i < 3; i++) | ||
109 | _DEBUG_PRINTF(" PLL%d: %d (%d)", i, | ||
110 | pll_get_out_freq(i), pll_get_cfg_freq(i)); | ||
111 | #endif | ||
85 | } | 112 | } |
86 | else if(state==1) | 113 | else if(state==1) |
87 | { | 114 | { |