summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath10k/snoc.c
AgeCommit message (Collapse)Author
2019-02-20ath10k: switch to use SPDX license identifiersKalle Valo
Use SPDX identifiers everywhere in ath10k. Makefile was incorrectly marked in commit b24413180f56 ("License cleanup: add SPDX GPL-2.0 license identifier to files with no license"), fix that as well. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-02-11ath10k: enable Factory Test Mode for WCN3990Rakesh Pillai
The support to put WCN3990 firmware into Factory test mode is not present currently. The WCN3990 firmware can operate in Factory test mode based on the mode it receives in the wlan enable message from the host driver. When the host driver is started in testmode send the operating mode as UTF mode, to the WCN3990 firmware, in the wlan enable message to start the firmware in Factory test mode. Tested on: WCN3990 Tested FW: WLAN.HL.2.0-01192-QCAHLSWMTPLZ-1. Signed-off-by: Rakesh Pillai <pillair@codeaurora.org> Reviewed-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-02-11ath10k: enable bus layer suspend/resume for WCN3990Govind Singh
Register snoc bus layer suspend/resume PM ops and configure the wakeup source(CE2) for the device. Testing: Tested on WCN3990 HW. Tested FW: WLAN.HL.2.0-01192-QCAHLSWMTPLZ-1. Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-02-07ath10k: snoc: remove set but not used variable 'ar_snoc'YueHaibing
Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/wireless/ath/ath10k/snoc.c: In function 'ath10k_snoc_tx_pipe_cleanup': drivers/net/wireless/ath/ath10k/snoc.c:681:22: warning: variable 'ar_snoc' set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-02-07ath10k: fix hw-restart crash inject mode for WCN3990Rakesh Pillai
The hw-restart crash inject mode is a special mode, where there is no crash generated in the firmware, but instead the driver restarts the firmware. In order to restart WCN3990 firmware, the driver needs to send qmi_wlan_disable message followed by the qmi_wlan_enable message to the WCN3990 firmware. Currently the qmi_wlan_disable message is not sent to the WCN3990 firmware when hw-restart crash is injected, which causes the firmware to crash when the driver sends qmi_wlan_enable message during ath10k_restart. Send qmi_wlan_disable to the WCN3990 firmware when the hw-restart crash is injected via debugfs. Tested HW: WCN3990 Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1 Signed-off-by: Rakesh Pillai <pillair@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-02-04ath10k: Set DMA address mask to 35 bit for WCN3990Rakesh Pillai
WCN3990 is a 37-bit target but can address memory range only upto 35 bits. The 36th bit is used to control the smmu/iommu translation and the 37th bit is used by the internal bus masters to access the wifi subsystem internal SRAM. With the DMA mask set to 37i-bit, the host driver can get 37-bit dma address, which leads to incorrect address access in the target. Hence the host driver can used addresses upto 35-bit for WCN3990. Fix the dma mask for wcn3990 to 35-bit, instead of 37-bit. Tested HW: WCN3990 Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1 Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Rakesh Pillai <pillair@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-12-20ath10k: remove work in progress logs from snoc driverGovind Singh
All the necessary patches to make wifi running (over SNOC) are merged and tested on SDM845/QCS404 platform with WCN3990 wifi module, hence remove work in progress debug from snoc driver and Kconfig. Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-11-06ath10k: fix struct init whitespace in SNOC driverBrian Norris
Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-11-06ath10k: ath10k_snoc_{read,write}32() should be staticBrian Norris
They're provided as callbacks in ath10k_hif_ops and should be accessed that way, if needed outside of snoc.c, and anyway, they're currently unused outside snoc.c. Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-11-06ath10k: snoc: fix unbalanced clock error handlingBrian Norris
Similar to regulator error handling, we should only start tearing down the 'i - 1' clock when clock 'i' fails to enable. Otherwise, we might end up with an unbalanced clock, where we never successfully enabled the clock, but we try to disable it anyway. Fixes: a6a793f98786 ("ath10k: vote for hardware resources for WCN3990") Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-11-06ath10k: snoc: relax voltage requirementsBrian Norris
I rarely see drivers specify precise voltage requirements like this, but if we really have to...let's at least give a little wiggle room. Board designs (and accompanying device trees) may not provide exactly the voltage listed here, and we shouldn't fail to probe just because of this. Round these ranges down to the nearest volt, and provide a 0.05V margin. The regulator should provide its own supported ranges, which will helpfully intersect with these ranges. I would just as well remove these ranges entirely, but if I understand correctly, there's some reason that QCOM SoC's like to set zero / non-zero voltages. Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-11-06ath10k: snoc: fix unabalanced regulator error handlingBrian Norris
If a regulator fails to set its voltage, we end up with an unbalanced call to regulator_disable(), because the error path starts with the current regulator (which was never enabled). Factor out the "on" function to perform (and unwind if failed) a single regulator at a time, and then main loop (ath10k_snoc_vreg_on()) can just worry about unwinding the regulators that were already enabled. It also helps to factor out the "off" function, to avoid repeating some code here. Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-11-06ath10k: snoc: remove 'wcn3990' from generic resource handlingBrian Norris
ath10k_wcn3990_clk_info and ath10k_wcn3990_vreg_info are not WCN3990-specific structures. They hold generic data. So don't name them with wcn3990 specifics. Signed-off-by: Brian Norris <briannorris@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-11-05ath10k: add support for WCN3990 firmware crash recoverySurabhi Vishnoi
Whenever the WCN3990 firmware becomes unavailable, the host driver receives a FW down indication, post which all the direct hardware register access should be avoided, in order to prevent improper behavior in the host driver. Set the crash_flush flag when the host driver receives a FW_DOWN_IND via qmi, in order to stop the untimely hardware register access. Also handle the case, where we need to do core register only for the first FW_READY indication, which is when we initialize the host driver. All the subsequent FW_READY indication will be received in subsystem recovery case and we only need to do the restart work. The state of driver is maintained using flags to distinguish between first and subsequent FW_READY indication received. Tested HW: WCN3990 Tested FW: WLAN.HL.2.0-01188-QCAHLSWMTPLZ-1 Signed-off-by: Surabhi Vishnoi <svishnoi@codeaurora.org> Signed-off-by: Rakesh Pillai <pillair@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-10-13ath10k: add QMI message handshake for wcn3990 clientGovind Singh
Add WCN3990 QMI client handshakes for Q6 integrated WLAN connectivity subsystem. This layer is responsible for communicating qmi control messages to wifi fw QMI service using QMI messaging protocol. Qualcomm MSM Interface(QMI) is a messaging format used to communicate between components running between remote processors with underlying transport layer based on integrated chipset(shared memory) or discrete chipset(PCI/USB/SDIO/UART). Signed-off-by: Govind Singh <govinds@codeaurora.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Acked-by: Niklas Cassel <niklas.cassel@linaro.org> Reviewed-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-10-01ath10k: disable napi before resource cleanup to avoid "use after free"Govind Singh
CE buffers are cleaned up prior to napi disable and this is causing NULL pointer dereference due to "use after free". Disable napi before resource cleanup to avoid "use after free". Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-10-01ath10k: move napi_enable to hif_start for consistent pairingGovind Singh
There is unbalanced napi_{enable,disable}() behavior as they are being called from hif_snoc_{power_up/stop). The fix is to call napi_enable() from ath10k_snoc_hif_start() so that it matches with napi_disable() being called from ath10k_snoc_hif_stop(). Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-09-06ath10k: add device type enum to ath10k_bus_paramsErik Stromdahl
Add dev_type parameter to struct ath10k_bus_params. The dev type specifies if the device is a high latency device (usb and sdio) or low latency device (pci, ahb and snoc) The setup of high latency chips is sometimes different than for chips using low latency interfaces. Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-09-06ath10k: add struct ath10k_bus_paramsErik Stromdahl
This struct is used as argument to ath10k_core_register in order to make it easier to add more bus parameters in the future. Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-09-06ath10k: enable pktlog for WCN3990 targetGovind Singh
WCN3990 target uses separate htc service for pktlog. Add pktlog service request and support for pktlog rx path handling. Testing: Tested on WCN3990 and QCA6174 HW. Tested FW: WLAN.HL.2.0-01192-QCAHLSWMTPLZ-1, WLAN.RM.4.4.1-00109-QCARMSWPZ-1 Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-06-14ath10k: handle resource init failure caseGovind Singh
Return type of resource init method is not assigned. Handle resource init failures for graceful exit. Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-06-14ath10k: snoc: sort include filesBrian Norris
Sort these alphabetically, with local includes in a separate section. Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-06-14ath10k: snoc: drop unused WCN3990_CE_ATTR_FLAGSBrian Norris
We started using a common CE_ATTR_FLAGS definition, so drop this one. Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-06-14ath10k: snoc: use correct bus-specific pointer in RX retryBrian Norris
We're 'ath10k_snoc', not 'ath10k_pci'. This probably means we're accessing junk data in ath10k_snoc_rx_replenish_retry(), unless 'ath10k_snoc' and 'ath10k_pci' happen to have very similar struct layouts. Noticed by inspection. Fixes: d915105231ca ("ath10k: add hif rx methods for wcn3990") Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-06-14ath10k: snoc: use module_platform_driver() macroBrian Norris
ath10k_snoc_init()/ath10k_snoc_exit() don't add much value; module_platform_driver() can remove the boilerplate. Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-06-14ath10k: make some functions staticWei Yongjun
Fixes the following sparse warnings: drivers/net/wireless/ath/ath10k/snoc.c:823:5: warning: symbol 'ath10k_snoc_get_ce_id_from_irq' was not declared. Should it be static? drivers/net/wireless/ath/ath10k/snoc.c:871:6: warning: symbol 'ath10k_snoc_init_napi' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-05-12ath10k: snoc: Remove owner assignment from platform_driverFabio Estevam
Structure platform_driver does not need to set the owner field, as this will be populated by the driver core. Generated by scripts/coccinelle/api/platform_no_drv_owner.cocci. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-04-24ath10k: enable SRRI/DRRI support on ddr for WCN3990Govind Singh
SRRI/DRRI are not mapped in the HW Shadow block and can lead to un-clocked access if common subsystem in the target is powered down due to idle mode. To mitigate this problem SRRI/DRRI can be read from DDR instead of doing an actual hardware read. Host allocates non cached memory on ddr and configures the physical address of this memory to the CE hardware. The hardware updates the RRI on this particular location. Read SRRI/DRRI from DDR location instead of direct target read. Enable retention restore on ddr using hw params to enable in specific targets. Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Rakesh Pillai <pillair@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-04-19ath10k: vote for hardware resources for WCN3990Govind Singh
Add clock and regulator votes for WCN3990 WLAN chipset. Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-04-19ath10k: add support to get target info from hif opsRakesh Pillai
wcn3990 does not use bmi. Add support to get target info from hif ops. Signed-off-by: Rakesh Pillai <pillair@codeaurora.org> Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-04-19ath10k: add hif rx methods for wcn3990Govind Singh
Add hif rx methods in rx path for wcn3990 target. Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-04-19ath10k: add hif tx methods for wcn3990Govind Singh
Add hif tx/tx-complete methods for wcn3990 target. Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-04-19ath10k: add hif power-up/power-down methodsGovind Singh
Add hif power-up/power-down methods for wcn3990 target. Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-04-19ath10k: map HTC services to tx/rx pipes for wcn3990Govind Singh
Add mapping of HTC endpoint services supported by wcn3990 target to tx/rx pipe. Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-04-19ath10k: add hif start/stop methods for wcn3990 snoc layerGovind Singh
Add hif start/stop callback for allocating/freeing buffers on tx/rx pipe and enabling/disabling the tx/rx pipe interrupts. Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-04-19ath10k: add resource init and deinit for WCN3990Govind Singh
Add methods for resource(memory, irq, HOST CE config) initialization and de-initialization for WCN3990 target. WCN3990 target uses 12 copy engine and following CE config. [CE0] :host->target control and raw streams [CE1] :target->host HTT [CE2] :target->host WMI [CE3] :host->target WMI [CE4] :host->target HTT [CE5] :reserved [CE6] :Target autonomous HIF_memcpy [CE7] :reserved [CE8] :reserved [CE9] :target->host HTT [CE10] :target->host HTT [CE11] :target -> host PKTLOG Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-04-19ath10k: platform driver for WCN3990 SNOC WLAN moduleGovind Singh
WCN3990 is integrated 802.11ac chipset with SNOC bus interface. Add snoc layer driver registration and associated ops. WCN3990 support is not yet complete as cold-boot handshake is done using qmi(Qualcomm-MSM-Interface) and qmi client support will be added once qmi framework is available. Signed-off-by: Govind Singh <govinds@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>