mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] Bluetooth: qca: add Qualcomm WCN3950 BT/WiFi chip support
@ 2025-02-01  9:18 Dmitry Baryshkov
  2025-02-01  9:18 ` [PATCH 1/4] dt-bindings: net: bluetooth: qualcomm: document WCN3950 Dmitry Baryshkov
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Dmitry Baryshkov @ 2025-02-01  9:18 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Balakrishna Godavarthi,
	Rocky Liao, Bjorn Andersson, Konrad Dybcio
  Cc: linux-bluetooth, devicetree, linux-kernel, linux-arm-msm

Qualcomm Robotics RB1 platform uses a new member of the WCN39xx family
of BT/WiFi chips. Add support for this member of the family and enable
it to be used on the RB1 board.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
Dmitry Baryshkov (4):
      dt-bindings: net: bluetooth: qualcomm: document WCN3950
      Bluetooth: qca: add WCN3950 support
      arm64: dts: qcom: qcm2290: add UART3 device
      arm64: dts: qcom: qrb2210-rb1: add Bluetooth support

 .../bindings/net/bluetooth/qualcomm-bluetooth.yaml |  2 +
 arch/arm64/boot/dts/qcom/qcm2290.dtsi              | 15 ++++
 arch/arm64/boot/dts/qcom/qrb2210-rb1.dts           | 81 ++++++++++++++++++++++
 drivers/bluetooth/btqca.c                          |  9 +++
 drivers/bluetooth/btqca.h                          |  1 +
 drivers/bluetooth/hci_qca.c                        | 25 +++++++
 6 files changed, 133 insertions(+)
---
base-commit: 88b6bfc04cc5f60ce79c25cd27fe83f7fb4468bf
change-id: 20250201-rb1-bt-cec7a314991d

Best regards,
-- 
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/4] dt-bindings: net: bluetooth: qualcomm: document WCN3950
  2025-02-01  9:18 [PATCH 0/4] Bluetooth: qca: add Qualcomm WCN3950 BT/WiFi chip support Dmitry Baryshkov
@ 2025-02-01  9:18 ` Dmitry Baryshkov
  2025-02-01  9:18 ` [PATCH 2/4] Bluetooth: qca: add WCN3950 support Dmitry Baryshkov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Dmitry Baryshkov @ 2025-02-01  9:18 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Balakrishna Godavarthi,
	Rocky Liao, Bjorn Andersson, Konrad Dybcio
  Cc: linux-bluetooth, devicetree, linux-kernel, linux-arm-msm

WCN3950 is another member of the WiFi/BT WCN39xx family of the chips. It
requires different firmware, so document it as a new compat string.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml b/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml
index a72152f7e29b490003114dae1e36df85cba384df..6353a336f382e4dd689d1f50a624079aa83b2ffa 100644
--- a/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml
+++ b/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml
@@ -19,6 +19,7 @@ properties:
       - qcom,qca2066-bt
       - qcom,qca6174-bt
       - qcom,qca9377-bt
+      - qcom,wcn3950-bt
       - qcom,wcn3988-bt
       - qcom,wcn3990-bt
       - qcom,wcn3991-bt
@@ -138,6 +139,7 @@ allOf:
         compatible:
           contains:
             enum:
+              - qcom,wcn3950-bt
               - qcom,wcn3988-bt
               - qcom,wcn3990-bt
               - qcom,wcn3991-bt

-- 
2.39.5


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 2/4] Bluetooth: qca: add WCN3950 support
  2025-02-01  9:18 [PATCH 0/4] Bluetooth: qca: add Qualcomm WCN3950 BT/WiFi chip support Dmitry Baryshkov
  2025-02-01  9:18 ` [PATCH 1/4] dt-bindings: net: bluetooth: qualcomm: document WCN3950 Dmitry Baryshkov
