/* 25/50/100ms timer (depends on cpu clock) */
timer_init(0, 50000);
- /* turn off all leds */
- led_set(0);
+ /* USB init */
+ usb_init();
+
+ memset(&dma_mem, 0, sizeof(dma_mem));
/* fill DMA rings */
dma_init_descriptors();
- /* USB init */
- usb_init();
-
/* clear all interrupt */
set(AR9170_MAC_REG_INT_CTRL, 0xffff);
{
/* initialize firmware context and DMA memory */
memset(&fw, 0, sizeof(fw));
- memset(&dma_mem, 0, sizeof(dma_mem));
/* watchdog magic pattern check */
if ((get(AR9170_PWR_REG_WATCH_DOG_MAGIC) & 0xffff0000) == 0x12340000) {
orl(AR9170_USB_REG_DMA_CTL, AR9170_DMA_CTL_DOWN_STREAM);
#endif /* CONFIG_CARL9170FW_USB_DOWN_STREAM */
- /* Enable up stream and down stream */
- orl(AR9170_USB_REG_DMA_CTL, AR9170_DMA_CTL_ENABLE_TO_DEVICE |
- AR9170_DMA_CTL_ENABLE_FROM_DEVICE);
-
#ifdef CONFIG_CARL9170FW_USB_UP_STREAM
/* Set the up stream mode maximum aggregate number */
set(AR9170_USB_REG_MAX_AGG_UPLOAD, 4);
set(AR9170_USB_REG_UPLOAD_TIME_CTL, 0x80);
#endif /* CONFIG_CARL9170FW_USB_UP_STREAM */
+ /* Enable up stream and down stream */
+ orl(AR9170_USB_REG_DMA_CTL, AR9170_DMA_CTL_ENABLE_TO_DEVICE |
+ AR9170_DMA_CTL_ENABLE_FROM_DEVICE);
}
#endif /* CONFIG_CARL9170FW_USB_INIT_FIRMWARE */