Skip to content

Commit

Permalink
nrf_wifi: Decrease MCU boot timeout
Browse files Browse the repository at this point in the history
If MCU isn't ready in 1s then there is not much use in waiting longer,
so, decrease the timeout to 1s and also rejig the code to make it
readable.

Fixes SHEL-2480 partially.

Signed-off-by: Chaitanya Tata <[email protected]>
  • Loading branch information
krish2718 authored and jfischer-no committed Feb 29, 2024
1 parent 5f81336 commit 2580e29
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions nrf_wifi/hw_if/hal/src/hal_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1599,15 +1599,15 @@ enum nrf_wifi_status nrf_wifi_hal_proc_reset(struct nrf_wifi_hal_dev_ctx *hal_de
return status;
}


#define MCU_FW_BOOT_TIMEOUT_MS 1000
enum nrf_wifi_status nrf_wifi_hal_fw_chk_boot(struct nrf_wifi_hal_dev_ctx *hal_dev_ctx,
enum RPU_PROC_TYPE rpu_proc)
{
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
unsigned int addr = 0;
unsigned int val = 0;
unsigned int exp_val = 0;
unsigned int i = 0;
unsigned int mcu_ready_wait_count = MCU_FW_BOOT_TIMEOUT_MS / 10;

if (rpu_proc == RPU_PROC_TYPE_MCU_LMAC) {
addr = RPU_MEM_LMAC_BOOT_SIG;
Expand All @@ -1624,7 +1624,7 @@ enum nrf_wifi_status nrf_wifi_hal_fw_chk_boot(struct nrf_wifi_hal_dev_ctx *hal_d

hal_dev_ctx->curr_proc = rpu_proc;

while (i < 1000) {
while (mcu_ready_wait_count-- > 0) {
status = hal_rpu_mem_read(hal_dev_ctx,
(unsigned char *)&val,
addr,
Expand All @@ -1644,12 +1644,9 @@ enum nrf_wifi_status nrf_wifi_hal_fw_chk_boot(struct nrf_wifi_hal_dev_ctx *hal_d
/* Sleep for 10 ms */
nrf_wifi_osal_sleep_ms(hal_dev_ctx->hpriv->opriv,
10);

i++;

};

if (i == 1000) {
if (mcu_ready_wait_count <= 0) {
nrf_wifi_osal_log_err(hal_dev_ctx->hpriv->opriv,
"%s: Boot_sig check failed for RPU(%d), "
"Expected: 0x%X, Actual: 0x%X",
Expand Down

0 comments on commit 2580e29

Please sign in to comment.