Commit Graph

139 Commits

Author SHA1 Message Date
Kannan Saravanan
fb0b54baee qcacmn: Initial changes for QCN9160 bring-up in HAL layer
Add device Id and target type checks for qcn9160 target
compilation.

Change-Id: I3f9bf381bd340755639184753a74159364331037
CRs-Fixed: 3282637
2022-10-18 10:08:14 -07:00
Jeff Johnson
117ae69181 qcacmn: hal: Fix misspellings
Fix misspellings in hal/...

Change-Id: Icf033a647e6a15d46420d7102dc161b94fa7dd2c
CRs-Fixed: 3304685
2022-10-10 23:02:47 -07:00
Hariharan Ramanathan
0f046983ec qcacmn: HAL changes for QCA5332
1. Changes to get correct write address in hal_get_window_address_5332.
2. Fix for monitor init crash - Added dummy entries to match the
ring_id.

Change-Id: If59b1c231d4595a95e7c1f02de1dbe0ce27a8805
CRs-Fixed: 3268933
2022-09-13 16:46:48 -07:00
Ananya Gupta
61b836202a qcacmn: Record data if pci write during suspended state
When FW was enabling WOW, a ring HP update interrupt is seen
which led to fw crash.
This change records any PCI writes that went through during
runtime suspend from host.

Change-Id: I3c44760ebaf49a131b483813522fe3e451957215
CRs-Fixed: 3280166
2022-09-12 10:15:32 -07:00
Shiva Krishna Pittala
527b0343a3 qcacmn: Fix hal_get_srng_ring_id() for Beryllium LMAC rings
For Beryllium LMAC rings, hal_get_srng_ring_id() provides the ring IDs
separately per each LMAC only if that LMAC ring is a destination ring
(This is done to use a common source ring for the DMAC rings).
But the ring IDs for LMAC source rings like DIR_BUF_RX_SRC_DMA_RING are not
being provided separately per LMAC. As a result, these ring IDs in
split-PHY mode are colliding for the 2 LMACs.
Fix this by doing the following.
 - Mark the DMAC common rings within the LMAC rings.
 - Provide ring ID separately per each LMAC if the ring is an LMAC ring
   but not a DMAC common ring.

Change-Id: Ifdae085b5784a03763abfc4edb42d94593e3ea21
CRs-Fixed: 3282702
2022-09-12 05:02:13 -07:00
Pavankumar Nandeshwar
a615488cf4 qcacmn: Hal changes for Umac post reset at host
Hal layer changes to handle Umac post reset
and post reset complete events from firmware.

Change-Id: Ib25427930aab25650731c87b38e2ef7e47ae98d9
CRs-Fixed: 3267222
2022-08-21 00:37:53 -07:00
Ruben Columbus
7a962c59e6 qcacmn: add new files for HAL v2
add hal v2 new files

Change-Id: I7728be33db7d28e44d04f19c99e8b9f47145f2e3
CRs-Fixed: 3249002
2022-08-01 19:41:18 -07:00
Hariharan Ramanathan
fc00c5bb21 qcacmn: Initial Hal changes for QCA5332
Changes to create hal files and add hal related changes in hal_srng.c

Change-Id: I96dd76333e68bdd030e17e09602b93843ebc5030
CRs-Fixed: 3233322
2022-07-18 04:53:25 -07:00
Rakesh Pillai
9ba8236444 qcacmn: Add support to track high watermark for SRNGs
Add support to track the high watermark for the number
of entries which are used at any given instant. This helps
in identifying if the ring size is sufficient or is being
full for certain use-cases.

Change-Id: Id3ffa52c653696699fbcfbb556a815d5f7908863
CRs-Fixed: 3235115
2022-07-11 03:59:38 -07:00
Srinivas Girigowda
6d056b9959 qcacmn: Add support for Mango device id
Add support for Mango device id.

Change-Id: I2b32a39e258caab408723db77f132af364dc6b04
CRs-Fixed: 3232512
2022-07-02 09:55:56 -07:00
Amit Mehta
721afd10ab qcacmn: Move tcl_data_cmd function attribute to common file
Move the function attribute to common file so that the
parsing issue due to unreferenced tcl_data_cmd can be
fixed on other targets also.

