/* * Those registers are accessed before switching the internal register * base, which is why we hardcode the 0xd0000000 base address, the one * used by the SoC out of reset.
*/ #define MBUS_WINDOW_12_CTRL 0xd00200b0 #define MBUS_INTERNAL_REG_ADDRESS 0xd0020080
/* * Ask the DT what is the internal register address on this * platform. In the mvebu-mbus DT binding, 0xf0010000 * corresponds to the internal register window.
*/
in_addr[0] = cpu_to_be32(0xf0010000);
in_addr[1] = 0x0;
/* * The bootloader expects the first two words to be a magic * value (BOOT_MAGIC_WORD), followed by the address of the * resume code to jump to. Then, it expects a sequence of * (address, value) pairs, which can be used to restore the * value of certain registers. This sequence must end with the * BOOT_MAGIC_LIST_END magic value.
*/
/* * Some platforms remap their internal register base address * to 0xf1000000. However, out of reset, window 12 starts at * 0xf0000000 and ends at 0xf7ffffff, which would overlap with * the internal registers. Therefore, disable window 12.
*/
writel(MBUS_WINDOW_12_CTRL, store_addr++);
writel(0x0, store_addr++);
/* * Set the internal register base address to the value * expected by Linux, as read from the Device Tree.
*/
writel(MBUS_INTERNAL_REG_ADDRESS, store_addr++);
writel(mvebu_internal_reg_base(), store_addr++);
/* * Ask the mvebu-mbus driver to store the SDRAM window * configuration, which has to be restored by the bootloader * before re-entering the kernel on resume.
*/
store_addr += mvebu_mbus_save_cpu_target(store_addr);
if (of_machine_is_compatible("marvell,armadaxp"))
mvebu_pm_store_armadaxp_bootinfo(store_addr); else return -ENODEV;
return 0;
}
staticint mvebu_enter_suspend(void)
{ int ret;
ret = mvebu_pm_store_bootinfo(); if (ret) return ret;
cpu_pm_enter();
cpu_suspend(0, mvebu_pm_powerdown);
outer_resume();
mvebu_v7_pmsu_idle_exit();
set_cpu_coherent();
cpu_pm_exit(); return 0;
}
staticint mvebu_pm_enter(suspend_state_t state)
{ switch (state) { case PM_SUSPEND_STANDBY:
cpu_do_idle(); break; case PM_SUSPEND_MEM:
pr_warn("Entering suspend to RAM. Only special wake-up sources will resume the system\n"); return mvebu_enter_suspend(); default: return -EINVAL;
} return 0;
}
staticint mvebu_pm_valid(suspend_state_t state)
{ if (state == PM_SUSPEND_STANDBY) return 1;
if (state == PM_SUSPEND_MEM && mvebu_board_pm_enter != NULL) return 1;
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.