Commit Graph

152 Commits

Author SHA1 Message Date
guangde
7501cf57a7 qcacld-3.0: Add athdiag functions for USB interface
For QCN7605 chip, FW team need athdiag tool to operate FW
information. Host driver need to pass the command and result
between athdiag tool and FW.

Change-Id: Ib3f4498ba560b2b76ec6939760535069777b972c
CRs-Fixed: 2595510
2020-02-14 17:52:29 -08:00
Surabhi Vishnoi
8333061e83 qcacld-3.0: Add pld API to get the audio timestamp
Add pld API to get audio timestamp needed in FTM wlan
timesync feature to synchronise the audio clocks of
master and slave devices

Change-Id: I6f08e33904e26728492286f516ce5a8074afd1ea
CRs-Fixed: 2616917
2020-02-10 04:31:33 -08:00
Jingxiang Ge
19042f697f qcacld-3.0: Reject Vdev trans when driver in unloading/recovering
Previously vdev trans will be rejected if psoc in trans. but
it causes issue when __hdd_psoc_idle_shutdown is in psoc trans,
if ifconfig comes here, the ifconfig will fail.

Add checking if psoc trans in driver recovering and unloading,
if yes, it will be safe to reject vdev trans, otherwise, we should
let vdev trans waiting for psoc trans.

At the same time, we also need to make sure driver state has been
set before psoc trans when unloading.

Change-Id: Ic47eebef76b8eadc90780b74f75d4ebef73b822d
CRs-Fixed: 2601435
2020-01-20 12:31:40 -08:00
Naman Padhiar
07f0c719e2 qcacld-3.0: Add PLD layer for iWCN architecture
Add PLD layer and introdue IPCI bus type for iWCN architecture.

Change-Id: Ia0164314c539df84205263de16432eec0eb7fb34
2020-01-17 08:52:59 -08:00
Naman Padhiar
ed3ada0bb0 qcacld-3.0: Correct API name called from HIF layer
Correct API name for disable irq called from HIF layer.

Change-Id: I353723dec61aba877160dd1faa96afdffc1a416b
2020-01-02 11:39:51 -08:00
Yu Ouyang
36b48bf65a qcacld-3.0: Support ROME SDIO
Function ol_txrx_hl_tdls_flag_reset will call function
ol_txrx_get_vdev_from_vdev_id, it will return NULL vdev
because ol_txrx_hl_tdls_flag_reset is called before
TAILQ_INSERT_TAIL(vdev).
So, move it after TAILQ_INSERT_TAIL(vdev).

Redefinition of 'pld_pcie_register_driver' when
CONFIG_PLD_PCIE_CNSS not defined. For Hastings WHUNT,
HIF_PCI is defined but CONFIG_PLD_PCIE_CNSS is not defined.
So, replace CONFIG_PLD_PCIE_CNSS by HIF_PCI and
CONFIG_PLD_PCIE_FW_SIM.

Change-Id: I05e58516efe6a9a445168a27df9e0cfc9de2e50c
CRs-Fixed: 2589802
2019-12-30 23:54:46 -08:00
Naman Padhiar
fb90ce5ccb qcacld-3.0: Add wrapper APIs for HIF layer
Add wrapper APIs which can be used to route calls
to PLD layer if PLD layer.

Change-Id: I4423483f5f3660f7743832d05fd38b45661d02e7
2019-12-26 11:37:52 -08:00
Tiger Yu
db568a828c qcacld-3.0: Don't set unload flags before unregister_driver when unloading
Don't set unload flags earlier before unregister_driver when driver
unloading to avoid runtime resume failure. And set this flags earlier
before wait_for_ops in the pld_pcie_remove to give chance SSR will be
skipped if unloading is in progress.

Change-Id: I084db32b436148932a2a90e3e1dcb1122f4303b5
CRs-Fixed: 2589413
2019-12-20 20:05:56 -08:00
Karthik Kantamneni
2d65b47bb3 qcacld-3.0: Add WHUNT bus types in pld_lock/unlock_reg_window APIs
Currently pld_lock/unlock_reg_window APIs don't support
WHUNT simulation bus types and treated as error.
Add support for WHUNT simulation buses in lock/unlock
register window APIs.

