Skip to contentSkip to conversation

Enable bluetooth on BeagleV-Ahead

PATCH In review Thomas Gerner 3 participants 8 messages Oct 20 – Nov 21

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover Enable bluetooth on BeagleV-Ahead

The single board system BeagleV-Ahead uses a Ampak AP6203BM chip for wifi and bluetooth. Wifi is already enabled for this board. The bluetooth module of the chip connects by UART and PCM to the TH1520 SOC. The PCM interface is currently not used because of missing I2S drivers for the SOC.

This patch set enables bluetooth.

Thomas Gerner (2):
riscv: dts: thead: Enable bluetooth on BeagleV-Ahead
Bluetooth: btbcm: disable read tx power for BeagleV-Ahead

 .../boot/dts/thead/th1520-beaglev-ahead.dts   | 85 +++++++++++++++++++
 drivers/bluetooth/btbcm.c                     | 19 ++++-
 2 files changed, 101 insertions(+), 3 deletions(-)
Signature · 1 line
2.53.0
#1 lore raw

PATCH v2 1/2 Bluetooth: btbcm: disable read tx power for BeagleV-Ahead

The bluetooth module of the Ampak AP6203BM is identified by the btbcm driver as BCM4362A2.

The firmware of the bluetooth module on the BeagleV-Ahead reports a capability of reading LE tx power. However reading fails. To get bluetooth working it is necessary to disable reading of LE tx power on the BeagleV-Ahead board. The disable is implemented in a similar way as for several Apple boards but uses the board compatible identification from the DTB as there is no DMI.

---
No changes in v2

 drivers/bluetooth/btbcm.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
drivers/bluetooth/btbcm.c +16 -3
index 463d59890bef..2d02cc1863d0 100644
@@ -436,6 +436,11 @@ static const struct dmi_system_id disable_broken_read_transmit_power[] = {
 	{ }
 };
 
