Commit Graph

70 Commits

Author SHA1 Message Date
Balamurugan Mahalingam
4120f06921 qcacmn: define SHADOW_REGISTER macro for QCN9000
Define shadow registers for QCN9000.

Change-Id: I47fc7057838bf6491dc292660a69b47a655fe0e9
2020-01-12 00:12:33 -08:00
Aniruddha Paul
33fce952a9 qcacmn: Fix the next link descriptor read issue
Link descriptor were getting freed by the pointer
of the previous freed link descriptor. This patch
fixes by copying the address of the current in a
local descriptor info and using it to free the
current.

Change-Id: I95e137ba5b1f0ad21b0e6fb39f6671e1d5b65ba6
CRs-Fixed: 2577624
2019-12-30 05:53:14 -08:00
Jinwei Chen
a718c757b3 qcacmn: check register writing result for IPA case
When SAP do connection with first Ref-STA or dis-connection with
last Ref_STA, wlan host need to re-configure REO Dst ring control
register. one of the register offset is 0xA38004, host need to write
remap window register (offset 0x310C) with value 0x14 first, but
sometimes this remap window writing not work, so just use the remap
window value 0x3F left by last writing, final Dst register offset will
be 0x1FB8004 which is out of valid range.
  Find that if we read back the remap window after writing is done,
remap window writing failure issue is gone. as a WAR, check register
writing result for this specific register REO_R0_DST_RING_CTRL_IX_0
always before root caused.

Change-Id: I8d385a0f974ff37bdd867d2ec946f2f46f6eff32
CRs-Fixed: 2570728
2019-12-01 13:11:45 -08:00
Nandha Kishore Easwaran
bcf953583a qcacmn: Use multi window write and read for pine
Write into hal register using three floating windows instead of one.
This change is done to avoid frequent window changes for writing into
DP and CE registers. Instead 3 windows are used. One window is statically
mapped to CE block and another window is mapped statically to DP block.
Due to this design there is no need to change the window register to
write into these blocks and write can be done on corresponding window
with single iowrite32. Similar loginc is used for ioread32.

Also modified the hp_addr and tp_addr in initialisation stage so that
hal_write will not have multiple if checks.

Change-Id: Ibb99ec4da7f63323082e46a28afbe90e1f555545
CRs-fixed: 2507441
2019-11-26 02:15:26 -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
Venkata Sharath Chandra Manchala
74a2f413df qcacmn: Increase the force wake timeout
Increase the force wake timeout to 100ms for
debug builds as mhi requires 100ms to
wake up.

Change-Id: Ida0b1287a86a5a97fd2d9c80fee4e677eea86cbe
CRs-Fixed: 2552815
2019-11-18 10:33:26 -08:00
Jinwei Chen
99ae1c1f3d qcacmn: Support register writing result check for IPA case
a. Add new macro HAL_REG_WRITE_CONFIRM to check register writing result,
enable register writing result check when do REO DST ring remap for
IPA.
b. only enable register writing result check when macro
HAL_REGISTER_WRITE_DEBUG is configured.

Change-Id: Ib52e6b0d689ccf714876b3978fa8e356f652d25e
CRs-Fixed: 2557252
2019-11-11 13:41:55 -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
Venkata Sharath Chandra Manchala
c9e344de3d qcacmn: Set the reo destination ring ctrl register
The reo destination ctrl registers
HWIO_REO_R0_DESTINATION_RING_CTRL_IX_2_ADDR and
HWIO_REO_R0_DESTINATION_RING_CTRL_IX_3_ADDR are used for mapping
msdu packets to different reo rings.
For QCA6390,
reo remap values varied from 0 - 7 so every 3 bits in
the register were used to map to a particular reo ring.
For QCA6490,
reo remap values vary from 0 - 9 as two extra reo rings are
added so we are using 4 bits in the register to map to a
particular reo ring.
Use the macros directly provided in the header files
to map reo rings.

