Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5ec14ca authored by Yuanyuan Liu's avatar Yuanyuan Liu
Browse files

net: cnss2: Add snapshot of CNSS2 driver



This is a snapshot of the CNSS2 driver and associated files as of
msm-4.14 commit b836faab20de
(cnss2: Do not suspend MHI if PCIe is not going to be suspended).

Checkpatch issues are also fixed on top of this commit.

CRs-Fixed: 2375545
Change-Id: Ia6d6624a17b92c6d3c64cf1a9dd4df489389fb45
Signed-off-by: default avatarYuanyuan Liu <yuanliu@codeaurora.org>
parent 22ea3159
Loading
Loading
Loading
Loading
+82 −0
Original line number Diff line number Diff line
* Qualcomm Technologies, Inc. ConNectivity SubSystem Platform Driver

This platform driver adds support for the CNSS subsystem used for PCIe
based Wi-Fi devices. It also adds support to integrate PCIe WLAN module
to subsystem restart framework. Apart from that, it also manages the
3.3V voltage regulator, WLAN Enable GPIO signal and PCIe link dynamically
with support for suspend and resume by retaining the PCI config space
states when PCIe link is shutdown. The main purpose of this device tree
entry below is to invoke the CNSS platform driver and provide handle to
the WLAN enable GPIO, 3.3V fixed voltage regulator resources. It also
provides the reserved RAM dump memory location and size.

Required properties:
  - compatible: "qcom,cnss" for QCA6174 device
                "qcom,cnss-qca6290" for QCA6290 device
                "qcom,cnss-qca6390" for QCA6390 device
  - wlan-en-gpio: WLAN_EN GPIO signal specified by the chip specifications
  - vdd-wlan-supply: phandle to the regulator device tree node
  - pinctrl-names: Names corresponding to the numbered pinctrl states
  - pinctrl-<n>: Pinctrl states as described in
                 bindings/pinctrl/pinctrl-bindings.txt
  - qcom,wlan-rc-num: PCIe root complex number which WLAN chip is attached to

Optional properties:
  - qcom,notify-modem-status: Boolean property to decide whether modem
                              notification should be enabled or not in this
                              platform
  - wlan-soc-swreg-supply: phandle to the external 1.15V regulator for QCA6174
  - wlan-ant-switch-supply: phandle to the 2.7V regulator for the antenna
                            switch of QCA6174
  - qcom,wlan-uart-access: Boolean property to decide whether QCA6174
                           has exclusive access to UART.
  - vdd-wlan-io-supply: phandle to the 1.8V IO regulator for QCA6174
  - vdd-wlan-xtal-supply: phandle to the 1.8V XTAL regulator for QCA6174
  - vdd-wlan-xtal-aon-supply: phandle to the LDO-4 regulator. This is needed
                              on platforms where XTAL regulator depends on
                              always on regulator in VDDmin.
  - vdd-wlan-ctrl1-supply: phandle to the DBU1 - 1.8V for QCA6595 or 3.3V for
                           QCA6174 on auto platform.
  - vdd-wlan-ctrl2-supply: phandle to the DBU4 - 2.2V for QCA6595 or 3.85V for
                           QCA6696 on auto platform.
  - vdd-wlan-core-supply: phandle to the 1.3V CORE regulator for QCA6174
  - vdd-wlan-sp2t-supply: phandle to the 2.7V SP2T regulator for QCA6174
  - qcom,smmu-s1-enable: Boolean property to decide whether to enable SMMU
                         S1 stage or not
  - qcom,wlan-smmu-iova-address: I/O virtual address range as <start length>
                                 format to be used for allocations associated
                                 between WLAN/PCIe and SMMU
  - qcom,wlan-ramdump-dynamic: To enable CNSS RAMDUMP collection
                               by providing the size of CNSS DUMP
  - reg: Memory regions defined as starting address and size
  - reg-names: Names of the memory regions defined in reg entry
  - wlan-bootstrap-gpio: WLAN_BOOTSTRAP GPIO signal specified by QCA6174
                         which should be drived depending on platforms
  - qcom,is-dual-wifi-enabled: Boolean property to control wlan enable(wlan-en)
                               gpio on dual-wifi platforms.
  - vdd-wlan-en-supply: WLAN_EN fixed regulator specified by QCA6174
                        specifications.
  - qcom,wlan-en-vreg-support: Boolean property to decide the whether the
                               WLAN_EN pin is a gpio or fixed regulator.
  - qcom,mhi: phandle to indicate the device which needs MHI support.
  - qcom,cap-tsf-gpio: WLAN_TSF_CAPTURED GPIO signal specified by the chip
                       specifications, should be drived depending on products