Change-Id: I1e82d822becaadc9592b693e6ab20331ecb9cbc2
2019-11-19 03:38:43 -08:00
Yue Ma
39b6f2ed51 qcacld-3.0: Add PCIe register window lock related APIs
The register window needs to be configed properly before accessing
any larger than 4K range PCIe registers. Expose the lock in PLD to
avoid race condition when both platform and host drivers
try to config it.

Change-Id: Icd3df3d4d2cc2ecc3df608e7b767a3e654b94500
CRs-Fixed: 2549887
2019-10-28 20:58:30 -07:00
Naman Padhiar
c52e7fd605 qcacld-3.0: Add PLD layer for WHUNT
WHUNT is host unit testing framework which simulates
firmware. Add a PLD wrapper layer for this virtual device.

Change-Id: I1d09b8a18a25b414b0c1d56723cc5687f2bfe297
2019-10-22 03:36:46 -07:00
Arun Kumar Khandavalli
378b7ee6a4 qcacld-3.0: Remove block/unblock shutdown cb
Modem block/unblock shutdown callbacks are added to synchronize
modem shutdown when the driver is in deinit sequence.

With new changes everything is synchronized via the platform driver,
So remove the the block/unblock shutdown callback's.

Change-Id: If66eed5b51bbce64f024edf49e37a21b222a6a4c
CRs-Fixed: 2489733
2019-10-15 02:30:04 -07:00
Nirav Shah
942cdf64c5 qcacld-3.0: Protect pld_del_dev function as part of psoc trans
Protect pld_del_dev function as part of psoc transaction
to avoid race condition with pld_deinit.

Change-Id: I3180801308b9a5e85822fb8d8bc04a9ecb42b347
CRs-Fixed: 2530822
2019-10-03 02:01:30 -07:00
Yue Ma
a36c0f1a99 qcacld-3.0: Add QMI send related APIs
These APIs can be used to send data request to firmware over QMI
as well as receive response from firmware.

Change-Id: I186d4c53e846af028b5ea75079027217af1580b4
CRs-fixed: 2517225
2019-10-02 14:54:48 -07:00
Yu Ouyang
523f56e6c3 qcacld-3.0: Fix CNSS_RECOVERY undeclared issue
If without CNSS2 module, CNSS_RECOVERY undeclared issue will occur.

Move function pld_sdio_uevent() to CONFIG_PLD_SDIO_CNSS2 macro,
because it is active only when CONFIG_PLD_SDIO_CNSS2 is defined.

Change-Id: Ic86260ccefad820c47257a8ccbcfae9194b78b8f
CRs-Fixed: 2530671
2019-09-22 21:16:22 -07:00
Alan Chen
50582ca9cb qcacld-3.0: Move clearing recovery flag to after platform driver callback
Platform driver is still doing MHI cleanup at the current location of
clearing the recovery flag. Clear it after platform driver callback.

Change-Id: Ifa81950790fa3d2704ed1aed85301a99c6383470
CRs-Fixed: 2526873
2019-09-18 19:01:57 -07:00
Jayachandran Sreekumaran
8785e2504b qcacld-3.0: Add sdio support for pld update status
Add pld update status api support for sdio

Change-Id: Id96bf8346989dfb2100bff7bd508a499570d2015
CRs-Fixed: 2512562
2019-09-07 23:44:34 -07:00
Jayachandran Sreekumaran
32a0d43f05 qcacld-3.0: Add sdio support for pld_wlan_enable
Add sdio support for pld_wlan_enable to put
the FW in the required mode.

Change-Id: I4ff3648a70b6c9cd4be389562851444258b347e6
CRs-Fixed: 2504554
2019-08-08 11:37:51 -07:00
Vignesh Viswanathan
2f7701a13e qcacld-3.0: Add separate FTM Coldboot Calibration Mode
Add separate Coldboot calibration mode (10) for Coldboot Calibration
done during FTM Mode in PLD.

