From 9da524a558a0d4a48b47c11c1b8417eca029b73d Mon Sep 17 00:00:00 2001 From: Bruno Martins Date: Sun, 16 Jul 2023 12:05:39 +0100 Subject: [PATCH] Import bt-devicetree from ASUS_AI2205-33.0820.0810.121 --- qcom/bt/Kbuild | 16 +++ qcom/bt/Makefile | 9 ++ qcom/bt/bindings/bluetooth/btfm_slim.txt | 16 +++ qcom/bt/bindings/bluetooth/btpower.txt | 60 ++++++++++++ qcom/bt/bindings/bt-fm/rtc6226_fm.txt | 13 +++ qcom/bt/kalama-bt.dts | 11 +++ qcom/bt/kalama-bt.dtsi | 120 +++++++++++++++++++++++ qcom/bt/khaje-bt.dts | 11 +++ qcom/bt/khaje-bt.dtsi | 34 +++++++ qcom/bt/waipio-bt.dts | 12 +++ qcom/bt/waipio-bt.dtsi | 48 +++++++++ qcom/bt/waipio-kiwi-bt.dts | 12 +++ qcom/bt/waipio-kiwi-bt.dtsi | 26 +++++ 13 files changed, 388 insertions(+) create mode 100644 qcom/bt/Kbuild create mode 100644 qcom/bt/Makefile create mode 100644 qcom/bt/bindings/bluetooth/btfm_slim.txt create mode 100644 qcom/bt/bindings/bluetooth/btpower.txt create mode 100644 qcom/bt/bindings/bt-fm/rtc6226_fm.txt create mode 100644 qcom/bt/kalama-bt.dts create mode 100644 qcom/bt/kalama-bt.dtsi create mode 100644 qcom/bt/khaje-bt.dts create mode 100644 qcom/bt/khaje-bt.dtsi create mode 100644 qcom/bt/waipio-bt.dts create mode 100644 qcom/bt/waipio-bt.dtsi create mode 100644 qcom/bt/waipio-kiwi-bt.dts create mode 100644 qcom/bt/waipio-kiwi-bt.dtsi diff --git a/qcom/bt/Kbuild b/qcom/bt/Kbuild new file mode 100644 index 00000000..ae920a2f --- /dev/null +++ b/qcom/bt/Kbuild @@ -0,0 +1,16 @@ +ifeq ($(CONFIG_ARCH_KALAMA),y) +dtbo-y += kalama-bt.dtbo +endif + +ifeq ($(CONFIG_ARCH_WAIPIO),y) +dtbo-y += waipio-bt.dtbo +dtbo-y += waipio-kiwi-bt.dtbo +endif + +ifeq ($(CONFIG_ARCH_KHAJE),y) +dtbo-y += khaje-bt.dtbo +endif + +always-y := $(dtb-y) $(dtbo-y) +subdir-y := $(dts-dirs) +clean-files := *.dtb *.dtbo diff --git a/qcom/bt/Makefile b/qcom/bt/Makefile new file mode 100644 index 00000000..ef33f916 --- /dev/null +++ b/qcom/bt/Makefile @@ -0,0 +1,9 @@ +KBUILD_OPTIONS += KBUILD_EXTMOD_DTS=. + +all: dtbs + +clean: + $(MAKE) -C $(KERNEL_SRC) M=$(M) clean + +%: + $(MAKE) -C $(KERNEL_SRC) M=$(M) $@ $(KBUILD_OPTIONS) diff --git a/qcom/bt/bindings/bluetooth/btfm_slim.txt b/qcom/bt/bindings/bluetooth/btfm_slim.txt new file mode 100644 index 00000000..2f116b5a --- /dev/null +++ b/qcom/bt/bindings/bluetooth/btfm_slim.txt @@ -0,0 +1,16 @@ +* BTFM Slimbus Slave Driver +BTFM Slimbus Slave driver configure and initialize slimbus slave device. +Bluetooth A2DP, SCO and FM Audio data is transferred over slimbus interface. + +Required properties: + - compatible: Should be set to the following where 217 is manufacture id and 221 is prod id: + ex. HSP elmental address is 0x000120021702 + compatible = "slim217,221" + - reg should be filled as per specs + reg = <1 0>; + +Example: + slimbus: btfmslim-driver { + compatible = "slim217,221"; + reg = <1 0>; + }; diff --git a/qcom/bt/bindings/bluetooth/btpower.txt b/qcom/bt/bindings/bluetooth/btpower.txt new file mode 100644 index 00000000..c0227c2b --- /dev/null +++ b/qcom/bt/bindings/bluetooth/btpower.txt @@ -0,0 +1,60 @@ +* Bluetooth Controller +Bluetooth controller communicates with the Bluetooth Host using HCI Transport +layer. HCI Transport layer can be based on UART or USB serial communication +protocol. + +Required properties: +- compatible: "qcom," + chip: Should be set to one of the following: + qcom,qca6174 + qcom,wcn3990 + qcom,qca6390 + qcom,qca6490 + qcom,kiwi + - qcom,bt-reset-gpio: GPIO pin to bring BT Controller out of reset + +Optional properties: + - qcom,xo-clk-gpio: GPIO for enabling clock at bootstrap + - qcom,bt-vdd-pa-supply: Bluetooth VDD PA regulator handle + - qcom,bt-vdd-io-supply: Bluetooth VDD IO regulator handle + - qcom,bt-vdd-ldo-supply: Bluetooth VDD LDO regulator handle. Kept under + optional parameters as some of the chipsets doesn't require ldo + or it may use from same vddio. + - qcom,bt-vdd-xtal-supply: Bluetooth VDD XTAL regulator handle + - qcom,bt-vdd-core-supply: Bluetooth VDD CORE regulator handle + - qcom,bt-vdd-asd-supply: Bluetooth VDD regulator handle for antenna switch + - reg: Memory regions defined as starting address and size + - reg-names: Names of the memory regions defined in reg entry + diversity. + - qcom,bt-chip-pwd-supply: Chip power down gpio is required when bluetooth + module and other modules like wifi co-exist in a singe chip and + shares a common gpio to bring chip out of reset. + - qcom,-config: Specifies voltage/current levels for supply. Should specified + in pairs (min, max), units uV. There can be optional + load in curr, unit uA. Last entry specifies if the retention + mode is supported for the regulator. + - mboxes: Specifies mbox channel data for AOP messaging + - qcom,vreg_ipa: Specifies Voltage regulator used for QCA6490 Internal Power + Amp config + +Example: + bluetooth: bt_qca6490 { + compatible = "qcom,qca6390", "qcom,qca6490"; + pinctrl-names = "default"; + pinctrl-0 = <&bt_en_sleep>; + qcom,bt-reset-gpio = <&tlmm 81 0>; /* BT_EN */ + qcom,wl-reset-gpio = <&tlmm 80 0>; /* WL_EN */ + qcom,bt-sw-ctrl-gpio = <&tlmm 82 0>; /* SW_CTRL */ + qcom,bt-xo-clk-gpio = <&tlmm 204 0>; /* XO */ + qcom,bt-vdd-aon-supply = <&S11B>; + qcom,bt-vdd-dig-supply = <&S11B>; + qcom,bt-vdd-rfa1-supply = <&S1C>; + qcom,bt-vdd-rfa2-supply = <&S12B>; + qcom,bt-vdd-asd-supply = <&L7E>; + + qcom,bt-vdd-aon-config = <966000 966000 0 1>; + qcom,bt-vdd-dig-config = <966000 966000 0 1>; + qcom,bt-vdd-rfa1-config = <1880000 1880000 0 1>; + qcom,bt-vdd-rfa2-config = <1350000 1350000 0 1>; + qcom,bt-vdd-asd-config = <2800000 2800000 0 1>; + }; diff --git a/qcom/bt/bindings/bt-fm/rtc6226_fm.txt b/qcom/bt/bindings/bt-fm/rtc6226_fm.txt new file mode 100644 index 00000000..d77417bf --- /dev/null +++ b/qcom/bt/bindings/bt-fm/rtc6226_fm.txt @@ -0,0 +1,13 @@ +Richwave FM radio device + +-FM RX playback with RDS +FM signal is demodulated then audio L/R samples are sent to external audio codec. +FM Rx RDS data received sent to host processor on I2C. + +Required Properties: +- compatible: "rtc6226" + +Example: + rtc6226 { + compatible = "rtc6226"; + }; diff --git a/qcom/bt/kalama-bt.dts b/qcom/bt/kalama-bt.dts new file mode 100644 index 00000000..baf239f6 --- /dev/null +++ b/qcom/bt/kalama-bt.dts @@ -0,0 +1,11 @@ +/dts-v1/; +/plugin/; + +#include "kalama-bt.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Kalama SoCs"; + compatible = "qcom,kalama", "qcom,kalamap"; + qcom,msm-id = <519 0x10000>, <536 0x10000>, <519 0x20000>, <536 0x20000>, <600 0x20000>, <601 0x20000>; + qcom,board-id = <0 0>; +}; diff --git a/qcom/bt/kalama-bt.dtsi b/qcom/bt/kalama-bt.dtsi new file mode 100644 index 00000000..94443d4b --- /dev/null +++ b/qcom/bt/kalama-bt.dtsi @@ -0,0 +1,120 @@ +#include + +&tlmm { + bt_en_sleep: bt_en_sleep { + mux { + pins = "gpio81"; + function = "gpio"; + }; + + config { + pins = "gpio81"; + drive-strength = <2>; + output-low; + bias-pull-down; + }; + }; +}; + +&soc { + bluetooth: bt-qca-converged { + compatible = "qcom,bt-qca-converged"; + qcom,converged-dt; + qcom,wlan-sw-ctrl-gpio = <&tlmm 83 0>; /* WLAN_SW_CNTRL_GPIO*/ + bt_kiwi { + compatible = "qcom,kiwi"; + pinctrl-names = "default"; + pinctrl-0 = <&bt_en_sleep>; + qcom,bt-reset-gpio = <&tlmm 81 0>; /* BT_EN */ + qcom,wl-reset-gpio = <&tlmm 80 0>; /* WL_EN */ + qcom,bt-sw-ctrl-gpio = <&tlmm 82 0>; /* SW_CTRL */ + mboxes = <&qmp_aop 0>; + qcom,bt-vdd18-aon-supply = <&L15B>; /* BT VDD1.8 AON */ + qcom,bt-vdd-dig-supply = <&S4E>; /* BT LDO*/ + qcom,bt-vdd-aon-supply = <&S4E>; /* BT AON LDO*/ + qcom,bt-vdd-rfaOp8-supply = <&S4E>; /* BT RFAOp8 CMN LDO*/ + qcom,bt-vdd-rfa1-supply = <&S4G>; /* BT RFA1.2 LDO */ + qcom,bt-vdd-rfa2-supply = <&S6G>; /* BT RFA1.8 LDO */ + + qcom,bt-vdd18-aon-config = <1800000 1800000 0 1>; + qcom,bt-vdd-aon-config = <950000 950000 0 1>; + qcom,bt-vdd-dig-config = <950000 950000 0 1>; + qcom,bt-vdd-rfaOp8-config = <950000 950000 0 1>; + qcom,bt-vdd-rfa1-config = <1350000 1350000 0 1>; + qcom,bt-vdd-rfa2-config = <1900000 1900000 0 1>; + qcom,pdc_init_table= + "{class: wlan_pdc, ss: rf, res: s4e.v, upval: 916}", + "{class: wlan_pdc, ss: rf, res: s4e.v, dwnval: 612}", + "{class: wlan_pdc, ss: rf, res: s4g.v, upval: 1316}", + "{class: wlan_pdc, ss: rf, res: s4g.v, dwnval: 944}", + "{class: wlan_pdc, ss: rf, res: s6g.v, upval: 1864}", + "{class: wlan_pdc, ss: rf, res: s6g.v, dwnval: 1820}"; + }; + bt_qca6490 { + compatible = "qcom,qca6490"; + pinctrl-names = "default"; + pinctrl-0 = <&bt_en_sleep>; + qcom,bt-reset-gpio = <&tlmm 81 0>; /* BT_EN */ + qcom,wl-reset-gpio = <&tlmm 80 0>; /* WL_EN */ + qcom,bt-sw-ctrl-gpio = <&tlmm 82 0>; /* SW_CTRL */ + mboxes = <&qmp_aop 0>; + qcom,bt-vdd-io-supply = <&L15B>; /* BT VDD1.8 AON */ + qcom,bt-vdd-aon-supply = <&S4E>; + qcom,bt-vdd-dig-supply = <&S4E>; + qcom,bt-vdd-rfaOp8-supply = <&S4E>; /* BT RFAOp8 CMN LDO*/ + qcom,bt-vdd-rfa1-supply = <&S6G>; + qcom,bt-vdd-rfa2-supply = <&S4G>; + + qcom,bt-vdd-io-config = <1800000 1800000 0 1>; + qcom,bt-vdd-aon-config = <966000 966000 0 1>; + qcom,bt-vdd-dig-config = <966000 966000 0 1>; + qcom,bt-vdd-rfaOp8-config = <966000 966000 0 1>; + qcom,bt-vdd-rfa1-config = <1900000 1900000 0 1>; + qcom,bt-vdd-rfa2-config = <1350000 1350000 0 1>; + qcom,pdc_init_table = + "{class: wlan_pdc, ss: rf, res: s4e.v, upval: 966}", + "{class: wlan_pdc, ss: rf, res: s4e.v, dwnval: 615}", + "{class: wlan_pdc, ss: rf, res: s4g.v, upval: 1350}", + "{class: wlan_pdc, ss: rf, res: s4g.v, dwnval: 945}", + "{class: wlan_pdc, ss: rf, res: s6g.v, upval: 1900}", + "{class: wlan_pdc, ss: rf, res: s6g.v, dwnval: 1825}", + "{class: wlan_pdc, ss: rf, res: s2g.m, enable: 1}", + "{class: wlan_pdc, ss: rf, res: s2g.v, enable: 1}", + "{class: wlan_pdc, ss: rf, res: s2g.v, upval: 1012}", + "{class: wlan_pdc, ss: rf, res: s2g.v, dwnval: 515}"; + }; + }; + slim_msm: slim@6C40000 { + status = "ok"; + ngd@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <1>; + //slimbus child nodes + slimbus: btfmslim-driver { + compatible = "slim217,221"; + reg = <1 0>; + }; + }; + }; +}; + +// FM changes +&qupv3_hub_i2c2 { + status = "ok"; + nq@64 { + compatible = "rtc6226"; + reg = <0x64>; + fmint-gpio = <&tlmm 15 0>; + vdd-supply = <&L16B>; + rtc6226,vdd-supply-voltage = <2800000 2800000>; + rtc6226,vdd-load = <15000>; + vio-supply = <&L15B>; + rtc6226,vio-supply-voltage = <1800000 1800000>; + }; +}; + +//uart instance +&qupv3_se14_4uart{ + status = "ok"; +}; diff --git a/qcom/bt/khaje-bt.dts b/qcom/bt/khaje-bt.dts new file mode 100644 index 00000000..51dabca5 --- /dev/null +++ b/qcom/bt/khaje-bt.dts @@ -0,0 +1,11 @@ +/dts-v1/; +/plugin/; + +#include "khaje-bt.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Khaje SoC"; + compatible = "qcom,khaje"; + qcom,msm-id = <518 0x10000>, <585 0x10000>; + qcom,board-id = <0 0>; +}; diff --git a/qcom/bt/khaje-bt.dtsi b/qcom/bt/khaje-bt.dtsi new file mode 100644 index 00000000..b6bc5ae6 --- /dev/null +++ b/qcom/bt/khaje-bt.dtsi @@ -0,0 +1,34 @@ + +&soc { + bluetooth: bt_wcn3990 { + compatible = "qcom,wcn3990"; + qcom,bt-sw-ctrl-gpio = <&tlmm 87 0>; /* SW_CTRL */ + qcom,bt-vdd-io-supply = <&L9A>; /* IO */ + qcom,bt-vdd-core-supply = <&L17A>; /* RFA */ + qcom,bt-vdd-pa-supply = <&L23A>; /* CH0 */ + qcom,bt-vdd-xtal-supply = <&L16A>; /* XO */ + + qcom,bt-vdd-io-config = <1700000 1900000 1 0>; + qcom,bt-vdd-core-config = <1304000 1304000 1 0>; + qcom,bt-vdd-pa-config = <3000000 3312000 1 0>; + qcom,bt-vdd-xtal-config = <1700000 1900000 1 0>; + }; + slim_msm: slim@a5c0000 { + status = "ok"; + ngd@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <1>; + //slimbus child nodes + slimbus: btfmslim-driver { + compatible = "slim217,221"; + reg = <1 0>; + }; + }; + }; + +}; + +&qupv3_se3_4uart { + status = "ok"; +}; diff --git a/qcom/bt/waipio-bt.dts b/qcom/bt/waipio-bt.dts new file mode 100644 index 00000000..bae36bb7 --- /dev/null +++ b/qcom/bt/waipio-bt.dts @@ -0,0 +1,12 @@ +/dts-v1/; +/plugin/; + +#include "waipio-bt.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Waipio SoCs"; + compatible = "qcom,waipio", "qcom,waipiop"; + qcom,msm-id = <457 0x10000>, <482 0x10000>, + <457 0x20000>, <482 0x20000>; + qcom,board-id = <0 0>; +}; diff --git a/qcom/bt/waipio-bt.dtsi b/qcom/bt/waipio-bt.dtsi new file mode 100644 index 00000000..4c3cbabb --- /dev/null +++ b/qcom/bt/waipio-bt.dtsi @@ -0,0 +1,48 @@ +#include + +&tlmm { + bt_en_sleep: bt_en_sleep { + mux { + pins = "gpio81"; + function = "gpio"; + }; + + config { + pins = "gpio81"; + drive-strength = <2>; + output-low; + bias-pull-down; + }; + }; +}; + +&soc { + bluetooth: bt_qca6490 { + compatible = "qcom,qca6490"; + pinctrl-names = "default"; + pinctrl-0 = <&bt_en_sleep>; + qcom,bt-reset-gpio = <&tlmm 81 0>; /* BT_EN */ + qcom,wl-reset-gpio = <&tlmm 80 0>; /* WL_EN */ + qcom,bt-sw-ctrl-gpio = <&tlmm 82 0>; /* SW_CTRL */ + qcom,xo-clk-gpio = <&tlmm 204 0>; /* XO */ + mboxes = <&qmp_aop 0>; + qcom,vreg_ipa="s3e"; + + qcom,bt-vdd-aon-supply = <&S11B>; + qcom,bt-vdd-dig-supply = <&S11B>; + qcom,bt-vdd-rfa1-supply = <&S1C>; + qcom,bt-vdd-rfa2-supply = <&S12B>; + qcom,bt-vdd-asd-supply = <&L7E>; + + qcom,bt-vdd-aon-config = <966000 966000 0 1>; + qcom,bt-vdd-dig-config = <966000 966000 0 1>; + qcom,bt-vdd-rfa1-config = <1900000 2100000 0 1>; + qcom,bt-vdd-rfa2-config = <1350000 1350000 0 1>; + qcom,bt-vdd-asd-config = <2800000 2800000 0 1>; + }; +}; + +&qupv3_se7_2uart { + status = "ok"; +}; + diff --git a/qcom/bt/waipio-kiwi-bt.dts b/qcom/bt/waipio-kiwi-bt.dts new file mode 100644 index 00000000..c7e74168 --- /dev/null +++ b/qcom/bt/waipio-kiwi-bt.dts @@ -0,0 +1,12 @@ +/dts-v1/; +/plugin/; + +#include "waipio-bt.dtsi" + +/ { + model = "Qualcomm Technologies, Inc. Waipio SoCs"; + compatible = "qcom,waipio", "qcom,waipiop"; + qcom,msm-id = <457 0x10000>, <482 0x10000>, + <457 0x20000>, <482 0x20000>; + qcom,board-id = <0x02010008 0>; +}; diff --git a/qcom/bt/waipio-kiwi-bt.dtsi b/qcom/bt/waipio-kiwi-bt.dtsi new file mode 100644 index 00000000..93b722ef --- /dev/null +++ b/qcom/bt/waipio-kiwi-bt.dtsi @@ -0,0 +1,26 @@ +#include + +&bluetooth { + status = "disabled"; +}; + +&soc { + bt_hmt: bt_wcn7850 { + compatible = "qcom,wcn7850"; + pinctrl-names = "default"; + pinctrl-0 = <&bt_en_sleep>; + qcom,bt-reset-gpio = <&tlmm 81 0>; /* BT_EN */ + qcom,wl-reset-gpio = <&tlmm 80 0>; /* WL_EN */ + qcom,bt-sw-ctrl-gpio = <&tlmm 82 0>; /* SW_CTRL */ + + qcom,bt-vdd-aon-supply = <&S11B>; + qcom,bt-vdd-dig-supply = <&S11B>; + qcom,bt-vdd-rfa1-supply = <&S1C>; + qcom,bt-vdd-rfa2-supply = <&S12B>; + + qcom,bt-vdd-aon-config = <950000 950000 0 1>; + qcom,bt-vdd-dig-config = <950000 950000 0 1>; + qcom,bt-vdd-rfa1-config = <1900000 1900000 0 1>; + qcom,bt-vdd-rfa2-config = <1350000 1350000 0 1>; + }; +};