X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=carlfw%2Fsrc%2Fmain.c;h=9500c0d26720bcb4d43f409e790048669788ae01;hb=0eb34487ee8e70ecb8e4ee2ed5092b2788eb7f26;hp=9b2a09c5ec6ebb1c69ea111187e540f2f85dce20;hpb=7658f6eb89b59cae3d7c5ee9dd16c5a134cccb99;p=carl9170fw.git diff --git a/carlfw/src/main.c b/carlfw/src/main.c index 9b2a09c..9500c0d 100644 --- a/carlfw/src/main.c +++ b/carlfw/src/main.c @@ -46,6 +46,7 @@ static void init(void) /* USB init */ usb_init(); + /* initialize DMA memory */ memset(&dma_mem, 0, sizeof(dma_mem)); /* fill DMA rings */ @@ -84,7 +85,7 @@ static void handle_fw(void) reboot(); } -static void __attribute__((noreturn)) main_loop(void) +static void __noreturn main_loop(void) { /* main loop */ while (1) { @@ -116,13 +117,10 @@ static void __attribute__((noreturn)) main_loop(void) * we put _start() there with the linker script carl9170.lds. */ -void __attribute__((noreturn)) start(void) +void start(void) { clock_set(true, AHB_40MHZ_OSC); - /* initialize firmware context and DMA memory */ - memset(&fw, 0, sizeof(fw)); - /* watchdog magic pattern check */ if ((get(AR9170_PWR_REG_WATCH_DOG_MAGIC) & 0xffff0000) == 0x12340000) { /* watch dog warm start */ @@ -149,5 +147,10 @@ void __attribute__((noreturn)) start(void) " ~`!1@2#3$4%%5^6&7*8(9)0_-+={[}]|\\:;\"'<,>.?/"); #endif /* CONFIG_CARL9170FW_DEBUG */ + /* + * Tell the host, that the firmware has booted and is + * now ready to process requests. + */ + send_cmd_to_host(0, CARL9170_RSP_BOOT, 0x00, NULL); main_loop(); }