@ 2025-02-01  9:18 ` Dmitry Baryshkov
  2025-02-01 10:51   ` Dmitry Baryshkov
  2025-02-01 12:15   ` Paul Menzel
  2025-02-01  9:18 ` [PATCH 3/4] arm64: dts: qcom: qcm2290: add UART3 device Dmitry Baryshkov
  2025-02-01  9:18 ` [PATCH 4/4] arm64: dts: qcom: qrb2210-rb1: add Bluetooth support Dmitry Baryshkov
  3 siblings, 2 replies; 11+ messages in thread
From: Dmitry Baryshkov @ 2025-02-01  9:18 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Balakrishna Godavarthi,
	Rocky Liao, Bjorn Andersson, Konrad Dybcio
  Cc: linux-bluetooth, devicetree, linux-kernel, linux-arm-msm

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@linaro.org>
---
 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);
+			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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/4] arm64: dts: qcom: qcm2290: add UART3 device
  2025-02-01  9:18 [PATCH 0/4] Bluetooth: qca: add Qualcomm WCN3950 BT/WiFi chip support Dmitry Baryshkov
  2025-02-01  9:18 ` [PATCH 1/4] dt-bindings: net: bluetooth: qualcomm: document WCN3950 Dmitry Baryshkov
  2025-02-01  9:18 ` [PATCH 2/4] Bluetooth: qca: add WCN3950 support Dmitry Baryshkov
@ 2025-02-01  9:18 ` Dmitry Baryshkov
  2025-02-01 15:19   ` Konrad Dybcio
  2025-02-01  9:18 ` [PATCH 4/4] arm64: dts: qcom: qrb2210-rb1: add Bluetooth support Dmitry Baryshkov
  3 siblings, 1 reply; 11+ messages in thread
From: Dmitry Baryshkov @ 2025-02-01  9:18 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Balakrishna Godavarthi,
	Rocky Liao, Bjorn Andersson, Konrad Dybcio
  Cc: linux-bluetooth, devicetree, linux-kernel, linux-arm-msm

On QCM2290-based devices the SE3 is used for the Bluetooth chips. Add
corresponding device node.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 arch/arm64/boot/dts/qcom/qcm2290.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/qcm2290.dtsi b/arch/arm64/boot/dts/qcom/qcm2290.dtsi
index f0746123e594d5ce5cc314c956eaca11556a9211..5f92eb16482a0ea5f8436cfa7e55849f171ebd24 100644
--- a/arch/arm64/boot/dts/qcom/qcm2290.dtsi
+++ b/arch/arm64/boot/dts/qcom/qcm2290.dtsi
@@ -1239,6 +1239,21 @@ &qup_virt SLAVE_QUP_CORE_0 RPM_ALWAYS_TAG>,
 				status = "disabled";
 			};
 
+			uart3: serial@4a8c000 {
+				compatible = "qcom,geni-uart";
+				reg = <0x0 0x04a8c000 0x0 0x4000>;
+				interrupts = <GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&gcc GCC_QUPV3_WRAP0_S3_CLK>;
+				clock-names = "se";
+				interconnects = <&qup_virt MASTER_QUP_CORE_0 RPM_ALWAYS_TAG
+						 &qup_virt SLAVE_QUP_CORE_0 RPM_ALWAYS_TAG>,
+						<&bimc MASTER_APPSS_PROC RPM_ALWAYS_TAG
+						 &config_noc MASTER_APPSS_PROC RPM_ALWAYS_TAG>;
+				interconnect-names = "qup-core",
+						     "qup-config";
+				status = "disabled";
+			};
+
 			i2c4: i2c@4a90000 {
 				compatible = "qcom,geni-i2c";
 				reg = <0x0 0x04a90000 0x0 0x4000>;

-- 
2.39.5


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 4/4] arm64: dts: qcom: qrb2210-rb1: add Bluetooth support
  2025-02-01  9:18 [PATCH 0/4] Bluetooth: qca: add Qualcomm WCN3950 BT/WiFi chip support Dmitry Baryshkov
                   ` (2 preceding siblings ...)
  2025-02-01  9:18 ` [PATCH 3/4] arm64: dts: qcom: qcm2290: add UART3 device Dmitry Baryshkov
@ 2025-02-01  9:18 ` Dmitry Baryshkov
  2025-02-01 15:29   ` Konrad Dybcio
  3 siblings, 1 reply; 11+ messages in thread
