ath10k: Support extended board data download for dual-band QCA9984
PATCH 2/2 ath10k: Support extended board data download for dual-band QCA9984
In reply to Sathishkumar MuruganandamTo support dual-band variant of QCA9984, new extended board data (eBDF) is introduced since existing board data ran out of space.
Below is the brief implementation & design detail,
----------------------------------------------------
1. New OTP changes to inform eBDF support in existing OTP download to fetch board ID and chip ID. This is backward compatible and older card sends 0 by default for eBDF support bit (bit 18 of OTP response) we check in ath10k driver.
2. If eBDF is supported, then we need to fetch eBDF ID which is bundled in downloaded board data. So again OTP is executed for knowing the eBDF ID. This is done once we set 'board_data_initialized' bit. If eBDF ID returned is zero, we continue booting with previous board data downloaded.
3. Based on the eBDF ID fetched, ath10k driver tries to download the extended board data to a new offset ahead of already downloaded board data address.
4. A new BD IE type, ATH10K_BD_IE_BOARD_EXT is added to differentiate in bundling eBDF separately in board-2.bin and also to parse through board bundle for eBDF download in ath10k boot.
5. If eBDF is not present in the board-2.bin bundle or when board ID is zero, we do a fallback boot to "eboard.bin" in the same QCA9984/hw1.0 dir. This is same as done to existing "board.bin" if board ID is not present in board-2.bin bundle.
Current design is that eBDF size will be 2KB and eBDF ID will be byte value.
Tested the above changes with dual-band variant of QCA9984 card. OTP update needed for the test will be part of next FW release 10.4-3.6-xxxx.
Below are the logs with ath10k BOOT debugs enabled.
First OTP response :
---------------------
..
boot upload otp to 0x1234 len 9478 for board id
boot get otp board id result 0x00040400 board_id 1 chip_id 0 ext_bid_support 1 ..
Second OTP response :
---------------------
..
boot upload otp to 0x1234 len 9478 for ext board id boot get otp ext board id result 0x00000005 ext_board_id 5 boot using eboard name 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5' ..
Extended board data download:
------------------------------
..
board name
00000000: 62 75 73 3d 70 63 69 2c 62 6d 69 2d 63 68 69 70 bus=pci,bmi-chip 00000010: 2d 69 64 3d 30 2c 62 6d 69 2d 65 62 6f 61 72 64 -id=0,bmi-eboard 00000020: 2d 69 64 3d 35 -id=5
boot found match for name 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5' boot found eboard data for 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5' using board api 2
boot writing ext board data to addr 0xc3000
..
Fallback Extended board data download from "eboard.bin":
---------------------------------------------------------
..
board name
00000000: 62 75 73 3d 70 63 69 2c 62 6d 69 2d 63 68 69 70 bus=pci,bmi-chip 00000010: 2d 69 64 3d 30 2c 62 6d 69 2d 62 6f 61 72 64 2d -id=0,bmi-board- 00000020: 69 64 3d 31 30 id=10
failed to fetch board data for bus=pci,bmi-chip-id=0,bmi-eboard-id=5 from ath10k/QCA9984/hw1.0/board-2.bin boot fw request 'ath10k/QCA9984/hw1.0/eboard.bin': 0
using board api 1
boot writing ext board data to addr 0xc3000
..
--- drivers/net/wireless/ath/ath10k/bmi.h | 5 + drivers/net/wireless/ath/ath10k/core.c | 244 ++++++++++++++++---- drivers/net/wireless/ath/ath10k/core.h | 5 + drivers/net/wireless/ath/ath10k/hw.h | 4 + drivers/net/wireless/ath/ath10k/targaddrs.h | 4 + 5 files changed, 221 insertions(+), 41 deletions(-)
drivers/net/wireless/ath/ath10k/bmi.h +5 -0
@@ -86,6 +86,10 @@ enum bmi_cmd_id {#define BMI_PARAM_GET_FLASH_BOARD_ID 0x8000#define BMI_PARAM_FLASH_SECTION_ALL 0x10000 +/* Dual-band Extended Board ID */ +#define BMI_PARAM_GET_EXT_BOARD_ID 0x40000 +#define ATH10K_BMI_EXT_BOARD_ID_SUPPORT 0x40000 +#define ATH10K_BMI_BOARD_ID_FROM_OTP_MASK 0x7c00#define ATH10K_BMI_BOARD_ID_FROM_OTP_LSB 10
@@ -93,6 +97,7 @@ enum bmi_cmd_id {#define ATH10K_BMI_CHIP_ID_FROM_OTP_LSB 15#define ATH10K_BMI_BOARD_ID_STATUS_MASK 0xff +#define ATH10K_BMI_EBOARD_ID_STATUS_MASK 0xffstruct bmi_cmd {__le32 id;/* enum bmi_cmd_id */
drivers/net/wireless/ath/ath10k/core.c +203 -41
360 lines not on this page · raw message
drivers/net/wireless/ath/ath10k/core.h +5 -0
@@ -861,6 +861,9 @@ struct ath10k_fw_components {const struct firmware *board;const void *board_data;size_t board_len; +const struct firmware *ext_board; +const void *ext_board_data; +size_t ext_board_len;struct ath10k_fw_file fw_file; };
@@ -947,7 +950,9 @@ struct ath10k {bool bmi_ids_valid;u8 bmi_board_id; +u8 bmi_eboard_id;u8 bmi_chip_id; +bool ext_bid_supported;char bdf_ext[ATH10K_SMBIOS_BDF_EXT_STR_LENGTH ]; } id;
drivers/net/wireless/ath/ath10k/hw.h +4 -0
@@ -109,6 +109,7 @@ enum qca9377_chip_id_rev {#define QCA9984_HW_1_0_CHIP_ID_REV 0x0#define QCA9984_HW_1_0_FW_DIR ATH10K_FW_DIR "/QCA9984/hw1.0"#define QCA9984_HW_1_0_BOARD_DATA_FILE "board.bin" +#define QCA9984_HW_1_0_EBOARD_DATA_FILE "eboard.bin"#define QCA9984_HW_1_0_PATCH_LOAD_ADDR 0x1234/* QCA9888 2.0 defines */
@@ -221,6 +222,7 @@ enum ath10k_fw_htt_op_version {enum ath10k_bd_ie_type {/* contains sub IEs of enum ath10k_bd_ie_board_type */ ATH10K_BD_IE_BOARD =0 , +ATH10K_BD_IE_BOARD_EXT =1 , };enum ath10k_bd_ie_board_type {
@@ -539,6 +541,8 @@ struct ath10k_hw_params {const char *dir;const char *board;size_t board_size; +const char *eboard; +size_t ext_board_size;size_t board_ext_size; } fw;
drivers/net/wireless/ath/ath10k/targaddrs.h +4 -0
@@ -484,6 +484,10 @@ struct host_interest {#define QCA99X0_BOARD_DATA_SZ 12288#define QCA99X0_BOARD_EXT_DATA_SZ 0 +/* Dual band extended board data */ +#define QCA99X0_EXT_BOARD_DATA_SZ 2048 +#define EXT_BOARD_ADDRESS_OFFSET 0x3000 +#define QCA4019_BOARD_DATA_SZ 12064#define QCA4019_BOARD_EXT_DATA_SZ 0
Signature · 7 lines
2.17.1 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
PATCH 1/2 ath10k: Support extended board data download for dual-band QCA9984
Just moving functions down in the file, no functional changes.
--- drivers/net/wireless/ath/ath10k/core.c | 402 ++++++++++++------------- 1 file changed, 201 insertions(+), 201 deletions(-)
drivers/net/wireless/ath/ath10k/core.c +201 -201
@@ -762,149 +762,6 @@ static int ath10k_push_board_ext_data(struct ath10k *ar, const void *data,return 0 ; } -static int ath10k_download_board_data (struct ath10k *ar,const void *data, -size_t data_len) -{ -u32 board_data_size = ar->hw_params.fw.board_size; -u32 address; -int ret; - - ret =ath10k_push_board_ext_data (ar, data, data_len); -if (ret) { -ath10k_err (ar,"could not push board ext data (%d)\n" , ret); - goto exit; - } - - ret =ath10k_bmi_read32 (ar, hi_board_data, &address); -if (ret) { -ath10k_err (ar,"could not read board data addr (%d)\n" , ret); - goto exit; - } - - ret =ath10k_bmi_write_memory (ar, address, data, -min_t (u32, board_data_size, - data_len)); -if (ret) { -ath10k_err (ar,"could not write board data (%d)\n" , ret); - goto exit; - } - - ret =ath10k_bmi_write32 (ar, hi_board_data_initialized,1 ); -if (ret) { -ath10k_err (ar,"could not write board data bit (%d)\n" , ret); - goto exit; - } - -exit: -return ret; -} - -static int ath10k_download_cal_file (struct ath10k *ar, -const struct firmware *file) -{ -int ret; - -if (!file) -return -ENOENT ; - -if (IS_ERR (file)) -return PTR_ERR (file); - - ret =ath10k_download_board_data (ar, file->data, file->size); -if (ret) { -ath10k_err (ar,"failed to download cal_file data: %d\n" , ret); -return ret; - } - -ath10k_dbg (ar,ATH10K_DBG_BOOT ,"boot cal file downloaded\n" ); - -return 0 ; -} - -static int ath10k_download_cal_dt (struct ath10k *ar,const char *dt_name) -{ -struct device_node *node; -int data_len; -void *data; -int ret; - - node = ar->dev->of_node; -if (!node) -/* Device Tree is optional, don't print any warnings if -* there's no node for ath10k. -*/ -return -ENOENT ; - -if (!of_get_property (node, dt_name, &data_len)) { -/* The calibration data node is optional */ -return -ENOENT ; - } - -if (data_len != ar->hw_params.cal_data_len) { -ath10k_warn (ar,"invalid calibration data length in DT: %d\n" , - data_len); - ret = -EMSGSIZE ; - goto out; - } - - data =kmalloc (data_len,GFP_KERNEL ); -if (!data) { - ret = -ENOMEM ; - goto out; - } - - ret =of_property_read_u8_array (node, dt_name, data, data_len); -if (ret) { -ath10k_warn (ar,"failed to read calibration data from DT: %d\n" , - ret); - goto out_free; - } - - ret =ath10k_download_board_data (ar, data, data_len); -if (ret) { -ath10k_warn (ar,"failed to download calibration data from Device Tree: %d\n" , - ret); - goto out_free; - } - - ret =0 ; - -out_free: -kfree (data); - -out: -return ret; -} - -static int ath10k_download_cal_eeprom (struct ath10k *ar) -{ -size_t data_len; -void *data =NULL ; -int ret; - - ret =ath10k_hif_fetch_cal_eeprom (ar, &data, &data_len); -if (ret) { -if (ret != -EOPNOTSUPP ) -ath10k_warn (ar,"failed to read calibration data from EEPROM: %d\n" , - ret); - goto out_free; - } - - ret =ath10k_download_board_data (ar, data, data_len); -if (ret) { -ath10k_warn (ar,"failed to download calibration data from EEPROM: %d\n" , - ret); - goto out_free; - } - - ret =0 ; - -out_free: -kfree (data); - -return ret; -} -static int ath10k_core_get_board_id_from_otp (struct ath10k *ar) {u32 result, address;
@@ -1055,64 +912,6 @@ static int ath10k_core_check_dt(struct ath10k *ar)return 0 ; } -static int ath10k_download_and_run_otp (struct ath10k *ar) -{ -u32 result, address = ar->hw_params.patch_load_addr; -u32 bmi_otp_exe_param = ar->hw_params.otp_exe_param; -int ret; - - ret =ath10k_download_board_data (ar, - ar->running_fw->board_data, - ar->running_fw->board_len); -if (ret) { -ath10k_err (ar,"failed to download board data: %d\n" , ret); -return ret; - } - -/* OTP is optional */ - -if (!ar->running_fw->fw_file.otp_data || - !ar->running_fw->fw_file.otp_len) { -ath10k_warn (ar,"Not running otp, calibration will be incorrect (otp-data %pK otp_len %zd)!\n" , - ar->running_fw->fw_file.otp_data, - ar->running_fw->fw_file.otp_len); -return 0 ; - } - -ath10k_dbg (ar,ATH10K_DBG_BOOT ,"boot upload otp to 0x%x len %zd\n" , - address, ar->running_fw->fw_file.otp_len); - - ret =ath10k_bmi_fast_download (ar, address, - ar->running_fw->fw_file.otp_data, - ar->running_fw->fw_file.otp_len); -if (ret) { -ath10k_err (ar,"could not write otp (%d)\n" , ret); -return ret; - } - -/* As of now pre-cal is valid for 10_4 variants */ -if (ar->cal_mode ==ATH10K_PRE_CAL_MODE_DT || - ar->cal_mode ==ATH10K_PRE_CAL_MODE_FILE ) - bmi_otp_exe_param =BMI_PARAM_FLASH_SECTION_ALL ; - - ret =ath10k_bmi_execute (ar, address, bmi_otp_exe_param, &result); -if (ret) { -ath10k_err (ar,"could not execute otp (%d)\n" , ret); -return ret; - } - -ath10k_dbg (ar,ATH10K_DBG_BOOT ,"boot otp execute result %d\n" , result); - -if (!(skip_otp ||test_bit (ATH10K_FW_FEATURE_IGNORE_OTP_RESULT , - ar->running_fw->fw_file.fw_features)) && - result !=0 ) { -ath10k_err (ar,"otp calibration failed: %d" , result); -return -EINVAL ; - } - -return 0 ; -} -static int ath10k_download_fw (struct ath10k *ar) {u32 address, data_len;
@@ -1490,6 +1289,207 @@ static int ath10k_core_fetch_board_file(struct ath10k *ar)return 0 ; } +static int ath10k_download_board_data (struct ath10k *ar,const void *data, +size_t data_len) +{ +u32 board_data_size = ar->hw_params.fw.board_size; +u32 address; +int ret; + + ret =ath10k_push_board_ext_data (ar, data, data_len); +if (ret) { +ath10k_err (ar,"could not push board ext data (%d)\n" , ret); + goto exit; + } + + ret =ath10k_bmi_read32 (ar, hi_board_data, &address); +if (ret) { +ath10k_err (ar,"could not read board data addr (%d)\n" , ret); + goto exit; + } + + ret =ath10k_bmi_write_memory (ar, address, data, +min_t (u32, board_data_size, + data_len)); +if (ret) { +ath10k_err (ar,"could not write board data (%d)\n" , ret); + goto exit; + } + + ret =ath10k_bmi_write32 (ar, hi_board_data_initialized,1 ); +if (ret) { +ath10k_err (ar,"could not write board data bit (%d)\n" , ret); + goto exit; + } + +exit: +return ret; +} + +static int ath10k_download_and_run_otp (struct ath10k *ar) +{ +u32 result, address = ar->hw_params.patch_load_addr; +u32 bmi_otp_exe_param = ar->hw_params.otp_exe_param; +int ret; + + ret =ath10k_download_board_data (ar, + ar->running_fw->board_data, + ar->running_fw->board_len); +if (ret) { +ath10k_err (ar,"failed to download board data: %d\n" , ret); +return ret; + } + +/* OTP is optional */ + +if (!ar->running_fw->fw_file.otp_data || + !ar->running_fw->fw_file.otp_len) { +ath10k_warn (ar,"Not running otp, calibration will be incorrect (otp-data %pK otp_len %zd)!\n" , + ar->running_fw->fw_file.otp_data, + ar->running_fw->fw_file.otp_len); +return 0 ; + } + +ath10k_dbg (ar,ATH10K_DBG_BOOT ,"boot upload otp to 0x%x len %zd\n" , + address, ar->running_fw->fw_file.otp_len); + + ret =ath10k_bmi_fast_download (ar, address, + ar->running_fw->fw_file.otp_data, + ar->running_fw->fw_file.otp_len); +if (ret) { +ath10k_err (ar,"could not write otp (%d)\n" , ret); +return ret; + } + +/* As of now pre-cal is valid for 10_4 variants */ +if (ar->cal_mode ==ATH10K_PRE_CAL_MODE_DT || + ar->cal_mode ==ATH10K_PRE_CAL_MODE_FILE ) + bmi_otp_exe_param =BMI_PARAM_FLASH_SECTION_ALL ; + + ret =ath10k_bmi_execute (ar, address, bmi_otp_exe_param, &result); +if (ret) { +ath10k_err (ar,"could not execute otp (%d)\n" , ret); +return ret; + } + +ath10k_dbg (ar,ATH10K_DBG_BOOT ,"boot otp execute result %d\n" , result); + +if (!(skip_otp ||test_bit (ATH10K_FW_FEATURE_IGNORE_OTP_RESULT , + ar->running_fw->fw_file.fw_features)) && + result !=0 ) { +ath10k_err (ar,"otp calibration failed: %d" , result); +return -EINVAL ; + } + +return 0 ; +} + +static int ath10k_download_cal_file (struct ath10k *ar, +const struct firmware *file) +{ +int ret; + +if (!file) +return -ENOENT ; + +if (IS_ERR (file)) +return PTR_ERR (file); + + ret =ath10k_download_board_data (ar, file->data, file->size); +if (ret) { +ath10k_err (ar,"failed to download cal_file data: %d\n" , ret); +return ret; + } + +ath10k_dbg (ar,ATH10K_DBG_BOOT ,"boot cal file downloaded\n" ); + +return 0 ; +} + +static int ath10k_download_cal_dt (struct ath10k *ar,const char *dt_name) +{ +struct device_node *node; +int data_len; +void *data; +int ret; + + node = ar->dev->of_node; +if (!node) +/* Device Tree is optional, don't print any warnings if +* there's no node for ath10k. +*/ +return -ENOENT ; + +if (!of_get_property (node, dt_name, &data_len)) { +/* The calibration data node is optional */ +return -ENOENT ; + } + +if (data_len != ar->hw_params.cal_data_len) { +ath10k_warn (ar,"invalid calibration data length in DT: %d\n" , + data_len); + ret = -EMSGSIZE ; + goto out; + } + + data =kmalloc (data_len,GFP_KERNEL ); +if (!data) { + ret = -ENOMEM ; + goto out; + } + + ret =of_property_read_u8_array (node, dt_name, data, data_len); +if (ret) { +ath10k_warn (ar,"failed to read calibration data from DT: %d\n" , + ret); + goto out_free; + } + + ret =ath10k_download_board_data (ar, data, data_len); +if (ret) { +ath10k_warn (ar,"failed to download calibration data from Device Tree: %d\n" , + ret); + goto out_free; + } + + ret =0 ; + +out_free: +kfree (data); + +out: +return ret; +} + +static int ath10k_download_cal_eeprom (struct ath10k *ar) +{ +size_t data_len; +void *data =NULL ; +int ret; + + ret =ath10k_hif_fetch_cal_eeprom (ar, &data, &data_len); +if (ret) { +if (ret != -EOPNOTSUPP ) +ath10k_warn (ar,"failed to read calibration data from EEPROM: %d\n" , + ret); + goto out_free; + } + + ret =ath10k_download_board_data (ar, data, data_len); +if (ret) { +ath10k_warn (ar,"failed to download calibration data from EEPROM: %d\n" , + ret); + goto out_free; + } + + ret =0 ; + +out_free: +kfree (data); + +return ret; +} +int ath10k_core_fetch_firmware_api_n (struct ath10k *ar,const char *name,struct ath10k_fw_file *fw_file) {
Signature · 7 lines
2.17.1 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 4 lines · Sathishkumar Muruganandam
Just moving functions down in the file, no functional changes.
Signed-off-by Sathishkumar Muruganandam <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Try to make the patch titles always unique, I changed this in pending branch to:
ath10k: refactoring needed for extended board data download
Signature · 9 lines
https://patchwork.kernel.org/patch/10575359/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 4 lines · Sathishkumar Muruganandam
Just moving functions down in the file, no functional changes.
Signed-off-by Sathishkumar Muruganandam <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Try to make the patch titles always unique, I changed this in pending branch to:
ath10k: refactoring needed for extended board data download
Signature · 3 lines
https://patchwork.kernel.org/patch/10575359/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 72 lines · Sathishkumar Muruganandam
To support dual-band variant of QCA9984, new extended board data (eBDF) is introduced since existing board data ran out of space.
Below is the brief implementation & design detail,
----------------------------------------------------1. New OTP changes to inform eBDF support in existing OTP download to fetch board ID and chip ID. This is backward compatible and older card sends 0 by default for eBDF support bit (bit 18 of OTP response) we check in ath10k driver.
2. If eBDF is supported, then we need to fetch eBDF ID which is bundled in downloaded board data. So again OTP is executed for knowing the eBDF ID. This is done once we set '
board_data_initialized' bit. If eBDF ID returned is zero, we continue booting with previous board data downloaded.3. Based on the eBDF ID fetched, ath10k driver tries to download the extended board data to a new offset ahead of already downloaded board data address.
4. A new BD IE type,
ATH10K_BD_IE_BOARD_EXTis added to differentiate in bundling eBDF separately in board-2.bin and also to parse through board bundle for eBDF download in ath10k boot.5. If eBDF is not present in the board-2.bin bundle or when board ID is zero, we do a fallback boot to "eboard.bin" in the same QCA9984/hw1.0 dir. This is same as done to existing "board.bin" if board ID is not present in board-2.bin bundle.
Current design is that eBDF size will be 2KB and eBDF ID will be byte value.
Tested the above changes with dual-band variant of QCA9984 card. OTP update needed for the test will be part of next FW release 10.4-3.6-xxxx.
Below are the logs with ath10k BOOT debugs enabled.
First OTP response :
---------------------
..
boot upload otp to0x1234len 9478 for board id
boot get otp board id result0x00040400board_id1chip_id0ext_bid_support1 ..Second OTP response :
---------------------
..
boot upload otp to0x1234len 9478 for ext board id boot get otp ext board id result0x00000005ext_board_id5 boot using eboard name 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5' ..Extended board data download:
------------------------------
..
board name00000000: 62 75 73 3d 70 63 69 2c 62 6d 69 2d 63 68 69 70 bus=pci,bmi-chip 00000010: 2d 69 64 3d 30 2c 62 6d 69 2d 65 62 6f 61 72 64 -id=0,bmi-eboard 00000020: 2d 69 64 3d 35 -id=5boot found match for name 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5' boot found eboard data for 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5' using board api 2
boot writing ext board data to addr0xc3000
..Fallback Extended board data download from "eboard.bin":
---------------------------------------------------------
..
board name00000000: 62 75 73 3d 70 63 69 2c 62 6d 69 2d 63 68 69 70 bus=pci,bmi-chip 00000010: 2d 69 64 3d 30 2c 62 6d 69 2d 62 6f 61 72 64 2d -id=0,bmi-board- 00000020: 69 64 3d 31 30 id=10
Quoted 8 lines
failed to fetch board data for bus=pci,bmi-chip-id=0,bmi-eboard-id=5 from ath10k/QCA9984/hw1.0/board-2.bin boot fw request 'ath10k/QCA9984/hw1.0/eboard.bin': 0
using board api 1
boot writing ext board data to addr0xc3000
..Signed-off-by Sathishkumar Muruganandam <[email protected]>Signed-off-by Kalle Valo <[email protected]>
This introduced a new checkpatch warning:
drivers/net/wireless/ath/ath10k/core.c:1059: line over 90 characters
I fixed this in the pending branch.
Signature · 9 lines
https://patchwork.kernel.org/patch/10575361/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 72 lines · Sathishkumar Muruganandam
To support dual-band variant of QCA9984, new extended board data (eBDF) is introduced since existing board data ran out of space.
Below is the brief implementation & design detail,
----------------------------------------------------1. New OTP changes to inform eBDF support in existing OTP download to fetch board ID and chip ID. This is backward compatible and older card sends 0 by default for eBDF support bit (bit 18 of OTP response) we check in ath10k driver.
2. If eBDF is supported, then we need to fetch eBDF ID which is bundled in downloaded board data. So again OTP is executed for knowing the eBDF ID. This is done once we set '
board_data_initialized' bit. If eBDF ID returned is zero, we continue booting with previous board data downloaded.3. Based on the eBDF ID fetched, ath10k driver tries to download the extended board data to a new offset ahead of already downloaded board data address.
4. A new BD IE type,
ATH10K_BD_IE_BOARD_EXTis added to differentiate in bundling eBDF separately in board-2.bin and also to parse through board bundle for eBDF download in ath10k boot.5. If eBDF is not present in the board-2.bin bundle or when board ID is zero, we do a fallback boot to "eboard.bin" in the same QCA9984/hw1.0 dir. This is same as done to existing "board.bin" if board ID is not present in board-2.bin bundle.
Current design is that eBDF size will be 2KB and eBDF ID will be byte value.
Tested the above changes with dual-band variant of QCA9984 card. OTP update needed for the test will be part of next FW release 10.4-3.6-xxxx.
Below are the logs with ath10k BOOT debugs enabled.
First OTP response :
---------------------
..
boot upload otp to0x1234len 9478 for board id
boot get otp board id result0x00040400board_id1chip_id0ext_bid_support1 ..Second OTP response :
---------------------
..
boot upload otp to0x1234len 9478 for ext board id boot get otp ext board id result0x00000005ext_board_id5 boot using eboard name 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5' ..Extended board data download:
------------------------------
..
board name00000000: 62 75 73 3d 70 63 69 2c 62 6d 69 2d 63 68 69 70 bus=pci,bmi-chip 00000010: 2d 69 64 3d 30 2c 62 6d 69 2d 65 62 6f 61 72 64 -id=0,bmi-eboard 00000020: 2d 69 64 3d 35 -id=5boot found match for name 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5' boot found eboard data for 'bus=pci,bmi-chip-id=0,bmi-eboard-id=5' using board api 2
boot writing ext board data to addr0xc3000
..Fallback Extended board data download from "eboard.bin":
---------------------------------------------------------
..
board name00000000: 62 75 73 3d 70 63 69 2c 62 6d 69 2d 63 68 69 70 bus=pci,bmi-chip 00000010: 2d 69 64 3d 30 2c 62 6d 69 2d 62 6f 61 72 64 2d -id=0,bmi-board- 00000020: 69 64 3d 31 30 id=10
Quoted 8 lines
failed to fetch board data for bus=pci,bmi-chip-id=0,bmi-eboard-id=5 from ath10k/QCA9984/hw1.0/board-2.bin boot fw request 'ath10k/QCA9984/hw1.0/eboard.bin': 0
using board api 1
boot writing ext board data to addr0xc3000
..Signed-off-by Sathishkumar Muruganandam <[email protected]>Signed-off-by Kalle Valo <[email protected]>
This introduced a new checkpatch warning:
drivers/net/wireless/ath/ath10k/core.c:1059: line over 90 characters
I fixed this in the pending branch.
Signature · 3 lines
https://patchwork.kernel.org/patch/10575361/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 4 lines · Sathishkumar Muruganandam
Just moving functions down in the file, no functional changes.
Signed-off-by Sathishkumar Muruganandam <[email protected]>Signed-off-by Kalle Valo <[email protected]>
2 patches applied to ath-next branch of ath.git, thanks.
5849ed48d226 ath10k: refactoring needed for extended board data download 31324d17976e ath10k: support extended board data download for dual-band QCA9984
Signature · 9 lines
https://patchwork.kernel.org/patch/10575359/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Quoted 4 lines · Sathishkumar Muruganandam
Just moving functions down in the file, no functional changes.
Signed-off-by Sathishkumar Muruganandam <[email protected]>Signed-off-by Kalle Valo <[email protected]>
2 patches applied to ath-next branch of ath.git, thanks.
5849ed48d226 ath10k: refactoring needed for extended board data download 31324d17976e ath10k: support extended board data download for dual-band QCA9984
Signature · 3 lines
https://patchwork.kernel.org/patch/10575359/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches