Gráfico de commits

33 Commits

Autor SHA1 Mensagem Data
Jiani Liu
d792a01299 cnss2: Control the power on/off wlan device for PCIe switch platform
CNSS driver controls the power on/off wlan device. because on CPE
platform the link/power status of RC<->USP may be still on when wlan
device is turning on/off, this may cause uncorrectable AER error on
DSP side, to avoid this issue DSP's downstream link should be
disabled before power on/off wlan device, and re-enabled after wlan
power on, and also wait for link training of DSP<->WLAN to complete.

To be compitable with non PCIE switch platform, add a new config
CONFIG_PCIE_SWITCH_SUPPORT to enable/disable this function

Change-Id: Iaca103850d5ffc717a2a8bc40d16358e03c0c9db
CRs-Fixed: 3848272
2024-08-07 03:59:43 -07:00
Mohammed Ahmed
234bc26709 cnss2: Fix mbox_msg size calculated
Current code passes in mbox_msg max buffer
size to mailbox api rather than actual string
length. Resulting in KASAN detecting an out of
bound issue. Fix this by calculating the string
length, and passing that in.

CRs-Fixed: 3876948
Change-Id: I7d9be5466ca5bec81e181f47e278205d6d9a64ce
2024-07-31 00:17:30 -07:00
Lin Bai
92b14cc478 cnss2: Return proper value when sending AOP msg
Positive return value from mbox_send_message() should be
treated as success, which indicate the index of
free mbox buffer obtained.

Change-Id: I59b47a3a711468ef233b43c1191217f1f6911c1f
CRs-Fixed: 3878630
2024-07-30 07:45:26 -07:00
Yu Wang
11b4ce58de cnss2: Add support for additional regulator
Add support for regulator: 3.3V M.2, to enable
it based on the entry in device tree.

Change-Id: I4716b9ad6fb6d116342ef0aa9157989f9dfbf152
CRs-Fixed: 3795246
2024-05-08 03:33:52 -07:00
Yu Wang
b6c97a4162 cnss2: refine the code for AOP configuration
The Mbox interface requires structure 'qmp_pkt' which is defined
only when kernel config CONFIG_MSM_QMP is enabled, so add
conditional compilation for these interfaces (controlled by
config CONFIG_MSM_QMP).
While at the same time, qmp_get/qmp_put/qmp_send are controlled
by kernel config CONFIG_QCOM_AOSS_QMP, but they are defined
even when CONFIG_QCOM_AOSS_QMP is disabled, so conditional
compilation is not needed.

Change-Id: I0f793ae3661fb901edc857af0b1d4191d7c113f8
CRs-Fixed: 3712102
2024-03-27 03:10:20 -07:00
Naman Padhiar
f140232c39 cnss2: Fix DEV SOL interrupt issue
Fix misfiring of DEV SOL interrupt during enable_irq().
Ignore DEV SOL interrupt in case of device power off
as it is expected as part of off sequence.
In case of HOST triggered recovery, CNSS driver
tries to put device to RDDM first using MHI_SYS_ERR
and HOST_RESET_REQUEST if MHI_SYS_ERR fails. With
SOL enable, replace HOST_RESET_REQUEST with HOST_SOL.

Change-Id: I90c1a2dbd68c4c9c2e56d87dd1304a6ab0db53eb
CRs-Fixed: 3590408
2024-01-12 16:31:27 -08:00
Naman Padhiar
2f61e5043c cnss2: Set FUNC_SEL for SW_CTRL and SW_CTRL_WLAN GPIO
From Sun onwards FUNC_SEL for SW_CTRL and SW_CTRL_WLAN
GPIO needs to be set by client. Add support to set
funtion to "wcn_sw_ctrl" and "wcn_sw" for SW_CTRL and
SW_CTRL_WLAN GPIO so that, when these GPIOs goes high,
PDC get interrupted and TCS sequence(which enables RF_CLK)
can be started.

Change-Id: Ia2ba7d8a89fe6bb54b6563f5319d50c90df2210d
CRs-Fixed: 3668322
2023-11-22 10:04:35 -08:00
Xiaoning Ma
cd3b976590 cnss2: Fix compilation error when CONFIG_MSM_QMP is not enabled
'qmp' is not defined in 'struct cnss_plat_data' when CONFIG_MSM_QMP
is not set, use 'use_direct_qmp' to check if 'qmp' is configured
or not.

Change-Id: If8f822a3bb1acfe10ecf175f742f3f5abd5f7df7
CRs-Fixed: 3647012
2023-10-26 19:21:41 -07:00
Prateek Patil
5d5c769c28 cnss2: include qcom_aoss.h file at correct place
There may be multiple time inclusion of inline definition of the
APIs defined in the header file qcom_aoss.h if config
CONFIG_QCOM_AOSS_QMP is disabled for underlying target.
This may result in linking error. Move the header file to the correct
place in power.c.

Change-Id: I5c79eff3be4c758db1ab313843b36a02ecccbef9
CRs-Fixed: 3603827
2023-09-01 07:02:24 -07:00
Rajesh Chauhan
90e0212ecc cnss2: Add support for direct QMP to communicate with AOP
Add support for direct QMP to communicate with AOP. There
are two ways to communicate with AOP: mailbox, and direct
QMP. Based on property set in the device tree use either
direct QMP or mailbox to send messages to AOP.

Change-Id: I9fc24f8a483abb3084cda4d85acf2d53e43d9ad8
CRs-Fixed: 3488507
2023-05-11 18:02:05 -07:00
Sai Kumar Kunchala
3b1df6da05 cnss2: Add NULL check for 'cfg_arr' pointer
Add NULL check for 'cfg_arr' pointer before passing to
'of_property_read_string_array' function

Change-Id: Ief30b57145af5842cfd8e9533fcc5d15ab5ea0f1
CRs-Fixed: 3409579
2023-03-01 07:43:20 -08:00
Wu Gao
dcbdb2f5fb cnss2: Use mdelay to avoid compilation issue
The function - udelay is used only for very small delays (< 2 msec) on
some arm architecture. Otherwise there is compilation issue like
"__bad_udelay", since input is out of range. This change uses mdelay
to replace udelay and avoid compilation issue.

Change-Id: I42df519e7004d89ae6bb394f65b0d61ab5073784
CRs-Fixed: 3418093
2023-03-01 03:05:30 -08:00
Anuj Khera
640497899b cnss2: Send AOP msg to disable WLAN PDC in case of specific Board ID
Send the AOP msg to disable WLAN PDC for boards which support
on chip PMIC.

Change-Id: I572799a727000b3f124f01919c013c637dee0e10
CRs-Fixed: 3386507
2023-02-13 15:13:38 -08:00
Nijun Gong
d173765b26 cnss2: treat no wlan regulator as no error
If device tree doesn't configure any regulators for
device, means this device doesn't need extra regulator.
This case shall not be treated as an error.

Return a positive value for this case to allow caller to
make proper choice.

Change-Id: I7ead81b3915d16f966f94c9d916e0d67bc04fda0
CRs-Fixed: 3355141
2023-01-05 13:22:01 +08:00
Nijun Gong
1f53dc0696 cnss2: make sure wlan_en is low when power up
Some auto HW can't guarantee wlan_en low state when powerup.
Add a macro to enable initializing wlan_en state.

Change-Id: I6755bcd49c78f7bb9931f80cb385e62177ebe603
CRs-Fixed: 3355148
2022-12-26 17:47:35 +08:00
Geetha Jaya Sri Bandla
7e956ba94e cnss2: Add support for qca6174
Added below mentioned changes to support qca6174 in cnss2 driver.
1.    While resuming pci link, restore the pci config space before
     enabling pci device.
2.    Add 10ms delay between wlan_en become active and pcie reset
     de-assert.
3.    For wlan chipsets which don't support cold boot calibration,
     schedule Wlan driver load in cnss_cold_boot_cal_start_hdlr.

Change-Id: I28435896314783353db5dd830051df9467be6585
CRs-Fixed: 3359223
2022-12-26 17:39:43 +08:00
Rajesh Chauhan
8d75ecdd2d cnss2: Setup GPIOs for interrupt wakeup capable
Setup GPIOs for interrupt wakeup capable by calling
msm_gpio_mpm_wake_set() for such GPIOs.

Change-Id: I8a6e35b6e5ab49c569bfcb0a96c5361072cbe458
CRs-Fixed: 3345066
2022-11-23 21:25:51 -08:00
Rajesh Chauhan
3ea3cda16f cnss2: Add support for additional regulators
Add support for regulators: 1.2V IO, and Antenna sharing
to enable those based on entries in device tree file.

Change-Id: I362f0251ff3923c725f0e2a62922a35149bef3b9
CRs-Fixed: 3338737
2022-11-21 01:12:12 -08:00
Sandeep Singh
04ddb614e4 cnss2: Use ol cpr to update retention voltage of aop regulator
Use ol cpr to update retention voltage of aop regulator
for qca6490 chipsets.

Change-Id: Ic67ca32964bd89fb940be069ec9468d97bbec68d
CRs-Fixed: 3326028
2022-11-01 20:44:08 +05:30
Wade Song
6d69e079af cnss2: Fix a typo in a parameter type
There is a typo in the parameter list of function
cnss_aop_set_vreg_param's declaration, and that is causing
a compilation error when CONFIG_MSM_QMP is not defined on
certain platforms.

Fix the compilation error by changing the 3rd parameter's
type from 'cnss_aop_tcs_seq_pram' to 'cnss_aop_tcs_seq_param'.

Change-Id: Iccb832e1d841a82db3df42c93ef8ed8367a93d26
CRs-Fixed: 3314506
2022-10-17 21:23:30 -07:00
Yu Wang
1296d41e40 cnss2: Add code to update feature list if WLAN_EN gpio supported
Add code to update feature list with CNSS_WLAN_EN_FEATURE flag
if WLAN_EN gpio is supported, the host indicates to firmware
about the WLAN_EN support via the feature list which is sent as
part of host capability qmi message. This would help firmware
to decouple the PERST in RDDM for MSM targets.

Change-Id: Iec870a0f9528a4ffdb118459ec611b33ff01cf80
CRs-Fixed: 3084551
2022-09-30 09:13:39 -07:00
Wade Song
5b9f2c571a cnss2: add support for multi-exchg wlan devices
Converge dt nodes for wlan chips that share the same PCI slot
into one node.

The items in this node are split into 2 parts: common and chip
specific.

The common part will be parsed during cnss probe, such as basic
power related configuration and bus type, to power on the device
and trigger pci probe;

Chip specific part will be parsed during bus specific probe, this
part includes chip specific power and feature related
configurations.

With this change, cnss2 can support different chips on one pci
slot with the same image.

Change-Id: I08c64b6dc3cc27a479ee6fd07e3c8705cc3ac43d
CRs-Fixed: 2384088
2022-09-28 10:09:35 +08:00
Naman Padhiar
a9d924743a cnss2: Fix boot time secure peripheral mode issues
If Device boots up in secure mode, CNSS defers PCI enumeration,
calibration and host driver registration. When secure mode exits
host driver gets notified from CTRL_PARAM and calls PLD API to
perform previously deferred operations and enable WLAN HW. This
can take some seconds and by the time again Secure mode can enter,
disable WLAN and access controlled by TZ.
Now Calibration completes and CNSS receives CAL_DONE indication.
As part of CAL_DONE when CNSS try to power off WLAN access WLAN_EN
it results in NOC error.

One more scenario, where CNSS can access WLAN_EN when WLAN HW
is disabled by TZ, could be when QMI message times out. Consider
secure mode is entering as part of CNSS will to IDLE shutdown.
During IDLE shutdown while sending MODE_OFF QMI message to FW
it might wait for 10 seconds if FW does not respond. But TZ has
timeout of 5 sec if framework does not respond in 5 Sec TZ will
disable WLAN_EN and access control it. Now when after QMI timedout
when try to access WLAN_EN it results in NOC error.

Check secure peripheral state before updating WLAN_EN and maintain
correct driver state in such scenario.

Change-Id: I4a0892f02edb42496b9633d2d33ded26cbc08707
CRs-Fixed: 3247847
2022-08-02 12:23:25 -07:00
Manikandan Mohan
eadcd47888 cnss2: Feature update for OL CPR
Open Loop CPR feature is extended to support multiple VRegs. Add IDL
data structures, device tree setup for WLAN device PMU pin to platform
VReg mapping and handling for new OL CPR params from FW.

Change-Id: Ibdcc5b30521c01e12124b32bd6291def98bd9516
2022-05-13 10:50:35 -07:00
Mohammed Siddiq
8ebc3d7e4f cnss2: Log SW_CTRL GPIO value if PCIe link training fails
Add change to print SW_CTRL GPIO value when PCIe link training
fails during power on.

