Grafico dei commit

282 Commit

Autore SHA1 Messaggio Data
Naman Padhiar
9eaccc90ab cnss2: Dump PCI scratch registers for MANGO and KIWI
Add support to dump PCIE SOC scratch registers for MANGO
and KIWI device.

Change-Id: I4f7a64c2bf186d19d96500ffedc5e732cc50fc03
CRs-Fixed: 3306157
2022-10-04 21:36:23 +05:30
Rajesh Chauhan
f7e10ed87e cnss2: fix issue in return type of debug functions
Fix issue in return type of following functions:
 - cnss_rddm_trigger_debug()
 - cnss_rddm_trigger_check()

Change-Id: I41eb4637605f9a2189e03e732c688c25b0895a90
CRs-Fixed: 3304957
2022-10-02 14:04:25 -07:00
Naman Padhiar
60f897b63a icnss2: Send WLAN_EN delay during Mode request
Send WLAN_EN delay during Mode On QMI request if temperature is
below threshold at that time.

Change-Id: I910168dafa09c25cc4a263a7756379eb8be46824
2022-10-02 01:17:36 -07:00
Naman Padhiar
2d912a8ca2 cnss2: Add GCC register read for debugging
Read GCC spare register after SOC reset to check device
status.

Change-Id: If25d8e42fcf6921744b1907e1abd4ef16ac95148
CRs-Fixed: 3290178
2022-09-30 17:40:38 -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
Rajesh Chauhan
ecb1bc2deb cnss2: use dma_set_mask and dma_set_coherent_mask
In kernel 5.18, pci-dma-compat.h is removed and so instead of
calling pci_set_dma_mask and pci_set_consistent_dma_mask, call
dma_set_mask and dma_set_coherent_mask.

Change-Id: I91cbe8700b8f165c1140d015c28b1c34d3ea99bd
CRs-Fixed: 3298228
2022-09-27 04:33:39 -07:00
Rajesh Chauhan
291b1a8d27 cnss2: Protect dependency on sec-module-symvers
Protect dependency on sec-module-symvers under flag
TARGET_KERNEL_DLKM_SECURE_MSM_OVERRIDE so that platform driver
builds successfully if TARGET_KERNEL_DLKM_SECURE_MSM_OVERRIDE
is set to false.

Change-Id: Ieb53f5a6db7378b2ac77db252343dfedb2b51a8c
CRs-Fixed: 3295225
2022-09-27 04:33:37 -07:00
Naman Padhiar
5d4164a215 cnss2: Check if secure peripheral feature is supported
TZ APIs, to check the secure peripheral state, can return error code
which says feature is not supported. Set a flag if feature not
supported and avoid calling TZ APIs again till next device boot.

Change-Id: I8f83c206b7a876cbaa304b442a9cfe9f6372a04d
CRs-Fixed: 3290183
2022-09-26 23:36:04 -07:00
Rajesh Chauhan
1771314f7e cnss2: Replace fallthrough comment with attribute
Some compilers such as clang requires the attribute instead
of just a fallthrough comment when -Wimplicit-fallthrough
is enabled. So replace fallthrough comment with attribute.

Change-Id: I1935bfb325b550fbc6539c58a99b3696fb6cc753
CRs-Fixed: 3295197
2022-09-26 23:36:01 -07:00
Sandeep Singh
39e099aa46 cnss2: pass fw build id in soc info to wlan host driver
Pass fw build id as part of  soc info to wlan host driver.

Change-Id: If1906abe5efc8f98a1e396e19574c817169a954a
CRs-Fixed: 3298924
2022-09-23 18:14:18 +05:30
Bruce Levy
18d51db05d cnss2: Enable/Disable DLKM
Control DLKM using ENABLE_WLAN_PLATFORM_DLKM.

Change-Id: Id1dc01a87565abc73ab1a84edb61351e29bdc602
CRs-Fixed: 3292543
2022-09-16 00:47:29 -07:00
Sandeep Singh
eeed8341c6 cnss2: move pci/mhi register dump after rddm mode trigger
Move pci/mhi register dump after rddm mode trigger
in case of smmu fault.

