Graf commitů

53 Commity

Autor SHA1 Zpráva Datum
Alan Chen
edab97e465 cnss2: Add support for WLAN PEACH PCI device
Add PCI device ID config and code updates to handle PEACH WLAN device.

Change-Id: Ib4f30a1dd5c3307c59694e94871617e766488677
CRs-Fixed: 3347738
2023-01-28 01:06:38 -08:00
Alan Chen
ae2498e987 cnss2: Collect and load elfdump data
Call collect_driver_dump() driver ops to add the data from the buffer
for the four log types.

Change-Id: Ic06d4520de6f87202d1c3ce24362d61002b85f61
CRs-Fixed: 3352310
2023-01-19 18:40:35 -08:00
Yu Wang
4d71059d9b cnss: store PCSS recovery config and send upon receiving fw ready
Keep PCSS recovery config as persistent during the whole
lifetime of cnss driver, and send it to WLAN firmware
service upon receiving firmware ready event.

Change-Id: Iec6c35c82750df3f8fd43723d102bcabfb539874
CRs-Fixed: 3378798
2023-01-13 06:12:59 -08:00
Yeshwanth Sriram Guntuka
a1b93f1d72 cnss2: Use IOMMU_CACHE flag for audio smmu mappings
WLAN IOMMU mappings have cached attribute set whereas
ADSP IOMMU mappings do not have cached attribute set.
This is resulting in an inconsistent memory view between
ADSP SS and WLAN SS. ADSP writes to a DDR location and
WLAN HW reads from the same location but since access is
cached from WLAN side, there is a possibility of reading
incorrect values.

Fix is to use IOMMU_CACHE flag for audio smmu mappings.

Change-Id: Ife97bee34bc8224fd2d0d2bb45b606efeea5aa53
CRs-Fixed: 3375521
2023-01-11 14:55:12 +05:30
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
Sai Kumar Kunchala
b1788474b3 cnss2: Add NULL check for 'dev' pointer
Add NULL check for 'dev' pointer before passing to
cnss_bus_dev_to_plat_priv function.

Change-Id: I8ab93a71219638e4b66d3b9fdcb164e052385129
CRs-Fixed: 3364740
2022-12-21 20:47:34 -08:00
Sai Kumar Kunchala
1def1b7402 cnss2: Add NULL check for 'dev' pointer
Add NULL check for 'dev' pointer before passing to
cnss_bus_dev_to_plat_priv function.

Change-Id: I319a9859c41d7e8096b3a4457f4a831e0e93f7ab
CRs-Fixed: 3360223
2022-12-18 20:36:49 -08:00
Naman Padhiar
6660ad60be cnss2: Add support for Audio IOMMU map and unmap
Add support for IOMMU map and unmap of WLAN memory
regions into Audio SMMU for direct link usecases.

Change-Id: Ic136b1e5ac22641b6612ab5285452273233fcaea
2022-12-10 08:30:32 +05:30
Naman Padhiar
42fee6ecad cnss2: Add API to send WFC mode to WLAN FW
Add and export API to host driver to send WFC(WiFi Calling)
mode to WLAN FW.

Change-Id: I92d3d0baad9afc6fdf66f66b847a4e8a90a54341
CRs-Fixed: 3346550
2022-11-26 14:01:00 -08:00
Naman Padhiar
2fd60f792b cnss2: Add API to get FW supported capabilities
Add and export API to check whether FW capabilities like
DIRECT_LINK, etc are supported by FW or not.
Update WLAN Firmware Service QMI file as per latest IDL file.

Change-Id: Ic33104ec55e18845b8c33ff611d1ecc15ec5cd77
CRs-Fixed: 3335259
2022-11-12 17:29:28 -08:00
Sandeep Singh
866685439c cnss2: Add RC_EP_ULTRASHORT_CHANNEL in cnss feature list
Add RC_EP_ULTRASHORT_CHANNEL in cnss feature if it
is enabled in dtsi and indicate it to wlan fw.

Change-Id: Ic70c4b1b2dd637f11c2e2b281521f2094a9a2fe9
CRs-Fixed: 3323608
2022-10-29 14:43:29 -07:00
Wade Song
99580edb00 cnss2: Remove function cnss_pm_notify
To protect firmware download not be processed when system goes into
suspend, before we add semaphore cnss_pm_sem in cnss driver.
Function cnss_pm_notify, PM_POST_SUSPEND may be got before
PM_SUSPEND_PREPARE. Once it happens, the count of cnss_pm_sem will
be abnormal.

And, ROME firmware download is in qcacld driver. Not in cnss driver.

So, remove function cnss_pm_notify, and the export symbol cnss_lock_pm_sem
and cnss_release_pm_sem. Move the protection to qcacld driver. In qcacld
driver, use wakeup source to protect ROME firmware download.

Change-Id: I7768fdbeb1fa8cd6ef3b260eb0aafb231aeed324
CRs-Fixed: 3294347
2022-10-24 18:57:14 -07:00
Jayachandran Sreekumaran
e079e8958c cnss2: Check calibration support after pci probe
Ensure the completion of pci probe before checking
whether the calibration is supported for the device id or not.

Change-Id: Ifb6b6b15c434c16822bb8a4291403e4a635f985f
CRs-Fixed: 3303831
2022-10-17 11:07:58 -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
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
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
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
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
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
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
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
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
Kai Liu
add05df61f cnss2: loads different fw binary per running mode
Kiwi-v2 supports separates image for MM and FTM mode,
platform driver will load difffernt binary according to the mode
indicated by wlan driver.
If seprate binary is not there, fall back to default binary.

