summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/as3525/clock-target.h1
-rw-r--r--firmware/target/arm/as3525/debug-as3525.c8
-rw-r--r--firmware/target/arm/as3525/system-as3525.c13
3 files changed, 19 insertions, 3 deletions
diff --git a/firmware/target/arm/as3525/clock-target.h b/firmware/target/arm/as3525/clock-target.h
index 9bb20b21ad..2feef89095 100644
--- a/firmware/target/arm/as3525/clock-target.h
+++ b/firmware/target/arm/as3525/clock-target.h
@@ -120,6 +120,7 @@
/* FCLK */
#define AS3525_FCLK_SEL AS3525_CLK_PLLA
#define AS3525_FCLK_POSTDIV (CLK_DIV((AS3525_PLLA_FREQ*(8-AS3525_FCLK_PREDIV)/8), AS3525_FCLK_FREQ) - 1) /*div=1/(n+1)*/
+#define AS3525_FCLK_POSTDIV_UNBOOSTED (CLK_DIV((AS3525_PLLA_FREQ*(8-AS3525_FCLK_PREDIV)/8), CPUFREQ_NORMAL) - 1) /*div=1/(n+1) : needed for as3525v2 */
/* MCLK */
#define AS3525_MCLK_SEL AS3525_CLK_PLLA
diff --git a/firmware/target/arm/as3525/debug-as3525.c b/firmware/target/arm/as3525/debug-as3525.c
index 0e09464c3d..d2e6f3c658 100644
--- a/firmware/target/arm/as3525/debug-as3525.c
+++ b/firmware/target/arm/as3525/debug-as3525.c
@@ -123,9 +123,11 @@ static int calc_freq(int clk)
return 0;
#endif
case CLK_PROC:
+#if CONFIG_CPU == AS3525 /* not in arm926-ejs */
if (!(read_cp15()>>30)) /* fastbus */
return calc_freq(CLK_PCLK);
else /* Synch or Asynch bus*/
+#endif /* CONFIG_CPU == AS3525 */
return calc_freq(CLK_FCLK);
case CLK_FCLK:
switch(CGU_PROC & 3) {
@@ -256,11 +258,11 @@ bool __dbg_hw_info(void)
lcd_puts(0, line++, " SET ACTUAL");
#if CONFIG_CPU == AS3525
lcd_putsf(0, line++, "922T:%s %3dMHz",
-#else
- lcd_putsf(0, line++, "926ejs:%s %3dMHz",
-#endif
(!(read_cp15()>>30)) ? "FAST " :
(read_cp15()>>31) ? "ASYNC" : "SYNC ",
+#else
+ lcd_putsf(0, line++, "926ejs: %3dMHz",
+#endif
calc_freq(CLK_PROC)/1000000);
lcd_putsf(0, line++, "PLLA:%3dMHz %3dMHz", AS3525_PLLA_FREQ/1000000,
calc_freq(CLK_PLLA)/1000000);
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c
index 201143c0ef..55c309ed44 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -257,6 +257,7 @@ void system_init(void)
CGU_PROC = 0; /* fclk 24 MHz */
CGU_PERI &= ~0x7f; /* pclk 24 MHz */
+ /* bits 31:30 should be set to 0 in arm926-ejs */
asm volatile(
"mrc p15, 0, r0, c1, c0 \n" /* control register */
"bic r0, r0, #3<<30 \n" /* clears bus bits : sets fastbus */
@@ -351,6 +352,7 @@ void set_cpu_frequency(long frequency)
while(adc_read(ADC_CVDD) < 470); /* 470 * .0025 = 1.175V */
#endif /* HAVE_ADJUSTABLE_CPU_VOLTAGE */
+#if CONFIG_CPU == AS3525 /* only in arm922tdmi */
asm volatile(
"mrc p15, 0, r0, c1, c0 \n"
@@ -363,16 +365,27 @@ void set_cpu_frequency(long frequency)
"mcr p15, 0, r0, c1, c0 \n"
: : : "r0" );
+#else
+ CGU_PROC = ((AS3525_FCLK_POSTDIV << 4) |
+ (AS3525_FCLK_PREDIV << 2) |
+ AS3525_FCLK_SEL);
+#endif /* CONFIG_CPU == AS3525 */
cpu_frequency = CPUFREQ_MAX;
}
else
{
+#if CONFIG_CPU == AS3525 /* only in arm922tdmi */
asm volatile(
"mrc p15, 0, r0, c1, c0 \n"
"bic r0, r0, #3<<30 \n" /* fastbus clocking */
"mcr p15, 0, r0, c1, c0 \n"
: : : "r0" );
+#else
+ CGU_PROC = ((AS3525_FCLK_POSTDIV_UNBOOSTED << 4) |
+ (AS3525_FCLK_PREDIV << 2) |
+ AS3525_FCLK_SEL);
+#endif /* CONFIG_CPU == AS3525 */
#ifdef HAVE_ADJUSTABLE_CPU_VOLTAGE
/* Decreasing frequency so reduce voltage after change */