From: Oleksij Rempel Date: Wed, 24 Jul 2013 08:26:18 +0000 (+0200) Subject: k2_fw_usb_api: workaround for EP4 bug. X-Git-Tag: 1.4.0~11^2~5 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=dbbb809d592dde0b3c9ecb97b3b387ff8e40e799;p=open-ath9k-htc-firmware.git k2_fw_usb_api: workaround for EP4 bug. This patch is workaround for xhci related issue. After usb port resume FIFO on EP4 can't accept Bulck stream longer then 64 Bytes. Currently we have no better way then just completly reset chip. Side effect of this workaround - disconnection event for this device. It means, module will be reloaded and we will get new usb minor id. This is why, we should not do it on each firmware restart. Signed-off-by: Oleksij Rempel --- diff --git a/target_firmware/magpie_fw_dev/target/hif/k2_fw_usb_api.c b/target_firmware/magpie_fw_dev/target/hif/k2_fw_usb_api.c index 0be8a87..83a72a9 100755 --- a/target_firmware/magpie_fw_dev/target/hif/k2_fw_usb_api.c +++ b/target_firmware/magpie_fw_dev/target/hif/k2_fw_usb_api.c @@ -402,6 +402,17 @@ void _fw_usb_reset_fifo(void) A_UART_HWINIT((22*1000*1000), 19200); } +void cold_reboot(void) +{ + 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(); +} + /* * -- support more than 64 bytes command on ep4 -- */ @@ -420,7 +431,7 @@ void vUsb_Reg_Out_patch(void) usbfifolen = USB_BYTE_REG_READ(ZM_EP4_BYTE_COUNT_LOW_OFFSET); if (usbfifolen > 0x40) { A_PRINTF("EP4 FIFO Bug? Buffer is too big: %x\n", usbfifolen); - goto ERR; + cold_reboot(); } // check is command is new