Change-Id: I6d64266d3b388b3453b7df959048e3d693cf0a40
CRs-Fixed: 2544102
2019-10-30 05:58:57 -07:00
Jinwei Chen
7d419468a9 qcacmn: Use CNSS register window lock for register accessing
If CNSS platform driver and wlan host driver try to write
window register at the same time, conflict happened which then
register write failed.
Use the window register lock shared from CNSS driver to avoid
the conflict.

Change-Id: Iccc4e60e4f5eed995ec6aa53b024f3f96a2619a0
CRs-Fixed: 2534408
2019-10-28 20:58:46 -07:00
Mohit Khanna
80002653b1 qcacmn: Check for ring approaching full during RX
Check if REO ring is near full at the end of dp_rx_process. In case the
ring is near full, reap the packets in the ring (and replenish, send to
upper layer) until the quota allows. Ignore the HIF yield time
limit in such cases.

This change is needed to prevent back pressure from the REO ring(in case
it gets full). Backpressure from REO ring (to LMAC) may lead to a
watchdog and eventually a FW crash. Hence, avoid such a scenario by
reaping as many packets as the 'quota' allows when the REO ring is in
aforementioned condition.

A sid-effect of this change would be that at times the RX softirq may run
longer (till the quota limit) than the configured HIF yield time.
However, this logic is not expected to kick-in in perf builds. The issue
is reported for a defconfig build where lots debug options are enabled
in the kernel which can slow the processing down.

Change-Id: I2eb6544c159ec5957d10386b1750fd96473fe13a
CRs-Fixed: 2540964
2019-10-23 12:04:39 -07:00
Sravan Goud
7d2afb4d62 qcacmn: Do panic if pci wake request fails
During hal write register first device force wakeup
request is done. If force wakeup request fails register
write is not done and the execution continues. This leads
to NOC erros in REO ramap register cases. As in later point
of time packets will be coming on wrong reo2sw ring and at
the destination side channels are not enabled. When NOC error
happens the current system is of no help to root cause as the
write fail happened way before. So do panic if pci wake request
fails which help to root cause the reason for failure.

Change-Id: I30d3f0a7858f3d4af96a80f69ba59764c9a7c8e9
CRs-Fixed: 2541061
2019-10-19 10:58:54 -07:00
Venkata Sharath Chandra Manchala
e69c9c2ac0 qcacmn: Add support for QCA6490
Add the following support for QCA6490:
1. Initialize the qca6490_hal_hw_txrx_ops
2. Initialize the hw_srng_table
3. Attach hal_qca6490_attach

Change-Id: Ic53c520ef804eb4fbe1434c704e9040c83011d3d
CRs-Fixed: 2522133
2019-10-17 15:12:14 -07:00
Venkata Sharath Chandra Manchala
222b2539cb qcacmn: Add more HAL APIs in hal_api_mon.h
Add the following macros:
1. HAL_REO_CONFIG
2. HAL_RX_MSDU_DESC_INFO_GET
3. HAL_RX_LINK_DESC_MSDU0_PTR

Add the relevant function pointers to
retrieve the descriptor info from the
above mentioned macros based on a
given chipset.

Change-Id: If44ae3d91397f1b1b0c36a49ce56a2c5e719434e
CRs-Fixed: 2522133
2019-10-17 15:10:39 -07:00
Sravan Kumar Kairam
78b01a1e1b qcacmn: Flush srng tp and hp only for flush event
Currently after runtime resume all SW2TCL data and reo cmd
srng rings hp and tp value are flushed. In case of IPA
offload case SW2TCL3 righ hp value will be updated by IPA
and not by host. In case of runtime pm enable host is
setting the value to zero as part of runtime resume which
results in incorrect hp value of SW2TCL3. As part of this
change set flush event for rings which are accessed by host
during link down state and after runtime resume flush the
rings for which flush event is set.

Change-Id: I5c9afa708277cf3a6e6d5ef99447bc21f88cfdcf
CRs-Fixed: 2514621
2019-10-12 22:16:04 -07:00
Akshay Kosigi
8eda31cab3 qcacmn: Remove void ptr usage in HAL
Add code to replace usage of void pointers from
HAL layer and instead use appropriate opaque pointers

