Gráfico de commits

225 Commits

Autor SHA1 Mensagem Data
Naman Padhiar
643d19ee98 icnss2: Check for SSR before SOC Wake request
There are scenarios when WLAN Host request for
SOC Wake during SSR. If WLAN FW receives the request
before FW_READY it ASSERT.
Avoid sending SOC Wake request to FW during SSR.

Change-Id: Ia42cc17149de7a33da0161a280c79d5dfce0f4c8
CRs-Fixed: 3435111
2023-03-16 22:37:14 -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
Zhaoyang Liu
203b502ea7 cnss2: Protect dependency on sec-module-symvers for KBUILD_EXTRA_SYMBOLS
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: Ib357815f73cd3b7e94854fa070ec036bb8624976
CRs-Fixed: 3433493
2023-03-16 04:54:32 -07:00
Jayachandran Sreekumaran
9d783b8514 cnss2: Ensure driver registration before suspend
Ensure wlan driver registration before invoking suspend callback.

Change-Id: I2c8e40770209ae37364bdfea71045522d43465a8
CRs-Fixed: 3378544
2023-03-16 04:54:32 -07:00
Gangadhar Kavalastramath
313bb86570 cnss2: Set genoa dma bit mask to 32 bit
Currently genoa is using lower 32 bits of 64 bit dma
bitmask. Unexpected access of higher 32 bits may cause
issues.This code change avoids such possibilities.

Change-Id: I8bf17056a12661a7c50333bf5897721d363550a3
CRs-Fixed: 3428036
2023-03-11 15:42:16 -08:00
Chaoli Zhou
74ebfcdb0a cnss2: Skip any adsp operation if DRV not supported
At the auto platform, DRV feature is not applicable.
So do not issue any DRV related operation from cnss2
side, which may cause the RC PHY not ready in the LPM
case.

Change-Id: Iefae9a885c1adc289da518d65a2974e127bdf359
CRs-Fixed: 3419811
2023-03-10 21:15:43 -08:00
Kai Liu
597155d64e cnss2: Move genl related data to ipc long context
Fw reports binary info to host, host will send to cnss-daemon by
nl80211 message, move log in this path to ipc long context.

Change-Id: Ie458f26789e765f7edf3188ed2897e7082cdb52b
CRs-Fixed: 3427156
2023-03-08 12:24:48 -08: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
Sandeep Singh
f6f7707351 icnss2: Add change to download qdss file for WCN6450
Add change to download qdss file after bdf download
for WCN6450 device.

Change-Id: I3b46c3411d8af7835af3907f472e82906f924d08
CRs-Fixed: 3413562
2023-03-02 10:48:37 -08: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
Sandeep Singh
b9deac9d5c icnss2: Disable APPS proxy votes before WLAN_EN
WCN6450 has strict power on sequence where WLAN_EN needs
to be enable first followed by regulators. To achieve
this remove Host Proxy votes before sending TARGET_CAP
and MODE_ON QMI request in which FW is suppose to do
WLAN_EN high.

Change-Id: I315269048c6499153d4d2daf6ee6a829f6fd2ccc
CRs-Fixed: 3413588
2023-02-28 23:33:52 -08:00
Sandeep Singh
aec346c6bc icnss2: Add support for WLAN WCN6450 device
Add corresponding driver support for WCN6450 device.
This change adds compatible dtsi entry, msi config,
v3 shadow register config and vreg regulator details
along with enabling bootup sequence for WCN6450 device.

Change-Id: I406c92cdc2815ffd1108331d382c4972befad998
CRs-Fixed: 3404702
2023-02-28 23:33:51 -08:00
Sandeep Singh
ecd2be21ed icnss2: Add null check for priv variable
Add null check for priv variable to avoid null
pointer dereference.

Change-Id: Ib1746d564f27f8096f66761946d37a2a3faf2e57
CRs-Fixed: 3378034
2023-02-28 18:35:39 -08:00
Naman Padhiar
01cb81be76 icnss2: Use event_data before posting event
In icnss_pdr_notifier_cb() API, event_data gets free while
processing PD_SERVICE_DOWN event. In the same function
event_data->crashed is checking after posting PD_SERVICE_DOWN
event which may cause using event_data even after free.

This commit updates checking for event_data->crashed before
posting PD_SERVICE_DOWN event.