Example:

    qcom,cnss@0d400000 {
        compatible = "qcom,cnss";
        reg = <0x0d400000 0x200000>;
        reg-names = "ramdump";
        qcom,wlan-ramdump-dynamic = <0x200000>;
        wlan-en-gpio = <&msmgpio 82 0>;
        vdd-wlan-supply = <&wlan_vreg>;
        qcom,notify-modem-status;
        wlan-soc-swreg-supply = <&pma8084_l27>;
        pinctrl-names = "default";
        pinctrl-0 = <&cnss_default>;
        qcom,wlan-rc-num = <0>;
        qcom,wlan-smmu-iova-address = <0 0x10000000>;
        qcom,mhi = <&mhi_wlan>;
        qcom,cap-tsf-gpio = <&tlmm 126 1>;
    };
+2 −0
Original line number Diff line number Diff line
@@ -121,4 +121,6 @@ config VIRT_WIFI
	  This option adds support for ethernet connections to appear as if they
	  are wifi connections through a special rtnetlink device.

source "drivers/net/wireless/cnss2/Kconfig"

endif # WLAN
+2 −0
Original line number Diff line number Diff line
@@ -29,3 +29,5 @@ obj-$(CONFIG_USB_NET_RNDIS_WLAN) += rndis_wlan.o
obj-$(CONFIG_MAC80211_HWSIM)	+= mac80211_hwsim.o

obj-$(CONFIG_VIRT_WIFI)	+= virt_wifi.o

obj-$(CONFIG_CNSS2) += cnss2/
+76 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only

config CNSS2
	tristate "CNSS2 Platform Driver for Wi-Fi Module"
	depends on !CNSS && PCI_MSM
	help
	  This module adds the support for Connectivity Subsystem (CNSS) used
	  for PCIe based Wi-Fi devices with QCA6174/QCA6290 chipsets.
	  This driver also adds support to integrate WLAN module to subsystem
	  restart framework.

config CNSS2_DEBUG
	bool "CNSS2 Platform Driver Debug Support"
	depends on CNSS2
	help
	  This option is to enable CNSS2 platform driver debug support which
	  primarily includes providing additional verbose logs for certain
	  features, enabling kernel panic for certain cases to aid the
	  debugging, and enabling any other debug mechanisms.

config CNSS2_QMI
	bool "CNSS2 Platform Driver QMI support"
	depends on CNSS2
	help
	  CNSS2 platform driver uses QMI framework to communicate with WLAN
	  firmware. It sends and receives boot handshake messages to WLAN
	  firmware, which includes hardware and software capabilities and
	  configurations. It also sends WLAN on/off control message to
	  firmware over QMI channel.

config CNSS_ASYNC
	bool "Enable/disable CNSS platform driver asynchronous probe"
	depends on CNSS2
	help
	  If enabled, CNSS platform driver would do asynchronous probe.
	  Using asynchronous probe will allow CNSS platform driver to
	  probe in parallel with other device drivers and will help to
	  reduce kernel boot time.

config BUS_AUTO_SUSPEND
	bool "Enable/Disable Runtime PM support for PCIe based WLAN Drivers"
	depends on CNSS2
	depends on PCI
	help
	  Runtime Power Management is supported for PCIe based WLAN Drivers.
	  The features enable cld wlan driver to suspend pcie bus when APPS
	  is awake based on the driver inactivity with the Firmware.
	  The Feature uses runtime power management framework from kernel to
	  track bus access clients and to synchronize the driver activity
	  during system pm.
	  This config flag controls the feature per target based. The feature
	  requires CNSS driver support.

config CNSS_QCA6290
	bool "Enable CNSS QCA6290 chipset specific changes"
	help
	  This enables the changes from WLAN host driver that are specific to
	  CNSS QCA6290 chipset.
	  These changes are needed to support the new hardware architecture
	  for CNSS QCA6290 chipset.

config CNSS_QCA6390
	bool "Enable CNSS QCA6390 chipset specific changes"
	help
	  This enables the changes from WLAN host driver that are specific to
	  CNSS QCA6390 chipset.
	  These changes are needed to support the new hardware architecture
	  for CNSS QCA6390 chipset.

config CNSS_EMULATION
	bool "Enable specific changes for emulation hardware"
	help
	  This enables the changes from WLAN drivers that are specific to
	  emulation hardware.
	  These changes are needed for WLAN drivers to support and meet the
	  requirement of emulation hardware.
+10 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0-only

obj-$(CONFIG_CNSS2) += cnss2.o

cnss2-y := main.o
cnss2-y += bus.o
cnss2-y += debug.o
cnss2-y += pci.o
cnss2-y += power.o
cnss2-$(CONFIG_CNSS2_QMI) += qmi.o wlan_firmware_service_v01.o
Loading