Commit-Graf

84 Incheckningar

Upphovsman SHA1 Meddelande Datum
Amit Mehta
600b1dfc1c cnss2: Add DP rings to host SSR dump
Add DP rings to host SSR dump.

Change-Id: I6e2462085ee41e60cfd2e5772f03d081af86617f
CRs-Fixed: 3604908
2023-09-20 07:11:26 -07:00
Mohammed Ahmed
e1dd6c2585 cnss2: cnss changes for sun compilation
Current code has compilation errors
when compiling for sun. sched_clock()
was moved to clock.h, and iommu_map API
was changed with new sun kernel. Fix
this by updating code for new kernel
apis.

Change-Id: I77029fcc74142f3f650dc289c8d19c121eba6445
CRs-Fixed: 3603129
2023-09-14 15:14:49 -07:00
Alan Chen
696ac36d11 cnss2: Create new infrastructure for removing sysfs group
Up until kernel 6.1, devm_device_remove_group() was used when
removing sysfs group. From kernel 6.2 onwards,
devm_device_remove_group() is no longer supported. Thus, create
new functions that replicate original functionality of
devm_device_remove_group().

Change-Id: If3a7b380a03eec5a3f918b5a0813830c3136fd1f
CRs-Fixed: 3601923
2023-09-02 09:03:06 -07:00
Naman Padhiar
e9066ddd35 cnss2: Add SMEM based Secure Peripheral check
Check secure peripheral HW state using SMEM APIs instead of
SCM APIs.

Change-Id: I3e652859189221d3b9d26bd2e71e254edf6843b0
CRs-Fixed: 3601121
2023-08-31 21:46:39 -07:00
Naman Padhiar
6f7e807fb9 cnss2: Move repetitive logs to cnss-long IPC logs
Move trivial repetitive logs from cnss IPC logs to
cnss-long IPC logs. This will reduce the chances of
losing important logs required for debug.

Change-Id: I9cfe76614603d5fb9b3e5d4a2f062abbb7fa754f
CRs-Fixed: 3580107
2023-08-09 01:01:30 -07:00
Zhiwei Yang
f0a7661f00 cnss2: Dump event desc history when SSR occurs
Dump hif_event_desc_history and hif_ce_desc_history_buff
when SSR occurs.

Change-Id: I3c115e1d6b35107e4f97f442a51bd50f50bd79ae
CRs-Fixed: 3553092
2023-07-23 17:09:05 -07:00
Naman Padhiar
3e85d50d6d cnss2: Correctly check for WCNSS_MEM_PRE_ALLOC macro
After CNSS2 switched to Bazel based compilation, conditional
compilation macros became same as configs and are enabled
directly from defconfig. Fix macro check in the code for
both 'y' or 'm' to enable code based on the that.

Change-Id: I12ca87c851a7b47af0255716ce1b9f59ad2eb70a
CRs-Fixed: 3553530
2023-07-12 15:39:07 -07:00
Lin Bai
02c2d4f750 cnss2: Provide platform name if it is required
Provide platform name in host_cap message if
property platform-name-required specified in DTS.

Current platform name is same as device's model name.

Change-id: I8d427602bfc7e6bb5d732fa3e29ff66c965e153b
CRs-Fixed: 3540641
2023-07-05 17:19:30 -07:00
Naman Padhiar
bdd3c6bf67 cnss2: Send QMI message to download TME-L patch
Send QMI message with TME-L patch information to WLAN FW, to
download TME-L patch.

Change-Id: Ieae07c0f761ada45ffcb990b1412654b9c6862b1
CRs-Fixed: 3521187
2023-07-03 09:34:38 -07:00
Shailendra Singh
6ce40d5c60 cnss2: Update time sync period based on tsf sync start/stop
Add cnss_update_time_sync_period and cnss_reset_time_sync_period to
update time sync period vote sent from wlan driver based on use-case.
CNSS driver stores both wlan driver and sys config time sync period
value and will apply the minimum value of all votes.

Change-Id: I46ad2866bd70aefe121c8a68a9c869e75ffd8345
CRs-Fixed: 3502060
2023-06-07 11:12:47 -07:00
Chaoli Zhou
7cd9a66ccc cnss2: Change log level for non-critical cases
Change log level from cnss_pr_err to cnss_pr_vdbg for
some non-critial cases.

