static int rk_lpmode_enter(unsigned long arg) { //RKPM_DDR_PFUN(slp_setting(rkpm_jdg_sram_ctrbits),slp_setting); RKPM_DDR_FUN(slp_setting); local_flush_tlb_all(); flush_cache_all(); outer_flush_all(); outer_disable(); cpu_proc_fin(); //outer_inv_all();// ??? // l2x0_inv_all_pm(); //rk319x is not need flush_cache_all(); rkpm_ddr_printch('d'); //rkpm_udelay(3*10); dsb(); wfi(); rkpm_ddr_printch('D'); return 0; }
static void __soft_restart(void *addr) { phys_reset_t phys_reset; /* Take out a flat memory mapping. */ setup_mm_for_reboot(); /* Clean and invalidate caches */ flush_cache_all(); /* Turn off caching */ cpu_proc_fin(); /* Push out any further dirty data, and ensure cache is empty */ flush_cache_all(); /* Push out the dirty data from external caches */ outer_disable(); /* Switch to the identity mapping. */ phys_reset = (phys_reset_t)(unsigned long)virt_to_phys(cpu_reset); phys_reset((unsigned long)addr); /* Should never get here. */ BUG(); }
void machine_crash_swreset(void) { printk(KERN_INFO "Software reset on panic!\n"); flush_cache_all(); outer_flush_all(); outer_disable(); arm_pm_restart_sw(0, NULL); }
/* * hi6930_pm_disable_l2x0()/hi6930_pm_enable_l2x0() is designed to * disable and enable l2-cache during Suspend-Resume phase */ void hi6930_pm_disable_l2x0(void) { u32 l2x0_base = HI_APPA9_L2_REGBASE_ADDR_VIRT; /* backup aux control register value */ l2x0_cache_bak[0] = readl_relaxed(l2x0_base + L2X0_AUX_CTRL); l2x0_cache_bak[1] = readl_relaxed(l2x0_base + L2X0_TAG_LATENCY_CTRL); l2x0_cache_bak[2] = readl_relaxed(l2x0_base + L2X0_DATA_LATENCY_CTRL); outer_disable(); pm_printk(BSP_LOG_LEVEL_DEBUG, "l2x0 Cache disabled.\r\n"); }
static int highbank_suspend_finish(unsigned long val) { outer_flush_all(); outer_disable(); highbank_set_pwr_suspend(); cpu_do_idle(); highbank_clear_pwr_request(); return 0; }
void machine_kexec(struct kimage *image) { unsigned long page_list; unsigned long reboot_code_buffer_phys; void *reboot_code_buffer; arch_kexec(); page_list = image->head & PAGE_MASK; /* we need both effective and real address here */ reboot_code_buffer_phys = page_to_pfn(image->control_code_page) << PAGE_SHIFT; reboot_code_buffer = page_address(image->control_code_page); /* Prepare parameters for reboot_code_buffer*/ mem_text_write_kernel_word(&kexec_start_address, image->start); mem_text_write_kernel_word(&kexec_indirection_page, page_list); mem_text_write_kernel_word(&kexec_mach_type, machine_arch_type); mem_text_write_kernel_word(&kexec_boot_atags, image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET); #ifdef CONFIG_KEXEC_HARDBOOT mem_text_write_kernel_word(&kexec_hardboot, image->hardboot); #endif /* copy our kernel relocation code to the control code page */ memcpy(reboot_code_buffer, relocate_new_kernel, relocate_new_kernel_size); flush_icache_range((unsigned long) reboot_code_buffer, (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE); printk(KERN_INFO "Bye!\n"); if (kexec_reinit) kexec_reinit(); local_irq_disable(); local_fiq_disable(); setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/ #ifdef CONFIG_KEXEC_HARDBOOT if (image->hardboot && kexec_hardboot_hook) /* Run any final machine-specific shutdown code. */ kexec_hardboot_hook(); #endif flush_cache_all(); outer_flush_all(); outer_disable(); cpu_proc_fin(); outer_inv_all(); flush_cache_all(); __virt_to_phys(cpu_reset)(reboot_code_buffer_phys); }
static int sirfsoc_pm_enter(suspend_state_t state) { switch (state) { case PM_SUSPEND_MEM: sirfsoc_pre_suspend_power_off(); outer_disable(); /* go zzz */ cpu_suspend(0, sirfsoc_finish_suspend); outer_resume(); break; default: return -EINVAL; } return 0; }
void machine_kexec(struct kimage *image) { unsigned long page_list; unsigned long reboot_code_buffer_phys; void *reboot_code_buffer; if (num_online_cpus() > 1) { pr_err("kexec: error: multiple CPUs still online\n"); return; } page_list = image->head & PAGE_MASK; /* we need both effective and real address here */ reboot_code_buffer_phys = page_to_pfn(image->control_code_page) << PAGE_SHIFT; reboot_code_buffer = page_address(image->control_code_page); /* Prepare parameters for reboot_code_buffer*/ kexec_start_address = image->start; kexec_indirection_page = page_list; kexec_mach_type = machine_arch_type; kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET; /* copy our kernel relocation code to the control code page */ memcpy(reboot_code_buffer, relocate_new_kernel, relocate_new_kernel_size); flush_icache_range((unsigned long) reboot_code_buffer, (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE); printk(KERN_INFO "Bye!\n"); if (kexec_reinit) kexec_reinit(); local_irq_disable(); local_fiq_disable(); setup_mm_for_reboot(0); /* mode is not used, so just pass 0*/ flush_cache_all(); outer_flush_all(); outer_disable(); cpu_proc_fin(); outer_inv_all(); flush_cache_all(); cpu_reset(reboot_code_buffer_phys); }
void _soft_restart(unsigned long addr, bool disable_l2) { u64 *stack = soft_restart_stack + ARRAY_SIZE(soft_restart_stack); /* Disable interrupts first */ raw_local_irq_disable(); local_fiq_disable(); /* Disable the L2 if we're the last man standing. */ if (disable_l2) outer_disable(); /* Change to the new stack and continue with the reset. */ call_with_stack(__soft_restart, (void *)addr, (void *)stack); /* Should never get here. */ BUG(); }
void machine_kexec(struct kimage *image) { unsigned long page_list; unsigned long reboot_code_buffer_phys; void *reboot_code_buffer; page_list = image->head & PAGE_MASK; /* we need both effective and real address here */ reboot_code_buffer_phys = page_to_pfn(image->control_code_page) << PAGE_SHIFT; reboot_code_buffer = page_address(image->control_code_page); /* Prepare parameters for reboot_code_buffer*/ kexec_start_address = image->start; kexec_indirection_page = page_list; kexec_mach_type = machine_arch_type; kexec_boot_atags = image->start - KEXEC_ARM_ZIMAGE_OFFSET + KEXEC_ARM_ATAGS_OFFSET; /* copy our kernel relocation code to the control code page */ memcpy(reboot_code_buffer, relocate_new_kernel, relocate_new_kernel_size); flush_icache_range((unsigned long) reboot_code_buffer, (unsigned long) reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE); printk(KERN_INFO "Bye!\n"); outer_flush_all(); outer_disable(); local_irq_disable(); local_fiq_disable(); outer_inv_all(); flush_cache_all(); cpu_proc_fin(); flush_cache_all(); __virt_to_phys(cpu_reset)(reboot_code_buffer_phys); }