Change-Id: I40a7196926061e8d232f0f070c0ed045dafd97e2
CRs-Fixed: 3228562
2022-06-28 01:13:01 -07:00
Ananya Gupta
8565e7029f qcacmn: Register DP, HTC, HAL modules with Runtime PM module
With restructuring in HIF runtime PM module, modules are
required to register with the HIF runtime PM module. Also,
changes are done in functions of allowing and preventing
runtime PM suspend as part of restructuring.
This change registers DP, HTC and HAL internal modules
with runtime PM module and update HIF runtime PM function
calls with the restructured code of HIF runtime PM module.

Change-Id: I8899a1d3b92a90a05c5eaf4df7609f4008f739f8
CRs-Fixed: 3169372
2022-06-18 23:11:24 -07:00
Mohit Khanna
04bf8070da qcacmn: Reo-Cmd: Donot write to reg if no src desc
For reo_cmd ring, in current implementation, we call hal_srng_access_end
in case a descriptor is not available before baling out. This may cause
a write to the shadow register for the reo_cmd ring. In case we are in
the middle of WOW, this can be problematic.
Modify existing implementation to use hal_srng_access_end_reap, which
will not schedule a write to the register and simply return.

Change-Id: Ifb83d904e39b3d749522cd246a5ab3fe51a3104e
CRs-Fixed: 3194289
2022-05-24 16:01:27 -07:00
Rakesh Pillai
68f96a8c79 qcacmn: Add support to send Shadow config v3
Shadow config v2 can support max of 36 shadow
registers only. For KIWI target, there are 40
shadow registers supported.

Hence add support to send shadow config v3
for KIWI.

Change-Id: If57e6597397da3e239f25a6c0cc24f8fd37dcdf1
CRs-Fixed: 3167758
2022-05-19 01:57:23 -07:00
sumedh baikady
e10617683d qcacmn: Fix mem issue in reo desc shared table free
Fix use after free in detach path of REO shared table.

Change-Id: I9bba8f16e19f2e6a5217c78a633bbb57d1609edf
CRs-Fixed: 3184481
2022-04-27 22:57:21 -07:00
Sai Rupesh Chevuru
d365912c55 qcacmn: Flush and invalidation of descriptor memory at allocation
Flush and invalidation of descriptor memory at allocation is helping
to avoid NULL descriptors issues in TX and RX path.

Change-Id: Ifcdb65df01365e7ec0b0be59d8b4bf862d90943d
CRs-Fixed: 3180696
2022-04-27 22:57:15 -07:00
Sumedh Baikady
e4d9b0c2d7 qcacmn: REO queue ref enhancement for Waikiki
In WIN BE chipsets, replace the REO tid
queue programming in FW via WMI with writing to a
Host managed table shared by HW and SW. REO HW will
pick the tid queue address from the table indexed by
peer id and tid number.

Change-Id: I8107ca5116425538329b11ae3519f02b32573bac
2022-02-02 12:06:29 -08:00
sandhu
ad2829718c qcacmn: Remove IP from files
remove IP from code

Change-Id: If119a4af213b10aadb9f1344e50b0342e72405c2
CRs-Fixed: 3073864
2021-12-29 04:28:58 -08:00
Jinwei Chen
c9ff3a2ac9 qcacmn: Support hif window register and set init_phase for Kiwi
For Kiwi, if UMAC force wake is enabled, HIF window register
support is needed as well. currently hal_soc->init_phase just be
true for a very short periord, this lead to hif_force_wake_request
is called frequently when configure register during initialization,
this is not necessary as pld and device is not in power collapse
state during this period.

Enable HIF window register and increase init_phase true period

Change-Id: I0b5394bbc1ca73d20b2fcabbf2a261e6f8335626
CRs-Fixed: 3097991
2021-12-27 13:00:36 -08:00
Yeshwanth Sriram Guntuka
de814c9b16 qcacmn: Trace del reg write, ce tasklet latency, tx, and rx pkts
Use the tracepoints to trace delayed register write, ce
tasklet scheduling latency, tx, and rx packets.

Change-Id: I63a89276177a9d0466dcb0c831eeb8e938a2bf79
CRs-Fixed: 3081870
2021-12-14 21:22:49 -08:00
Mohit Khanna
733215d31f qcacmn: Change device_wake, high_tput check order
In hal_delayed_reg_write change the order of
hal_is_reg_write_tput_level_high and pld_is_device_awake check. This
ensures that throughput level is checked before checking for device
wake state. This is beneficial in saving CPU cycles in high throughput
scenarios.

Change-Id: I23d0bde46779df9dca4388bf67c9395999274f3a
CRs-Fixed: 3078096
2021-11-25 14:17:28 -08:00
Tallapragada Kalyan
e3c327a0ba qcacmn: do a batch invalidation of REO descriptors
Added an API to do a batch invalidation of REO descs
saw an improvement of 40 to 45 Mbps.
Note: this change is applicable only for cached
descriptors