Change-Id: I66b16afe5327bab77d52a1ba1b5d72fb88c71715
CRs-Fixed: 3509919
2023-06-01 18:16:16 -07:00
Alan Chen
f4e0145655 cnss2: Add AUX UC download functionality
Add support for AUX UC download functionality if aux support is
indicated by both host and fw.

Change-Id: I3bfbebbb5cdfbbaa350a34378ab2f0809f27affb
CRs-Fixed: 3402104
2023-05-25 19:54:56 -07:00
Sandeep Singh
c32955295b cnss2: move reboot notifier registration after initializing completion
Currently, power_up_complete and cal_complete are getting initialized
after registering for cnss reboot notifier and in cnss reboot
notifier callback we are completing power_up_complete and cal_complete.
In certain cases cnss_reboot_notifier cb getting called before
power_up_complete and cal_complete are getting initialized which
is leading to crash. To avoid these crashes move reboot notifier
registration after initializing completion variables.

Change-Id: Iaf9e925489f4faea621ea40836dcd7330c7b98d2
CRs-Fixed: 3503651
2023-05-22 15:02:57 -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
Sandeep Singh
ff9d11362f cnss_prealloc: add wrapper APIs if MEM_PRE_ALLOC flag not enabled
Add wrapper api to avoid compilaton failure if
CONFIG_WCNSS_MEM_PRE_ALLOC flag is not enabled.

Change-Id: Ic0625d68f587c79f38f33495b53645f1d7582144
CRs-Fixed: 3492092
2023-05-11 15:36:42 -07:00
Naman Padhiar
a232234d41 cnss2: Fix MHI state mismatch for MHI INIT
MHI INIT called during host driver registration leads to MHI state
mismatch because MHI is already in INIT state due to power up of
device as part of ongoing self recovery.
To fix this issue, avoid powering up device during recovery if host
driver is not registered. Device would be powered up later during
host driver registration.

Change-Id: I534dfc0e389ba97a6e2c4869d42be5ecff9609b3
CRs-Fixed: 3476947
2023-05-11 15:36:41 -07:00
Yu Wang
b26c26e7b0 cnss2: notify WLAN driver of system reboot
Notify WLAN driver of system reboot to avoid state
mismatch between cnss driver and WLAN driver.

Change-Id: I03e867484ee450c796c0dfabac7ed550a1d0337c
CRs-Fixed: 3467387
2023-04-28 19:03:31 -07:00
Sandeep Singh
97303bf330 cnss_prealloc: update prealloc mem pool based on device type
Update prealloc mem pool based on device type.

Change-Id: Ic7fc2145a0039aa55643672b8e125857c096a3ee
CRs-Fixed: 3459351
2023-04-25 23:46:44 -07:00
Yu Wang
21bd3e2016 cnss2: wait for device power up although idle restart is interrupted
When the waits on CNSS_DRIVER_EVENT_IDLE_RESTART is
interrupted by a kill signal, the device power up
is still in progress, it needs to wait for power
up complete to ensure synchronization.

Change-Id: I1f350cf70537257d8edbd5d31378d766f924915c
CRs-Fixed: 3422562
2023-04-24 00:10:45 -07:00
Alan Chen
7793f64f52 cnss2: Add 3 more log buffer regions to ssr driver logs
Add support to include hif_ce_desc_history, hif_ce_desc_history_buff,
and hang_event_data log buffer regions in ssr host dump collection.

Change-Id: I650b94973b8b12cb546a1bc2d121ee319a182767
CRs-Fixed: 3455747
2023-04-21 08:16:54 -07:00
Chaoli Zhou
03a337ba78 cnss2: Support enable 32k sleep clk from cnss2
Add one new device tree config item "qcom,sleep-clk-supported"
to support enable 32k internal sleep clock in case it has no
external 32k clk attached in wlan chipset HW. Like qca6390
on some auto platform, host need explicitly tell firmware
to use internal sleep clock, otherwise it will cause LMAC
ps failure.

Change-Id: I52f5d332a912235596eb127ab8e4660355988038
CRs-Fixed: 3448595
2023-04-14 11:58:40 -07:00
Meng Yuan
8eb1e1e993 cnss2: fix the issue that NULL pointer may be referenced
Pointer 'plat_priv' returned from call to function
'cnss_get_plat_priv' may be NULL and may be passed to
another function that may reference it.