Change-Id: Id950bd9130a99014305738937aed736cf0144aca
CRs-Fixed: 2487250
2019-07-27 13:43:07 -07:00
Akshay Kosigi
a870c6181a qcacmn: Change to clean up of void pointers
Add code to cleanup usages of void pointer usages
in DP code.

Change-Id: I0736bcc0a547d858ed02f1ee59084a44e5fe4bec
CRs-Fixed: 2487249
2019-07-27 13:43:04 -07:00
Akshay Kosigi
0bca9fb200 qcacmn: Change to remove void pointer usage for HAL SRNG
Add code to remove void pointer usage for hal_srng
and use opaque pointer dp_hal_ring_t instead.

Change-Id: I6907f7376d7fe3c9180b8795bd96f49fead2ec64
CRs-Fixed: 2484404
2019-07-27 13:42:41 -07:00
Akshay Kosigi
91c56523d3 qcacmn: Remove void pointer usage for ring desc's
Make change to remove usage of void pointers for
ring descriptors and instead use a opaque pointer
dp_ring_desc_t.

Change-Id: Ia1e9a3da9eaa3cccf297b2135b52a72f2fe21431
CRs-Fixed: 2484409
2019-07-27 13:42:37 -07:00
Akshay Kosigi
6a206753d6 qcacmn: Add code to remove void pointer usage
Add code to remove void pointer usage for hal_soc
and introduce opaque pointer to be used intead of void
from dp layer into hal layer

Change-Id: Ia38571174c6ed79558d0f0c9cd1a0f4afaa66483
CRs-Fixed: 2480857
2019-07-27 13:42:34 -07:00
Saket Jha
16d8432a3d qcacmn: Reduce log level to avoid console logging
Reducing the log level of debug log to avoid console logging
and instead get it on the cnss diag log.

Change-Id: Ie5a1eb6f45ffa97790d91528a173b16319ec760b
CRs-Fixed: 2486057
2019-07-16 18:40:26 -07:00
Sravan Kumar Kairam
830542f0d1 qcacmn: Fix wrong register window access
In register select window if the register offset falls
in the last stored register window in driver, register
window remap is not done. There is a case if platform
driver accesses the hardware registers and remaps the
register window, then driver wont be aware of this and
have the wrong cached register window. So when driver
tries to write or read it selects the wrong register
window and accesses wrong register address. So fix this
by always doing the register window remap.

Change-Id: Ic38cc8cc3d9d82a3534f5ea356027db324c9fe13
CRs-Fixed: 2477771
2019-07-12 02:05:35 -07:00
Venkata Sharath Chandra Manchala
d8b05b54d7 qcacmn: Add support to log CE DST and STATUS ring events
1. Record hp/tp for ce dst and status ring to keep
   a track of the last reaped and posted buffers.
2. Add union ce_srng_desc to record ce srng descriptor
   information.

Change-Id: I6f4728893d629c60f676826bf806b725326fb83d
CRs-Fixed: 2465492
2019-06-25 13:06:54 -07:00
Rakesh Pillai
56320c1e4d qcacmn: Fix calculation of getting head/tail pointer
The current calculation of head/tail pointer for
srng gives an index in the array by skipping
entry_size dwords.
The head/tail pointers are preffered to be the
index values like in the srng registers, which
brings them in alignment with the other usage of
head/tail pointers.

Fix the calculation of head/tail pointers for srng
by avoiding the division by srng entry size.

CRs-Fixed: 2469332
Change-Id: If9a167f3fac3cb39ebe59618e9ad2224d9e54bcc
2019-06-14 12:58:31 -07:00
Chaithanya Garrepalli
ab234e56f6 qcacmn: Add Cached Descriptor support for DP SRNGs
Add support to configure any HAL SRNG descriptor to
be allocated from cached memory area. This is to
optimize of CPU cycles spent on uncached
memory accesses. Also added prefetch of cached
descriptors

Change-Id: I2544e8596d48e2f5549bf687a764c16d73397545
CRs-fixed: 2267945
2019-05-29 11:08:12 -07:00
nwzhao
ea2ffbb331 qcacmn: skip processing duplicate descriptor in dp_rx_err_mpdu_pop
If there's a HW duplicate rx descriptor from hardware,
it'll cause a NULL pointer issue in
__dma_inv_range in dp_rxdma_err_process.
In this case, skip procssing it as a workaround.

CRs-Fixed: 2398327
Change-Id: I5639e5fc9a3a06e6762448ec7cb2ea58d9ae8160
2019-05-15 21:34:29 -07:00
Mohit Khanna
e5a6e94464 qcacmn: Restrict RX softirq poll times
The following changes are made

-Yield dp_rx_process if poll time exceeds
-Yield dp_tx_comp_handler if poll time exceeds
-Interrupt statistics to track various interrupt contexts and
 corresponding interrupt masks
-Add poll times histogram buckets to NAPI stats

Change-Id: I8c7a6bbbb97c7b3dd1dde6ac3a97113c433086a2
CRs-Fixed: 2423879
2019-05-14 18:39:59 -07:00
jiad
09526ac0d1 qcacmn: Fix REO2IPA reo destination routing
Observed that when IPA offload is enabled, RX packets
are not routed correctly to IPA ring. Currently only
IX0 of REO_DESTINATION_CTRL_IX registers are remapped,
which only covers 3-bit reo_destination_indication of
range 0 to 7.

Fix is to remap REO_DESTINATION_CTRL_IX2|3 registers
so that reo_destination_indication of range 16 to
31 can also be routed REO2IPA ring when IPA offload
is enabled. Upon IPA offload is disabled, save values
of IX2 and IX3 are reset back to HW.

Change-Id: I3428b450ab10076d27c7628a3729e8cec088bd94
CRs-Fixed: 2434331
2019-04-30 02:13:28 -07:00
Krunal Soni
9911b44343 qcacmn: Use hal_verbose_debug() to print msgs which come excessively
Some of the print messages in HAL module come very excessively.
Use hal_verbose_debug() API to print them.

CRs-fixed: 2405028
Change-Id: I4b4754af65c00edb571de898527026b6183ef15f
2019-03-06 12:52:10 -08:00
Jinwei Chen
1cb78177e6 qcacmn: Fix REO entry potential overwrite issue
Host SW should not update the cached TP pointer to HW register before
current cached TP REO entry finishes processing, otherwise there is
risk if HW HP catches up to this cached TP, but HW TP value has been
updated to (cached TP + one entry size) now, this TP REO entry might
be overwritten.

Refine it and only update TP pointer to HW when entry processing has done.

Change-Id: I54df3247745717855a67649f440c606c518efd61
CRs-Fixed: 2391658
2019-02-14 03:11:43 -08:00
Tallapragada Kalyan
eff377a1d3 qcacmn: do not process duplicate descriptor frame in RX
once in a while the HW is sending a descriptor which
is already processed by host. This can be a potential HW
issue, as a WAR we are not processing such duplicate descriptors
instead increment a counter and continue with next descriptor.

Change-Id: I6c9bc6a9fb4705b42284171a32855411aa5dd73f
CRs-Fixed: 2338543
2019-01-17 10:49:24 -08:00
Venkata Sharath Chandra Manchala
443b9b4da2 qcacmn: Print HP/TP Stats
Extend txrx_stats to print current HP/TP
Status for UMAC rings.

Change-Id: I50332f7507fdf1841dee51f0b1e97ef4ea68f04f
CRs-Fixed: 2332191
2018-11-13 06:56:15 -08:00
Pramod Simha
95c59f2993 qcacmn: Add force wake APIs for register access
Add force wake request/release API before accessing
BAR+4K register space.

Change-Id: I6583d24925de9f4464f800e19c2d27c0d1b62819
CRs-Fixed: 2302152
2018-10-31 11:50:51 -07:00
Mohit Khanna
81179cb75e qcacmn: Fixes for IPA enablement for lithium/Hastings
- Support to pass IPA enabled(disabled) flag from ini to DP layer
- Use ioremap call to translate tx_comp_doorbell_paddr obtained from
  calling ipa_setup api to tx_comp_doorbell_vaddr. This is needed to
  write the initial value of HP at the doorbell address.
- Change REO_DST_RING_SIZE and WLAN_CFG_TX_RING_SIZE to 1023
  for napier/hastings if IPA is enabled. This is needed because,
  ipa_setup API can handle only 16-bit values for the size param(bytes)
  of the ring.
- Disable hash based flow steering for SAP peers in case IPA is enabled
  and set default reo_dest_ring_4 as default RX ring. Since IPA will be
  reaping RX packets from reo_dest_ring_4 only, flow steering is not
  needed for SAP peers.
- Unmap pre-allocated TX buffers for IPA in the TX completion ring.
- Donot execute IPA functionality if IPA is disabled from ini.

Change-Id: I6855bfe293a457ccc0abd1ad5567f5c95232a9d2
CRs-Fixed: 2183519
2018-10-17 17:42:35 -07:00
Krunal Soni
ef1f0f90fc qcacmn: check hal_ring pointer before servicing the ring
Do null check before servicing the ring. When dp_service_srngs()
is common API which gets called when interrupt gets fired for
any ring. Within this API, driver goes one by one to each ring
and service the rings as it is not obvious from interrupt line that
which particular service ring needs to be served.

So race happens when rings are getting initialized and packet has been
arrived to one of the rings. Due to dp_service_srngs() API's
implementation, driver goes to one by one each ring without checking
if all rings are initialized.

CRs-Fixed: 2310496
Change-Id: I3c8f668756c8d266abe082e8473d54cb4df9065e
2018-10-01 14:59:47 -07:00
Balamurugan Mahalingam
5d80641550 qcacmn: [1/2] Support both qca8074v1 and qca8074v2 from hal
Some of the macro names defined in qca8074v1, are defined with
a slightly different name in qca8074v2, and few macros have the
same name in both headers but are defined with different values.
Fixed the same.

Change-Id: I5e948baf5326d1d8fdfa2bd7ee8aa072c710d17c
2018-09-04 11:53:36 -07:00
sumedh baikady
1f8f319500 qcacmn: Add support for cfgtool ba aging timeout cmd
Adds dp handlers for cfgtool80211 cmd to get/set
block ack aging timeout.

Change-Id: I74bb6e9e25c01f1e712066cb1e41e9adb6619662
CRs-fixed: 2193128
2018-08-28 14:46:35 -07:00
Venkata Sharath Chandra Manchala
79860aa182 qcacmn: Enable QCA6390
1. Allocate and Initialize host and target copy engine configuration
   for QCA6390 based products.
2. Setup Copy engine service map for QCA6390.
3. Add conditional compilation flag QCA_WIFI_QCA6390 to support
   QCA6390 based products.

Change-Id: Ia4dd4d436b8ecae0e9f91faa0c1fe7dbd14f001f
CRs-Fixed: 2259312
2018-08-08 12:53:51 -07:00
Balamurugan Mahalingam
d0159640ea qcacmn: Separate hal for qca6290 and qca8074
Create separate individual hal_srng_table and hal register
offset in target specific source files. Create separate
functions for qca6290 and qca8074 for few hal rx tx
functions as the macro value differs between the chipsets.

Assign target specific hal tx, rx ops as part of hal_attach
and call respective hal tx, rx ops through callbacks.

Change-Id: Ibbf490c678c39fdd9d54191aad7aaec786db30ec
2018-07-21 00:03:20 -07:00
Venkata Sharath Chandra Manchala
9347b8dbd0 qcacmn: Select window mask based on target
For QCA6390 PCI address space is reduced to 1MB.
Change bitmask to map it to appropriate range.

Change-Id: I70385df91855b7e7ddbedf7f0c6bf6e364b7d78c
CRs-Fixed: 2259194
2018-06-27 03:44:55 -07:00
Jeff Johnson
f7aed493b1 qcacmn: hal: Fix misspellings
Address the following issues in the hal folder:
CHECK: 'completly' may be misspelled - perhaps 'completely'?
CHECK: 'Initalize' may be misspelled - perhaps 'Initialize'?
CHECK: 'refered' may be misspelled - perhaps 'referred'?
CHECK: 'Retreive' may be misspelled - perhaps 'Retrieve'?
CHECK: 'settting' may be misspelled - perhaps 'setting'?

