Commit Graph

696 Commits

Author SHA1 Message Date
Jingxiang Ge
84e83c24c0 qcacmn: Enhance log for usage_count mismatch debug
Add below change:
1 log level change from error to debug level in
  hif_pci_runtime_pm_warn.
2 Change warn_on to bug_on in hif_pci_runtime_pm_warn.
3 change pm_stats to atomic
4 record last 128 caller both for get/put

Change-Id: I2dae883dfaed22812445c5d50920fb363b9e0ea7
CRs-Fixed: 2638863
2020-03-17 16:09:28 -07:00
Alok Kumar
048c20096b qcacmn: Use platform driver APIs to enable/disable IRQ
Use pfrm_disable_irq_nosync/pfrm_enable_irq APIs inplace
of disable_irq_nosync/enable_irq to enable/disable IRQ.

Change-Id: I4002a0c8efddac7211ab0c7e8b92356b0c7bc7bf
CRs-Fixed: 2636512
2020-03-17 09:16:17 -07:00
Chaoli Zhou
2e0fb4fd50 qcacmn: Change copy engine 8 entry numbers
From Genoa firmware request, in order to improve
the IPA througput, increasing the number of copy
engine 8 entries and other nbytes values.

Change-Id: Ib1ae170c3b3f5af61d03ad8a60bc616b7a58a725
2020-03-13 06:47:45 -07:00
Mohit Khanna
ace98f847f qcacmn: HIF APIs to prevent/allow low power states
Add HIF APIs to prevent or allow link to go into low power states. The
current implementation uses PLD APIs to make the needed configuration.

Change-Id: I22efb4bcf902f9aff674ed1872f4f23bef508aae
CRs-Fixed: 2602029
2020-03-09 20:58:34 -07:00
Naman Padhiar
f675e5c4f4 qcacmn: Set DMA mask as 37 for WCN6750
Set DMA coherent mask as 37 for WCN6750.

Change-Id: I1fdd98a9c221d2e8ee1ff730e37bd0adaed54dd6
2020-03-04 22:58:59 -08:00
Mohit Khanna
b34654bd55 qcacmn: Callback to get current bandwidth level
Add HIF callbacks to get current bandwidth level from upper layers.

Change-Id: I18524558296f4b7d684f18b0e6615b2a0516b6d2
CRs-Fixed: 2602029
2020-03-04 21:19:30 -08:00
Alok Kumar
32de2fe166 qcacmn: Fix compilation and update SHADOW REG OFFSET for qca6750
For qca6750, update the SHADOW REGISTER OFFSET value and
fix the compilation issue.

Change-Id: Ic4b44c1c40e62ddcc50c0a66d37c0663a70b5c54
CRs-Fixed: 2633044
2020-03-04 07:30:44 -08:00
Lihua Liu
a2d35b81ac qcacmn: Enable interrupt mode for CE4 of Genoa
Currently, Genoa CE4 is using interrupt mode. Host will not require
IRQ base on current CE configuration and change below:
"Change-Id: Icabe68298737dc412949484f6d3fdcd8c05910d5", which cause
no IRQ handle of tx completion and source ring full, blocking
TX finally. To unblock TX, correct configuration of CE4.

At the meanwhile, this issue expose another problem that the polling
mode seems doesn't work. Will scope it on another thread.

Change-Id: I31eed8806b939a12503bb4ddd8b9dec85f3c3540
CRs-Fixed: 2602888
2020-03-01 19:45:23 -08:00
Chaoli Zhou
588021e773 qcacmn: Pass shadow register address for IPA
Since it support PCIe shadow register for QCN7605,
and these shadow register also falls below 512K,
which can be used for IPA write directly without
windowing. So don't use the temporary PCIE_PCIE_SCRATCH_2
for IPA GSI write now, insteadly, passing the correct shadow
register of copy engine 5 to IPA.