Change-Id: I3e2c4c5725f614b7b12e95d3a13ec0250a631608
CRs-Fixed: 3291781
2022-09-15 18:26:56 +05:30
Naman Padhiar
9f778282b9 cnss2: Avoid assert if WLAN HW disabled during power on
In some scenario like ssgtzd get killed, CNE and TZ go out of sync.
Consider a case where TZ notified CNE to enable WLAN HW. Now CNE
will request to CNSS to Enable WLAN HW. At the same time again TZ
notified CNE to Disable WLAN HW but due ssgtzd killed, CNE did not
wait for previous request(sent to CNSS to enable WLAN HW) and immediately
return to TZ. TZ assumes everything is done and change state to secure
mode. Now CNSS act on previous request of enabling WLAN HW but when
when checks the state it get secure mode and fails to enable WLAN
and asserts. Avoid assert in such scenarios.

Change-Id: I85f63258ff55a44cfcc5ebeaa9da9ba19db67780
CRs-Fixed: 3288122
2022-09-13 18:08:10 -07:00
Naman Padhiar
2e0fe8fe22 cnss2: Release DMS QMI handle during dms_del_server
DMS server runs in Modem. When Modem SSR happens dms_del_server
gets called. Even after DMS service disconnected, qmi_txn_wait is
still waiting. Release DMS QMI handle in dms_del_server to cancel
pending transaction.

Change-Id: I06ccfba34269dc51288300aa5fa0326842a09e32
CRs-Fixed: 3288808
2022-09-13 13:47:10 +05:30
Yu Wang
a5a88a8d75 cnss_prealloc: replace in_atomic() with proper API
According to kernel comment for in_atomic(), it's
incorrect to use it outside core kernel code.
To follow this rule, replace
(irqs_disabled() || in_atomic()) with (!preemptible())
when getting GFP flags.

Change-Id: I7cdb28a7f12ffd60216c7bc1921a277de6113cb5
CRs-Fixed: 3273779
2022-08-26 12:28:06 -07:00
Sandeep Singh
865b5ac35b cnss2: Add support for pci reg dump for hang data for kiwi
Add support for pci reg dump for hang data for kiwi.

Change-Id: I0b4372e3cf977a3916487360112dc06355b457d8
CRs-Fixed: 3139461
2022-08-24 18:33:07 -07:00
Naman Padhiar
3adaa3d25d cnss2: Fix dereference of pointer before NULL check
Have NULL check for plat_priv pointer before dereference.

Change-Id: I1a67f5cb237c7a6d2f960c0afa5146c5ed90d44f
CRs-Fixed: 3273468
2022-08-24 01:32:18 -07:00
Yu Wang
728b08d683 cnss_prealloc: fix GFP flag for mempool_alloc
As per implementation of might_sleep(), rcu_read_lock()
nesting depth should be take into consideration too to
figure out whether sleeping is allowable or not.
To make align with it, allocate memory with GFP_ATOMIC
if rcu_read_lock() nesting depth is not zero.

Change-Id: Ib225a33b1a3f37b919e41daf064ce2de44428973
CRs-Fixed: 3271651
2022-08-22 04:51:13 -07:00
Sandeep Singh
99c1335031 cnss2: Allocate sram dump memory for qca6490 debug build only
Sram dumps are getting dumped only for qca6490 debug build, so
allocate sram dump memory for qca6490 debug build only.

Change-Id: If714b49720c1445ebfc0d4645dde592145b734a8
CRs-Fixed: 3256709
2022-08-19 03:15:10 -07:00
Sandeep Singh
db6c6ce1d2 cnss2: Return kobject to wlan host driver
Return kobject to wlan host driver. Host driver
asks platform driver for wifi kobject. If wifi kobject
provided by platform driver is NULL, it creates wifi
kobject itself.

Change-Id: I7f44350a84ad054c674442ae0c0272885dc95d38
CRs-Fixed: 3262907
2022-08-09 01:27:16 -07:00
Alan Chen
a2e700310b cnss2: Enable PCIe gen switch
PCIe gen switch via debugfs is allowed only for QCA6490. Remove check
on QCA6490 and instead allow PCIe gen switch based on firmware
capability exchange.

Change-Id: Ib17c54a6c17a2b87d01a877b057495debec704f6
CRs-Fixed: 3260767
2022-08-05 18:08:23 -07:00
Alan Chen
787df21a61 cnss2: Disable MHI satellite if DRV is disabled
When DRV is disabled during use, MHI satellite is still enabled and
is causing timeout when suspend occurs again. Hence, set base to 0
for MHI satellite when DRV is disabled in order to disable it.

Change-Id: I68315cc102884a33b2ba92753f21af2e59b6b466
CRs-Fixed: 3256095
2022-08-03 11:19:05 -07: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
Yu Wang
54e992906b cnss2: skip operations when it's under reboot
Skip FW ready event handling and driver probe
when it's under reboot.

