From: Oleksij Rempel Date: Sat, 14 Dec 2013 21:02:48 +0000 (+0100) Subject: init.c: do cold reboot on exception X-Git-Tag: 1.4.0~10^2~2^2 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=refs%2Fpull%2F39%2Fhead;p=open-ath9k-htc-firmware.git init.c: do cold reboot on exception 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 --- diff --git a/target_firmware/magpie_fw_dev/target/init/init.c b/target_firmware/magpie_fw_dev/target/init/init.c index 8fc4640..3554656 100755 --- a/target_firmware/magpie_fw_dev/target/init/init.c +++ b/target_firmware/magpie_fw_dev/target/init/init.c @@ -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(); }