/* * Enter a standby mode (S0D1C2 or S0D2C2). Upon wakeup, the dynamic * memory controller has to be reinitialised, so we place some code * in the SRAM to perform this function. * * We disable FIQs across the standby - otherwise, we might receive a * FIQ while the SDRAM is unavailable.
*/ staticvoid pxa3xx_cpu_standby(unsignedint pwrmode)
{ void (*fn)(unsignedint) = (void __force *)(sram + 0x8000);
/* * NOTE: currently, the OBM (OEM Boot Module) binary comes along with * PXA3xx development kits assumes that the resuming process continues * with the address stored within the first 4 bytes of SDRAM. The PSPR * register is used privately by BootROM and OBM, and _must_ be set to * 0x5c014000 for the moment.
*/ staticvoid pxa3xx_cpu_pm_suspend(void)
{ volatileunsignedlong *p = (volatilevoid *)0xc0000000; unsignedlong saved_data = *p; #ifndef CONFIG_IWMMXT
u64 acc0;
staticvoid pxa3xx_cpu_pm_enter(suspend_state_t state)
{ /* * Don't sleep if no wakeup sources are defined
*/ if (wakeup_src == 0) {
printk(KERN_ERR "Not suspending: no wakeup sources\n"); return;
}
switch (state) { case PM_SUSPEND_STANDBY:
pxa3xx_cpu_standby(PXA3xx_PM_S0D2C2); break;
case PM_SUSPEND_MEM:
pxa3xx_cpu_pm_suspend(); break;
}
}
staticint pxa3xx_cpu_pm_valid(suspend_state_t state)
{ return state == PM_SUSPEND_MEM || state == PM_SUSPEND_STANDBY;
}
staticvoid __init pxa3xx_init_pm(void)
{
sram = ioremap(ISRAM_START, ISRAM_SIZE); if (!sram) {
printk(KERN_ERR "Unable to map ISRAM: disabling standby/suspend\n"); return;
}
/* * Since we copy wakeup code into the SRAM, we need to ensure * that it is preserved over the low power modes. Note: bit 8 * is undocumented in the developer manual, but must be set.
*/
AD1R |= ADXR_L2 | ADXR_R0;
AD2R |= ADXR_L2 | ADXR_R0;
AD3R |= ADXR_L2 | ADXR_R0;
/* * clear RDH bit every time after reset * * Note: the last 3 bits DxS are write-1-to-clear so carefully * preserve them here in case they will be referenced later
*/
ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
/* * Disable DFI bus arbitration, to prevent a system bus lock if * somebody disables the NAND clock (unused clock) while this * bit remains set.
*/
NDCR = (NDCR & ~NDCR_ND_ARB_EN) | NDCR_ND_ARB_CNTL;
pxa3xx_init_pm();
enable_irq_wake(IRQ_WAKEUP0); if (cpu_is_pxa320())
enable_irq_wake(IRQ_WAKEUP1);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.