Change-Id: I98368830eeef7942c20380dbe6c638319a9860d9
CRs-Fixed: 2241575
2018-05-19 19:40:27 -07:00
Aniruddha Paul
91dfd50160 qcacmn: Add API to change Rx Fragment DST ring
Add API to change the Rx Fragment DST ring based on the SoC NSS
config
CRs-Fixed: 2175933

Change-Id: I2e3f0b82d301538f54d9790d55eeccdd0f6fa154
2018-01-30 23:55:20 -08:00
Kai Liu
b8e1241366 qcacmn: dump reo ring when flush cache failed
When delete peer, host will try to flush all frames in REO queue
by sending a cmd through reo ring, but sometimes encounted failure to
send this cmd, dump ring status if ecountered above failure.

Change-Id: I3ea4e96e5999f85398b531ddf4f350e91e798d70
CRs-Fixed: 2167419
2018-01-22 07:37:34 -08:00
Pamidipati, Vijay
980ceb9cb9 qcacmn: Add new HAL API to get SRNG descriptor which is pending reap
To release/flush buffers from source SRNGs which have not been reaped yet,
add a new HAL API to get next descriptor which is pending reap

Change-Id: Ibe490d8f8667ed046beb98fe19bfd7feb31aa286
CRs-Fixed: 2165595
2018-01-11 10:53:46 -08:00
Sathish Kumar
03d77e6590 qcacmn: Add source ring for direct buffer rx module
Direct Buffer Receive provides the driver with a mechanism by which target
can transfer information directly into host memory via DMA.

DMA rings must be initialized and configured before they can be shared
to the target for transfer ot data. Host driver will use the HAL SRNG
APIs to create, initialize and configure the DMA rings.

Change-Id: I43cd39ccbb5f5069c9a14092459d5c88ea514dca
CRs-Fixed: 2157986
2017-12-13 19:18:09 -08:00
jiad
5661cef405 qcacmn: Fix pcie remap window to 6 bits mask
Per Napier SWI spec, PCIE_REMAP_1M_BAR_CTRL expects
6 bits mask for window selection.

Change-Id: I72ac800a9eb133790b611ee1a5b56a0dc8ca49e3
CRs-Fixed: 2142294
2017-11-17 15:21:42 -08:00
Yun Park
601d0d868a qcacmn: Fix IPA WDI3 Tx issues
Fix bug to enable IPA WDI3 Tx H/W path.

Change-Id: Ice691dccc649b38971985cd8da042719d943cec7
CRs-Fixed: 2085751
2017-10-23 22:08:28 -07:00
sumedh baikady
72b1c7195f qcacmn: Add support for data path ring stats
Add feature to obtain position of head and tail pointer of all rings.
Change code to include 'iwpriv athx txrx_stats 263' that gives the entries
pointed to by head and tail pointer.

Change-Id: Ib125db8982362c50a415058fd29f07f326991a50
CRs-fixed: 2098806
2017-09-28 21:59:24 -07:00
Tallapragada Kalyan
dbbb0c8085 qcacmn: Add support for Hash based steering in RX PATH
Add support for hash based steering in RX path, also
considered cases where a particular radio or both radios
are handled by NSS offload.
CRs-Fixed: 2092357

Change-Id: Ib0e88c28eecd7bfdb52c7337d4485ac41371be68
2017-08-31 02:11:15 -07:00
Karunakar Dasineni
6bcbdd5a27 qcacmn: Use HP instead of loop count in dst rings
SRNG loop count is not restored after LMAC resets, and hence can't
be used to reap entries from destination rings. Modify the SRNG API
to use head pointer instead.

Change-Id: I3b05948d531cc3d1a5ccb7f01e38f8f36ae69da9
CRs-Fixed: 2091809
2017-08-29 20:59:02 -07:00