init.c: do cold reboot on exception 39/head
authorOleksij Rempel <linux@rempel-privat.de>
Sat, 14 Dec 2013 21:02:48 +0000 (22:02 +0100)
committerOleksij Rempel <linux@rempel-privat.de>
Sat, 14 Dec 2013 21:11:54 +0000 (22:11 +0100)
Currently, if we get exception, FW will print exception info, send crash
pattern to the host and reboot. We can reduce deadtime by doing cold reboot
instead of simple reboot. The difference is, that usb interface will be
reseted and usb subsystem will reinit driver. In this case we even do not need
to update host driver.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
target_firmware/magpie_fw_dev/target/init/init.c

index 8fc464006ba7805f7d49a6b594650083c7442df1..3554656a7616b53ac829f9f03f90906d631a9676 100755 (executable)
@@ -166,9 +166,12 @@ void exception_reset(struct register_dump_s *dump)
        MAGPIE_REG_USB_RX1_SWAP_DATA = 0x1;
        MAGPIE_REG_USB_RX2_SWAP_DATA = 0x1;
 
-       A_PRINTF("Jump to BOOT\n");
-
-       // reboot.....
+        A_PRINTF("Cold reboot initiated.");
+#if defined(PROJECT_MAGPIE)
+        HAL_WORD_REG_WRITE(WATCH_DOG_MAGIC_PATTERN_ADDR, 0);
+#elif defined(PROJECT_K2)
+        HAL_WORD_REG_WRITE(MAGPIE_REG_RST_STATUS_ADDR, 0);
+#endif /* #if defined(PROJECT_MAGPIE) */
        A_USB_JUMP_BOOT();
 }