Change-Id: I59418faea0d36e77d4da001110cf65756a842d8d
CRs-Fixed: 3256553
2022-08-02 11:54:36 -07:00
Nirav Shah
20cf29c42e cnss2: Add sysfs support for configuring timer sync interval
It can be used to tune the host and fw time synchronization interval
for better accuracy.

Change-Id: I0a3d8895520cec526341f278c91f153dd0bd1966
CRs-Fixed: 3257702
2022-07-29 10:44:44 +05:30
Wade Song
f0ec361d6a cnss2: Add support for conditional powering off
It is observed during some stress tests under very bad thermal
conditions that wlan re-probe can fail after cnss2 probes the
device for the 1st time and then powers it off.

When this happens, the SW_CTRL signal doesn't go high after
cnss2 toggles WLAN_EN.

To avoid such issue, add support for conditional device power
off so power supply will be retained for certain chipsets after
cnss2 probes it for the 1st time.

Change-Id: I81d508f2a69fcbc6f8761988981ec432af059fac
CRs-Fixed: 3241179
2022-07-18 16:36:35 -07:00
CNSS_WLAN Service
a6ec859365 Merge "cnss2: Fix a minor discrepancy for device powering off" into wlan-platform.lnx.1.0 2022-07-18 04:47:38 -07:00
Sandeep Singh
efa5599cc4 cnss2: Add code to parse and store hwid bitmap received from FW
Add code to parse and store hwid bitmap received from Firmware
as part of target cap response QMI message. The bitmap gives
information about the FEM combination in use.

Change-Id: I6c7e9cedfc70df056ed361953b10a65166915087
Signed-off-by: Sandeep Singh <quic_sandsing@quicinc.com>
2022-07-17 21:45:31 -07:00
CNSS_WLAN Service
c0028b8bb8 Merge "cnss2: Add base changes for pci hang data support on HMT" into wlan-platform.lnx.1.0 2022-07-17 14:48:19 -07:00
Wade Song
1c1564f44c cnss2: Fix a minor discrepancy for device powering off
On device probe, cnss2 should not power off the device in api
cnss_wlan_device_init() because the device either:
  1) has already been powered down after it is enumerated by
     the pcie probe callback and its related code; or
  2) doesn't have to be powered off.

To fix this issue, add code to return directly from
cnss_wlan_device_init() without powering down the device once
cnss_bus_init() returns 0.

Change-Id: I1dd57952368471e522757cdda47bf2ac27eab112
CRs-Fixed: 3244133
2022-07-14 23:12:57 +08:00
CNSS_WLAN Service
87360d22d9 Merge "cnss2: Add code to fallback to non-contiguous FW mem allocation" into wlan-platform.lnx.1.0 2022-07-13 20:55:38 -07:00
CNSS_WLAN Service
80a9b9b268 Merge "cnss2: Add code to optimize prints" into wlan-platform.lnx.1.0 2022-07-13 20:55:36 -07:00
Sandeep Singh
1e6a925b34 cnss2: Add base changes for pci hang data support on HMT
Add base changes for pci hang data support for HMT.

Change-Id: I0e1dde6649b36ffdca5a6a75f2198f4fde50d211
CRs-Fixed: 3111908
2022-07-12 21:55:24 -07:00
Sandeep Singh
1e6b77b03b cnss2: Add code to fallback to non-contiguous FW mem allocation
Add code to fallback to non-contiguous FW mem allocation on
failure to allocate contiguous memory.

Change-Id: Idbc7ff7f9ea4d2157e3b549dde8ee090a0f0b412
CRs-Fixed: 3072737
2022-07-13 10:18:20 +05:30
Naman Padhiar
2a23792d48 cnss2: Properly handle Secure HW feature API error
There are scenarios where APIs to get HW secure mode fails
due to feature not supported. Handle the error gracefully
for such cases.

Change-Id: Iace96f21dbbcd87ddb94bf4546a0fca3b3868995
CRs-fixed: 3241447
2022-07-12 22:50:47 +05:30
Wade Song
c08c79e658 cnss2: Increase the value of dev power on retry factor
Based on the results of some stress tests under very low
temperature, such as -40degC, the AON voltage on some of the
devices can take more than 1.5s to reach zero. And under
such circumstances, wlan device probe can fail if cnss2 turns
on wlan power supply too fast.

To avoid wlan probe failure, increase the value of wlan power
on retry factor to 4 so cnss2 can wait up to 2s during extreme
conditions before probing the device again.