Change-Id: I77bd2db80dad4c56647f52d67acfab0fe7efb7a7
2022-05-09 20:27:55 -07:00
Manikandan Mohan
5f2db0d3b8 cnss2: Update AOP Mbox interface for PDC config
AOP Mbox interface message is updated to include the PDC name as WLAN
devices like KIWI needs 2 PDCs.

Also following updates are done:
1. Always open Mbox channel for OL CPR update.
2. Add device tree config for PDC - VReg mapping and
   WLAN device PDC Init table.
3. Reconfig PDC based on WLAN device connected to the platform.
4. Add debug interface for PDC update.

Change-Id: Ia3150166a0ef5d44cb74a8c7e3b78870284cd18f
2022-05-02 09:10:59 -07:00
Mohammed Siddiq
ab313f046c cnss2: Add code to support multiple device attaches via sub nodes
Add code to support multiple device attaches via sub nodes.

Change-Id: Ifa2bff0cacbb25bed2498c8804723deb64c583b0
2022-04-27 16:47:54 +05:30
Wade Song
b12d988719 cnss2: Enable support for qca6390 on hana-au
To enable support for qca6390 on hana-au:

1) Return 0, instead of an error code, when 'qcom,icc-path-count'
   isn't present in the device tree, given some chipsets like
   qca6390 don't need this parameter to get probed successfully;

2) Add one more vreg config, 'vdd-wlan-rfa3', into the vreg list
   as it's required for qca6390 to get probed;

3) Add one more dts parameter, 'qcom,multi-wlan-exchg' into the
   wlan device tree node on auto platforms, to reflect the fact
   that multiple wlan chipsets can be plugged, while only one of
   them exists at a time.

Also, reorder the parameters passed for debug printing in function
cnss_plat_ipc_init_fn(), given the original ordering is not
matching with the debug message literally.

Change-Id: I94d33fcfa2343646c55d8021894f35bc3cf8a56b
2022-04-13 06:23:16 -07:00
Yue Ma
ce5d7eafbc cnss2: Add pinctrl support for SOL GPIOs
Add pinctrl support for SOL GPIOs so that default state of the
GPIOs can be set properly.

Change-Id: I2694d5d61074df04ab2e14251a743d387f814ae1
2022-03-29 14:58:40 -07:00
Yue Ma
c4cba5ad7b cnss2: Add support to handle SOL GPIOs
The side-band SOL (Sign-Of-Life) GPIOs are introduced to help make
RDDM more reliable so that device dump can be copied correctly. When
device SOL GPIO is triggered from device, it means there is watchdog
reset happened in device and driver should expect RDDM to happen.
When host SOL GPIO is triggered from host, it will result watchdog
reset as well as PCIe controller reset in device which should try to
enter RDDM always. This commit also adds debug hooks for the GPIOs.

Change-Id: I61a0f252d04ab0a62c5bf838850fe9a1bec2273b
2022-03-29 14:57:36 -07:00
Yue Ma
74770284f9 cnss2: Add regulator entry for sleep clock
For some platforms there will be a fixed regulator (GPIO) to supply
sleep clock for WLAN device. Add that entry for power on regulator
list.

Change-Id: I93a44b2466603abc98de17bdbf09c9ddb44ec8ec
2022-02-16 13:19:20 -08:00
Yue Ma
bd8df912fd wlan_platform: Update CNSS family drivers
Update CNSS family drivers from msm-5.10 kernel as of commit
db1b2399e273 (Merge "cnss2: Increase power on retry delay")
to WLAN platform project. Also add proper copyright markings
for some files.

Change-Id: I03a10b929f5460f80a9b1f258df58e0c1a593598
2021-11-01 20:42:30 -07:00
Yue Ma
5b29459b17 wlan_platform: Bring initial files for CNSS family drivers
Bring CNSS family drivers from msm-5.10 kernel as of commit
cc3bc4b888af (cnss2: Fix a few switch statement fallthrough
issues) to WLAN platform project. Fix SPDX-License format for
a few files as well.

drivers/net/wireless/cnss* -> .
include/net/cnss* -> inc/

Above shows how directories and header files are relocated.

Change-Id: If8fd40a35c9fdbeb1aa76a8aac5fdb1fc1c7e786
2021-10-08 15:28:40 -07:00