PINE with Default driver: 3189 @ 100% core-3
PINE with skb prefetch: 3469 @ 100% core-3
PINE with skb pre + batch inv: 3506 @ 100% core-3
Change-Id: Ic2cf294972acfe5765448a18bed7e903562836c3
2021-11-22 13:36:28 -08:00
Karthik Kantamneni
436c1c4484 qcacmn: Flush reg work instead of cancelling in deinit path
Currently reg work is being cancelled in deinit path,
cancel work will remove all the pending work items
and wait for completion of current executing work.
But in reg work case even pending work items has to be
executed because we don't want to skip HP/TP values update.

To avoid this make sure all the pending reg work items are
flushed then disable the work for further queueing.

Change-Id: I2ba1e26cf41fb3b0c33ec584c56525cbfac94d8f
CRs-Fixed: 3065038
2021-10-29 02:15:56 -07:00
Himanshu Batra
ff8ee42eac qcacmn: Add API to get dp peer authorize state
Add API to get dp peer authorize state.
Also modify dp_tx_get_rbm_id_li to update rbm for IPA offload
scenario

Change-Id: I0f8cca4623a1c3b840f336aa6d67740951cb6700
2021-10-26 03:10:03 -07:00
Vevek Venkatesan
7a2c2fd90f qcacmn: cleanup FEATURE_HAL_DELAYED_REG_WRITE_V2 support
This FEATURE_HAL_DELAYED_REG_WRITE_V2 was added to fix the
Audio jank issue, but it could not resolve it completely,
so that was later fixed by existing delayed reg write
support with the help of SMP2P messages to communicate
with FW regarding PCIe link status. This code is not being
used, so removing it and cleaning up the redundant code.

Change-Id: Iada088e72a76b4c071c8a80ee945f36ac959670e
CRs-Fixed: 3056475
2021-10-18 06:13:49 -07:00
Jingxiang Ge
37bf2d6b08 qcacmn: record cpu_id for hal_reg_write_work
Record cpu_id in hal_reg_write_work for easily debugging
work latency issue.

Change-Id: I819b9fe0977e9e982240c090f76a69532f149e86
CRs-Fixed: 3055639
2021-10-18 06:13:20 -07:00
Chaithanya Garrepalli
7ccb73b31f qcacmn: Add support for beryllium on WIN
Add support for split between lithium and beryllium
HAL files.
Add Wkk TLV support.

Change-Id: I7135e4061a4c3605d76c70c33320cbd533ea0c62
2021-08-13 12:04:12 -07:00
Vevek Venkatesan
1a98ac54d7 qcacmn: init last_desc_cleared and it should always behind tp
Initialize the last_desc_cleared pointer to -1 not 0, and
also fix the check it should always behind tp.

Change-Id: I281e066d45a99ac99d4f3c4e0bcc3f65f14bb589
CRs-Fixed: 2987029
2021-07-12 00:22:00 -07:00
Rakesh Pillai
37e2c6d9ed qcacmn: Register IRQ for near full irq
WCN7850 has support for near full indication for
the consumer srngs. This interrupt is used to take
preventive actions to avoid ring full watchdog irq
trigger.

Register for the near full irq and add the necessary
ext groups for these near-full irqs.

Change-Id: Ic16381fceabc54e6c52b34dd13abea74cad4d38c
CRs-Fixed: 2965081
2021-06-30 13:47:51 -07:00
Yeshwanth Sriram Guntuka
8ddd31db96 qcacmn: Invoke hal_reg_write_need_delay before the register write
hal_reg_write_need_delay is invoked immediately after
q_elem->valid check. The first two instructions in
hal_reg_write_need_delay could be in the CPU instruction
pipeline which could result in possible loading and
dereferencing of NULL srng from an invalid q_elem.

Fix is to invoke hal_reg_write_need_delay just before
hal_process_reg_write_q_elem and also add NULL checks
to avoid the srng NULL pointer dereference.

Change-Id: I2de50b1e78782e3c91a9cb4477f28d91f9c29439
CRs-Fixed: 2973257
2021-06-24 22:25:27 -07:00
Rakesh Pillai
1104d6d5a7 qcacmn: Delay 50us when update same shadow reg
Add 50us delay if srng's shadow reg write again within 5us.

