Re: [PATCH 2/4] Bluetooth: qca: add WCN3950 support

From: Dmitry Baryshkov
Date: Sat Feb 01 2025 - 05:51:36 EST


On Sat, Feb 01, 2025 at 11:18:13AM +0200, Dmitry Baryshkov wrote:
> WCN3950 is another example of the WCN39xx BT/WiFI family of chips. It
> requires different firmware files and has different current
> requirements, so add it as a separate SoC type.
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>
> ---
> drivers/bluetooth/btqca.c | 9 +++++++++
> drivers/bluetooth/btqca.h | 1 +
> drivers/bluetooth/hci_qca.c | 25 +++++++++++++++++++++++++
> 3 files changed, 35 insertions(+)
>
> diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
> index cdf09d9a9ad27c080f27c5fe8d61d76085e1fd2c..4d259d8447774ac7adfcc44d7cfb5bf41774289c 100644
> --- a/drivers/bluetooth/btqca.c
> +++ b/drivers/bluetooth/btqca.c
> @@ -821,6 +821,10 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
> snprintf(config.fwname, sizeof(config.fwname),
> "qca/crbtfw%02x.tlv", rom_ver);
> break;
> + case QCA_WCN3950:
> + snprintf(config.fwname, sizeof(config.fwname),
> + "qca/cmbtfw%02x.tlv", rom_ver);
> + break;
> case QCA_WCN3988:
> snprintf(config.fwname, sizeof(config.fwname),
> "qca/apbtfw%02x.tlv", rom_ver);
> @@ -891,6 +895,10 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
> "qca/crnv%02x.bin", rom_ver);
> }
> break;
> + case QCA_WCN3950:
> + snprintf(config.fwname, sizeof(config.fwname),
> + "qca/cmnv%02x.bin", rom_ver);

WCN3950 1.3 might need to use additional NVM variants. I'll send the
updated patchset tomorrow. The RB1 board uses version 1.2 of the chip.

