Esempio n. 1
0
static void board_arch_reset(char mode, const char *cmd)
{
#warning "to do: record expection information fastboot"
	unsigned long  num  = 0;

	if (cmd == NULL) {
		/* cmd = NULL; case: cold boot */
		num = find_rebootmap(RESET_COLD_FLAG);
		writel(num, SRAM_RESET_FLAG_ADDR);
	} else {
		/* cmd != null; case: warm boot */
		if (!strcmp(cmd, "bootloader") ||
			!strcmp(cmd, "recovery") ||
			!strcmp(cmd, "resetfactory") ||
			!strcmp(cmd, "resetuser") ||
			!strcmp(cmd, "sdupdate") ||
			!strcmp(cmd, "usbupdate")) {

			num = (find_rebootmap(cmd));
			writel(num, SRAM_RESET_FLAG_ADDR);
		} else {
			/* otherwise cold boot */
			printk(KERN_EMERG "reboot: non-supported mode [%s]\n", cmd);
			num = find_rebootmap(RESET_COLD_FLAG);
			writel(num, SRAM_RESET_FLAG_ADDR);
		}
	}

	printk(KERN_EMERG "reboot: mode reg 0x%x\n", readl(SRAM_RESET_FLAG_ADDR));

	reboot_board();
}
Esempio n. 2
0
static void _k3v2oem1_reset(char mode, const char *cmd)
{
	unsigned long num = 0;

	printk(KERN_EMERG "_k3v2oem1_reset cmd:%s.\n", cmd);

	if (cmd == NULL) {
		/* cmd = NULL; case: cold boot */
		num = find_rebootmap(RESET_COLD_FLAG);
		if (readl(SECRAM_RESET_ADDR) & (1 << 5)) {
			num = 0x06;
			printk(KERN_EMERG "_k3v2oem1_reset cmd:panic.\n");
		}
		writel(num, SECRAM_RESET_ADDR);
	}
	else {
		/* cmd != null; case: warm boot */
		if (!strcmp(cmd, "bootloader") ||
			!strcmp(cmd, "recovery") ||
			!strcmp(cmd, "resetfactory") ||
			!strcmp(cmd, "resetuser") ||
			!strcmp(cmd, "usbupdate") ||
			!strcmp(cmd, "sdupdate")) {

			num = (find_rebootmap(cmd));
			writel(num, SECRAM_RESET_ADDR);
			printk(KERN_EMERG "_k3v2oem1_reset type [%s 0x%lx]\n", cmd, num);
		} else {
			/* otherwise cold boot */
			printk(KERN_EMERG "reboot: non-supported mode [%s]\n", cmd);
			num = find_rebootmap(RESET_COLD_FLAG);
			writel(num, SECRAM_RESET_ADDR);
		}
	}

	printk(KERN_EMERG "reboot: mode reg 0x%x\n", readl(SECRAM_RESET_ADDR));

	reboot_board();
}