+static const char *board_broken_read_transmit_power[] __maybe_unused = {
+	"beagle,beaglev-ahead",
+	NULL
+};
+
 static int btbcm_read_info(struct hci_dev *hdev)
 {
 	struct sk_buff *skb;
@@ -537,12 +542,13 @@ static const struct bcm_subver_table bcm_usb_subver_table[] = {
  * This currently only looks up the device tree board appendix,
  * but can be expanded to other mechanisms.
  */
-static const char *btbcm_get_board_name(struct device *dev)
+static const char *btbcm_get_board_name(struct hci_dev *hdev)
 {
 #ifdef CONFIG_OF
 	struct device_node *root __free(device_node) = of_find_node_by_path("/");
 	char *board_type;
 	const char *tmp;
+	const char **s;
 
 	if (!root)
 		return NULL;
@@ -550,8 +556,15 @@ static const char *btbcm_get_board_name(struct device *dev)
 	if (of_property_read_string_index(root, "compatible", 0, &tmp))
 		return NULL;
 
+	/* disable broken Read LE Min/Max Tx Power on first board found in list */
+	for (s = board_broken_read_transmit_power; *s; s++)
+		if (!strcmp(tmp, *s)) {
+			hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER);
+			break;
+		}
+
 	/* get rid of any '/' in the compatible string */
-	board_type = devm_kstrdup(dev, tmp, GFP_KERNEL);
+	board_type = devm_kstrdup(&hdev->dev, tmp, GFP_KERNEL);
 	if (!board_type)
 		return NULL;
 
@@ -577,7 +590,7 @@ int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud
 	const struct firmware *fw;
 	int i, err;
 
-	board_name = btbcm_get_board_name(&hdev->dev);
+	board_name = btbcm_get_board_name(hdev);
 
 	/* Reset */
 	err = btbcm_reset(hdev);
Signature · 1 line
2.53.0
#2 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1189748/

---Test result---

Test Summary:

CheckPatch                    FAIL      1.16 seconds
VerifyFixes                   PASS      3.32 seconds
VerifySignedoff               PASS      0.23 seconds
GitLint                       FAIL      0.54 seconds
SubjectPrefix                 FAIL      0.14 seconds
BuildKernel                   PASS      29.63 seconds
CheckAllWarning               PASS      33.37 seconds
CheckSparse                   PASS      35.85 seconds
BuildKernel32                 PASS      29.33 seconds
CheckKernelLLVM               PASS      33.33 seconds
TestRunnerSetup               PASS      696.58 seconds
TestRunner_l2cap-tester       PASS      12.78 seconds
TestRunner_iso-tester         PASS      10.60 seconds
TestRunner_bnep-tester        PASS      3.05 seconds
TestRunner_mgmt-tester        PASS      87.27 seconds
TestRunner_rfcomm-tester      PASS      4.40 seconds
TestRunner_sco-tester         PASS      5.60 seconds
TestRunner_ioctl-tester       PASS      4.60 seconds
TestRunner_mesh-tester        PASS      5.41 seconds
TestRunner_smp-tester         PASS      4.29 seconds
TestRunner_userchan-tester    PASS      3.14 seconds
TestRunner_6lowpan-tester     PASS      4.34 seconds
IncrementalBuild              PASS      28.77 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[v2,2/2] riscv: dts: thead: Enable bluetooth on BeagleV-Ahead
WARNING: please, no space before tabs
#239: FILE: arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts:397:
+^I^Ishutdown-gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>; ^I/* BT-REG-ON */$

total: 0 errors, 1 warnings, 106 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

/home/runner/work/bluetooth-next/bluetooth-next/src/patch/14902974.patch has style problems, please review.

NOTE: Ignored message types: UNKNOWN_COMMIT_ID

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[v2,2/2] riscv: dts: thead: Enable bluetooth on BeagleV-Ahead

11: B3 Line contains hard tab characters (\t): " - use default pinctrl definition for bluetooth in and out pins"
12: B2 Line has trailing whitespace: " "
12: B3 Line contains hard tab characters (\t): " "
##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix Output:
"Bluetooth: " prefix is not specified in the subject

https://github.com/bluez/bluetooth-next/pull/968

---
Regards,
Linux Bluetooth

maintainer
#3 lore raw

Re: [PATCH v2 1/2] Bluetooth: btbcm: disable read tx power for BeagleV-Ahead

In reply to Thomas Gerner
Quoted 9 lines · Thomas Gerner

The bluetooth module of the Ampak AP6203BM is identified by the btbcm driver as BCM4362A2.

The firmware of the bluetooth module on the BeagleV-Ahead reports a capability of reading LE tx power. However reading fails. To get bluetooth working it is necessary to disable reading of LE tx power on the BeagleV-Ahead board. The disable is implemented in a similar way as for several Apple boards but uses the board compatible identification from the DTB as there is no DMI.

Thanks for sending this patch. Do you know if this is a problem on any other boards with the AP6203BM?

Also, is there an error message for the failed read?

Quoted 12 lines

---
No changes in v2

 drivers/bluetooth/btbcm.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
drivers/bluetooth/btbcm.c +0 -0
index 463d59890bef..2d02cc1863d0 100644

[..]

Quoted 12 lines
drivers/bluetooth/btbcm.c +2 -1
-static const char *btbcm_get_board_name(struct device *dev)
+static const char *btbcm_get_board_name(struct hci_dev *hdev)
 {
 #ifdef CONFIG_OF
 	struct device_node *root __free(device_node) = of_find_node_by_path("/");
 	char *board_type;
 	const char *tmp;
+	const char **s;
 
 	if (!root)
 		return NULL;

drivers/bluetooth/btbcm.c static const char *btbcm_get_board_name(struct device *dev) · line 564

Quoted 9 lines
drivers/bluetooth/btbcm.c +6 -0
@@ -550,8 +556,15 @@ static const char *btbcm_get_board_name(struct device *dev)
 	if (of_property_read_string_index(root, "compatible", 0, &tmp))
 		return NULL;
 
+	/* disable broken Read LE Min/Max Tx Power on first board found in list */
+	for (s = board_broken_read_transmit_power; *s; s++)
+		if (!strcmp(tmp, *s)) {
+			hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER);
+			break;
+		}

It seems that btbcm_get_board_name() only looks up the board name for the firmware file so I think it could be unexpected to set a quirk here. Maybe this would work better?

  static const char * const board_broken_read_transmit_power[] = {
          "beagle,beaglev-ahead",
          NULL
  };

[..]

  if (dmi_first_match(disable_broken_read_transmit_power))
          hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER);

  if (of_machine_compatible_match(board_broken_read_transmit_power))
          hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER);

However, I am not very familiar with Bluetooth drivers so I am hoping Marcel or Luiz can comment too.

Thanks,
Drew

#4 lore raw

Re: [PATCH v2 1/2] Bluetooth: btbcm: disable read tx power for BeagleV-Ahead

