projects
/
carl9170fw.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
carl9170 firmware: remove firmware context memset
[carl9170fw.git]
/
carlfw
/
src
/
main.c
diff --git
a/carlfw/src/main.c
b/carlfw/src/main.c
index bdb68babd58a79bbf583b3314573256cf6fe3a9f..3efa6a8fe5383939e3000c7c036b4739d66a1a59 100644
(file)
--- a/
carlfw/src/main.c
+++ b/
carlfw/src/main.c
@@
-43,15
+43,15
@@
static void init(void)
/* 25/50/100ms timer (depends on cpu clock) */
timer_init(0, 50000);
/* 25/50/100ms timer (depends on cpu clock) */
timer_init(0, 50000);
- /* turn off all leds */
- led_set(0);
+ /* USB init */
+ usb_init();
+
+ /* initialize DMA memory */
+ memset(&dma_mem, 0, sizeof(dma_mem));
/* fill DMA rings */
dma_init_descriptors();
/* fill DMA rings */
dma_init_descriptors();
- /* USB init */
- usb_init();
-
/* clear all interrupt */
set(AR9170_MAC_REG_INT_CTRL, 0xffff);
/* clear all interrupt */
set(AR9170_MAC_REG_INT_CTRL, 0xffff);
@@
-76,14
+76,20
@@
static void init(void)
down_trigger();
}
down_trigger();
}
-static void
__attribute__((noreturn)) main_loop
(void)
+static void
handle_fw
(void)
{
{
- clock_set(true, AHB_40MHZ_OSC);
+ if (fw.watchdog_enable == 1)
+ set(AR9170_TIMER_REG_WATCH_DOG, AR9170_WATCH_DOG_TIMER);
+
+ if (fw.reboot)
+ reboot();
+}
+static void __attribute__((noreturn)) main_loop(void)
+{
/* main loop */
while (1) {
/* main loop */
while (1) {
- if (fw.watchdog_enable == 1)
- set(AR9170_TIMER_REG_WATCH_DOG, AR9170_WATCH_DOG_TIMER);
+ handle_fw();
/*
* Due to frame order persevation, the wlan subroutines
/*
* Due to frame order persevation, the wlan subroutines
@@
-113,9
+119,7
@@
static void __attribute__((noreturn)) main_loop(void)
void __attribute__((noreturn)) start(void)
{
void __attribute__((noreturn)) start(void)
{
- /* initialize firmware context and DMA memory */
- memset(&fw, 0, sizeof(fw));
- memset(&dma_mem, 0, sizeof(dma_mem));
+ clock_set(true, AHB_40MHZ_OSC);
/* watchdog magic pattern check */
if ((get(AR9170_PWR_REG_WATCH_DOG_MAGIC) & 0xffff0000) == 0x12340000) {
/* watchdog magic pattern check */
if ((get(AR9170_PWR_REG_WATCH_DOG_MAGIC) & 0xffff0000) == 0x12340000) {
@@
-143,5
+147,10
@@
void __attribute__((noreturn)) start(void)
" ~`!1@2#3$4%%5^6&7*8(9)0_-+={[}]|\\:;\"'<,>.?/");
#endif /* CONFIG_CARL9170FW_DEBUG */
" ~`!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();
}
main_loop();
}