Change-Id: I7e4bb5209d87613bb49a0a958d8e691c73fdcfe1
CRs-Fixed: 2499766
2019-07-30 20:21:05 -07:00
Sriram Madhvapathi
ecb0bcde59 qcacld-3.0: Add sdio abstraction layer support for QCN7605
The SDIO HIF for QCN7605 requires to use the SDIO Abstraction Layer.
Used the SDIO CNSS2 PLD layer api's to interface with SDIO AL

Change-Id: I839a580941e4651e3dcff4f87cda26cc567687fc
CRs-Fixed: 2275631
2019-07-30 09:11:31 -07:00
Mohit Khanna
6dbf9c8301 qcacld-3.0: Add BW level PLD_BUS_WIDTH_VERY_HIGH
Add additional bandwidth level for "very high" bandwidth. As per the
default configuration if the total number of tx/rx packets exceeds
bus_bw_very_high_threshold, the bus bandwidth requirement is designated
as PLD_BUS_WIDTH_VERY_HIGH and PLD API is called with this value.

Default value of 7000 is chosen for bus_bw_very_high_threshold, which
amounts to 820Mbps of throughput considering a 1500 byte packet and
100ms bandwidth timer interval.

Change-Id: I3bd904429a02ec4935ba12da7c2cfd37eec738ed
CRs-Fixed: 2489362
2019-07-18 09:16:10 -07:00
Mahesh Kumar Kalikot Veetil
64a886965f qcacld-3.0: Add idle state to bus bw logic
Bus bandwidth logic uses PLD_BUS_WIDTH_NONE to vote if the packet
threshold is less than bus_bw_low_threshold. The same vote is used for
system suspend too. Add a new state for bus bandwidth logic to vote for
idle state.

Change-Id: I62ca6fff84a01083001db360f56344a05fb955db
CRs-Fixed: 2484003
2019-07-09 17:26:32 -07:00
Vevek Venkatesan
4a03124774 qcacld-3.0: change prototype of pld_wlan_enable
Change the function prototype of pld_wlan_enable, to use local
version string.

Change-Id: Ic4c46b609afc8f9510a5c4cbf5e708e28c82d066
2019-07-02 08:39:06 -07:00
Sandeep Singh
b2df1387eb qcacld-3.0: Add api to get smmu domain
Add api to get smmu domain from cnss2 platform driver.

Change-Id: I1e0370616bda32b013104db7c086e9611a699f43
2019-06-12 16:14:59 -07:00
Sandeep Singh
75d4b7d4cd qcacld-3.0: Add api to get smmu domain
Add api to get smmu domain from platform driver.

Change-Id: I71efe1a770c8c73f17ffe574555aa9c3b3595819
2019-06-08 06:29:14 -07:00
Rajeev Kumar
588a254004 qcacld-3.0: Add idle restart/shutdown support for PCIe in PLD
Provide platform driver interface for idle restart/shutdown for
PCIe bus in PLD. Remove PCIe power off call for discrete PCIe bus
enabled SoC such that platform driver can execute proper SoC power
off sequence.

Change-Id: If08186247e89a4182cadbf83817dce4f02654ecc
CRs-Fixed: 2431419
2019-05-30 19:29:34 -07:00
Yue Ma
0631a756fb qcacld-3.0: Add PLD API to check DRV connection
Add PLD API in order to check if DRV (Direct Resource Vote) subsystem
is connected or not.

Change-Id: I3b600b0760e27c7111320088034c555aee4ff773
CRs-fixed: 2452039
2019-05-16 05:57:13 -07:00
Yue Ma
b4ebd87f7b qcacld-3.0: Add WLAN device version to SOC info API
Populate WLAN device version related info along with other SOC info
in pld_get_soc_info() API.