Change-Id: Id56bb4687b30ec214cda05d3ee388b3e5c468ab8
2022-07-10 22:04:51 -07:00
Sandeep Singh
6b4390361d cnss2: Add code to optimize prints
Add code to optimize prints.

Change-Id: I21c070b4c136eeb5ef3ea2cc18e0fc415fd2297b
CRs-Fixed: 3161488
2022-07-06 12:29:56 +05:30
Alan Chen
79dd3075ca cnss2: Add support for WLAN MANGO PCI device
Add PCI device ID config and code updates to handle MANGO WLAN device.

CRs-fixed: 3210010
Change-Id: I48fffdb8c7ecf5343908d823facf7a2fad2f2dea
2022-06-30 17:51:42 -07:00
Kai Liu
07e71590f2 cnss2: Dump qdss registers only when etr dump enabled
Skip dumping qdss registers if etr dump is not enabled, or
will hit NOC error since these qdss registers are not powered on.
Move dump process after device enter into RDDM mode, or registers
might be invalid.

Change-Id: Ib5e5a8d8beb2e1f76266ce0f25d4abe6e73e7506
CRs-fixed: 3226702
2022-06-28 12:14:21 -07:00
Naman Padhiar
4d21b48025 icnss2: Add support to configure WLAN_EN_DELAY
Add support to configure WLAN_EN_DELAY using sysfs.
When temperature detected is less than threshold
configure WLAN_EN_DELAY value from sysfs if it is
greater than default WLAN_EN_DELAY value.

Change-Id: I94ac0c6bb3bd2bc2da122d3cf1215b8fe964159f
CRs-Fixed: 3230892
2022-06-28 14:36:37 +05:30
Mohit Khanna
2c3d91eed9 cnss2: Dynamically use shadow regs for time_sync
For kiwi target the current code is using shadow_reg indexes 0,1. Change
the logic to use next two shadow registers of what is used by the host.

Change-Id: Ice95be0f2106078b8f799ca1182d1d8702b564c6
CRs-Fixed: 3218660
2022-06-24 16:11:19 -07:00
Manikandan Mohan
fc97f926b0 cnss2: Skip HW re-enable if HW is already probed at boot
Peripheral control service can send notification to enable WLAN HW
even if HW is already enabled at boot. Thus skip wlan device pci
re-enumeration if PCI probe is already complete.

Change-Id: I5687b9ee74afe9331e11ec1fc5f1cf20f94117c8
CRs-fixed: 3224613
2022-06-20 13:35:34 -07:00
CNSS_WLAN Service
fc8e91f180 Merge "cnss2: Add support secured wlan HW disable mode" into wlan-platform.lnx.1.0 2022-06-20 03:21:14 -07:00
Manikandan Mohan
ad4399e37a cnss2: Add support secured wlan HW disable mode
WLAN HW can be securely disabled. Add support in platform driver to
handle WLAN cold boot initialization sequence changes if HW is disabled
at boot and WLAN resume sequence after WLAN HW is enabled.

Change-Id: If5036560820c54653801298ceebe4f50b7532f3f
CRs-fixed: 3211229
2022-06-16 16:23:19 -07:00
Sandeep Singh
9f32f8da41 icnss2: Enable host trigger recovery for wpss adrastea
This change enables host trigger recovery for wpss
adrastea targets.

Change-Id: I23345f57531563e96352d61e5404ae9d68cdfbcc
Signed-off-by: Sandeep Singh <quic_sandsing@quicinc.com>
2022-06-14 11:49:23 +05:30
CNSS_WLAN Service
5c067d4008 Merge "icnss: Add debug fs entry to call PSF callback" into wlan-platform.lnx.1.0 2022-06-13 09:54:26 -07:00
Manikandan Mohan
99b7b2d663 cnss2: Remove MHI satellite config for QCA6490 and KIWI_V1
MHI Satellite configuration is not supported for QCA6490 and KIWI_V1.
Hence remove these configuration from MHI controller for these wlan
devices.

Change-Id: I781af04da1a0a69e1997d5b53704b5e341e17a53
CRs-fixed: 3202317
2022-06-09 10:48:48 -07:00
CNSS_WLAN Service
b9a7971007 Merge "cnss2: Print the bandwidth level voted" into wlan-platform.lnx.1.0 2022-06-07 10:15:15 -07:00
CNSS_WLAN Service
9763601a0c Merge "icnss2: Enable power supply framework for 5.15 kernel" into wlan-platform.lnx.1.0 2022-06-07 10:15:06 -07:00