Other Parts Discussed in Thread: AM625, TPS65988, LM34936, LM61460-Q1, TCA6424, WL1837, TLV320AIC3106,
Tool/software:
Hello TI Expert,
My customer board hardware (AM254A - ALW) is similar to E3 and I am using SDK 9.0
UART4 (TX: GPMC0_CSn3, RX: GPMC0_CSn2) is used as an HW interface to communicate with external BT/WLAN combo chip.
And BT_EN (MCU_GPIO0_1) is to enable the chip (pull up to 3.3v).
I referred to a similiar top: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1166852/am625-use-wkup_uart0-as-bt-connect-port/4490741#4490741
But I failed to see the UART4 (no ttyS4) and unable to control BT_EN gpio
May you help to correct my DTS? or provide a patch for this purpose?
==========My modification patch==============
diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
index b1737978103b..ff371140cb74 100644
--- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts
+++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts
@@ -13,6 +13,11 @@ / {
compatible = "ti,am625-sk", "ti,am625";
model = "Texas Instruments AM625 SK";
+ aliases {
+ serial6 = &main_uart4;
+ gpio2 = &mcu_gpio0;
+ };
+
opp-table {
/* Add 1.4GHz OPP for am625-sk board. Requires VDD_CORE to be at 0.85V */
opp-1400000000 {
@@ -68,9 +73,10 @@ vdd_mmc1: regulator-3 {
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
- enable-active-high;
+ /* enable-active-high; */
vin-supply = <&vcc_3v3_sys>;
- gpio = <&exp1 3 GPIO_ACTIVE_HIGH>;
+ regulator-always-on;
+ /* gpio = <&exp1 3 GPIO_ACTIVE_HIGH>; */
};
vdd_sd_dv: regulator-4 {
@@ -82,7 +88,8 @@ vdd_sd_dv: regulator-4 {
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
- vin-supply = <&vcc_5v0>;
+ regulator-always-on;
+ vin-supply = <&vcc_3v3_sys>;
gpios = <&main_gpio0 31 GPIO_ACTIVE_HIGH>;
states = <1800000 0x0>,
<3300000 0x1>;
@@ -105,7 +112,7 @@ wlan_lten: regulator-6 {
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
vin-supply = <&vcc_3v3_sys>;
- regulator-always-on;
+ /* regulator-always-on;*/
gpios = <&exp1 11 GPIO_ACTIVE_LOW>;
};
@@ -120,6 +127,18 @@ wlan_en: regulator-7 {
pinctrl-names = "default";
pinctrl-0 = <&wlan_en_pins_default>;
};
+
+ btwlan_en: regulator-8 {
+ compatible = "regulator-fixed";
+ regulator-name = "btwlan_en";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ vin-supply = <&wlan_lten>;
+ enable-active-high;
+ gpios = <&mcu_gpio0 1 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&mcu_btwlan_en_pins_default>;
+ };
};
&main_pmx0 {
@@ -191,6 +210,34 @@ main_wlirq_pins_default: main-wlirq-pins-default {
AM62X_IOPAD(0x128, PIN_INPUT, 7) /* (B23) MMC2_SDWP.GPIO0_72 */
>;
};
+
+ /* For BT/WLAN connection interface */
+ main_uart4_pins_default: main-uart4-default-pins {
+ pinctrl-single,pins = <
+ AM62X_IOPAD(0x00b0, PIN_OUTPUT, 3) /* (K22) GPMC0_CSn2.UART4_RXD */
+ AM62X_IOPAD(0x00b4, PIN_OUTPUT, 3) /* (K24) GPMC0_CSn3.UART4_TXD */
+ >;
+ };
+};
+
+&main_uart4 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&main_uart4_pins_default &mcu_btwlan_en_pins_default>;
+
+ bluetooth {
+ enable-gpios = <&mcu_gpio0 1 GPIO_ACTIVE_HIGH>;
+ };
+
+};
+
+&mcu_pmx0 {
+ /* Enable BT/WLAN Pin */
+ mcu_btwlan_en_pins_default: mcu-btwlan-en-pins-default {
+ pinctrl-single,pins = <
+ AM62X_MCU_IOPAD(0x0004, PIN_OUTPUT_PULLUP, 7) /* (B8) MCU_SPI0_CS1.MCU_GPIO0_1 */
+ >;
+ };
};
&main_i2c1 {
@@ -223,6 +270,7 @@ exp1: gpio@22 {
};
&sdhci1 {
+ status = "okay";
vmmc-supply = <&vdd_mmc1>;
vqmmc-supply = <&vdd_sd_dv>;
};
==========Result==========================
A) No ttyS4 device file
root@am62xx-evm:/# dmesg | grep ttyS
[ 0.000000] Kernel command line: console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000 mtdparts=spi-nand0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),98048k@32m(ospi.rootfs),256k@130816k(ospi.phypattern);omap2-nand.0:2m(NAND.tiboot3),2m(NAND.tispl),2m(NAND.tiboot3.backup),4m(NAND.u-boot),256k(NAND.u-boot-env),256k(NAND.u-boot-env.backup),-(NAND.file-system) root=PARTUUID=3aa7079c-02 rw rootfstype=ext4 rootwait
[ 1.212018] printk: console [ttyS2] disabled
[ 1.216499] 2800000.serial: ttyS2 at MMIO 0x2800000 (irq = 239, base_baud = 3000000) is a 8250
[ 1.225425] printk: console [ttyS2] enabled
root@am62xx-evm:/# ls /dev/ttyS*
/dev/ttyS0 /dev/ttyS1 /dev/ttyS2 /dev/ttyS3
root@am62xx-evm:/#
B) Unable to control GPIO0_1 to high/low (measured by Voltmeter)
root@am62xx-evm:/sys/kernel/debug# cat gpio
gpiochip2: GPIOs 344-395, parent: platform/601000.gpio, 601000.gpio:
gpio-393 ( |am62-sk:green:heartb) out lo
gpiochip1: GPIOs 396-487, parent: platform/600000.gpio, 600000.gpio:
gpio-427 ( |tlv71033 ) out lo
gpiochip0: GPIOs 488-511, parent: platform/4201000.gpio, 4201000.gpio:
root@am62xx-evm:/sys/kernel/debug# echo 489 > /sys/class/gpio/export
root@am62xx-evm:/sys/kernel/debug# echo out > /sys/class/gpio/gpio489/direction
root@am62xx-evm:/sys/kernel/debug# echo 1 > /sys/class/gpio/gpio489/value
root@am62xx-evm:/sys/kernel/debug# cat /sys/class/gpio/gpio489/value
0
root@am62xx-evm:/sys/kernel/debug#