Change-Id: Ica3a502b96e98ee6c07c1032760b5dcb512957d8
2020-02-25 14:03:43 -08:00
guangde
7b4e341e81 qcacmn: HIF changes to support Genova
Add HIF changes for supporting the newly added USB bus type
for Genova.
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: I6158a9f8c723a797d39beca09a913c7cb9e10025
CRs-Fixed: 2595515
2020-02-25 06:23:43 -08:00
Venkata Sharath Chandra Manchala
607f32711f qcacmn: Increase the CE2 source entry buffer size
Allocate a buffer of size 4096 bytes for each buffer
posted to CE2 source/destination ring.

Change-Id: I0beb1e4e87c19508917e8564b441819031be2065
CRs-Fixed: 2619899
2020-02-23 22:43:30 -08:00
Nirav Shah
47fdeadbd1 qcacmn: Enable Shadow register from PCIe block in QCN7605
QCN7605 has 2 set of shadow registers, WCSS block and PCIe block.
As PCIe shadow register are at power domain boundary, enabling
PCIe shadow register for QCN7605.
Also PCIe shadow register falls below 512KB, no need to use register
windowing which is required to get it access from IPA FW

Change-Id: If18d2d0a3f16f492b3c32449695e70c2b9942375
CRs-Fixed: 2623853
2020-02-21 06:08:41 -08:00
Chaoli Zhou
10cfeb84a4 qcacmn: Pass phy address PCIE_PCIE_SCRATCH_2 to IPA
Currently, the IPA GSI can't update the index to copy
engine 5 write index register since such kind of
register address is above 512k, so as a workaround,
we use PCIE_PCIE_SCRATCH_2 to replace copy engine 5
write index register for IPA update the index. And then
WLAN firmware will poll this register to check if this
index update or not, if updtae, WLAN firmware will be
as agent to update the index to real copy engine 5 write
index register, and then the data from IPA to WLAN will
work. Before the real fix is ready, we use this method
for workaround.

Change-Id: I383a7d52f5685b633f1bd44659b11f30231c8ca8
2020-02-15 17:41:40 -08:00
Linux Build Service Account
67ef957780 Merge "qcacmn: Rename cmd ring to cmd_credit ring" 2020-02-15 11:08:15 -08:00
Alok Kumar
281aa22857 qcacmn: Update CE registers and CE IRQ for qca6750
Update CE registers offset during hal srng configuration
and configure CE IRQ for qcac6750.

Change-Id: I4fd3d37783361f0029c7ef80e32425f8790d1250
CRs-Fixed: 2617699
2020-02-14 20:20:07 -08:00
Chaoli Zhou
09815803eb qcacmn: Change copy engine 5 destination ring entries to 128
Genoa FW use the hardcode 128 for ce5 destination ring
entries, so change host code to follow up with it.

Change-Id: I1b7e70f8244efc3d3ca3dc659fb3d7687828b9c4
2020-02-14 05:48:08 -08:00
nakul kachhwaha
7fba021821 qcacmn: Fix compilation issue on non-msm platform
Fixing compilation issue for USB interface on non-
msm platform by adding pld_common.h header file in
if_usb.c which contains cnss pld specific definitions.

Change-Id: I67b3fd29bb21d827618655f337f38beb683a4c41
CRs-Fixed: 2615907
2020-02-11 02:39:31 -08:00
Basamma Yakkanahalli
f9529fbba8 qcacmn: Adding hal support for ipq5018
Added new qca5018 hal folder to add ipq5018 specific changes.
This includes interface files to access ipq5018 hal registers.

Change-Id: I7e19dc7c8719fa175695b268dc904fb4521a3330
2020-02-10 21:56:37 -08:00
Alan Chen
6760310422 qcacmn: Move hif_pm_runtime_resume() to hif.h file
This is a public API, so move it outside to hif.h file so it can be
used elsewhere as well.

Change-Id: Ic870cf804df69f6d7bb5a792da662759d687e0ed
CRs-Fixed: 2616491
2020-02-07 10:40:16 -08:00
Surya Prakash Raajen
ff8e33a3bd qcacmn: Export hif display stats api
Export hif display stats api to enable
ce stats debug print

Change-Id: Id3044a94ddfe5fb33eee6a09e873a58b489a30fc
CRs-Fixed: 2596873
2020-02-04 03:19:40 -08:00
Linux Build Service Account
9cf6099bec Merge "qcacmn: Replace 8074_VP with WIFI_EMULATION_3_0" 2020-01-31 05:37:08 -08:00
Nandha Kishore Easwaran
b7c18849ae qcacmn: Replace 8074_VP with WIFI_EMULATION_3_0
Replace QCA_WIFI_QCA8074_VP with CONFIG_WIFI_EMULATION_WIFI_3_0
since VP platform is not being used anymore.
Most of the parameters present inside QCA_WIFI_QCA8074_VP are related
to emulation timeouts. Hence replacing it with a more meaningful flag.

Change-Id: I22a0e5803e765333947f1613b376dcc6bd25b5af
2020-01-31 02:34:19 -08:00
Alan Chen
898760633d qcacmn: Create new HIF function to handle PM no idle operations
Some areas in other components are directly calling the kernel api
functions to perform runtime PM no idle operations. Create a new HIF
function to handle runtime PM no idle operations.

Change-Id: I8328bc74ccc8e8acd35d7d73ec4cc21094b8f5b2
CRs-Fixed: 2607721
2020-01-30 15:13:53 -08:00
Surya Prakash Raajen
c10ffa0652 qcacmn: Run time enablement of CE tasklet debug
Add support for enbalement of CE_TASKET_DEBUG_ENABLE in
run time.

Change-Id: I0132c3b989b75e7d526680f1e5f73a716e9db54c
CRs-Fixed:: 2610811
2020-01-30 05:00:18 -08:00
Venkateswara Swamy Bandaru
b3989495c7 qcacmn: Fix kernel panic in hif_ahb_configure_grp_irq
Move qal_vbus_get_irq out of irq locks as it can sleep
and cause kenel panic.

Change-Id: Id00e0cdc978fbd3889a39a48d8b757d8c3e0d754
CRs-Fixed: 2602900
2020-01-28 12:44:47 -08:00
Venkata Sharath Chandra Manchala
e0a2b69883 qcacmn: Reap timer and batch count threshold values for CE dest
Enable timer and batch count threshold interrupt for CE1, CE2
and CE5 rings through INI and retrieve the parameters through
psoc handle.

Change-Id: Ifa6cd768ed41ded46cae652ad7c910ffa62f2310
CRs-Fixed: 2593531
2020-01-27 15:43:36 -08:00
Alan Chen
850a888935 qcacmn: Change enable_runtime_pm from bool to uint8_t
Change enable_runtime_pm from bool to uint8_t in correspondence to
changing CFG_INI_BOOL to CFG_INI_UINT for enabling runtime PM.

Change-Id: Ib5031ada43fac864d933cdfee875593f896b2a62
CRs-Fixed: 2603918
2020-01-19 09:48:20 -08:00
Alok Kumar
44e048386b qcacmn: Add IPCIE directory for QCA6750
Add HIF changes for supporting the newly added IPCI
bus type for QCA6750

Change-Id: Icc06ac71caa3bb23aac5d4ec2f2e5aee8b7f8baa
CRs-Fixed: 2597345
2020-01-18 04:44:47 -08:00
Alok Kumar
ffc116e798 qcacmn: HIF changes to support Moselle
Add HIF changes for supporting the newly
added IPCI bus type for Moselle

CRs-Fixed: 2597321
Change-Id: I9097e4622e9d6d561e92f5a21cb279c4d631cfbb
2020-01-18 04:44:35 -08:00
Naga
ab425a2edf qcacmn: Fix return values in if_ahb.c
Fix return code to return error code instead
of -1 in if_ahb.c.

Change-Id: I41a6e0b6db44c9ade02a0f835232b5d6c9ba7a73
CRs-Fixed: 2597545
2020-01-13 23:18:22 -08:00
Linux Build Service Account
5e7141ceb3 Merge "qcacmn: Do not get/put the pm_runtime if RPM is disabled" 2020-01-11 20:06:29 -08:00
Tiger Yu
0778a3973d qcacmn: Do not get/put the pm_runtime if RPM is disabled
Do not get/put the pm_runtime if RPM is not enabled to avoid the WMI
command sending block.

