1 From: Sven Eckelmann <sven.eckelmann@openmesh.com>
2 Date: Fri, 10 Mar 2017 09:06:15 +0100
3 Subject: ath10k: search DT for qcom,ath10k-calibration-variant
5 Board Data File (BDF) is loaded upon driver boot-up procedure. The right
6 board data file is identified on QCA4019 using bus, bmi-chip-id and
9 The problem, however, can occur when the (default) board data file cannot
10 fulfill the vendor requirements and it is necessary to use a different
13 This problem was solved for SMBIOS by adding a special SMBIOS type 0xF8.
14 Something similar has to be provided for systems without SMBIOS but with
15 device trees. No solution was specified by QCA and therefore a new one has
16 to be found for ath10k.
18 The device tree requires addition strings to define the variant name
22 qcom,ath10k-calibration-variant = "RT-AC58U";
27 qcom,ath10k-calibration-variant = "RT-AC58U";
30 This would create the boarddata identifiers for the board-2.bin search
32 * bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U
33 * bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U
35 Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
37 Origin: other, https://patchwork.kernel.org/patch/9615185/
40 --- a/drivers/net/wireless/ath/ath10k/core.c
41 +++ b/drivers/net/wireless/ath/ath10k/core.c
42 @@ -860,6 +860,25 @@ static int ath10k_core_check_smbios(stru
46 +static int ath10k_core_check_dt(struct ath10k *ar)
48 + struct device_node *node;
49 + const char *variant = NULL;
51 + node = ar->dev->of_node;
55 + of_property_read_string(node, "qcom,ath10k-calibration-variant",
60 + strscpy(ar->id.bdf_ext, variant, sizeof(ar->id.bdf_ext));
65 static int ath10k_download_and_run_otp(struct ath10k *ar)
67 u32 result, address = ar->hw_params.patch_load_addr;
68 @@ -1231,19 +1250,19 @@ static int ath10k_core_create_board_name
69 /* strlen(',variant=') + strlen(ar->id.bdf_ext) */
70 char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 };
72 + if (ar->id.bdf_ext[0] != '\0')
73 + scnprintf(variant, sizeof(variant), ",variant=%s",
76 if (ar->id.bmi_ids_valid) {
77 scnprintf(name, name_len,
78 - "bus=%s,bmi-chip-id=%d,bmi-board-id=%d",
79 + "bus=%s,bmi-chip-id=%d,bmi-board-id=%d%s",
80 ath10k_bus_str(ar->hif.bus),
82 - ar->id.bmi_board_id);
83 + ar->id.bmi_board_id, variant);
87 - if (ar->id.bdf_ext[0] != '\0')
88 - scnprintf(variant, sizeof(variant), ",variant=%s",
91 scnprintf(name, name_len,
92 "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x%s",
93 ath10k_bus_str(ar->hif.bus),
94 @@ -2343,7 +2362,11 @@ static int ath10k_core_probe_fw(struct a
96 ret = ath10k_core_check_smbios(ar);
98 - ath10k_dbg(ar, ATH10K_DBG_BOOT, "bdf variant name not set.\n");
99 + ath10k_dbg(ar, ATH10K_DBG_BOOT, "SMBIOS bdf variant name not set.\n");
101 + ret = ath10k_core_check_dt(ar);
103 + ath10k_dbg(ar, ATH10K_DBG_BOOT, "DT bdf variant name not set.\n");
105 ret = ath10k_core_fetch_board_file(ar);