Change-Id: Ie82a0b7b4ceb40063318ab2d926b9c14412fb2c9
CRs-Fixed: 3415299
2023-02-28 14:47:48 -08:00
Chaoli Zhou
b4a9230200 cnss2: Support compile flag CONFIG_CNSS_REQ_FW_DIRECT
Support CONFIG_CNSS_REQ_FW_DIRECT compile flag passing
from external to use request_firmware_direct instead of
firmware_request_nowarn to avoid regdb.bin search failure
with qcn7605 that finally cause kernel panic on the LV
platform.

Change-Id: I2431692465298c841bf63add44187c15e68a9742
CRs-Fixed: 3413712
2023-02-28 02:21:00 -08:00
Naman Padhiar
5c7494ce4a cnss2: Set TME-Lite support flag for Peach
Peach supports TME-Lite to validate FW image. TME-Lite supported
FW image format is different from currently used FW images and it
requires different way of downloading in MHI layer. Set TME-Lite
supported flag in MHI controller for Peach to inform MHI about
FW image format.

Change-Id: I615570914c9cec297aa422ce683b4d1c6c75ea1c
CRs-Fixed: 3364546
2023-02-26 22:53:13 -08:00
Chaoli Zhou
ef7ea762d7 cnss2: Force PM resume for qca6390
For whatever reason, the qca6390 is not in M3 state
during PM resume phase, but still functional if do
force resume. So calling mhi_pm_resume_force()
instead of the mhi_pm_resume() to unblock PM
resume for kernel 5.15.

Reference link:
https://lore.kernel.org/regressions/871r5p0x2u.fsf@codeaurora.org/

As for lower kernel version, like 5.4, it will do local
mhi pm state check in the mhi_pm_resume() instead of
target pm state check, so has no issue with qca6390.

Change-Id: I54c2cef457405720386af6a6f7d4617f3d081875
CRs-Fixed: 3402571
2023-02-20 08:30:48 -08:00
Xiaoning Ma
d1e484f291 cnss2: Support make target 'modules'
Yocto module.bbclass calls 'make modules' from wlan platform
root dir to compile external modules, it gets the error
"make: *** No rule to make target 'modules'.  Stop."

Update Makefile to support make target 'modules'.

Change-Id: I5b20d71eeedb5dac987d42768d609b32bace1b79
CRs-Fixed: 3401306
2023-02-20 08:30:47 -08:00
Sandeep Singh
f9c51b9eb2 cnss2: Enhance debugging information
Add change to print file type which is getting
downloaded from cnss2 platform driver to wlan fw.

Change-Id: I737c9c04bc02a3cd320362f230a0862321ec312c
CRs-Fixed: 3401928
2023-02-17 00:53:01 -08:00
Chaoli Zhou
8fdf81fea5 cnss2: Support conditional power off in the LPM for HST/HSP
Should power off HST/HSP if it only finished pcie
enumeration without WLAN driver load before do
LPM. Otherwise, it will cause the mhi state switch
from INIT to SUSPEND failure that block LPM.

Change-Id: Ia2c5fbf0a2bf9c088be548eb533d7836f45a3cfd
CRs-Fixed: 3283893
2023-02-16 07:16:03 -08:00
Jia Ding
05abe90286 Revert "wlan_platform: Update Makefile to build CNSS drivers for Atherton_target"
cnss driver is supposed to be supported across platforms regardless of
CONFIG_PCI_MSM. Hence using CONFIG_PCI_MSM to decide if cnss2 needs to
be compiled is not correct.

This reverts Change-Id: I9ab82aeca945d29d3608e65ecbe69902f8a5b47b.

Change-Id: I1ab90e80694b0e45270f6b47666781d784f8ab76
CRs-Fixed: 3405347
2023-02-14 18:34:31 -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
Lin Bai
13c9e92c31 cnss2: log the debug cmd for runtime_pm debugfs
User may configure such runtime_pm debugfs unexpected during test,
add the log to explicitly show what is configured.

Change-Id: I7d427603bfc7e6bb5d732fa3e29ff66c965e153b
CRs-Fixed: 3399930
2023-02-08 21:04:53 -08:00
Lin Bai
2684b4a9d8 cnss2: Avoid OS assert if SSR enabled
Current implementation tries to collect FW dump when cnss shutdown,
and then ASSERT after collection complete.

Do not invoke CNSS_ASSERT if SSR enabled.

