Skip to content
Snippets Groups Projects
Commit 40b0bafb authored by Markus Klotzbuecher's avatar Markus Klotzbuecher Committed by Markus Klotzbcher
Browse files

Added config options CFG_MONAHANS_RUN_MODE_OSC_RATIO and

CFG_MONAHANS_TURBO_RUN_MODE_RATIO for configuring the Monahans core
frequency.
parent ba70d6a4
No related branches found
No related tags found
No related merge requests found
...@@ -190,6 +190,14 @@ OSTIMER_BASE: .word 0x40a00000 ...@@ -190,6 +190,14 @@ OSTIMER_BASE: .word 0x40a00000
#define OIER 0x1C #define OIER 0x1C
/* Clock Manager Registers */ /* Clock Manager Registers */
#ifdef CONFIG_CPU_MONAHANS
# ifndef CFG_MONAHANS_RUN_MODE_OSC_RATIO
# error "You have to define CFG_MONAHANS_RUN_MODE_OSC_RATIO!!"
# endif
# ifndef CFG_MONAHANS_TURBO_RUN_MODE_RATIO
# define CFG_MONAHANS_TURBO_RUN_MODE_RATIO 0x1
# endif
#else /* ! CONFIG_CPU_MONAHANS */
#ifdef CFG_CPUSPEED #ifdef CFG_CPUSPEED
CC_BASE: .word 0x41300000 CC_BASE: .word 0x41300000
#define CCCR 0x00 #define CCCR 0x00
...@@ -197,6 +205,7 @@ cpuspeed: .word CFG_CPUSPEED ...@@ -197,6 +205,7 @@ cpuspeed: .word CFG_CPUSPEED
#else #else
#error "You have to define CFG_CPUSPEED!!" #error "You have to define CFG_CPUSPEED!!"
#endif #endif
#endif /* CONFIG_CPU_MONAHANS */
/* takes care the CP15 update has taken place */ /* takes care the CP15 update has taken place */
.macro CPWAIT reg .macro CPWAIT reg
...@@ -233,9 +242,13 @@ cpu_init_crit: ...@@ -233,9 +242,13 @@ cpu_init_crit:
str r2, [r1] str r2, [r1]
#endif #endif
#ifndef CONFIG_CPU_MONAHANS /* set clock speed */
#ifdef CONFIG_CPU_MONAHANS
ldr r0, =ACCR
ldr r1, =(((CFG_MONAHANS_TURBO_RUN_MODE_RATIO<<8) & ACCR_XN_MASK) | (CFG_MONAHANS_RUN_MODE_OSC_RATIO & ACCR_XL_MASK))
str r1, [r0]
#else /* ! CONFIG_CPU_MONAHANS */
#ifdef CFG_CPUSPEED #ifdef CFG_CPUSPEED
/* set clock speed tbd@mk: required for monahans? */
ldr r0, CC_BASE ldr r0, CC_BASE
ldr r1, cpuspeed ldr r1, cpuspeed
str r1, [r0, #CCCR] str r1, [r0, #CCCR]
......
...@@ -132,7 +132,13 @@ ...@@ -132,7 +132,13 @@
#define CFG_LOAD_ADDR (CFG_DRAM_BASE + 0x8000) /* default load address */ #define CFG_LOAD_ADDR (CFG_DRAM_BASE + 0x8000) /* default load address */
#define CFG_HZ 3250000 /* incrementer freq: 3.25 MHz */ #define CFG_HZ 3250000 /* incrementer freq: 3.25 MHz */
#define CFG_CPUSPEED 0x161 /* set core clock to 400/200/100 MHz */
/* Monahans Core Frequency =
*
*/
#define CFG_MONAHANS_RUN_MODE_OSC_RATIO 16 /* valid values: 8, 16, 24, 31 */
#define CFG_MONAHANS_TURBO_RUN_MODE_RATIO 1 /* valid values: 1, 2 */
/* valid baudrates */ /* valid baudrates */
#define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 } #define CFG_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200 }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment