mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Menzel <pmenzel@molgen.mpg.de>
To: Zijun Hu <quic_zijuhu@quicinc.com>
Cc: Marcel Holtmann <marcel@holtmann.org>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	Zijun Hu <zijun_hu@icloud.com>,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	Bjorn Andersson <bjorande@quicinc.com>,
	Aiqun Yu <quic_aiquny@quicinc.com>,
	Cheng Jiang <quic_chejiang@quicinc.com>,
	Johan Hovold <johan@kernel.org>,
	Jens Glathe <jens.glathe@oldschoolsolutions.biz>,
	Steev Klimaszewski <steev@kali.org>
Subject: Re: [PATCH] Bluetooth: qca: Support downloading board id specific NVM for WCN6855
Date: Thu, 14 Nov 2024 10:49:05 +0100	[thread overview]
Message-ID: <4d973d61-27be-4830-880a-a3d74c4bbbc7@molgen.mpg.de> (raw)
In-Reply-To: <20241113-x13s_wcn6855_fix-v1-1-15af0aa2549c@quicinc.com>

Dear Zijun,


Thank you for your patch.

Am 14.11.24 um 07:26 schrieb Zijun Hu:
> Download board id specific NVM instead of default for WCN6855 if board
> id is available, and that is required by Lenovo ThinkPad X13s.

Could you please start by describing the problem/motivation. What does 
not work with the Lenovo ThinkPad X13s before your pacth.

What is variant *g*?

Maybe also describe the file naming convention in the commit message.

> Cc: Bjorn Andersson <bjorande@quicinc.com>
> Cc: Aiqun Yu (Maria) <quic_aiquny@quicinc.com>
> Cc: Cheng Jiang <quic_chejiang@quicinc.com>
> Cc: Johan Hovold <johan@kernel.org>
> Cc: Jens Glathe <jens.glathe@oldschoolsolutions.biz>
> Cc: Steev Klimaszewski <steev@kali.org>
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
> ---
>   drivers/bluetooth/btqca.c | 35 ++++++++++++++++++++++++++++++++---
>   1 file changed, 32 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
> index dfbbac92242a..4f8576cbbab9 100644
> --- a/drivers/bluetooth/btqca.c
> +++ b/drivers/bluetooth/btqca.c
> @@ -717,6 +717,29 @@ static void qca_generate_hsp_nvm_name(char *fwname, size_t max_size,
>   		snprintf(fwname, max_size, "qca/hpnv%02x%s.%x", rom_ver, variant, bid);
>   }
>   
> +static void qca_get_hsp_nvm_name_generic(struct qca_fw_config *cfg,
> +					 struct qca_btsoc_version ver,
> +					 u8 rom_ver, u16 bid)
> +{
> +	const char *variant;
> +
> +	/* hsp gf chip */
> +	if ((le32_to_cpu(ver.soc_id) & QCA_HSP_GF_SOC_MASK) == QCA_HSP_GF_SOC_ID)
> +		variant = "g";
> +	else
> +		variant = "";
> +
> +	if (bid == 0x0)
> +		snprintf(cfg->fwname, sizeof(cfg->fwname), "qca/hpnv%02x%s.bin",
> +			 rom_ver, variant);
> +	else if (bid & 0xff00)
> +		snprintf(cfg->fwname, sizeof(cfg->fwname), "qca/hpnv%02x%s.b%x",
> +			 rom_ver, variant, bid);
> +	else
> +		snprintf(cfg->fwname, sizeof(cfg->fwname), "qca/hpnv%02x%s.b%02x",
> +			 rom_ver, variant, bid);
> +}
> +
>   static inline void qca_get_nvm_name_generic(struct qca_fw_config *cfg,
>   					    const char *stem, u8 rom_ver, u16 bid)
>   {
> @@ -810,8 +833,15 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
>   	/* Give the controller some time to get ready to receive the NVM */
>   	msleep(10);
>   
> -	if (soc_type == QCA_QCA2066 || soc_type == QCA_WCN7850)
> +	switch (soc_type) {
> +	case QCA_QCA2066:
> +	case QCA_WCN6855:
> +	case QCA_WCN7850:
>   		qca_read_fw_board_id(hdev, &boardid);
> +		break;
> +	default:
> +		break;
> +	}
>   
>   	/* Download NVM configuration */
>   	config.type = TLV_TYPE_NVM;
> @@ -848,8 +878,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
>   				 "qca/msnv%02x.bin", rom_ver);
>   			break;
>   		case QCA_WCN6855:
> -			snprintf(config.fwname, sizeof(config.fwname),
> -				 "qca/hpnv%02x.bin", rom_ver);
> +			qca_get_hsp_nvm_name_generic(&config, ver, rom_ver, boardid);
>   			break;
>   		case QCA_WCN7850:
>   			qca_get_nvm_name_generic(&config, "hmt", rom_ver, boardid);


Kind regards,

Paul

  reply	other threads:[~2024-11-14  9:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-14  6:26 Zijun Hu
2024-11-14  9:49 ` Paul Menzel [this message]
2024-11-15  7:13   ` Jens Glathe
2024-11-15 10:07     ` Johan Hovold
2024-11-16 16:10   ` quic_zijuhu
2024-11-15  6:40 ` Jens Glathe
2024-11-16 16:14   ` quic_zijuhu
2024-11-15  7:17 ` Steev Klimaszewski
2024-11-16 16:17   ` quic_zijuhu
2024-11-15 10:01 ` Johan Hovold
2024-11-16 16:07   ` quic_zijuhu
2024-11-15 16:40 ` Luiz Augusto von Dentz
2024-11-16 15:57   ` quic_zijuhu

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=4d973d61-27be-4830-880a-a3d74c4bbbc7@molgen.mpg.de \
    --to=pmenzel@molgen.mpg.de \
    --cc=bjorande@quicinc.com \
    --cc=jens.glathe@oldschoolsolutions.biz \
    --cc=johan@kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=quic_aiquny@quicinc.com \
    --cc=quic_chejiang@quicinc.com \
    --cc=quic_zijuhu@quicinc.com \
    --cc=steev@kali.org \
    --cc=zijun_hu@icloud.com \
    /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®