mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 05:05:20 -05:00
Ingenic Jz4740: add basic frequency switching
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21625 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
9ecaa5562d
commit
eabeb928dd
3 changed files with 25 additions and 6 deletions
|
|
@ -541,10 +541,11 @@ void system_reboot(void)
|
|||
void system_exception_wait(void)
|
||||
{
|
||||
/* check for power button without including any .h file */
|
||||
while (1)
|
||||
while(1)
|
||||
{
|
||||
if( ~REG_GPIO_PXPIN(3) & (1 << 29) )
|
||||
break;
|
||||
if( (~REG_GPIO_PXPIN(3)) & (1 << 29) )
|
||||
return;
|
||||
asm volatile("nop");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -574,3 +575,19 @@ int system_memory_guard(int newmode)
|
|||
(void)newmode;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
|
||||
void set_cpu_frequency(long frequency)
|
||||
{
|
||||
unsigned long cfcr = REG_CPM_CPCCR;
|
||||
cfcr &= ~CPM_CPCCR_CDIV_MASK;
|
||||
|
||||
if(frequency == CPUFREQ_NORMAL)
|
||||
cfcr |= (0 << CPM_CPCCR_CDIV_BIT);
|
||||
else
|
||||
cfcr |= (2 << CPM_CPCCR_CDIV_BIT);
|
||||
|
||||
REG_CPM_CPCCR = cfcr;
|
||||
cpu_frequency = frequency;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue