Skip to contentSkip to conversation

wl1251: halt the embedded CPU before loading firmware

PATCH In review Bob Copeland 2 participants 2 messages Aug 18, 2009 – Sep 10, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wl1251: halt the embedded CPU before loading firmware

After initial power-up, the embedded cpu is usually halted. However, if we down the interface and only do a soft reset before bringing the interface back up, it will still be running and the firmware loading code will bail out. This change halts the CPU before loading the firmware, enabling a second call to wl1251_boot() to succeed without a hard reset.

---

Hi Kalle,

Thoughts on this? It fixes my remaining issue with warm card reset. I think Android code does this in the firmware loader:

http://android.git.kernel.org/?p=platform/system/wlan/ti.git;a=blob;f=sta_dk_4_0_4_32/common/src/TNETW_Driver/FW_Transfer/HwInit/HwInit.c;h=e5cc2becdd2b9010903598fc56574776f6aeec8d;hb=HEAD#l291

 drivers/net/wireless/wl12xx/wl1251_boot.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/wireless/wl12xx/wl1251_boot.c +3 -0
index 592c3b5..452d748 100644
@@ -465,6 +465,9 @@ int wl1251_boot(struct wl1251 *wl)
 	int ret = 0, minor_minor_e2_ver;
 	u32 tmp, boot_data;
 
+	/* halt embedded ARM CPU while loading firmware */
+	wl1251_reg_write32(wl, ACX_REG_ECPU_CONTROL, ECPU_CONTROL_HALT);
+
 	ret = wl1251_boot_soft_reset(wl);
 	if (ret < 0)
 		goto out;
Signature · 4 lines
1.6.2.5

-- 
Bob Copeland %% www.bobcopeland.com
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Bob Copeland

After initial power-up, the embedded cpu is usually halted. However, if we down the interface and only do a soft reset before bringing the interface back up, it will still be running and the firmware loading code will bail out. This change halts the CPU before loading the firmware, enabling a second call to wl1251_boot() to succeed without a hard reset.

(Even though the patch is already in wireless-testing.)

Quoted 1 line

Hi Kalle,

Hi Bob,

sorry for the long delay. Last few weeks has been crazy :)

Quoted 2 lines

Thoughts on this? It fixes my remaining issue with warm card reset. I think Android code does this in the firmware loader:

I'm fine with this. I tested the patch with spi and it works fine.

Thanks again.

Signature · 1 line
Kalle Valo