/* Resets clock rates and reboots the system. Only called from system.h */ void omap_prcm_arch_reset(char mode) { s16 prcm_offs; omap2_clk_prepare_for_reboot(); if (cpu_is_omap24xx()) { prcm_offs = WKUP_MOD; prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL); } else if (cpu_is_omap34xx()) { u32 l; prcm_offs = OMAP3430_GR_MOD; l = ('B' << 24) | ('M' << 16) | mode; /* Reserve the first word in scratchpad for communicating * with the boot ROM. A pointer to a data structure * describing the boot process can be stored there, * cf. OMAP34xx TRM, Initialization / Software Booting * Configuration. */ omap_writel(l, OMAP343X_SCRATCHPAD + 4); omap3_configure_core_dpll_warmreset(); } else WARN_ON(1); }
// This code is yanked from arch/arm/mach-omap2/prcm.c void machine_emergency_restart(void) { s16 prcm_offs; u32 l; // delay here to allow eMMC to finish any internal housekeeping before reset // even if mdelay fails to work correctly, 8 second button press should work // this used to be an msleep but scheduler is gone here and calling msleep // will cause a panic mdelay(1600); prcm_offs = OMAP3430_GR_MOD; l = ('B' << 24) | ('M' << 16) | 'h'; /* Reserve the first word in scratchpad for communicating * with the boot ROM. A pointer to a data structure * describing the boot process can be stored there, * cf. OMAP34xx TRM, Initialization / Software Booting * Configuration. */ omap_writel(l, OMAP343X_SCRATCHPAD + 4); omap3_configure_core_dpll_warmreset(); }
/* Resets clock rates and reboots the system. Only called from system.h */ void omap_prcm_arch_reset(char mode, const char *cmd) { s16 prcm_offs; omap2_clk_prepare_for_reboot(); if (cpu_is_omap24xx()) { prcm_offs = WKUP_MOD; prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs, RM_RSTCTRL); } else if (cpu_is_omap34xx()) { u32 l; /* Copy cmd into scratchpad memmory if any */ if(cmd != 0) { u16 counter = 0; while((counter < (OMAP343X_SCRATCHPAD_BCB_SIZE-1)) && (cmd[counter]!='\0')) { omap_writeb(cmd[counter], OMAP343X_SCRATCHPAD_BCB + counter); counter++; } omap_writeb('\0', OMAP343X_SCRATCHPAD_BCB + counter); } prcm_offs = OMAP3430_GR_MOD; l = ('B' << 24) | ('M' << 16) | mode; /* Reserve the first word in scratchpad for communicating * with the boot ROM. A pointer to a data structure * describing the boot process can be stored there, * cf. OMAP34xx TRM, Initialization / Software Booting * Configuration. */ omap_writel(l, OMAP343X_SCRATCHPAD + 4); omap3_configure_core_dpll_warmreset(); } else WARN_ON(1); }