From: Dmitry Baryshkov @ 2025-02-01  9:18 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Balakrishna Godavarthi,
	Rocky Liao, Bjorn Andersson, Konrad Dybcio
  Cc: linux-bluetooth, devicetree, linux-kernel, linux-arm-msm

Add support for the onboard WCN3950 BT/WiFi chip. Corresponding firmware
has been merged to linux-firmware and should be available in the next
release.

Bluetooth: hci0: setting up wcn399x
Bluetooth: hci0: QCA Product ID   :0x0000000f
Bluetooth: hci0: QCA SOC Version  :0x40070120
Bluetooth: hci0: QCA ROM Version  :0x00000102
Bluetooth: hci0: QCA Patch Version:0x00000001
Bluetooth: hci0: QCA controller version 0x01200102
Bluetooth: hci0: QCA Downloading qca/cmbtfw12.tlv
Bluetooth: hci0: QCA Downloading qca/cmnv12.bin
Bluetooth: hci0: QCA setup on UART is completed

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 arch/arm64/boot/dts/qcom/qrb2210-rb1.dts | 81 ++++++++++++++++++++++++++++++++
 1 file changed, 81 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
index 7a789b41c2f1887f0c41ae24da2e2fe8915ab13c..9bb2254d3198b18908bb6ba201602aa809592dcb 100644
--- a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
+++ b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
@@ -15,6 +15,7 @@ / {
 
 	aliases {
 		serial0 = &uart4;
+		serial1 = &uart3;
 		sdhc1 = &sdhc_1;
 		sdhc2 = &sdhc_2;
 	};
@@ -549,6 +550,66 @@ can@0 {
 };
 
 &tlmm {
+	uart3_default: uart3-default-state {
+		cts-pins {
+			pins = "gpio8";
+			function = "qup3";
+			drive-strength = <2>;
+			bias-bus-hold;
+		};
+
+		rts-pins {
+			pins = "gpio9";
+			function = "qup3";
+			drive-strength = <2>;
+			bias-disable;
+		};
+
+		tx-pins {
+			pins = "gpio10";
+			function = "qup3";
+			drive-strength = <2>;
+			bias-disable;
+		};
+
+		rx-pins {
+			pins = "gpio11";
+			function = "qup3";
+			drive-strength = <2>;
+			bias-pull-up;
+		};
+	};
+
+	uart3_sleep: uart3-sleep-state {
+		cts-pins {
+			pins = "gpio8";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-bus-hold;
+		};
+
+		rts-pins {
+			pins = "gpio9";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-pull-down;
+		};
+
+		tx-pins {
+			pins = "gpio10";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-pull-up;
+		};
+
+		rx-pins {
+			pins = "gpio11";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-pull-up;
+		};
+	};
+
 	lt9611_rst_pin: lt9611-rst-state {
 		pins = "gpio41";
 		function = "gpio";
@@ -584,6 +645,26 @@ key_volp_n: key-volp-n-state {
 	};
 };
 
+&uart3 {
+	interrupts-extended = <&intc GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH>,
+			      <&tlmm 11 IRQ_TYPE_LEVEL_HIGH>;
+	pinctrl-0 = <&uart3_default>;
+	pinctrl-1 = <&uart3_sleep>;
+	pinctrl-names = "default", "sleep";
+	status = "okay";
+
+	bluetooth {
+		compatible = "qcom,wcn3950-bt";
+
+		vddio-supply = <&pm4125_l15>;
+		vddxo-supply = <&pm4125_l13>;
+		vddrf-supply = <&pm4125_l10>;
+		vddch0-supply = <&pm4125_l22>;
+		enable-gpios = <&tlmm 87 GPIO_ACTIVE_HIGH>;
+		max-speed = <3200000>;
+	};
+};
+
 /* UART connected to the Micro-USB port via a FTDI chip */
 &uart4 {
 	compatible = "qcom,geni-debug-uart";

-- 
2.39.5


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] Bluetooth: qca: add WCN3950 support
  2025-02-01  9:18 ` [PATCH 2/4] Bluetooth: qca: add WCN3950 support Dmitry Baryshkov
@ 2025-02-01 10:51   ` Dmitry Baryshkov
  2025-02-01 12:15   ` Paul Menzel
  1 sibling, 0 replies; 11+ messages in thread
From: Dmitry Baryshkov @ 2025-02-01 10:51 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Balakrishna Godavarthi,
	Rocky Liao, Bjorn Andersson, Konrad Dybcio
  Cc: linux-bluetooth, devicetree, linux-kernel, linux-arm-msm

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@linaro.org>
> ---
>  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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] Bluetooth: qca: add WCN3950 support
  2025-02-01  9:18 ` [PATCH 2/4] Bluetooth: qca: add WCN3950 support Dmitry Baryshkov
  2025-02-01 10:51   ` Dmitry Baryshkov
@ 2025-02-01 12:15   ` Paul Menzel
  2025-02-01 12:47     ` Dmitry Baryshkov
  1 sibling, 1 reply; 11+ messages in thread
From: Paul Menzel @ 2025-02-01 12:15 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Balakrishna Godavarthi,
	Rocky Liao, Bjorn Andersson, Konrad Dybcio, linux-bluetooth,
	devicetree, linux-kernel, linux-arm-msm

Dear Dmitry,


Thank you for the patch.

Am 01.02.25 um 10:18 schrieb Dmitry Baryshkov:
> 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.

Is the firmware publicly available already? (In patch 4/4 you write, it 
is, and I found it [1].) I find such information helpful in commit 
messages, and also the firmware names:

•   qca/cmbtfw12.tlv
•   qca/cmbtfw13.tlv
•   qca/cmnv12.bin
•   qca/cmnv13.bin

Do you also have a datasheet name to review the vregs?

> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>   drivers/bluetooth/btqca.c   |  9 +++++++++
>   drivers/bluetooth/btqca.h   |  1 +
>   drivers/bluetooth/hci_qca.c | 25 +++++++++++++++++++++++++
>   3 files changed, 35 insertions(+)

[…]

The rest looks good.


Kind regards,

Paul


[1]: 
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=421017641e6a6ef389190ac3edf67885183f3de0

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/4] Bluetooth: qca: add WCN3950 support
  2025-02-01 12:15   ` Paul Menzel
@ 2025-02-01 12:47     ` Dmitry Baryshkov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Baryshkov @ 2025-02-01 12:47 UTC (permalink / raw)
  To: Paul Menzel
  Cc: Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Balakrishna Godavarthi,
	Rocky Liao, Bjorn Andersson, Konrad Dybcio, linux-bluetooth,
	devicetree, linux-kernel, linux-arm-msm

On Sat, Feb 01, 2025 at 01:15:29PM +0100, Paul Menzel wrote:
> Dear Dmitry,
> 
> 
> Thank you for the patch.
> 
> Am 01.02.25 um 10:18 schrieb Dmitry Baryshkov:
> > 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.
> 
> Is the firmware publicly available already? (In patch 4/4 you write, it is,
> and I found it [1].) I find such information helpful in commit messages, and
> also the firmware names:
> 
> •   qca/cmbtfw12.tlv
> •   qca/cmbtfw13.tlv
> •   qca/cmnv12.bin
> •   qca/cmnv13.bin

Ack, I will add it.

> Do you also have a datasheet name to review the vregs?

I have it, but I don't think it is public.

> 
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
> >   drivers/bluetooth/btqca.c   |  9 +++++++++
> >   drivers/bluetooth/btqca.h   |  1 +
> >   drivers/bluetooth/hci_qca.c | 25 +++++++++++++++++++++++++
> >   3 files changed, 35 insertions(+)
> 
> […]
> 
> The rest looks good.
> 
> 
> Kind regards,
> 
> Paul
> 
> 
> [1]: https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=421017641e6a6ef389190ac3edf67885183f3de0

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/4] arm64: dts: qcom: qcm2290: add UART3 device
  2025-02-01  9:18 ` [PATCH 3/4] arm64: dts: qcom: qcm2290: add UART3 device Dmitry Baryshkov
@ 2025-02-01 15:19   ` Konrad Dybcio
  2025-02-01 16:22     ` Dmitry Baryshkov
  0 siblings, 1 reply; 11+ messages in thread
From: Konrad Dybcio @ 2025-02-01 15:19 UTC (permalink / raw)
  To: Dmitry Baryshkov, Marcel Holtmann, Luiz Augusto von Dentz,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Balakrishna Godavarthi, Rocky Liao, Bjorn Andersson,
	Konrad Dybcio
  Cc: linux-bluetooth, devicetree, linux-kernel, linux-arm-msm

On 1.02.2025 10:18 AM, Dmitry Baryshkov wrote:
> On QCM2290-based devices the SE3 is used for the Bluetooth chips. Add
> corresponding device node.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>  arch/arm64/boot/dts/qcom/qcm2290.dtsi | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/qcm2290.dtsi b/arch/arm64/boot/dts/qcom/qcm2290.dtsi
> index f0746123e594d5ce5cc314c956eaca11556a9211..5f92eb16482a0ea5f8436cfa7e55849f171ebd24 100644
> --- a/arch/arm64/boot/dts/qcom/qcm2290.dtsi
> +++ b/arch/arm64/boot/dts/qcom/qcm2290.dtsi
> @@ -1239,6 +1239,21 @@ &qup_virt SLAVE_QUP_CORE_0 RPM_ALWAYS_TAG>,
>  				status = "disabled";
>  			};
>  
> +			uart3: serial@4a8c000 {
> +				compatible = "qcom,geni-uart";
> +				reg = <0x0 0x04a8c000 0x0 0x4000>;
> +				interrupts = <GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH>;
> +				clocks = <&gcc GCC_QUPV3_WRAP0_S3_CLK>;
> +				clock-names = "se";
> +				interconnects = <&qup_virt MASTER_QUP_CORE_0 RPM_ALWAYS_TAG
> +						 &qup_virt SLAVE_QUP_CORE_0 RPM_ALWAYS_TAG>,
> +						<&bimc MASTER_APPSS_PROC RPM_ALWAYS_TAG
> +						 &config_noc MASTER_APPSS_PROC RPM_ALWAYS_TAG>;

This path doesn't look quite right.. there'MASTER_APPSS_PROC is only
on one of these.

+ RPM_ACTIVE_TAG

Konrad

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4] arm64: dts: qcom: qrb2210-rb1: add Bluetooth support
  2025-02-01  9:18 ` [PATCH 4/4] arm64: dts: qcom: qrb2210-rb1: add Bluetooth support Dmitry Baryshkov
@ 2025-02-01 15:29   ` Konrad Dybcio
  0 siblings, 0 replies; 11+ messages in thread
From: Konrad Dybcio @ 2025-02-01 15:29 UTC (permalink / raw)
  To: Dmitry Baryshkov, Marcel Holtmann, Luiz Augusto von Dentz,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Balakrishna Godavarthi, Rocky Liao, Bjorn Andersson,
	Konrad Dybcio
  Cc: linux-bluetooth, devicetree, linux-kernel, linux-arm-msm

On 1.02.2025 10:18 AM, Dmitry Baryshkov wrote:
> Add support for the onboard WCN3950 BT/WiFi chip. Corresponding firmware
> has been merged to linux-firmware and should be available in the next
> release.
> 
> Bluetooth: hci0: setting up wcn399x
> Bluetooth: hci0: QCA Product ID   :0x0000000f
> Bluetooth: hci0: QCA SOC Version  :0x40070120
> Bluetooth: hci0: QCA ROM Version  :0x00000102
> Bluetooth: hci0: QCA Patch Version:0x00000001
> Bluetooth: hci0: QCA controller version 0x01200102
> Bluetooth: hci0: QCA Downloading qca/cmbtfw12.tlv
> Bluetooth: hci0: QCA Downloading qca/cmnv12.bin
> Bluetooth: hci0: QCA setup on UART is completed
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

[...]

> +&uart3 {
> +	interrupts-extended = <&intc GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH>,
> +			      <&tlmm 11 IRQ_TYPE_LEVEL_HIGH>;

You need to either /delete-property/ interrupts, or define
interrupts-extended in the base dt

Though thinking about it years after, I'm not super impresesed that
we have to hardcode what always is the UART_RX gpio manually, every time

> +	pinctrl-0 = <&uart3_default>;
> +	pinctrl-1 = <&uart3_sleep>;
> +	pinctrl-names = "default", "sleep";
> +	status = "okay";

Please add a newline before status

Konrad

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/4] arm64: dts: qcom: qcm2290: add UART3 device
  2025-02-01 15:19   ` Konrad Dybcio
@ 2025-02-01 16:22     ` Dmitry Baryshkov
  0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Baryshkov @ 2025-02-01 16:22 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Balakrishna Godavarthi,
	Rocky Liao, Bjorn Andersson, Konrad Dybcio, linux-bluetooth,
	devicetree, linux-kernel, linux-arm-msm

On Sat, Feb 01, 2025 at 04:19:01PM +0100, Konrad Dybcio wrote:
> On 1.02.2025 10:18 AM, Dmitry Baryshkov wrote:
> > On QCM2290-based devices the SE3 is used for the Bluetooth chips. Add
> > corresponding device node.
> > 
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
> >  arch/arm64/boot/dts/qcom/qcm2290.dtsi | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/qcom/qcm2290.dtsi b/arch/arm64/boot/dts/qcom/qcm2290.dtsi
> > index f0746123e594d5ce5cc314c956eaca11556a9211..5f92eb16482a0ea5f8436cfa7e55849f171ebd24 100644
> > --- a/arch/arm64/boot/dts/qcom/qcm2290.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/qcm2290.dtsi
> > @@ -1239,6 +1239,21 @@ &qup_virt SLAVE_QUP_CORE_0 RPM_ALWAYS_TAG>,
> >  				status = "disabled";
> >  			};
> >  
> > +			uart3: serial@4a8c000 {
> > +				compatible = "qcom,geni-uart";
> > +				reg = <0x0 0x04a8c000 0x0 0x4000>;
> > +				interrupts = <GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH>;
> > +				clocks = <&gcc GCC_QUPV3_WRAP0_S3_CLK>;
> > +				clock-names = "se";
> > +				interconnects = <&qup_virt MASTER_QUP_CORE_0 RPM_ALWAYS_TAG
> > +						 &qup_virt SLAVE_QUP_CORE_0 RPM_ALWAYS_TAG>,
> > +						<&bimc MASTER_APPSS_PROC RPM_ALWAYS_TAG
> > +						 &config_noc MASTER_APPSS_PROC RPM_ALWAYS_TAG>;
> 
> This path doesn't look quite right.. there'MASTER_APPSS_PROC is only
> on one of these.

Hmm. I should check my c&p source then.

> 
> + RPM_ACTIVE_TAG
> 
> Konrad

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2025-02-01 16:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-01  9:18 [PATCH 0/4] Bluetooth: qca: add Qualcomm WCN3950 BT/WiFi chip support Dmitry Baryshkov
2025-02-01  9:18 ` [PATCH 1/4] dt-bindings: net: bluetooth: qualcomm: document WCN3950 Dmitry Baryshkov
2025-02-01  9:18 ` [PATCH 2/4] Bluetooth: qca: add WCN3950 support Dmitry Baryshkov
2025-02-01 10:51   ` Dmitry Baryshkov
2025-02-01 12:15   ` Paul Menzel
2025-02-01 12:47     ` Dmitry Baryshkov
2025-02-01  9:18 ` [PATCH 3/4] arm64: dts: qcom: qcm2290: add UART3 device Dmitry Baryshkov
2025-02-01 15:19   ` Konrad Dybcio
2025-02-01 16:22     ` Dmitry Baryshkov
2025-02-01  9:18 ` [PATCH 4/4] arm64: dts: qcom: qrb2210-rb1: add Bluetooth support Dmitry Baryshkov
2025-02-01 15:29   ` Konrad Dybcio

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®