Change-Id: I8d48496814e063ebd441db3520e3a5406c5db13e
CRs-Fixed: 2965371
2021-06-24 22:25:21 -07:00
Basamma Yakkanahalli
00bcc8cbd3 qcacmn: Initial changes for ipq9574 target compilation
Added device ID and target type checks for ipq9574 traget
compilation.

Change-Id: Ie337d1256f828987ed469a609c8fb74de2180dca
2021-06-18 11:07:50 -07:00
nobelj
8a11583471 qcacmn: Add field to return Lmac ring start ID
Return LMAC start id also as part of hal_get_meminfo API.
This field is added to hal_mem_info struct.

Change-Id: I013d357cf4337702c06a91ed15e8337469865270
2021-06-10 06:16:57 -07:00
nobelj
25acb759bf qcacmn: Fixes to enable LI & BE in a build
Changes to build Lithium and Beryllium together.
This is needed for WIN

Change-Id: I74c86803ea99fb17d1f73e8b9c4e7cf59751a707
2021-06-07 01:51:15 -07:00
Rakesh Pillai
b2548a90cd qcacmn: HAL srng API changes for beryllium
Add HAL srng API changes for WCN7850

Change-Id: I4b78dbe6a88b24c9ef7662c2091123fa7f86ba18
CRs-Fixed: 2891049
2021-06-05 15:10:50 -07:00
Mohit Khanna
4e6a7cf1bf qcacmn: Use function to attach HAL TX/RX ops
Assign th HAL TX/RX ops in a function instead of assining a structure
directly. This can be later extended to have default ops for a family of
chips and then override that with chip specific ops.

This also helps the case where a new hal_soc->ops needs to be added.
The new 'op' will need to be added to only a default ops initializer
(with assumption that it applies to all chips).

Change-Id: Iefa23d14110fa5252444fad89737a3b2b2fbab6f
CRs-Fixed: 2891049
2021-06-05 15:10:50 -07:00
Karthik Kantamneni
bd49a69019 qcacmn: Introduce intermediate EP voting access state
Introduce intermediate EP voting state during this transition state
access the votes only if direct writes are not possible.

Change-Id: Ib4522aef2209b4797100ca84e4e230a00e14b654
CRs-Fixed: 2954903
2021-05-28 18:30:53 -07:00
Karthik Kantamneni
ad0f442d8f qcacmn: Add delayed reg write support based on EP power state
Even though HP/TP updates are posted writes at CPU level, they
are getting blocked until soc comes out retention which is hogging
CPU.

To avoid this if EP is in low power state update HP/TP writes from
delayed work context. In delayed work vote for EP awake wait till it
comes out low power state and then proceed to HP/TP update.

Change-Id: I61d5795f58f25f850b5a9ad4d30e3181dba23713
CRs-Fixed: 2913495
2021-05-11 08:03:35 -07:00
Karthik Kantamneni
1807be0f1e qcacmn: Add CE delayed reg update support for QCA6750
Add support to update CE srngs HP/TP in delayed manner
for QCA6750 target. This avoids busy wait in register update.

Change-Id: Id825a6fdf709187765ff823cb3015db21a024af3
CRs-Fixed: 2894094
2021-03-18 03:38:36 -07:00
Aditya Kodukula
7679b0651a qcacmn: Add params to the wlan_minidump_remove function
For the minidump feature, the wlan_minidump_remove function
definition is modified. So, update the function parameters
accordingly at all instances of the wlan_minidump_remove function.

Change-Id: I5a346f6cdf423ece02fb08d68e4422251af54876
CRs-Fixed: 2860435
2021-03-09 21:07:01 -08:00
Nisha Menon
8d4b739df0 qcacmn: Enable device force wake recipe in driver
Enable force wake recipe feature DEVICE_FORCE_WAKE_ENABLE
and disable the generic shadow register write feature
GENERIC_SHADOW_REGISTER_ACCESS_ENABLE.
Force wake recipe will be used to write to the REO remap
control registers by waking up the UMAC instead of using
shadow register writes.
Assert soc wake reg and poll on the scratch reg to check
if UMAC is awake.
Enable HIF_REG_WINDOW_SUPPORT to enable windowed reg
read/write in HIF layer.

Change-Id: Ib696e27e19a07c0084c097b95b7780b56e643c8b
CRs-Fixed: 2850590
2021-02-24 19:35:13 -08:00
Vevek Venkatesan
38af510319 qcacmn: add dedicated workqueue for Tx ring delayed reg write
Add delayed SRNG register writes support for Tx Ring, also add
dedicated workqueue to do the delayed Tx SRNG register writes.

