mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
To: Jonas Gorski <jonas.gorski@gmail.com>
Cc: jjohnson@kernel.org, johannes@sipsolutions.net, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org,
	ath11k@lists.infradead.org, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	krzk@kernel.org
Subject: Re: [PATCH v3 ath-current 1/2] wifi: ath11k: add usecase firmware handling based on device compatible
Date: Tue, 20 Jan 2026 09:31:43 +0800	[thread overview]
Message-ID: <1e19474c-4b0f-4e68-84af-4ffe9c8c0f8b@oss.qualcomm.com> (raw)
In-Reply-To: <CAOiHx=nBLtSFNhuRZrHn5z8bCrA5nyuS9G8B0nh-WTiFU_HUMw@mail.gmail.com>



On 1/19/2026 11:56 PM, Jonas Gorski wrote:
> Hi,
> 
> On Mon, Jan 19, 2026 at 3:04 PM Miaoqing Pan
> <miaoqing.pan@oss.qualcomm.com> wrote:
>>
>> For M.2 WLAN chips, there is no suitable DTS node to specify the
>> firmware-name property. In addition, assigning firmware for the
>> M.2 PCIe interface causes chips that do not use usecase specific
>> firmware to fail. Therefore, abandoning the approach of specifying
>> firmware in DTS. As an alternative, propose a static lookup table
>> mapping device compatible to firmware names. Currently, only WCN6855
>> HW2.1 requires this.
>>
>> However, support for the firmware-name property is retained to keep
>> the ABI backwards compatible.
>>
>> For details on usecase specific firmware, see:
>> https://lore.kernel.org/all/20250522013444.1301330-3-miaoqing.pan@oss.qualcomm.com/.
>>
>> Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-04685-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1
>>
>> Fixes: edbbc647c4f3 ("wifi: ath11k: support usercase-specific firmware overrides")
>> Signed-off-by: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com>
>> ---
>>   drivers/net/wireless/ath/ath11k/core.c | 36 ++++++++++++++++++++++++++
>>   drivers/net/wireless/ath/ath11k/core.h |  4 +++
>>   2 files changed, 40 insertions(+)
>>
>> diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
>> index de84906d1b27..1cf7f4e601c3 100644
>> --- a/drivers/net/wireless/ath/ath11k/core.c
>> +++ b/drivers/net/wireless/ath/ath11k/core.c
>> @@ -1044,6 +1044,42 @@ static const struct dmi_system_id ath11k_pm_quirk_table[] = {
>>          {}
>>   };
>>
>> +static const struct __ath11k_core_usecase_firmware_table {
>> +       u32 hw_rev;
>> +       const char *compatible;
>> +       const char *firmware_name;
>> +} ath11k_core_usecase_firmware_table[] = {
>> +       { ATH11K_HW_WCN6855_HW21, "qcom,lemans-evk", "nfa765"},
>> +       { ATH11K_HW_WCN6855_HW21, "qcom,monaco-evk", "nfa765"},
>> +       { ATH11K_HW_WCN6855_HW21, "qcom,hamoa-iot-evk", "nfa765"},
>> +       { /* Sentinel */ }
>> +};
>> +
>> +const char *ath11k_core_get_usecase_firmware(struct ath11k_base *ab)
>> +{
>> +       struct device_node *root __free(device_node) = of_find_node_by_path("/");
>> +       const struct __ath11k_core_usecase_firmware_table *entry = NULL;
>> +       int i, count = of_property_count_strings(root, "compatible");
>> +       const char *compatible = NULL;
>> +
>> +       for (i = 0; i < count; i++) {
>> +               if (of_property_read_string_index(root, "compatible", i,
>> +                                                 &compatible) < 0)
>> +                       continue;
>> +
>> +               entry = ath11k_core_usecase_firmware_table;
>> +               while (entry->compatible) {
>> +                       if (ab->hw_rev == entry->hw_rev &&
>> +                           !strcmp(entry->compatible, compatible))
> 
> You should be able to replace most of this code by using
> of_machine_is_compatible(entry->compatible) instead.
> 

Thanks, will update.

>> +                               return entry->firmware_name;
>> +                       entry++;
>> +               }
>> +       }
>> +
>> +       return NULL;
>> +}
>> +EXPORT_SYMBOL(ath11k_core_get_usecase_firmware);
>> +
>>   void ath11k_fw_stats_pdevs_free(struct list_head *head)
>>   {
> 
> Best regards,
> Jonas


  reply	other threads:[~2026-01-20  1:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-19 14:02 [PATCH v3 ath-current 0/2] " Miaoqing Pan
2026-01-19 14:02 ` [PATCH v3 ath-current 1/2] " Miaoqing Pan
2026-01-19 15:56   ` Jonas Gorski
2026-01-20  1:31     ` Miaoqing Pan [this message]
2026-01-19 14:02 ` [PATCH v3 ath-current 2/2] dt-bindings: net: wireless: ath11k-pci: deprecate 'firmware-name' property Miaoqing Pan
2026-01-19 14:48   ` Krzysztof Kozlowski
2026-01-20  1:31     ` Miaoqing Pan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1e19474c-4b0f-4e68-84af-4ffe9c8c0f8b@oss.qualcomm.com \
    --to=miaoqing.pan@oss.qualcomm.com \
    --cc=ath11k@lists.infradead.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jjohnson@kernel.org \
    --cc=johannes@sipsolutions.net \
    --cc=jonas.gorski@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®