Revīziju grafs

60 Revīzijas

Autors SHA1 Ziņojums Datums
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
Lin Bai
7b9d7b465a cnss2: Add chip serial id in wlfw cap resp
Add support to handle chip serial number in wlfw cap
respone message.

Change-Id: Icf6a310a127264c09db8567f53372590cae0e81f
CRs-Fixed: 3754364
2024-03-26 08:57:22 -07:00
Yeshwanth Sriram Guntuka
e488d6bdfb cnss2: Add support to determine Audio shared IOMMU group
Add support to determine if CNSS and Audio share
IOMMU group and do iommu_map/unmap only in the
case of distinct iommu groups for direct link
datapath.

CRs-Fixed: 3714345
Change-Id: I6134e9d732052fd492e0f20d538e86ba96c14c4d
2024-02-26 04:21:10 -08:00
Naman Padhiar
e38803e8a0 Revert "cnss2: loads different fw binary per running mode"
This reverts Change-Id I848309440fdffd6517463e18190c03c1b7ed9269.

Reason for revert: Separate FW Binary not required

Change-Id: Ib694d38922f81895ce6bc01f4e38f95813625730
CRs-Fixed: 3726340
2024-02-10 11:46:13 -08: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
Prateek Patil
dc9f45faee cnss2: Send QMI message to download TME binaries
Send QMI message with SEC, RPR and DPR file information to WLAN FW, to
download TME binaries (sec, rpr, dpr files)

Change-Id: I0a4ab7ab127d493ef62d14658be2aa08b7d41606
CRs-Fixed: 3684131
2023-12-20 05:31:07 -08:00
Prateek Patil
6d5176c254 cnss2: Update TME-L patch name
Update TME-L patch name as per the target version 1.0 and change the
patch file location.

Change-Id: I1e5e8e6ac330a093f61e34029f8aec35fd3f26aa
CRs-Fixed: 3687807
2023-12-17 15:45:14 -08:00
Prateek Patil
36a061b235 cnss2: Add dump collection for CAL memory
Add CNSS_FW_CAL dump segement for dump collection of CAL memory

Change-Id: Ie3d339f3db8898e087d8460d1efb7b9a8f75a13d
CRs-Fixed: 3684125
2023-12-15 09:26:28 -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
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
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
Naman Padhiar
c4bc8cea33 cnss2: Add PCI link info to Host Cap QMI message
PCI link info contains maximum link speed and link width
supported by platform. WLAN FW will use supported link
speed to restrict link speed switch upto maximum
supported speed.

Change-Id: Icdf54c8729192faf4966514b57bd826f86652065
CRs-Fixed: 3535790
2023-07-14 03:57:54 -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
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
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
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
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
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
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
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
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
Naman Padhiar
f61b9298a1 cnss2: Validate maximum number of memory segments
For WIN use case maximum number of memory segments requested
by FW is increased to 52 in QMI layer. Since CNSS2 driver uses
same QMI header files and message structures the same maximum
number of segment is applicable for CNSS2. It means for memory
allocation, FW can request 52 memory segments to CNSS2 via QMI
indication but local CNSS2 variable which get segment info from
indication supports maximum 32 segments.
To fix it, change CNSS2 array variable size to same as number of
maximum segment supported in QMI layer.

Change-Id: I661b55b53cb31327da12f064d0a516884159eb5b
CRs-Fixed: 3355665
2022-12-16 20:26:38 -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
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
Bing Sun
7418239f92 cnss2: Add force one MSI field for quirk
Add new bit FORCE_ONE_MSI for quirk to force one MSI configure

Change-Id: I5053a0f95619ee75aad8a4c3f413affc0f9af3f5
CRs-Fixed: 3313980
2022-10-25 10:08:13 -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
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
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
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
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
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
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
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
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
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
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
Mohammed Siddiq
42f4e0431a cnss2: Get hang event params over target cap qmi response
Add change to get hang event params over target cap response.
With this change hard-coding of hang data address and offset
is removed if valid hang data params are received over QMI.

Change-Id: Ife163cf66d5880cd9a658a841e5d4a73816fd982
2022-05-09 17:47:54 -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