> + break;
> case QCA_WCN3988:
> snprintf(config.fwname, sizeof(config.fwname),
> "qca/apnv%02x.bin", rom_ver);
> @@ -948,6 +956,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
> * VsMsftOpCode.
> */
> switch (soc_type) {
> + case QCA_WCN3950:
> case QCA_WCN3988:
> case QCA_WCN3990:
> case QCA_WCN3991:
> diff --git a/drivers/bluetooth/btqca.h b/drivers/bluetooth/btqca.h
> index 9d28c88002257bae31249457b98a5df1df26efe4..10ba8ebfe80fa43827e5c05f9ad643ecb2cea872 100644
> --- a/drivers/bluetooth/btqca.h
> +++ b/drivers/bluetooth/btqca.h
> @@ -145,6 +145,7 @@ enum qca_btsoc_type {
> QCA_INVALID = -1,
> QCA_AR3002,
> QCA_ROME,
> + QCA_WCN3950,
> QCA_WCN3988,
> QCA_WCN3990,
> QCA_WCN3998,
> diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> index 0ac2168f1dc4f8ae2f7a3b2912e7f5b5b8115cac..b39889ce0e8ff9d97f72eb8e70cb9c6825984c82 100644
> --- a/drivers/bluetooth/hci_qca.c
> +++ b/drivers/bluetooth/hci_qca.c
> @@ -623,6 +623,7 @@ static int qca_open(struct hci_uart *hu)
> qcadev = serdev_device_get_drvdata(hu->serdev);
>
> switch (qcadev->btsoc_type) {
> + case QCA_WCN3950:
> case QCA_WCN3988:
> case QCA_WCN3990:
> case QCA_WCN3991:
> @@ -1366,6 +1367,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate)
>
> /* Give the controller time to process the request */
> switch (qca_soc_type(hu)) {
> + case QCA_WCN3950:
> case QCA_WCN3988:
> case QCA_WCN3990:
> case QCA_WCN3991:
> @@ -1452,6 +1454,7 @@ static unsigned int qca_get_speed(struct hci_uart *hu,
> static int qca_check_speeds(struct hci_uart *hu)
> {
> switch (qca_soc_type(hu)) {
> + case QCA_WCN3950:
> case QCA_WCN3988:
> case QCA_WCN3990:
> case QCA_WCN3991:
> @@ -1494,6 +1497,7 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
> * changing the baudrate of chip and host.
> */
> switch (soc_type) {
> + case QCA_WCN3950:
> case QCA_WCN3988:
> case QCA_WCN3990:
> case QCA_WCN3991:
> @@ -1528,6 +1532,7 @@ static int qca_set_speed(struct hci_uart *hu, enum qca_speed_type speed_type)
>
> error:
> switch (soc_type) {
> + case QCA_WCN3950:
> case QCA_WCN3988:
> case QCA_WCN3990:
> case QCA_WCN3991:
> @@ -1746,6 +1751,7 @@ static int qca_regulator_init(struct hci_uart *hu)
> }
>
> switch (soc_type) {
> + case QCA_WCN3950:
> case QCA_WCN3988:
> case QCA_WCN3990:
> case QCA_WCN3991:
> @@ -1776,6 +1782,7 @@ static int qca_regulator_init(struct hci_uart *hu)
> qca_set_speed(hu, QCA_INIT_SPEED);
>
> switch (soc_type) {
> + case QCA_WCN3950:
> case QCA_WCN3988:
> case QCA_WCN3990:
> case QCA_WCN3991:
> @@ -1807,6 +1814,7 @@ static int qca_power_on(struct hci_dev *hdev)
> return 0;
>
> switch (soc_type) {
> + case QCA_WCN3950:
> case QCA_WCN3988:
> case QCA_WCN3990:
> case QCA_WCN3991:
> @@ -1891,6 +1899,7 @@ static int qca_setup(struct hci_uart *hu)
> soc_name = "qca2066";
> break;
>
> + case QCA_WCN3950:
> case QCA_WCN3988:
> case QCA_WCN3990:
> case QCA_WCN3991:
> @@ -1925,6 +1934,7 @@ static int qca_setup(struct hci_uart *hu)
> clear_bit(QCA_SSR_TRIGGERED, &qca->flags);
>
> switch (soc_type) {
> + case QCA_WCN3950:
> case QCA_WCN3988:
> case QCA_WCN3990:
> case QCA_WCN3991:
> @@ -1958,6 +1968,7 @@ static int qca_setup(struct hci_uart *hu)
> }
>
> switch (soc_type) {
> + case QCA_WCN3950:
> case QCA_WCN3988:
> case QCA_WCN3990:
> case QCA_WCN3991:
> @@ -2046,6 +2057,17 @@ static const struct hci_uart_proto qca_proto = {
> .dequeue = qca_dequeue,
> };
>
> +static const struct qca_device_data qca_soc_data_wcn3950 __maybe_unused = {
> + .soc_type = QCA_WCN3950,
> + .vregs = (struct qca_vreg []) {
> + { "vddio", 15000 },
> + { "vddxo", 60000 },
> + { "vddrf", 155000 },
> + { "vddch0", 585000 },
> + },
> + .num_vregs = 4,
> +};
> +
> static const struct qca_device_data qca_soc_data_wcn3988 __maybe_unused = {
> .soc_type = QCA_WCN3988,
> .vregs = (struct qca_vreg []) {
> @@ -2338,6 +2360,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
> qcadev->btsoc_type = QCA_ROME;
>
> switch (qcadev->btsoc_type) {
> + case QCA_WCN3950:
> case QCA_WCN3988:
> case QCA_WCN3990:
> case QCA_WCN3991:
> @@ -2374,6 +2397,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)
> break;
> }
> fallthrough;
> + case QCA_WCN3950:
> case QCA_WCN3988:
> case QCA_WCN3990:
> case QCA_WCN3991:
> @@ -2683,6 +2707,7 @@ static const struct of_device_id qca_bluetooth_of_match[] = {
> { .compatible = "qcom,qca6174-bt" },
> { .compatible = "qcom,qca6390-bt", .data = &qca_soc_data_qca6390},
> { .compatible = "qcom,qca9377-bt" },
> + { .compatible = "qcom,wcn3950-bt", .data = &qca_soc_data_wcn3950},
> { .compatible = "qcom,wcn3988-bt", .data = &qca_soc_data_wcn3988},
> { .compatible = "qcom,wcn3990-bt", .data = &qca_soc_data_wcn3990},
> { .compatible = "qcom,wcn3991-bt", .data = &qca_soc_data_wcn3991},
>
> --
> 2.39.5
>

--
With best wishes
Dmitry