Change-Id: I848309440fdffd6517463e18190c03c1b7ed9269
2022-05-31 21:54:57 +08:00
Naman Padhiar
126f48b0f4 cnss2: Allow wlan host driver loading if cnss2 node is present
This change allows wlan host driver loading only if cnss2
node is present in dtsi. On spf, qca6490 wlan driver loading
is getting retried 100 times even if cnss2 node is not present
which is causing andoid bootup delay. This change will return
ENODEV error on wlan driver loading if cnss2 node is not present
instead of EAGAIN which was getting returned earlier.

Change-Id: Ic8568147257642a84983a0d6e738e4bf0ee917b5
CRs-Fixed: 3201930
2022-05-26 16:18:52 -07:00
Naman Padhiar
2aa767ca86 cnss2: Add support to download ini file to FW
Add new QMI message to download wlan-connection-roaming.ini
file to FW.

Change-Id: Icc7d63847560ae07f3d3cdebc158faf8e4cb5aec
2022-05-23 10:09:32 -07:00
Kai Liu
648ac5ccff cnss2: Add pcss recovery support
Extend current recovery sysfs interface, add pcss recovery support.
Change previous sysfs recovery from bool to bitamp. Bit 0 is used
for original wlan recovery, bit 1 is newly added for pcss recovery.
Once fw is downloaded, host driver can use QMI message to notify
fw enable or disable this feature.

Change-Id: Ifdf49cecc70ab2d554bd267d18ff78d92049f5b8
2022-05-19 14:36:33 -07:00
Mohammed Siddiq
c4f490a979 cnss2: Add code to parse wlan sw ctrl gpio in get_dev_cfg_node
Add code to parse wlan sw ctrl gpio in cnss_get_dev_cfg_node so
that entire handling of subnodes is restricted to one function.

Change-Id: I13ccb0b3de082e396939c8b37e738b149ccd3095
2022-05-19 14:35:06 -07:00
Mohammed Siddiq
334ef0ec36 cnss2: Add code to dump SRAM on MHI power on failure for QCA6490
Add code to dump SRAM on MHI power-on failure. To avoid CPU hog
relinquish CPU after dumping 256Kb chunks.

Change-Id: I2c9c64424c8ae4612e67b78fcabc1f872fefea81
2022-05-17 10:43:17 -07:00
Kai Liu
af5e427b47 cnss2: Limit DRV suspend mode setting before FW ready
Debugfs item control_params can be used to disable|enable
drv suspend, since FW can configure suspend mode only before FW ready,
so host needs make sure this flag is set at proper phase.

Change-Id: I632e3802aa1ab152fe153530a49a7405599cf96d
2022-05-05 18:35:01 -07:00
Mohammed Siddiq
be6ab7d269 wlan_platform: use cnss_utils to send device type across wlan & bt
Add code to use cnss_utils to send device type across wlan & bt.
cnss platform driver reads the wlan sw control gpio and updates
the cnss_utils with the device type, when Bt comes up it get the
device type from cnss_utils.

Change-Id: I5b6f3e7d3dc44e4c5a4a341b3e286f87b5c24bbb
2022-05-02 12:47:44 -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
1f16ed3cb1 cnss2: Explicitly enable/disable dev SOL interrupt during power on/off
Dev SOL GPIO will be pulled down (interrupt will be triggered then) by
design when WLAN_EN GPIO is pulled down. Hence enable/disable dev SOL
interrupt during power on/off to avoid handling such case.

Change-Id: Ia0ddcbd438d533832c944632443000e2a087a300
2022-04-11 14:19:57 -07:00
Manikandan Mohan
11e6daf9bf cnss2: Refactor calibration timeout handling
WLAN driver register requires calibration to complete if enabled.
Calibration timeout can happen due to FW or file system mount delay.

Update driver to assert only for calibration timeout due to FW.

In some cases file system mount may take longer if file system repair
is attempted. Thus update cnss platform driver to wait for this
operation to complete and only log the time elapsed.

Change-Id: Iacd4d4565fb05ae1557c94c574c0153b5995b226
2022-04-04 13:51:28 -07:00
Manikandan Mohan
abe9d5bfb6 cnss2: Add sysfs entry for charger mode
WLAN is not needed in charger mode. Thus add a sysfs entry to notify
charger mode to cnss platform driver to ignore wlan initialization
request.

Change-Id: I4719b16e7fa6914c253018284b5a5d80acf14bbb
2022-04-04 13:49:57 -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
f6441910dc cnss2: Add NULL check for a few exposed APIs
Per static analysis, NULL check is needed for a few exposed APIs,
hence add it.

Change-Id: I614418cd47e6cc8f7c58e294b7bd5de596b6362c
2022-03-08 15:13:23 -08:00
Yue Ma
be03060a66 cnss2: Use correct device code name
Correct code name for kiwi device.

Change-Id: Ic52ba0abfc7049fd353eb1416a5c77c5bfec4bb5
2021-11-15 13:16:26 -08:00
Yue Ma
2aa7359c06 cnss2: Add dev coredump support
Support dev coredump feature if QC ramdump related features are
not present so that WLAN dump can be saved to file system using
userspace binary. Most of the logic here is referred from QC
ramdump driver.

Change-Id: I9a0966f66f3d7999948216a7b83f57beff1ef519
2021-11-02 10:53:37 -07:00