1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Michael Sevakis 2010-04-23 15:32:50 +00:00
parent 6cee7579db
commit 11cca264ff
20 changed files with 1311 additions and 125 deletions

View file

@ -26,6 +26,7 @@
#include "gpio-imx31.h"
#include "mmu-imx31.h"
#include "system-target.h"
#include "powermgmt-target.h"
#include "lcd.h"
#include "serial-imx31.h"
#include "debug.h"
@ -115,18 +116,24 @@ int system_memory_guard(int newmode)
return 0;
}
void system_halt(void)
{
disable_interrupt(IRQ_FIQ_STATUS);
avic_set_ni_level(AVIC_NIL_DISABLE);
while (1)
core_idle();
}
void system_reboot(void)
{
/* Multi-context so no SPI available (WDT?) */
while (1);
system_halt();
}
void system_exception_wait(void)
{
/* Called in many contexts so button reading may be a chore */
avic_disable_int(INT_ALL);
core_idle();
while (1);
system_halt();
}
void system_init(void)
@ -175,6 +182,9 @@ void system_init(void)
unsigned int i;
/* Initialize frequency with current */
cpu_frequency = ccm_get_mcu_clk();
/* MCR WFI enables wait mode (CCM_CCMR_LPM_WAIT_MODE = 0) */
imx31_regclr32(&CCM_CCMR, CCM_CCMR_LPM);
@ -239,16 +249,33 @@ void __attribute__((naked)) imx31_regclr32(volatile uint32_t *reg_p,
(void)reg_p; (void)mask;
}
#ifdef BOOTLOADER
void system_prepare_fw_start(void)
{
dvfs_dptc_stop();
disable_interrupt(IRQ_FIQ_STATUS);
avic_disable_int(INT_ALL);
mc13783_close();
tick_stop();
disable_interrupt(IRQ_FIQ_STATUS);
avic_set_ni_level(AVIC_NIL_DISABLE);
}
#endif
#ifndef BOOTLOADER
void rolo_restart_firmware(const unsigned char *source, unsigned char *dest,
int length) __attribute__((noreturn));
void __attribute__((noreturn))
rolo_restart(const unsigned char *source, unsigned char *dest, int length)
{
/* Some housekeeping tasks must be performed for a safe changeover */
charging_algorithm_close();
system_prepare_fw_start();
/* Copying routine where new image is run */
rolo_restart_firmware(source, dest, length);
}
#endif /* BOOTLOADER */
inline void dumpregs(void)
{