Change-Id: Id6cddc4d5b6322fea063f08a1b641034ba0272d9
CRs-Fixed: 2587797
2020-01-11 19:23:39 -08:00
Surya Prakash Raajen
3206d614d1 qcacmn: Fix unknown symbol error for ce_tasklet_debug in 32bit
Fix unknown symbol error for ce_tasklet_debug_enable in 32bit

Change-Id: I76843f9569b79d4128932c2c2e27c8446285e831
CRs-Fixed: 2597243
2020-01-07 08:31:07 -08:00
Nandha Kishore Easwaran
54532861c7 qcacmn: Disable wake irq for QCN9000
Disable wake IRQ for QCN9000 since it doesn't require wake
feature.

Change-Id: I62e8712f9c7c7624c84889740249f3b70b21d6ff
2020-01-07 04:39:13 -08:00
Surya Prakash Raajen
b976076b3b qcacmn: Track tasklet execution and total time (sched+exec)
Add support to track tasklet execution and total time in different
buckets for debugging purposes

Change-Id: Ide459c385b2a44c0f16d05b37879c8b462782d72
CRs-Fixed: 2589199
2020-01-05 10:16:57 -08:00
Naga
3ea157570e qcacmn: Replace kernel calls with pfrm wrapper
HIF layer have kernel calls for interrupt registration
which need to be replaced in case of whunt framework,
as interrupt generation will be simulated by framework
itself, hence adding abstraction to call either kernel call
or whunt calls based on platform bus type.

Change-Id: Ife113d6338defa8e693e761992ce3a1bb9524306
CRs-Fixed: 2582523
2020-01-04 05:44:39 -08:00
Yu Ouyang
82e3fbda26 qcacmn: Support ROME SDIO
To support ROME SDIO card, change in HIF SDIO layer. Without CNSS or
CNSS2 module, it can bring up adapter successfully.

Output few logs in SDIO read and write thread, and optimize HIF
SDIO layer logging.

Change-Id: I96ba731a7fa572131aaaec8ab25d9cffc41ec0b2
CRs-Fixed: 2542051
2020-01-01 22:17:23 -08:00
Surya Prakash Raajen
141db5f642 qcacmn: Fix unknown symbol error in HIF_CE_DEBUG_DATA_BUF case
When HIF_CE_DEBUG_DATA_BUF is enabled for some apis when module is
inserted, it throws unknown symbol error, fix them by exporting the
required apis.

Change-Id: Icf6fc40f7df1c463ad7a6f9eff38adcbdf9276b7
CRs-Fixed: 2593859
2019-12-31 02:44:38 -08:00
Rakesh Pillai
4863352e53 qcacmn: Unmap the htc connect buffer after connect failure
The htc connect message buffer is not unmapped,
if the firmware does not send wmi ready event to the
host.

Scenario:
- Host sends htc init command.
- The command is queued into the src ring.
- The firmware has crashed before the Copy Engine
  could copy the message to the destination ring
- Due to the above point, no copy completion
  interrupt is received.
- The host times out during its wait for the wmi
  ready event.
- Hence the htc init command buffer stays unmapped
  and unfreed.

As a part of the wma ready event missing cleanup,
the htc connect buffer is not unmapped. Fix this
to avoid missing to unmap the buffer.

To avoid a side effect of sending a completion for
HTC connect command, all the commands are freed in
the htc completion handler in case of SSR.

CRs-Fixed: 2512344
Change-Id: I05026b3cbb764197e6df85c41634002d271a50e5
2019-12-25 22:11:36 -08:00
Nandha Kishore Easwaran
ee037a0f89 qcacmn: Reduce number of CE to 6 for QCN9000
Reduce the number of CEs used in QCN9000 to 6 since it has only
one mac and requires only 6 CEs. CE7 and CE8 are reserved for FW
and not needed to be configured from host

Change-Id: I989ffdb0219e2628bac5536e25c4cb2dbba6b7fb
2019-12-22 22:14:41 -08:00
Nandha Kishore Easwaran
a4f6b8ecce qcacmn: Do not request irq if DISABLE_INTR is set
Do not request interrupt if DISABLE_INTR flag is set in CE flags.
This check is already present in hif_ahb_configure_irq but is missing in
MSI path.