Change-Id: Ie0e862c6755d10fbc80b11fbf39d004fafcfd9af
CRs-fixed: 2437413
2019-05-16 02:28:23 -07:00
Rajeev Kumar
473f9afe2a qcacld-3.0: Serialize psoc idle shutdown and restart via PLD
Serialize psoc interface inactivity idle shutdown and restart via PLD
such that platfrom driver can serialize psoc idle shutdown and restart
to driver unload and SSR events to avoid any race conditions.

Change-Id: Ibac40158ad5b94468b09c53eaf7f3d9a3cb8badf
CRs-Fixed: 2430868
2019-05-13 03:31:17 -07:00
Yu Wang
7d866f6906 qcacld-3.0: add build flag DYNAMIC_SINGLE_CHIP
Introduces a new build flag 'DYNAMIC_SINGLE_CHIP':
If DYNAMIC_SINGLE_CHIP is defined, which means there
are multiple possible drivers, but only requires one
instance of driver at a time. In such case, leave
MULTI_IF_NAME undefined, no matter what the module
name is, only prepend DYNAMIC_SINGLE_CHIP to names
of firmware/mac/ini files.

Take path of driverdump and ini file for example:
If both MULTI_IF_NAME and DYNAMIC_SINGLE_CHIP are not
defined, the paths are:
driverdump: '/proc/debugdriver/driverdump'
ini: '/<fw_root>/wlan/qca_cld/WCNSS_qcom_cfg.ini'

If DYNAMIC_SINGLE_CHIP is defined as 'qca6174':
driverdump: '/proc/debugdriver/driverdump'
ini: '/<fw_root>/wlan/qca_cld/qca6174/WCNSS_qcom_cfg.ini'

If MULTI_IF_NAME is defined as 'qca6174' and
DYNAMIC_SINGLE_CHIP is not defined:
driverdump: '/proc/debugdriverqca6174/driverdump'
ini: '/<fw_root>/wlan/qca_cld/qca6174/WCNSS_qcom_cfg.ini'

On LA platform, DYNAMIC_SINGLE_CHIP is controlled by
TARGET_WLAN_CHIP and TARGET_MULTI_WLAN:

If more than one WLAN devices are enabled in TARGET_WLAN_CHIP,
and TARGET_MULTI_WLAN is not set to 'true',
DYNAMIC_SINGLE_CHIP will be set to the device name, to
avoid name conflicts of firmware/mac/ini files;
meanwhile, MODNAME is set to 'wlan', then paths for
debugging are not changed.
Otherwise, MULTI_IF_NAME will be defined if requires
multiple instances of driver.

Change-Id: I22ed34d80d3540451bf8b891243c6cdac5a73d7e
CRs-Fixed: 2402432
2019-04-30 22:27:24 -07:00
Vevek Venkatesan
789b6b32c7 qcacld-3.0: add IPA cleanup during PD Restart
Currently there is no way to find out PD Restart indication,
so platform driver has added an API to differentiate PD Restart
from SSR. Using this API in shutdown notify handler, sending
message to IPA to do required cleanup.

Change-Id: I9d07c6fc573b6db1c7d0c1b7c99f325e22fe81cd
CRs-Fixed: 2436036
2019-04-26 01:50:28 -07:00
Ajit Pal Singh
10372fa5bf qcacld-3.0: Dont return error for USB from pld_collect_rddm
Do not return error from pld_collect_rddm() for USB also.

Change-Id: Id271f6fe40d116f0ce02f4ae31ad49238b23273f
CRs-Fixed: 2431879
2019-04-22 18:21:04 -07:00
Jayachandran Sreekumaran
df553017a5 qcacld-3.0: Correct the dev pointer provided in pld_usb
Correct the dev pointer provided in pld_usb_is_fw_down.

Change-Id: Ibc5569c2ae1645813ef2e197c7ad525320312113
CRs-fixed: 2433662
2019-04-12 10:12:55 -07:00
Ajit Pal Singh
8cf6754eca qcacld-3.0: usb: Add CNSS update_status callback
Add update_status callback to pld usb which will be called by
CNSS to update WLAN FW status(FW-DOWN, RECOVERY)

