static void kk40_arch_reset(char mode, const char *cmd) { u32 boot_flag = 0; u32 boot_mode = BOOT_MODE_REBOOT; if (cmd) { if (!strcmp(cmd, "loader") || !strcmp(cmd, "bootloader")) boot_flag = SYS_LOADER_REBOOT_FLAG + BOOT_LOADER; else if(!strcmp(cmd, "recovery")) boot_flag = SYS_LOADER_REBOOT_FLAG + BOOT_RECOVER; else if (!strcmp(cmd, "charge")) boot_mode = BOOT_MODE_CHARGE; } else { if (is_panic) boot_mode = BOOT_MODE_PANIC; } #ifndef RK30_PMU_BASE writel_relaxed(boot_flag, RK30_GRF_BASE + GRF_OS_REG4); // for loader writel_relaxed(boot_mode, RK30_GRF_BASE + GRF_OS_REG5); // for linux #else writel_relaxed(boot_flag, RK30_PMU_BASE + PMU_SYS_REG0); // for loader writel_relaxed(boot_mode, RK30_PMU_BASE + PMU_SYS_REG1); // for linux #endif ....
所以會reboot flag 和 mode 會被寫入 cpu register...
沒有留言:
張貼留言