Change-Id: Icabe68298737dc412949484f6d3fdcd8c05910d5
2019-12-22 22:14:22 -08:00
Venkata Sharath Chandra Manchala
87a56bc7b7 qcacmn: Increase the force wake timeout
Increase force wake timeout value to 500ms to
accommodate scheduler latencies.

Change-Id: Id3748539e4b4809530ff78bd810681cb2210ff31
CRs-Fixed: 2573863
2019-12-22 22:14:01 -08:00
Manikandan Mohan
b199b73f43 qcacmn: Fix unused expression result warning
Fix unused return value warning for hif_fw_interrupt_handler function
usage.

Change-Id: I64a063f795e5087baff37d4bb63f9fe79ce811fc
CRs-fixed: 2587457
2019-12-19 04:39:39 -08:00
Nirav Shah
eb26831637 qcacmn: Update tx/rx bundle statistics for USB interface
Update tx/rx bundle statistics for USB interface.

Change-Id: Ia7951f9feb88ca28e055d9f32f0dfee65c7f0bf9
CRs-Fixed: 2571550
2019-12-06 08:40:56 -08:00
Venkata Sharath Chandra Manchala
2b0d3f38d5 qcacmn: Support force wake request
1. Add hif_force_wake_request API to wake the
mhi and umac before reading/writing the memory region
greater than BAR+4K.
2. Add hif_force_wake_release API to release the
PCIE_PCIE_LOCAL_REG_PCIE_SOC_WAKE_PCIE_LOCAL_REG so the
umac can power collapse again at a later point of time.
3. Add pci stats to dump the force wake status.

Change-Id: Ic6d5463ea0cdb28d9144be61da55e43033b53298
CRs-Fixed: 2478052
2019-11-26 02:15:13 -08:00
Sravan Goud
3af8bd05e8 qcacmn: Increase the napi scale for slub debug builds
UMAC reo full condition is seen in slub debug builds in case of
DL throughput traffic. This is due to host process only 64 packets
per NAPI schedule in case of slub debug builds where in case of
perf builds budget is of scale 4 times. Also the time between two
napi schedules is in order of milliseconds which accounts for the
delay of host reo ring processing. So increase the napi budget
scale to 3 times which make sures host process enough packets per
napi schedule.

Change-Id: I3e134f31277a72056f3d7d5433ed1adeefa433fa
CRs-Fixed: 2563595
2019-11-19 16:55:09 -08:00
Tiger Yu
987de79182 qcacmn: Wake up system for early interrupt wakeup during suspending
During system suspending, the target might request wakeup early to the
host. The host will wakeup the system directly to abort current suspend
to avoid mismatching PM state between host & target.

Change-Id: Icf6e58ff24cbe072ef56aa22820432efb2ca1932
CRs-Fixed: 2559306
2019-11-13 06:53:29 -08:00
Nandha Kishore Easwaran
cbf2eb71d3 qcacmn: Enable interrupts for pine
Remove EPPING_CE_FLAGS_POLL from poll flags so that interrupt is
enabled for pine.

Change-Id: I8271ab47e75fbe254e0c5d745f861edbda4b07ce
CRs-fixed: 2507441
2019-11-13 00:56:22 -08:00
Venkata Sharath Chandra Manchala
ea6518b89e qcacmn: Record reo command srng events
Add debugging infrastructure to record every event posted to reo
command ring. The infrastructure maintains the record of the last
64 events posted to the ring.

Change-Id: Id56fc352050eb664a64b0abb767f3b4a6b4c3aa3
CRs-Fixed: 2552822
2019-11-07 19:50:09 -08:00
Nandha Kishore Easwaran
fb73acb147 qcacmn: CE flag changes for QCN9000
Added change to modify ce flags for Pine.
Also made changes in window enable bit

Change-Id: Id080be53d14450cb6d9376fc810177bce26a2869
CRs-fixed: 2507441
2019-11-05 16:18:38 -08:00