Change-Id: I8d427603bfc7e6bb5d732fa3e29ff66c965e153b
CRs-Fixed: 3399930
2023-02-08 16:59:48 +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
Ajit Vaishya
8e0ff47179 icnss2: Don't clear LP on subsystem AFTER SHUTDOWN Event
As per Hibernate Entry (i.e. SUBSYS_BEFORE_SHUTDOWN with flag
crashed is not set) and based on low power supports it set the
state to ICNSS_LOW_POWER.
While processing the SUBSYS_AFTER_SHUTDOWN, its reset the
ICNSS_LOW_POWER state based on previous state already set
state and low power supported.
But before system freeze callback triggered,
SUBSYS_AFTER_SHUTDOWN event received to wlan and due to
which ICNSS_LOW_POWER state is clear and freeze callback failed,
thus its leads to prevent Hibernate freeze on WLAN.
This fix is to provides WLAN entered into Hibernate freeze state
by not clearing ICNSS_LOW_POWER state in SUBSYS_AFTER_SHUTDOWN.

Change-Id: I7b34d54c7ce5314e5092dbe2c0bc65ffe13d014d
CRs-Fixed: 3394501
2023-02-03 21:18:20 -08:00
Surabhi Vishnoi
26e2742f2f icnss2: Add support for Hibernate low power mode
Hibernate is a system wide power mode during which Modem
would be brought down along with DDR and the RAM contents
would be saved on the disk (suspend-to-Disk).

Modem would be do graceful shutdown in Hibernate mode,
so BEFORE_SUBSYS_DOWN notification will be received.
Based on dtsi node "is_low_power", if BEFORE_SUBSYS_DOWN
with notif->crashed bit not set is received, platform
driver will trigger an idle shutdown and set low power mode.

On AFTER_SUBSYS_DOWN notification, low power mode will be
cleared if it was set and ramdump collection will happen
only in case of crash.

Change-Id: I7b618e7c23950e4055079cde237ed75d6861620f
CRs-Fixed: 3394501
2023-02-03 21:17:25 -08:00
Surabhi Vishnoi
6c9f906a94 icnss2: Add Low power mode to icnss driver state
Deep Sleep is a system wide low power mode during which
Modem would be brought down and DDR would be in self
refresh mode (suspend-to-RAM) thus platform driver on
receiving deep sleep indication goes to a state similar
to SSR apart from the fact that FW is not crashed but
deliberately brought down.

In msm-5.15, there are no seperate notifications used
for deep sleep, notifications used for hibernate like
BEFORE_SHUTDOWN, AFTER_SHUTDOWN, BEFORE_POWERUP and
AFTER_POWERUP are used for deep sleep also.

In this commit add only low power mode state to
icnss driver state.

Change-Id: I4b12c5a8841e3cfc3e5e44ab6d9dff141e472876
CRs-Fixed: 3394501
2023-02-03 21:16:40 -08:00
Naman Padhiar
2ac2197477 cnss2: icnss2: Remove unused macro
Remove unused temporary macros CNSS_API_WITH_DEV and
ICNSS_API_WITH_DEV.

Change-Id: I5dff354c08b6772d85d9fe0814e1b3a501810df9
CRs-Fixed: 3394987
2023-02-03 00:45:00 -08:00
Sandeep Singh
172b8aee52 icnss2: trigger wpss self recovery
Icnss driver receives early crash indication when
fatal error happens in wpss. In few cases rproc
framework didn't receive any notification regarding
wpss fatal crash due to which icnss driver wpss
notfier is not getting called. This prevents wpss ssr
recovery. To recover wpss from this scenerio icnss
driver tries to do self recovery of wpss subystem.

Change-Id: Ie22dfb6a6218aafd1fec84fb14f3efb16c60bf5e
CRs-Fixed: 3265930
2023-02-02 18:05:22 -08:00
Sandeep Singh
54df2d964c icnss2: Add ASSERT if fw ready got timed out
Recovery timer is used to detect FW_READY timeout(60 Sec)
during SSR/PDR recovery and assert. Same timer starts
before cold boot calibration also and expires in 40 sec
if FW_READY is not received.

Change-Id: Ie4e2a327aa4f4df49b8684f9c178b9b5f4d4fb15
CRs-Fixed: 3221566
2023-02-02 18:05:21 -08:00
Sandeep Singh
3a589a650e icnss2: Remove wlan driver on device shutdown
This change shutdown wpss on device shutdown for
adrastea targets. With this change icnss driver unloads
wlan host driver in wpss shutdown callback.