Am 21.11.26 um 00:53 schrieb Drew Fustini:

Quoted 12 lines · Thomas Gerner
Quoted 9 lines

The bluetooth module of the Ampak AP6203BM is identified by the btbcm driver as BCM4362A2.

The firmware of the bluetooth module on the BeagleV-Ahead reports a capability of reading LE tx power. However reading fails. To get bluetooth working it is necessary to disable reading of LE tx power on the BeagleV-Ahead board. The disable is implemented in a similar way as for several Apple boards but uses the board compatible identification from the DTB as there is no DMI.

Thanks for sending this patch. Do you know if this is a problem on any other boards with the AP6203BM?

Unfortunately I don't know of other boards with the AP6203BM.

Quoted 1 line

Also, is there an error message for the failed read?

Without the quirk I get this message:

Bluetooth: hci0: unexpected cc 0x204b length: 1 < 3
Bluetooth: hci0: Opcode 0x204b failed: -38

As a result the hci driver stops initializing and Bluetooth is not working.

Quoted 51 lines
Quoted 11 lines

---
No changes in v2

  drivers/bluetooth/btbcm.c | 19 ++++++++++++++++---
  1 file changed, 16 insertions(+), 3 deletions(-)
drivers/bluetooth/btbcm.c +0 -0
index 463d59890bef..2d02cc1863d0 100644

[..]

Quoted 12 lines
drivers/bluetooth/btbcm.c +2 -1
-static const char *btbcm_get_board_name(struct device *dev)
+static const char *btbcm_get_board_name(struct hci_dev *hdev)
  {
  #ifdef CONFIG_OF
  	struct device_node *root __free(device_node) = of_find_node_by_path("/");
  	char *board_type;
  	const char *tmp;
+	const char **s;
 
  	if (!root)
  		return NULL;

drivers/bluetooth/btbcm.c static const char *btbcm_get_board_name(struct device *dev) · line 564

Quoted 9 lines
drivers/bluetooth/btbcm.c +6 -0
@@ -550,8 +556,15 @@ static const char *btbcm_get_board_name(struct device *dev)
  	if (of_property_read_string_index(root, "compatible", 0, &tmp))
  		return NULL;
 
+	/* disable broken Read LE Min/Max Tx Power on first board found in list */
+	for (s = board_broken_read_transmit_power; *s; s++)
+		if (!strcmp(tmp, *s)) {
+			hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER);
+			break;
+		}

It seems that btbcm_get_board_name() only looks up the board name for the firmware file so I think it could be unexpected to set a quirk here. Maybe this would work better?

   static const char * const board_broken_read_transmit_power[] = {
           "beagle,beaglev-ahead",
           NULL
   };
   [..]

   if (dmi_first_match(disable_broken_read_transmit_power))
           hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER);

   if (of_machine_compatible_match(board_broken_read_transmit_power))
           hci_set_quirk(hdev, HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER);
Quoted 2 lines

However, I am not very familiar with Bluetooth drivers so I am hoping Marcel or Luiz can comment too.

My idea was to use the board name at btbcm_get_board_name() as it is already available. However, this suggestion looks is it is more common than my idea.

Quoted 2 lines

Thanks,
Drew

Best regadrs

#5 lore raw

PATCH v2 2/2 riscv: dts: thead: Enable bluetooth on BeagleV-Ahead

In reply to Thomas Gerner

On the BeagleV-Ahead the bluetooth module of the Ampak AP6203BM is identified by the btbcm driver as BCM4362A2. The module is connected by UART4, several gpio pins and an I2S interface. The I2S is currently not used as there is currently no driver.

---
Changes in v2:
- use default pinctrl definition for bluetooth in and out pins

 .../boot/dts/thead/th1520-beaglev-ahead.dts   | 85 +++++++++++++++++++
 1 file changed, 85 insertions(+)
arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +85 -0
index e16484a47653..7161a9d4c61f 100644
@@ -76,6 +76,23 @@ led-5 {
 		};
 	};
 