Change-Id: I5f8bad5efd0b728127f6f257882693a042d78223
CRs-Fixed: 3428657
2023-04-11 06:26:10 -07:00
Chaoli Zhou
bd49da5f3e cnss2: Support disable pcie bw scalling from cnss2 side
Add new "qcom,no-bwscale" under child device node to
indicate it want to disable bw scalling.

And the background is like HSP, it has stability issue
with some specific pcie cable with gen3, so it will
negotiate with RC side to change from gen3 to gen2
with MHI_ER_BW_SCALE_ELEMENT_TYPE event, which will
impact all the platform that want to keep use gen3.
So add this device tree config item to skip the link
speed negotiation.

Change-Id: I4a8d94a50dd740b84c3eeac435c5a19098b79ad9
CRs-Fixed: 3435289
2023-04-07 18:28:25 -07:00
Wu Gao
3ef55a9a08 cnss2: Add CONFIG_DISABLE_CNSS_SRAM_DUMP
It costs 4M when loading cnss2, if device id is QCA6490 and enabled
CONFIG_CNSS2_DEBUG. Which is big memory consumption for low rate issue
debugging. So add CONFIG_DISABLE_CNSS_SRAM_DUMP to disable sram_dump.

Change-Id: Iacf338a3cc8f1583e16034a9873029a450fd254a
CRs-Fixed: 3441274
2023-04-06 19:13:16 -07:00
Alan Chen
ddbe3d0e4e cnss2: Use proper enum type for local iterator
Change type of local iterator for finding registered log
buffer region to enum.

Change-Id: Iffbde0921fa9d9c9ad15ce890af5c12b28ecc8e7
CRs-Fixed: 3436059
2023-04-03 18:26:04 -07:00
Alan Chen
31dbde2074 cnss2: Add null check for allocated segment
Currently, cnss_do_host_ramdump() is allocating memory for a new segment
to be added to list to be written to ramdump, but it is not accounting
for the case that the kcalloc call returns NULL for the segment pointer.
Thus, add a null check after memory is allocated for the segment.

Change-Id: I80b68f699a44800c19a734c0be7e231726368f68
CRs-Fixed: 3431776
2023-03-16 04:54:33 -07:00
Gangadhar Kavalastramath
4f03c58310 cnss2: Add support for QCN7605
Add support for QCN7605 in cnss2 driver

Change-Id: I529d76f8f6fa6eeea2117630b2a1e9d05ce5f5b4
CRs-Fixed: 3359985
2023-03-07 18:28:55 -08:00
Naman Padhiar
97d02063a9 cnss2: Avoid IDLE Shutdown during recovery
There can be scenario where CNSS driver receives
IDLE shutdown request from WLAN Host driver when
SSR/Recovery is in progress. In such case return
-EBUSY to Host driver and avoid doing IDLE Shutdown.

Change-Id: I68bea49d23e741f405acc1f2c9133cb7452d7952
CRs-Fixed: 3418977
2023-03-03 15:24:27 -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
Gangadhar Kavalastramath
6c09e62157 cnss2: Add code changes to support thermal mitigation
Add cnss2 code changes to register with thermal framework to support
thermal mitigation.

Change-Id: I9d427603bfc7e6bb5d732fa3e29ff66c965e153b
CRs-Fixed: 3386762
2023-02-06 00:02:18 -08:00
Chaoli Zhou
f2346285bc cnss2: Support dual wlan cards managed by cnss2 platform driver
Currently, the cnss2 platform driver just can support
one wlan device attached, so do the following changes
to cover dual wlan card attach case. Firstly, delay
the second device go to pcie link suspend and power
off state to make sure it really finished the pcie
enumeration. Then pcie enumeration succeeds with
multi-devices. Secondly, supporting to write the qrtr
node instance id to PCIE register for wlan fw reading,
which can fix qmi message exchange failure if active
two Hastings devices. Thirdly, change the usage of
plat_env to support dual Hastings.

Change-Id: Ica41a23d4e983b91c0ff1b4e76b380803fb877ab
2023-01-31 16:53:31 +08:00
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