Change-Id: I159e09eac8bdb75525c64e7b42c3315141ec1f8d
CRs-Fixed: 2430265
2019-04-12 05:20:05 -07:00
Jayachandran Sreekumaran
1438216e41 qcacld-3.0: Add support for pld_is_fw_down in usb
Add support for pld_is_fw_down in usb case.

Change-Id: I2103964c6413734ec4f156fe3058e67984b8e09b
CRs-fixed: 2432112
2019-04-12 05:19:59 -07:00
Rajeev Kumar
e01118e85f qcacld-3.0: Define PLD APIs for idle shutdown and restart
Define PLD APIs for idle shutdown and restart such that platform
driver can serialize PSOC idle shutdown and restart with driver
load/unload and SSR shutdown/reinit.

Change-Id: I4e772343fbccb099b9af104ac978dcdb650a567a
CRs-Fixed: 2431405
2019-04-12 00:36:30 -07:00
Jeff Johnson
753f9d7861 qcacld-3.0: pld: Replace explicit comparison to NULL
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within pld replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: I8092ddbb80bb39fc6ff560cca34e021b115f7fd7
CRs-Fixed: 2418390
2019-03-24 19:26:51 -07:00
Yuanyuan Liu
3ab5531e6d qcacld-3.0: Collect ramdump before kernel panic
FW dumps is not getting collected during kernel panic handler.
Hence move ramdump collection before kernel panic.

CRs-Fixed: 2362637
Change-Id: Id9f1dfefe1560affff6c4ecfca1b8fdba3eb0928
2019-03-18 23:55:43 -07:00
Anurag Chouhan
ca8bc1663c qcacld-3.0: Add API to block/Unblock modem shutdown
Add API to Block/Unblock modem shutdown.

CRs-Fixed: 2393336
Change-Id: Ia1e455a8d52bb79451c26b9a527b902397f19508
2019-02-22 13:39:20 -08:00
Frank Liu
d462d9c62b qcacld-3.0: Add support for IPA SMMU on CNSS
For now IPA SMMU can only work on ICNSS platform.
Add support for IPA SMMU feature on CNSS platform.

CRs-Fixed: 2286287
Change-Id: I6515d6ec764659f1aeefa50d9fd0b120c47b36bf
2019-02-19 03:03:45 -08:00
Dustin Brown
8513e84f6f qcacld-3.0: Zero-initialize soc info
pld_snoc_get_soc_info() stack allocates a icnss_soc_info struct before
populating its contents via a call to icnss_get_soc_info(). However,
icnss_get_soc_info() may not populate all of the fields of the struct.
Zero-initialize the struct before passing it to icnss_get_soc_info() to
avoid using any uninitialized values.

Change-Id: I859a880c9fb8483b66e17ded2857634ab878977a
CRs-Fixed: 2396653
2019-02-15 13:10:05 -08:00
Nirav Shah
a6c6dc9f75 qcacld-3.0: Changes to support rri_over_ddr support for Genoa
Changes to support rri_over_ddr support for Genoa.

Change-Id: I1b98e6ec765b8b9da7f0a2f8b21f410c44fa90c2
CRs-Fixed: 2357344
2019-01-30 00:02:55 -08:00
Ajit Pal Singh
5e618aa8c4 qcacld-3.0: Add support to save and get interface device
A bus can have multiple sub interfaces or pipes.
USB bus for example has endpoints grouped into interfaces.
WLAN uses one of these interfaces.
Each interface has its own "struct device". Add support to save
and retrieve this "struct device".
Also pass interface dev to pld_usb_wlan_enable() as CNSS expects
interface device.

