Grafik Komit

201 Melakukan

Penulis SHA1 Pesan Tanggal
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
Alan Chen
f12f76a73f cnss2: Create new driver ops for SSR Dump Collection
Create new driver ops for SSR Dump Collection.

Change-Id: I26b429ee3eba9e4d3125c0b9650c0801771816f2
CRs-Fixed: 3352309
2023-01-07 03:02:59 -08:00
Nijun Gong
b15f3ce9fe cnss2: Use external configurations
Add option to select configurations from other places
such as yocto recipe.

Change-Id: I9ce971f3548d65630642f0b467515090f10f1480
2023-01-05 12:31:47 -08:00
CNSS_WLAN Service
3c022af5f9 Merge "cnss2: treat no wlan regulator as no error" into wlan-platform.lnx.1.0 2023-01-05 07:21:36 -08:00
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
Surabhi Vishnoi
075cc964ce icnss2: Send rf_subtype to firmware via QMI command
Send rf_subtype based on dt node "qcom, rf_subtype" to
firmware using QMI_WLFW_WLAN_HW_INIT_CFG message after
qmi server arrive. Firmware will initialize different
halphy code based on rf_subtype sent by host.
Currently, this change will be applicable only for
adreastea targets which can have either slate RF or Apache
RF attached.

Change-Id: Iba327d0c221104a4ebb55a72d42e1a4b8dcb66c3
2023-01-05 10:28:42 +05:30
Alan Chen
ef9321c23d icnss2: Add data length validation in cnss_wlfw_qdss_data_send_sync()
Add a data length validation check in fw response message in
qdss_data_send_sync().

Change-Id: I750f46549bc914698baaf4e24f1710536ca8e356
CRs-Fixed: 3366343
2022-12-29 16:41:24 -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
Sandeep Singh
219c37b87e platform: Add sanity change for fw memory size
Icnss and cnss2 driver receives and sends memory size
over qmi to and from wlan fw. This change add maximum
memory size check before sending or receiving fw mem size
over qmi. Also, use QMI_WLFW_MAX_NUM_MEM_SEG_V01 enum as
maximum size limit.

Change-Id: I392bfbbf0359e60bce9e93d909a119e8c72f07d5
CRs-Fixed: 3367408
2022-12-23 14:11:24 -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
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
Alan Chen
4def39b409 cnss2: Add data length validation in cnss_wlfw_qdss_data_send_sync()
Add a data length validation check in fw response message in
qdss_data_send_sync().

Change-Id: I197b8d52c06e35f5fcf0f8fee94429fdcf500fcb
CRs-Fixed: 3359589
2022-12-16 20:26:37 -08:00
Rajesh Chauhan
ecb024f0d1 icnss2: Fix build issue when strict-prototypes is enabled
When strict-prototypes and format-insufficient-args are
enabled then icnss2 fails to build. Change prototype of
icnss_get_plat_priv() and remove extra arg from error log
in icnss_wlfw_wlan_mac_req_send_sync().

Change-Id: I81c7d90fa24b05d573a9ce47c0301d2798118182
CRs-Fixed: 3359853
2022-12-13 19:36:36 -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
Alan Chen
7e8d314913 cnss2: Include smcinvoke.h from include/linux path
smcinvoke.h header file is moved to include/linux for pineapple target.
Hence, include smcinvoke.h from include/linux path.

Change-Id: Iec5622b09f8dd6536f5b9c8f81c46320731ba630
CRs-Fixed: 3354727
2022-12-07 14:34:29 -08:00
chunquan
a7f6cb0389 cnss2: Free m3 blob memory once driver probed
Free m3 blob memory after driver probed.

Change-Id: I10803eae60f2308b3a024877cdb7c446f3d33802
CRs-Fixed: 3321438
2022-12-01 14:07:57 +08:00
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
35fdadc9a2 cnss2: Avoid shadow register dump in RDDM mode
Before CNSS2 triggers RDDM mode in device it collects shadow
register dump in a global variable. Now when device moves to
RDDM, shadow registers will be reset. Reading shadow registers
in RDDM mode will override previously read correct values with
reset values. To avoid it, do not dump shadow register in RDDM
mode.

Change-Id: I470208be7e38bc9291932a7acfbaf07d87d46651
2022-11-26 11:53:00 -08:00
Naman Padhiar
69cf56c2cf cnss2: Dump PBL logging registers on RDDM timeout
Dump PBL and SBL logging registers to debug RDDM failure.

Change-Id: I9225e95c529a928e6e6f9e4528dadbe7237440b3
2022-11-26 11:52:59 -08:00
Rajesh Chauhan
8d75ecdd2d cnss2: Setup GPIOs for interrupt wakeup capable
Setup GPIOs for interrupt wakeup capable by calling
msm_gpio_mpm_wake_set() for such GPIOs.

Change-Id: I8a6e35b6e5ab49c569bfcb0a96c5361072cbe458
CRs-Fixed: 3345066
2022-11-23 21:25:51 -08:00
Vijay Raj
722aaf5581 wlan_platform: Add CLD80211_ATTR_IFINDEX to send interface index
Add CLD80211_ATTR_IFINDEX attribute to send interface index
in order to overcome duplicate logs for STA+STA case

Change-Id: Iba2a5d59b2e3a444844510afa2f17140244507d7
CRs-Fixed: 3340768
2022-11-23 13:54:50 -08:00
Rajesh Chauhan
3ea3cda16f cnss2: Add support for additional regulators
Add support for regulators: 1.2V IO, and Antenna sharing
to enable those based on entries in device tree file.

Change-Id: I362f0251ff3923c725f0e2a62922a35149bef3b9
CRs-Fixed: 3338737
2022-11-21 01:12:12 -08:00
Tiger Yu
e6f30383bf cnss2: Do not notify mhi about pcie link down for QCA6174
Do not invoke the mhi_control_error to notify the pcie link down event
for QCA6174 to avoid NULL pointer access.

Change-Id: I2c899ab51117aef2f9474e83217229b211eb4759
CRs-Fixed: 3335555
2022-11-18 06:52:12 -08:00