+	reg_vbat_1v8: regulator-vbat-1v8 {
+		compatible = "regulator-fixed";
+		regulator-boot-on;
+		regulator-max-microvolt = <1800000>;
+		regulator-min-microvolt = <1800000>;
+		regulator-name = "vbat-1v8";
+	};
+
+	reg_vbat_3v3: regulator-vbat-3v3 {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		regulator-boot-on;
+		regulator-max-microvolt = <3300000>;
+		regulator-min-microvolt = <3300000>;
+		regulator-name = "vbat-3v3";
+	};
+
 	hdmi-connector {
 		compatible = "hdmi-connector";
 		type = "d";
@@ -152,6 +169,28 @@ led-pins {
 };
 
 &padctrl0_apsys {
+	bluetooth_pins: bluetooth-0 {
+		in-pins {
+			bias-disable;
+			drive-strength = <1>;
+			function = "gpio";
+			input-enable;
+			input-schmitt-enable;
+			pins = "GPIO2_30";
+			slew-rate = <0>;
+		};
+
+		out-pins {
+			bias-disable;
+			drive-strength = <3>;
+			input-disable;
+			input-schmitt-disable;
+			pins = "SDIO1_DETN",	/* GPIO2_29 */
+			       "SDIO1_WPRTN";	/* GPIO2_28 */
+			slew-rate = <0>;
+		};
+	};
+
 	gmac0_pins: gmac0-0 {
 		tx-pins {
 			pins = "GMAC0_TX_CLK",
@@ -268,6 +307,30 @@ reg-on-pins {
 	};
 };
 
+&padctrl1_apsys {
+	uart4_pins: uart4-0 {
+		rx-pins {
+			bias-disable;
+			drive-strength = <1>;
+			function = "uart";
+			input-enable;
+			pins = "UART4_RXD", "UART4_CTSN";
+			input-schmitt-enable;
+			slew-rate = <0>;
+		};
+
+		tx-pins {
+			bias-disable;
+			drive-strength = <3>;
+			function = "uart";
+			input-disable;
+			pins = "UART4_TXD", "UART4_RTSN";
+			input-schmitt-disable;
+			slew-rate = <0>;
+		};
+	};
+};
+
 &sdio0 {
 	bus-width = <4>;
 	max-frequency = <198000000>;
@@ -314,3 +377,25 @@ &uart0 {
 	pinctrl-0 = <&uart0_pins>;
 	status = "okay";
 };
+
+&uart4 {
+	pinctrl-0 = <&uart4_pins>;
+	pinctrl-names = "default";
+	uart-has-rtscts;
+
+	status = "okay";
+
+	bluetooth {
+		compatible = "brcm,bcm4329-bt";
+		device-wakeup-gpios = <&gpio2 29 GPIO_ACTIVE_HIGH>;
+		interrupt-parent = <&gpio2>;
+		interrupts = <30 IRQ_TYPE_EDGE_RISING>;
+		interrupt-names = "host-wakeup";
+		max-speed = <921600>;
+		pinctrl-0 = <&bluetooth_pins>;
+		pinctrl-names = "default";
+		shutdown-gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>; 	/* BT-REG-ON */
+		vbat-supply = <&reg_vbat_3v3>;
+		vddio-supply = <&reg_vbat_1v8>;
+	};
+};
Signature · 1 line
2.53.0
maintainer
#6 lore raw

Re: [PATCH v2 2/2] riscv: dts: thead: Enable bluetooth on BeagleV-Ahead

Quoted 9 lines · Thomas Gerner

On the BeagleV-Ahead the bluetooth module of the Ampak AP6203BM is identified by the btbcm driver as BCM4362A2. The module is connected by UART4, several gpio pins and an I2S interface. The I2S is currently not used as there is currently no driver.

---
Changes in v2:
- use default pinctrl definition for bluetooth in and out pins

Thanks for sending v2. Sorry for the delay in review.

Quoted 13 lines
	
 .../boot/dts/thead/th1520-beaglev-ahead.dts   | 85 +++++++++++++++++++
 1 file changed, 85 insertions(+)
arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +1 -0
index e16484a47653..7161a9d4c61f 100644
@@ -76,6 +76,23 @@ led-5 {
 		};
 	};
 
+	reg_vbat_1v8: regulator-vbat-1v8 {

arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts led-5 { · line 89

Quoted 10 lines
arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +10 -0
+		compatible = "regulator-fixed";
+		regulator-boot-on;
+		regulator-max-microvolt = <1800000>;
+		regulator-min-microvolt = <1800000>;
+		regulator-name = "vbat-1v8";
+	};
+
+	reg_vbat_3v3: regulator-vbat-3v3 {
+		compatible = "regulator-fixed";
+		enable-active-high;

enable-active-high has no effect without a gpio.

arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts led-5 { · line 94

Quoted 5 lines
arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +5 -0
+		regulator-boot-on;
+		regulator-max-microvolt = <3300000>;
+		regulator-min-microvolt = <3300000>;
+		regulator-name = "vbat-3v3";
+	};

Nothing can switch these two rails so regulator-always-on describes them better than regulator-boot-on.

Quoted 76 lines
arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +55 -0
+
 	hdmi-connector {
 		compatible = "hdmi-connector";
 		type = "d";
@@ -152,6 +169,28 @@ led-pins {
 };
 
 &padctrl0_apsys {
+	bluetooth_pins: bluetooth-0 {
+		in-pins {
+			bias-disable;
+			drive-strength = <1>;
+			function = "gpio";
+			input-enable;
+			input-schmitt-enable;
+			pins = "GPIO2_30";
+			slew-rate = <0>;
+		};
+
+		out-pins {
+			bias-disable;
+			drive-strength = <3>;
+			input-disable;
+			input-schmitt-disable;
+			pins = "SDIO1_DETN",	/* GPIO2_29 */
+			       "SDIO1_WPRTN";	/* GPIO2_28 */
+			slew-rate = <0>;
+		};
+	};
+
 	gmac0_pins: gmac0-0 {
 		tx-pins {
 			pins = "GMAC0_TX_CLK",
@@ -268,6 +307,30 @@ reg-on-pins {
 	};
 };
 
+&padctrl1_apsys {
+	uart4_pins: uart4-0 {
+		rx-pins {
+			bias-disable;
+			drive-strength = <1>;
+			function = "uart";
+			input-enable;
+			pins = "UART4_RXD", "UART4_CTSN";
+			input-schmitt-enable;
+			slew-rate = <0>;
+		};
+
+		tx-pins {
+			bias-disable;
+			drive-strength = <3>;
+			function = "uart";
+			input-disable;
+			pins = "UART4_TXD", "UART4_RTSN";
+			input-schmitt-disable;
+			slew-rate = <0>;
+		};
+	};
+};
+
 &sdio0 {
 	bus-width = <4>;
 	max-frequency = <198000000>;
@@ -314,3 +377,25 @@ &uart0 {
 	pinctrl-0 = <&uart0_pins>;
 	status = "okay";
 };
+
+&uart4 {
+	pinctrl-0 = <&uart4_pins>;
+	pinctrl-names = "default";
+	uart-has-rtscts;
+
+	status = "okay";
+

arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts &uart0 { · line 397

Quoted 10 lines
arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +10 -0
+	bluetooth {
+		compatible = "brcm,bcm4329-bt";
+		device-wakeup-gpios = <&gpio2 29 GPIO_ACTIVE_HIGH>;
+		interrupt-parent = <&gpio2>;
+		interrupts = <30 IRQ_TYPE_EDGE_RISING>;
+		interrupt-names = "host-wakeup";
+		max-speed = <921600>;
+		pinctrl-0 = <&bluetooth_pins>;
+		pinctrl-names = "default";
+		shutdown-gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>; 	/* BT-REG-ON */

This triggers checkpatch:

WARNING: please, no space before tabs
#230: FILE: arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts:397:
+^I^Ishutdown-gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>; ^I/* BT-REG-ON */$

Quoted 7 lines
arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +4 -0
+		vbat-supply = <&reg_vbat_3v3>;
+		vddio-supply = <&reg_vbat_1v8>;
+	};
+};
Signature · 1 line
2.53.0

Thanks,
Drew

#7 lore raw

Re: [PATCH v2 2/2] riscv: dts: thead: Enable bluetooth on BeagleV-Ahead

Am 21.11.26 um 00:34 schrieb Drew Fustini:

Quoted 37 lines · Thomas Gerner
Quoted 9 lines

On the BeagleV-Ahead the bluetooth module of the Ampak AP6203BM is identified by the btbcm driver as BCM4362A2. The module is connected by UART4, several gpio pins and an I2S interface. The I2S is currently not used as there is currently no driver.

---
Changes in v2:
- use default pinctrl definition for bluetooth in and out pins

Thanks for sending v2. Sorry for the delay in review.

Quoted 13 lines
	
  .../boot/dts/thead/th1520-beaglev-ahead.dts   | 85 +++++++++++++++++++
  1 file changed, 85 insertions(+)
arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +1 -0
index e16484a47653..7161a9d4c61f 100644
@@ -76,6 +76,23 @@ led-5 {
  		};
  	};
 
+	reg_vbat_1v8: regulator-vbat-1v8 {

arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts led-5 { · line 89

Quoted 10 lines
arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +10 -0
+		compatible = "regulator-fixed";
+		regulator-boot-on;
+		regulator-max-microvolt = <1800000>;
+		regulator-min-microvolt = <1800000>;
+		regulator-name = "vbat-1v8";
+	};
+
+	reg_vbat_3v3: regulator-vbat-3v3 {
+		compatible = "regulator-fixed";
+		enable-active-high;

enable-active-high has no effect without a gpio.

Quoted 7 lines

arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts led-5 { · line 94

Quoted 5 lines
arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +5 -0
+		regulator-boot-on;
+		regulator-max-microvolt = <3300000>;
+		regulator-min-microvolt = <3300000>;
+		regulator-name = "vbat-3v3";
+	};

Nothing can switch these two rails so regulator-always-on describes them better than regulator-boot-on.

I see. With the next version I will consider this. The regulator definitions are here only to prevent the hci driver form printing a message about missing regulator. Once we have the final regulators for the AON subsystem we should check this definitions and replace them if appropriate.

Quoted 93 lines
Quoted 77 lines
arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +55 -0
+
  	hdmi-connector {
  		compatible = "hdmi-connector";
  		type = "d";
@@ -152,6 +169,28 @@ led-pins {
  };
 
  &padctrl0_apsys {
+	bluetooth_pins: bluetooth-0 {
+		in-pins {
+			bias-disable;
+			drive-strength = <1>;
+			function = "gpio";
+			input-enable;
+			input-schmitt-enable;
+			pins = "GPIO2_30";
+			slew-rate = <0>;
+		};
+
+		out-pins {
+			bias-disable;
+			drive-strength = <3>;
+			input-disable;
+			input-schmitt-disable;
+			pins = "SDIO1_DETN",	/* GPIO2_29 */
+			       "SDIO1_WPRTN";	/* GPIO2_28 */
+			slew-rate = <0>;
+		};
+	};
+
  	gmac0_pins: gmac0-0 {
  		tx-pins {
  			pins = "GMAC0_TX_CLK",
@@ -268,6 +307,30 @@ reg-on-pins {
  	};
  };
 
+&padctrl1_apsys {
+	uart4_pins: uart4-0 {
+		rx-pins {
+			bias-disable;
+			drive-strength = <1>;
+			function = "uart";
+			input-enable;
+			pins = "UART4_RXD", "UART4_CTSN";
+			input-schmitt-enable;
+			slew-rate = <0>;
+		};
+
+		tx-pins {
+			bias-disable;
+			drive-strength = <3>;
+			function = "uart";
+			input-disable;
+			pins = "UART4_TXD", "UART4_RTSN";
+			input-schmitt-disable;
+			slew-rate = <0>;
+		};
+	};
+};
+
  &sdio0 {
  	bus-width = <4>;
  	max-frequency = <198000000>;
@@ -314,3 +377,25 @@ &uart0 {
  	pinctrl-0 = <&uart0_pins>;
  	status = "okay";
  };
+
+&uart4 {
+	pinctrl-0 = <&uart4_pins>;
+	pinctrl-names = "default";
+	uart-has-rtscts;
+
+	status = "okay";
+

arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts &uart0 { · line 397

Quoted 10 lines
arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +10 -0
+	bluetooth {
+		compatible = "brcm,bcm4329-bt";
+		device-wakeup-gpios = <&gpio2 29 GPIO_ACTIVE_HIGH>;
+		interrupt-parent = <&gpio2>;
+		interrupts = <30 IRQ_TYPE_EDGE_RISING>;
+		interrupt-names = "host-wakeup";
+		max-speed = <921600>;
+		pinctrl-0 = <&bluetooth_pins>;
+		pinctrl-names = "default";
+		shutdown-gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>; 	/* BT-REG-ON */

This triggers checkpatch:

WARNING: please, no space before tabs
#230: FILE: arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts:397:
+^I^Ishutdown-gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>; ^I/* BT-REG-ON */$

Quoted 9 lines
Quoted 7 lines
arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts +4 -0
+		vbat-supply = <&reg_vbat_3v3>;
+		vddio-supply = <&reg_vbat_1v8>;
+	};
+};
Signature · 1 line
2.53.0

Thanks,
Drew

Best regards
Thomas