Change-Id: I5800bde107157c35efed848a23b95696bd7f793a
CRs-Fixed: 2371440
2019-01-14 12:58:51 -08:00
Yu Ouyang
781f1b56c9 qcacld-3.0: correct return value for pld_pcie_get_user_msi_assignment
Without CNSS module, function pld_pcie_get_user_msi_assignment return zero
even no msi config. For caller function pld_get_user_msi_assignment, zero
means TRUE. It will result to panic when deinit sequence called in
function hif_ce_srng_msi_free_irq. Return correcly value to avoid panic.

Change-Id: Id4480ef1db5357943162472963c4e78d7bfe64b8
CRs-Fixed: 2373130
2019-01-02 03:52:58 -08:00
Ashish Kumar Dhanotiya
7a11e273df qcacld-3.0: Enable MAC provisioning from ini
Currently MAC addresses are generated by driver only.
MAC addresses are queried from platform driver or wlan_mac.bin.
If platform driver gives  mac addresses, driver uses it, else it
will use wlan_mac.bin to update MAC addresses. If wlan_mac.bin also
don't have MAC addresses then random MAC addresses are generated
using the HW address or using device serial number.

Add an ini support to enable MAC provisioning. If MAC provisioning
is enabled, ensure that platform driver provides atleast 2 provisioned
MAC addresses. Query the derived addresses also from platform driver.
Generate the remaining random MAC addresses.

Change-Id: Ib943f9de70a78ba5d5e87d81c76b20341893f8e9
CRs-Fixed: 2153836
2018-12-14 05:34:46 -08:00
Yu Ouyang
58648a57f3 qcacld-3.0: fix wlan driver reload issue without CNSS module
Currently, driver without CNSS module can't be unloaded when firmware
crashed. Without CNSS module, driver should set recovery in progress
flag to false when fw dump finished or failed. Driver should add ramdump
memory address and length too.

Change-Id: I672c50bd90ada7ff47ddff64ff3b313a75faff13
CRs-Fixed: 2343124
2018-11-23 02:00:06 -08:00
Dustin Brown
8f05f65391 qcacld-3.0: Remove PLD_RECOVERY handling
The platform driver uevent handling in WLAN handles both the firmware-
down and "recovery" events. However, the recovery event on snoc
platforms is actually the firmware-crashed event. Recovery _is_ a valid
uevent for pcie platforms, but I20db3698602ea273038a3f024b4e5f61639f6d74
is adding support for the firmware down event.

Additionally, there is no good reason to handle both events, and the
various handling logics are spread across both events with little rhyme
or reason. Remove handling of the "recovery" platform uevent, and move all
associated logic to the firmware-down uevent handling.

Change-Id: I36b6f607438c930dff1936f372af80be311dfe49
CRs-Fixed: 2339357
2018-11-08 13:39:26 -08:00
Hardik Kantilal Patel
239c7a268d qcacld-3.0: remove redundant snoc pld APIs
The snoc wlan platform driver supports snoc API with
the device pointer in all upstream kernel, So remove
the redundant snoc APIs from the pld layer.

CRs-Fixed: 2173110
Change-Id: Iee8bce586569e135da81f9a465a9e7df8b042af4
2018-10-31 13:21:15 -07:00
Arunk Khandavalli
f9957c0fcf qcacld-3.0: Add fiwmare down case in the pld pcie uevent
When the firmware crashes platform driver notifies the driver
through CNSS_FW_DOWN. Since firmware down support is not
present for the PCI bus, The driver flags for target ready
and recovery flags are not getting set resulting in the commands
sent to firmware.

Add the firmware down support for the pci bus.

Change-Id: I20db3698602ea273038a3f024b4e5f61639f6d74
CRs-Fixed: 2338570
2018-10-29 13:49:33 -07:00
Yue Ma
fb3b78d7d2 qcacld-3.0: Add force wake APIs support in PLD
As part of PCIe power management for new WLAN devices, it requires
asserting WAKE register before accessing any MMIO registers outside
first 4K range. Add the APIs support in PLD for WLAN host driver.

Change-Id: I307cc6688fca58a52a6eaf3982d675c7a85a6965
CRs-fixed: 2326459
2018-10-26 16:42:28 -07:00