Skip to content

Commit 2b21656

Browse files
committed
nrf71 system level parameter
Syncing nrf71 system parameters to firmware code base and relevant changes to make system level working. Signed-off-by: Ajay Parida <[email protected]>
1 parent 383c2b3 commit 2b21656

File tree

6 files changed

+83
-11
lines changed

6 files changed

+83
-11
lines changed

fw_if/umac_if/inc/fw/host_rpu_sys_if.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,9 @@ enum rpu_ch_bw {
224224
*
225225
*/
226226
struct chan_params {
227+
#ifdef WIFI_NRF71
228+
unsigned int op_band;
229+
#endif /* WIFI_NRF71 */
227230
/** Primary channel number */
228231
unsigned int primary_num;
229232
/** Channel bandwidth */
@@ -340,6 +343,14 @@ struct umac_rx_dbg_params {
340343
unsigned int null_skb_pointer_from_lmac;
341344
/** Number of unexpected management packets received in coalesce event */
342345
unsigned int unexpected_mgmt_pkt;
346+
#ifdef WIFI_NRF71
347+
/** Number of packets flushed from reorder buffer
348+
* before going to sleep
349+
*/
350+
unsigned int reorder_flush_pkt_count;
351+
/** Unprotected error data frames received in security mode */
352+
unsigned int unsecured_data_error;
353+
#endif /* WIFI_NRF71 */
343354
} __NRF_WIFI_PKD;
344355

345356
/**
@@ -847,6 +858,11 @@ enum op_band {
847858
BAND_ALL,
848859
/** 2.4Ghz band */
849860
BAND_24G,
861+
#ifdef WIFI_NRF71
862+
BAND_5G,
863+
/** 6 GHz band */
864+
BAND_6G
865+
#endif /* WIFI_NRF71 */
850866
};
851867

852868
/**

fw_if/umac_if/inc/fw/host_rpu_umac_if.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,11 @@ enum nrf_wifi_band {
260260
/** Around 5 GHz band (4.9 - 5.7 GHz) */
261261
NRF_WIFI_BAND_5GHZ,
262262
/** Unused */
263+
#ifdef WIFI_NRF71
264+
NRF_WIFI_BAND_6GHZ,
265+
#else
263266
NRF_WIFI_BAND_60GHZ,
267+
#endif /* WIFI_NRF71 */
264268
/** Invalid */
265269
NRF_WIFI_BAND_INVALID
266270
};
@@ -683,8 +687,12 @@ struct nrf_wifi_channel {
683687

684688

685689
#define NRF_WIFI_SCAN_MAX_NUM_SSIDS 2
690+
#ifdef WIFI_NRF71
691+
#define NRF_WIFI_SCAN_MAX_NUM_FREQUENCIES 89
692+
#define MAX_NUM_CHANNELS 42
693+
#else /* WIFI_NRF71 */
686694
#define NRF_WIFI_SCAN_MAX_NUM_FREQUENCIES 64
687-
695+
#endif /* !WIFI_NRF71 */
688696
#define NRF_WIFI_SCAN_BAND_2GHZ (1 << 0)
689697
#define NRF_WIFI_SCAN_BAND_5GHZ (1 << 1)
690698
#define NRF_WIFI_SCAN_BAND_6GHZ (1 << 2)
@@ -1807,8 +1815,11 @@ struct nrf_wifi_ext_capability {
18071815

18081816
} __NRF_WIFI_PKD;
18091817

1818+
#ifdef WIFI_NRF71
1819+
#define NRF_WIFI_SUPPORTED_CHANNELS_MAX_LEN 89
1820+
#else /* WIFI_NRF71 */
18101821
#define NRF_WIFI_SUPPORTED_CHANNELS_MAX_LEN 64
1811-
1822+
#endif /* !WIFI_NRF71 */
18121823
/**
18131824
* @brief Supported channels.
18141825
*/
@@ -2948,8 +2959,10 @@ struct nrf_wifi_umac_event_power_save_info {
29482959
unsigned int ps_timeout;
29492960
/** Listen interval value */
29502961
unsigned short listen_interval;
2962+
#ifndef WIFI_NRF71
29512963
/** Power save exit strategy */
29522964
unsigned char ps_exit_strategy;
2965+
#endif /* !WIFI_NRF71 */
29532966
/** Number TWT flows */
29542967
unsigned char num_twt_flows;
29552968
/** TWT info of each flow nrf_wifi_umac_config_twt_info */

fw_if/umac_if/src/system/fmac_api.c

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,13 @@ enum nrf_wifi_status nrf_wifi_sys_fmac_dev_init(struct nrf_wifi_fmac_dev_ctx *fm
384384
{
385385
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
386386
#ifndef NRF71_ON_IPC
387+
#ifdef WIFI_NRF71
388+
struct nrf_wifi_phy_rf_params phy_rf_params = { 0};
389+
int ret = -1;
390+
#else /* WIFI_NRF71 */
387391
struct nrf_wifi_fmac_otp_info otp_info;
388392
struct nrf_wifi_phy_rf_params phy_rf_params;
393+
#endif /* !WIFI_NRF71 */
389394
#endif /* !NRF71_ON_IPC */
390395

391396
if (!fmac_dev_ctx) {
@@ -414,6 +419,21 @@ enum nrf_wifi_status nrf_wifi_sys_fmac_dev_init(struct nrf_wifi_fmac_dev_ctx *fm
414419
}
415420

416421
#ifndef NRF71_ON_IPC
422+
#ifdef WIFI_NRF71
423+
nrf_wifi_osal_mem_set(&phy_rf_params,
424+
0x0,
425+
sizeof(phy_rf_params));
426+
427+
ret = nrf_wifi_utils_hex_str_to_val(
428+
(unsigned char *)&phy_rf_params.phy_params,
429+
sizeof(phy_rf_params.phy_params),
430+
NRF_WIFI_SYS_DEF_RF_PARAMS);
431+
if (ret == -1) {
432+
nrf_wifi_osal_log_err("%s: Initialization of RF params with default values failed", __func__);
433+
status = NRF_WIFI_STATUS_FAIL;
434+
goto out;
435+
}
436+
#else /* WIFI_NRF71 */
417437
nrf_wifi_osal_mem_set(&otp_info,
418438
0xFF,
419439
sizeof(otp_info));
@@ -435,6 +455,7 @@ enum nrf_wifi_status nrf_wifi_sys_fmac_dev_init(struct nrf_wifi_fmac_dev_ctx *fm
435455
__func__);
436456
goto out;
437457
}
458+
#endif /* !WIFI_NRF71 */
438459
#endif /* !NRF71_ON_IPC */
439460

440461
status = nrf_wifi_sys_fmac_fw_init(fmac_dev_ctx,
@@ -3722,13 +3743,14 @@ static int nrf_wifi_sys_fmac_phy_rf_params_init(struct nrf_wifi_phy_rf_params *p
37223743
unsigned char *str)
37233744
{
37243745
int ret = -1;
3746+
#ifndef WIFI_NRF71
37253747
unsigned int rf_param_offset = BAND_2G_LW_ED_BKF_DSSS_OFST - NRF_WIFI_RF_PARAMS_CONF_SIZE;
3726-
3748+
#endif /* !WIFI_NRF71 */
37273749
/* Initilaize reserved bytes */
37283750
nrf_wifi_osal_mem_set(prf,
37293751
0x0,
37303752
sizeof(prf));
3731-
3753+
#ifndef WIFI_NRF71
37323754
/* Initialize PD adjust values for MCS7. Currently these 4 bytes are not being used */
37333755
prf->pd_adjust_val.pd_adjt_lb_chan = PD_ADJUST_VAL;
37343756
prf->pd_adjust_val.pd_adjt_hb_low_chan = PD_ADJUST_VAL;
@@ -3849,7 +3871,7 @@ static int nrf_wifi_sys_fmac_phy_rf_params_init(struct nrf_wifi_phy_rf_params *p
38493871
prf->phy_params[rf_param_offset + 31] = NRF70_PCB_LOSS_5G_BAND1;
38503872
prf->phy_params[rf_param_offset + 32] = NRF70_PCB_LOSS_5G_BAND2;
38513873
prf->phy_params[rf_param_offset + 33] = NRF70_PCB_LOSS_5G_BAND3;
3852-
3874+
#endif /* !WIFI_NRF71 */
38533875
return(ret);
38543876
}
38553877

@@ -3864,9 +3886,10 @@ enum nrf_wifi_status nrf_wifi_sys_fmac_rf_params_get(struct nrf_wifi_fmac_dev_ct
38643886
/* If package_info is not written to OTP then the default value will be 0xFF. */
38653887
unsigned int package_info = 0xFFFFFFFF;
38663888
struct nrf_wifi_tx_pwr_ceil_params *tx_pwr_ceil_params;
3889+
#ifndef WIFI_NRF71
38673890
unsigned char backoff_2g_dsss = 0, backoff_2g_ofdm = 0;
38683891
unsigned char backoff_5g_lowband = 0, backoff_5g_midband = 0, backoff_5g_highband = 0;
3869-
3892+
#endif /* !WIFI_NRF71 */
38703893
if (!fmac_dev_ctx || !phy_rf_params) {
38713894
nrf_wifi_osal_log_err("%s: Invalid parameters",
38723895
__func__);
@@ -3920,7 +3943,7 @@ enum nrf_wifi_status nrf_wifi_sys_fmac_rf_params_get(struct nrf_wifi_fmac_dev_ct
39203943
status = NRF_WIFI_STATUS_FAIL;
39213944
goto out;
39223945
}
3923-
3946+
#ifndef WIFI_NRF71
39243947
if (!(otp_info.flags & (~CALIB_XO_FLAG_MASK))) {
39253948
nrf_wifi_osal_mem_cpy(&phy_rf_params->xo_offset.xo_freq_offset,
39263949
(char *)otp_info.info.calib + OTP_OFF_CALIB_XO,
@@ -3977,7 +4000,7 @@ enum nrf_wifi_status nrf_wifi_sys_fmac_rf_params_get(struct nrf_wifi_fmac_dev_ct
39774000
MIN(tx_pwr_ceil_params->max_pwr_5g_high_mcs0,
39784001
phy_rf_params->max_pwr_ceil.max_hb_high_chan_mcs0_pwr) - backoff_5g_highband;
39794002
#endif /* NRF70_2_4G_ONLY */
3980-
4003+
#endif /* !WIFI_NRF71 */
39814004
status = NRF_WIFI_STATUS_SUCCESS;
39824005
out:
39834006
return status;

fw_if/umac_if/src/system/fmac_cmd.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ enum nrf_wifi_status umac_cmd_sys_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ct
115115
umac_cmd_data->temp_vbat_config_params.vth_very_low = NRF_WIFI_VBAT_VERYLOW;
116116

117117
umac_cmd_data->op_band = op_band;
118-
118+
#ifndef CONFIG_NRF71
119119
nrf_wifi_osal_mem_cpy(&umac_cmd_data->sys_params.rf_params[PCB_LOSS_BYTE_2G_OFST],
120120
&board_params->pcb_loss_2g,
121121
NUM_PCB_LOSS_OFFSET);
@@ -127,7 +127,7 @@ enum nrf_wifi_status umac_cmd_sys_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ct
127127
nrf_wifi_osal_mem_cpy(&umac_cmd_data->sys_params.rf_params[BAND_2G_LW_ED_BKF_DSSS_OFST],
128128
&tx_pwr_ctrl_params->band_edge_2g_lo_dss,
129129
NUM_EDGE_BACKOFF);
130-
130+
#endif /* !CONFIG_NRF71 */
131131
nrf_wifi_osal_mem_cpy(umac_cmd_data->country_code,
132132
country_code,
133133
NRF_WIFI_COUNTRY_CODE_LEN);
@@ -157,6 +157,7 @@ enum nrf_wifi_status umac_cmd_sys_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ct
157157
umac_cmd_data->coex_disable_ptiwin_for_wifi_scan = 0;
158158
#endif /* NRF_WIFI_COEX_DISABLE_PRIORITY_WINDOW_FOR_SCAN */
159159

160+
#ifndef WIFI_NRF71
160161
#ifdef WIFI_MGMT_RAW_SCAN_RESULTS
161162
umac_cmd_data->raw_scan_enable = 1;
162163
#else
@@ -176,6 +177,7 @@ enum nrf_wifi_status umac_cmd_sys_init(struct nrf_wifi_fmac_dev_ctx *fmac_dev_ct
176177
umac_cmd_data->dynamic_ed = 1;
177178
#endif /* NRF_WIFI_DYNAMIC_ED */
178179

180+
#endif /* !WIFI_NRF71 */
179181
status = nrf_wifi_hal_ctrl_cmd_send(fmac_dev_ctx->hal_dev_ctx,
180182
umac_cmd,
181183
(sizeof(*umac_cmd) + len));

hw_if/hal/inc/common/phy_rf_params_common.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,20 @@
2424
#define NRF_WIFI_PHY_CALIB_FLAG_TXDC 2
2525
#endif
2626

27+
#ifdef WIFI_NRF71
28+
#define NRF_WIFI_PHY_CALIB_FLAG_RXDC 1
29+
#define NRF_WIFI_PHY_CALIB_FLAG_TXDC 2
30+
#define NRF_WIFI_PHY_CALIB_FLAG_TXPOW 0
31+
#define NRF_WIFI_PHY_CALIB_FLAG_TXIQ 8//8
32+
#define NRF_WIFI_PHY_CALIB_FLAG_RXIQ 16//16
33+
#define NRF_WIFI_PHY_CALIB_FLAG_DPD 0
34+
#else /* WIFI_NRF71 */
2735
#define NRF_WIFI_PHY_CALIB_FLAG_TXPOW 0
2836
#define NRF_WIFI_PHY_CALIB_FLAG_TXIQ 8
2937
#define NRF_WIFI_PHY_CALIB_FLAG_RXIQ 16
3038
#define NRF_WIFI_PHY_CALIB_FLAG_DPD 32
39+
#endif /* !WIFI_NRF71 */
40+
3141
#define NRF_WIFI_PHY_CALIB_FLAG_ENHANCED_TXDC 64
3242
#define NRF_WIFI_PHY_SCAN_CALIB_FLAG_RXDC (1<<16)
3343
#ifdef NRF70_PASSIVE_SCAN_ONLY
@@ -318,6 +328,9 @@ struct nrf_wifi_temp_volt_depend_params {
318328
* first 42 bytes of RF parameters.
319329
*/
320330
struct nrf_wifi_phy_rf_params {
331+
#ifdef WIFI_NRF71
332+
unsigned char phy_params[NRF_WIFI_RF_PARAMS_SIZE];
333+
#else /* WIFI_NRF71 */
321334
unsigned char reserved[6];
322335
struct nrf_wifi_xo_freq_offset xo_offset;
323336
struct nrf_wifi_pd_adst_val pd_adjust_val;
@@ -326,6 +339,7 @@ struct nrf_wifi_phy_rf_params {
326339
struct nrf_wifi_rx_gain_offset rx_gain_offset;
327340
struct nrf_wifi_temp_volt_depend_params temp_volt_backoff;
328341
unsigned char phy_params[NRF_WIFI_RF_PARAMS_SIZE - NRF_WIFI_RF_PARAMS_CONF_SIZE];
342+
#endif /* !WIFI_NRF71 */
329343
} __NRF_WIFI_PKD;
330344

331345
/** The byte offsets of RF parameters indicate the start offset

hw_if/hal/inc/system/phy_rf_params.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
#define _PHY_RF_PARAMS_SYS_H_
1313
#include "common/phy_rf_params_common.h"
1414

15+
#ifdef WIFI_NRF71
16+
/* Currnet working phy_rf_params */
17+
#define NRF_WIFI_SYS_DEF_RF_PARAMS "0000000000001C00000000000000004030303838383838380000000050EC000000000000000000000000214365003F032424001000002800323500000CF008007D8105010071630300EED501001F6F00003B350100F52E0000E35E0000B7B6000066EFFEFFB5F60000896200007A840200E28FFCFF08080808040A140100000000A1A10178000000680150003B0207262D2D28281A120A140E0600"
18+
#else /* WIFI_NRF71 */
1519
#define NRF_WIFI_SYS_DEF_RF_PARAMS "007077003F032424001000002800323500000CF008087D8105010071630300EED501001F6F00003B350100F52E0000E35E0000B7B6000066EFFEFFB5F60000896200007A840200E28FFCFF080808080408120100000000A1A10178000000080050003B020726181818181A120A140E0600"
16-
20+
#endif /* !WIFI_NRF71 */
1721
#endif /* _PHY_RF_PARAMS_SYS_H_ */

0 commit comments

Comments
 (0)