Change-Id: I6d7d2563e694786b8d74725d77dc8c25943198e9
CRs-Fixed: 3392307
2023-02-01 15:26:29 +05:30
CNSS_WLAN Service
7ea12c4e63 Merge "cnss2: Support dual wlan cards managed by cnss2 platform driver" into wlan-platform.lnx.1.0 2023-01-31 23:49:31 -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
Dundi Raviteja
1d66a24813 icnss2: Update slatecom_interface.h file path
slatecom_interface.h file is moved to include/ in kernel,
update the same in icnss2 also.

Change-Id: Ibd07235636066b48221de9928283bfdf24b90221
CRs-Fixed: 3390989
2023-01-30 12:04:07 +05:30
Alan Chen
436eadfdaa cnss2: Update new register addresses for Peach Devices
Update new register addresses for Peach Devices.

Change-Id: I9543af4ca8aa4130533ea1975793ddce36b97eb1
CRs-Fixed: 3387208
2023-01-28 01:06:39 -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
9250fa8db3 cnss2: Remove unnecessary logs from cnss_wlfw_ini_file_send_sync()
Connection-roaming INI file and its backup files are optional.
So if these files are not present on a device, then do not log error
indicating files are not found.

Change-Id: I1a8fdaf6db75fff0e867c5454d16c40b72d6fbdb
CRs-Fixed: 3389578
2023-01-27 10:37:23 -08:00
Alan Chen
25bd9c5c1d cnss_utils: Add AUX UC capability and PCIe link control QMI messages
Add support for AUX UC capability and PCIe link control QMI messages
by updating the WLAN Firmware Service QMI file with the latest IDL file.

Change-Id: I3c51bbad8def33a727210ec80cad799fbb72b895
CRs-Fixed: 3385851
2023-01-21 11:52:44 -08:00
Krupali Dhanvijay
1f4d030577 wlan_platform: Update Makefile to build CNSS drivers for Atherton_target
Currently CNSS2 is getting compiled by default and it depends
on MHI & PCIE driver code and in Atherton_target MHI & PCIE
code is not enabled.

To avoid CNSS2 driver compilation, add CONFIG_PCI_MSM check
in Makefile.

Change-Id: I9ab82aeca945d29d3608e65ecbe69902f8a5b47b
CRs-Fixed: 3356064
2023-01-20 23:17:52 -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
Dundi Raviteja
6d4715f78c icnss2: Send wlan boot init and complete commands
When server arrive event is received send wlan boot init command
and when firmware ready indication is received send
wlan boot complete to co-processor subsystem.

Change-Id: I1c75ca772b7b96757f1b060b6c1d5700245b17aa
2023-01-17 23:00:22 -08:00
Dundi Raviteja
e5906b5e52 icnss2: Handle co-processor subsys down notification
WLAN RFA is present on another co-processor subsystem.
Any error fatal in co-processor subsystem will result in
WLAN reset.

In order to make sure that rf clock/rails are up
before accessing WLAN hardware, ICNSS platform driver
needs to register with co-processor SSR notification and trigger
PDR once co-processor is down.

Change-Id: I28cdc997646cc15ef0de23c28dfada87972eb465
2023-01-17 23:00:22 -08:00
Dundi Raviteja
951c866f53 icnss2: Synchronize qmi server arrive with co-processor up
WLAN RFA is present in another co-processor subsystem.
In order to prevent unclocked access, Wait for SLATE_POWER_UP
event before starting wlan cold boot qmi handshakes.

Change-Id: If24816c270c32c5f0191227ef66bc4a31549c54d
2023-01-17 23:00:21 -08:00
Dundi Raviteja
d2bd912107 icnss2: Register for co-processor subsystem notifier
WLAN RFA is present on another co-processor subsystem.
Any error fatal in co-processor subsystem will result in
WLAN reset.

In order to make sure that rf clock/rails are up before
accessing WLAN hardware, ICNSS platform driver needs to
register with co-processor SSR notification and wait for
POWER_UP event before starting QMI handshake.

Change-Id: Idf65e508a09d93e481349afc73de4804c7841111
2023-01-17 23:00:20 -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
Naman Padhiar
b0d6e583c7 icnss2: Send ICNSS_SMMU_FAULT uevent to host driver
On detection of SMMU fault, platform driver send
SMMU_FAULT and FW_DOWN event to Host driver.

Change-Id: I623522231b5ee7ab0b03b8c1b25993395b7f3a2d
2023-01-12 07:35:10 -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