Change-Id: I8dd157d341f3035e988804eab50d1ca681ab789b
CRs-Fixed: 2868989
2021-02-12 14:40:11 -08:00
Pavankumar Nandeshwar
d6c9f3ad8a qcacmn: change qcn9100 to qcn6122 in data path
Change the name of target type qcn9100
to qcn6122 in data path.

Change-Id: Ia1463ca276b7c107ca4c1ebce4ffc8b517134a5e
CRs-Fixed: 2849577
2021-01-18 21:45:30 -08:00
Yeshwanth Sriram Guntuka
871c29e8f2 qcacmn: Set IPA WBM2SW ring HP to DDR addr on disable pipes
WLAN HW can still access the IPA tx doorbell address post
disable pipes if there are any pending tx completions which
could result in a NOC error.

Fix is to reset the WBM2SW ring HP addr to shadow addr in
DDR before pipes are disabled.

Change-Id: I52900eb34530388487923a887354ef8839d8c728
CRs-Fixed: 2846421
2021-01-06 13:52:45 -08:00
Mohit Khanna
a939d20dbf qcacmn: Move delayed-reg-work active_work_cnt decrement
Currently, we decrement active_work_cnt in a while loop in delayed
register worker and later on make a "allow_l1" call to enable L1ss.
The bus suspend routine depends on the value of active_work_cnt to
determine if any register writes are pending. In case there are, bus
suspend is rejected.
As a result its possible that when bus suspend happens, the
delayed worker while processing the last remaining enqueued
write,  makes the active_work_cnt to 0. This will allow the bus suspend
routine to continue to disable the bus, even before the
delayed-reg-worker has called allow_l1 and run to completion. This may
lead to a NOC error while calling "allow_l1" API from
delayed-reg-worker.

Hence, move the decrement of active_work_cnt to the very end in
hal_reg_write_work function.

Change-Id: Iec602f97c953df1c6a018310fd02ab458547ce3a
CRs-fixed: 2813733
2020-11-14 20:04:04 -08:00
Wu Gao
32cab9b00c qcacmn: Fix compilation issue on arch32 by gcc 9.3
This change fixed compilation error about implicit-fallthrough and
pointer to in cast.

Change-Id: Iea2c25d97d8a039ed0f8083078427a8f8de70cd1
CRs-Fixed: 2814658
2020-11-11 10:23:54 -08:00
Mohit Khanna
98181d9ccc qcacmn: Flush reg write work before bus suspend
Delayed register write work needs to be flushed before bus suspend to
make sure there are on pending writes after driver's bus suspend routine
exits. In case delayed work context is not able to finish before the bus
(PCI) is suspended (DRV), it may lead to a NOC error.

Change-Id: I40cbcec5d23ddd75ec87aed69ac45d95510fa880
CRs-Fixed: 2813733
2020-11-09 22:57:51 -08:00
Nisha Menon
a377301c78 qcacmn: Add support to map generic shadow regs
Add apis to map generic registers to shadow region. Existing
logic includes mapping only srng based regs to the shadow
region.
Add support to map REO control regs and WBM2SW2 rel
ring HP reg address to the shadow region in case the direct
reg writes in IPA enable/disable autonomy fail due to UMAC
block being in a power collapsed state.
Shadow reg mapping for these regs is provided to FW during
init. Add stat shadow_reg_write_fail to track shadow reg
write failure and shadow_reg_write_succ to track successful
shadow writes.

Change-Id: I04790765a3de80047689657e2cad0b73123440b9
CRs-Fixed: 2790321
2020-10-20 15:05:51 -07:00
Jinwei Chen
4fdb9be461 qcacmn: Retry reo_dst_ctrl register writing if fails
If reo_dst_ctrl register writing failed, this is a fatal error for
IPA pipe going to down case as RX frames will still be routed to
IPA rings then hit NOC error. retry register writing to see any
chance to write successfully, if fail always, trigger SSR or panic.

Change-Id: I3c03faa28e6cc93f396944579a360d5405c8138e
CRs-Fixed: 2774789
2020-09-15 04:59:41 -07:00
Srinivas Girigowda
5040a3b6ed qcacmn: hal: Remove redundant __func__ from the logs
The logging macros implicitly takes care of embedding function name
in the log, hence there is no need to include __func__ again.
Getting rid of redundant __func__ reduces driver memory footprint.

Change-Id: I6b5beea990e78486e1e5aab5a8df5fc2f1e5ab51
CRs-Fixed: 2774457
2020-09-15 02:45:57 -07:00