Commit graph

114 commits

Author SHA1 Message Date
Linux Build Service Account
f2b51db98e Merge "cnss2: update device id in cnss_usb_dev_powerup" 2019-07-24 03:01:42 -07:00
Rajasekaran Kalidoss
f28c0c7e61 cnss2: update device id in cnss_usb_dev_powerup
Add device id's of qcn7605 ver20 USB devices to
cnss_usb_dev_powerup function.

Change-Id: I2dd173b609a778fb3699b54e032e2183efd925b5
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-07-22 15:16:46 +05:30
Yu Wang
961798b123 cnss2: initialize the structures before using them
Some structures are used uninitialized, which may
result in unexpected behavior.
Initialize these structures before using them.

CRs-Fixed: 2494231
Change-Id: I89c7c8ec9defe1db14b9c8cdc3632f5d0051e626
Signed-off-by: Yu Wang <yyuwang@codeaurora.org>
2019-07-22 17:14:03 +08:00
Linux Build Service Account
c0f636f832 Merge "cnss2: Update board data file name format" 2019-07-01 00:42:14 -07:00
Rajasekaran Kalidoss
c94369b4c1 cnss2: print firmware cap info in stats
Show firmware capability information i.e Chip ID
Chip family, SOC Info, Board id,Firmware Version,
and Firmware Build Timestamp in /d/cnss/stats.

Change-Id: I1d2f2e4a88960e690aabe610182d33cf8035f6c1
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-06-24 00:47:44 -07:00
Nirav Shah
fbf98df8d0 cnss2: Update board data file name format
If board ID is larger than 0xFF (e.g. 0xABCD), the proper BDF file
name format should be updated to bdwlanAB.bCD or bdwlanAB.eCD based
on corresponding BDF types.

Add snapshot of data file name format change from msm-4.14
commit 48129d773e327f7131116bb8bb8d7b91cc235e90.

Change-Id: Ib076d16d2faeb5ee1e9006e215a9ed4d279c35e9
Signed-off-by: Nirav Shah <nnshah@codeaurora.org>
2019-06-07 10:08:55 +05:30
Nirav Shah
e405d025f3 cnss2: Return failure if bus type do not match
Return failure in bus register if bus_type do not
match between cnss and wlan driver.

Change-Id: I9c322e4f6eca3220f1de18a6031715381ba495d7
Signed-off-by: Nirav Shah <nnshah@codeaurora.org>
2019-05-29 13:25:19 +05:30
Yue Ma
f4d62ca185 cnss2: Expose idle restart/shutdown APIs
Interface change to expose idle restart/shutdown APIs for WLAN
driver. This patch is to provide API interface to ease compilation
issues among various branches of kernel and WLAN driver. The actual
implementation will be in a separate patch.

Change-Id: I7f4a0079c32875c362d36c9f794d55609f924198
Signed-off-by: Yue Ma <yuem@codeaurora.org>
2019-05-03 10:46:29 -07:00
Yue Ma
f12b2d3f77 cnss2: Expose PCIe DRV connection status
Interface change to expose PCIe DRV connection status to WLAN
driver so that it is able to suspend/resume based on the status.

Change-Id: If8f706b0eb38f209a5e322b112beb9a95babdcad
Signed-off-by: Yue Ma <yuem@codeaurora.org>
2019-04-29 17:32:46 -07:00
Jayachandran Sreekumaran
00389026f8 cnss2: Remove setting recovery state during driver unload
Remove setting the recovery state in wlan driver unload path.

Change-Id: Ib59c8d406fe67f14b7893884f23d323e87e2490f
Signed-off-by: Jayachandran Sreekumaran <jsreekum@codeaurora.org>
2019-04-16 19:00:08 +05:30
Rajasekaran Kalidoss
04235478f2 cnss2: Support USB SSR and disconnect scenarios
For USB devices, irrecoverable scenarios in firmware
can lead to USB bus disconnect. In USB disconnect, the
interface and dev structures passed by USB sub system
are freed and are no longer valid. The current
implementation is PCIe specific and assumes dev struct
being present and valid always. The clean way to handle
this for HL(USB/SDIO) is to call pld_usb_remove in
disconnect and pld_usb_probe in re-connect after a recovery

Change-Id: I3fc9a5a2fc7bb53439b0410e61f381aa94e18634
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-04-09 17:46:24 -07:00
Guisen Yang
9ec08ea59b cnss2: Export a platform API to force collect ramdump
Add an API to force collect ramdump in platform driver. This API will be
called from WLAN driver to collect  ramdump before calling kernel panic.

CRs-Fixed: 2351811
Change-Id: Ic88769beec4f7f8303fc2c0803012789e02c9f4f
Signed-off-by: Guisen Yang <guiseny@codeaurora.org>
2019-04-08 19:43:57 -07:00
Linux Build Service Account
90059640cc Merge "cnss2: Initialize plat_priv during bus_init" 2019-03-26 07:12:51 -07:00
Jayachandran Sreekumaran
a7370a6289 cnss2: Initialize plat_priv during bus_init
cnss_usb_data structure member plat_priv remains uninitialized till
the function invoke of cnss_usb_probe. This leads to the access of
uninitialized pointer plat_priv if CLD gets loaded prior to
firmware download completion. Hence initialize the plat_priv
in cnss_usb_data structure during cnss_usb_init.

Change-Id: Ic471eacf22b112aaffe61458e22c7a9102470467
Signed-off-by: Jayachandran Sreekumaran <jsreekum@codeaurora.org>
2019-03-26 12:27:47 +05:30
Rajasekaran Kalidoss
9ccdcef087 cnss2: Add QCN7605 USB for cold boot cal via fs_ready
For triggering cold boot via fs_ready, the device ID
and bus type of QCN7605 USB was added in fs_ready and
cold boot cal start and done handlers.

Change-Id: I28801207c7833af18a09819cd9ab07ede556ac87
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-03-25 20:33:25 -07:00
Rajasekaran Kalidoss
8e839de595 cnss2: Add support for QCN7605 ver 2 usb device support
New PID has been introduced for Version 2.0 of QCN7605
USB composite device. PID should be updated in cnss2
driver to support this device.

Change-Id: I12b944b15021f317b24a34b0801a4d600133eee3
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-03-14 22:08:42 -07:00
Rajasekaran Kalidoss
88d22796e1 cnss2: power up & power down during reg and unreg
In insmod and rmmod handling, cnss2 should power up and power
down WLAN as part of register and unregister.

Change-Id: I5c588e7db0748363ffbfec9ee4ec26ebdb85e3aa
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-03-13 09:26:53 +05:30
Linux Build Service Account
eb7d854b0d Merge "cnss2: Disable PCIe bus master bit before save config space" 2019-02-18 14:15:04 -08:00
Nirav Shah
6b98de4a98 cnss2: Disable PCIe bus master bit before save config space
There may be a issue if save PCIe config space with bus master
enabled. During resume, since the bit will be restored first,
device will think master is ready and then trigger MSI for some
events, but actually MSI config has not been restored yet which
will mask the MSI. To avoid this, clear the bus master bit before
save config space and the bit will be enabled at a later time.

Change-Id: I75b993dda602ab94da37e108f07dd0f996e1a071
Signed-off-by: Nirav Shah <nnshah@codeaurora.org>
2019-02-13 19:32:28 +05:30
Linux Build Service Account
cc11fdf3ca Merge "cnss2: Provide sysfs control for vdd-wlan-en" 2019-02-12 23:51:33 -08:00
Linux Build Service Account
6e489721e7 Merge "cnss2: Add support for bdf filename with bin prefix" 2019-02-12 23:51:31 -08:00
Rajasekaran Kalidoss
721e25a021 cnss2: Provide sysfs control for vdd-wlan-en
For qcn7605 USB, firmware download and error
recovery are handled by entities in userspace.
cnss needs to provide access vdd-wlan-en to
the kickstart userspace via sysfs

Change-Id: I53da7f2f7ebb2ec55f98fc328a550181dccb5a18
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-02-12 15:41:08 +05:30
Jayachandran Sreekumaran
f247ea1faa cnss2: Add support for bdf filename with bin prefix
Add support for bdf filename with the prefix suitable for
binary format.

Change-Id: I24cc19b24ab084a754ba28eb8b2fa459189990d9
Signed-off-by: Jayachandran Sreekumaran <jsreekum@codeaurora.org>
2019-02-11 12:28:40 +05:30
Rajasekaran Kalidoss
22cbaeeb0e cnss2: Implement cold boot cal upload/download via QMI
In QCN7605, HL(USB and SDIO) transports are supported.
Cold boot calibration data upload and download is handled
in kernel space itself. New logic was decided for upload
and download. This logic is implemented in cnss2.

Change-Id: I19fcd643a2fc656e98b5375de16229cc3217dd45
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-02-07 23:44:36 -08:00
Rajasekaran Kalidoss
94a480760a cnss2: Return 0 from susped/resume for driver_ops null
During usb suspend/resume call from USB SS, if driver
ops is not present cnss should return success. presently
it is returning -EINVAL if driver_ops is NULL.

Change-Id: I43a268489107bdad1945b4a842bb9ab3abe1b4ea
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-01-19 05:52:43 -08:00
Rajasekaran Kalidoss
d76cb454ed cnss2: USB:skip ce config for USB transport
For USB transport, ce config request should not be
sent. In cnss_wlan_enable, skip ce config if bus type
is USB.

Change-Id: Icf7c2a7c01c4b93a0856442f8a78d733a9858183
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-01-15 06:53:12 -08:00
Rajasekaran Kalidoss
b8d62600fc cnss2: Add QCN7605 device ID for elf ramdump
For QCN7605 device ID, the collected dump
segments are not dumped to /dev/ramdump_QCN7605.
Device ID of QCN7605 needs to be added to the
ramdump path.

Change-Id: Ib3931f13f99f9c219f4a0e64b5bc92fb2f0b3902
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-01-10 07:10:25 -08:00
Linux Build Service Account
c2161416e7 Merge "cnss2: Add cnss usb API to check the target status" 2019-01-09 08:54:50 -08:00
Linux Build Service Account
cd4e8fc6f9 Merge "cnss2: Add cal duration in host capability request" 2019-01-08 21:26:03 -08:00
Rajasekaran Kalidoss
72c6bb7c2b cnss2: Add cal duration in host capability request
Add cal duration in host capability request as host needs to support
best effort cold calibration.

Change-Id: I2bb162da4db2c72efb7866b665cff2cb5a4863a5
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2019-01-08 20:27:53 +05:30
Jayachandran Sreekumaran
2bf8ef1af3 cnss2: Add cnss usb API to check the target status
Add new cnss usb API to check to check whether the target
is up or down. Remove invoking pld_remove callback function
in usb disconnect.

Change-Id: I0e873737a27f9941db1dae54636ef55ba4d05288
Signed-off-by: Jayachandran Sreekumaran <jsreekum@codeaurora.org>
2019-01-08 11:54:01 +05:30
Jayachandran Sreekumaran
1030466da5 cnss2: Add support for bin format bdf file
As genoa supports bdf file only in bin format, add support for the same.

Change-Id: I55db0480a259379c4ee2dac76f587d3fdf497090
Signed-off-by: Jayachandran Sreekumaran <jsreekum@codeaurora.org>
2019-01-08 10:44:05 +05:30
Linux Build Service Account
84da71b286 Merge "cnss2: Handle USB disconnect scenario" 2018-11-17 08:16:28 -08:00
Rajasekaran Kalidoss
e548e6fd44 cnss2: Handle USB disconnect scenario
Clean up cnss during a USB disconnect scenario
and call driver_ops remove if wlan driver is
registered with CNSS.

Change-Id: I72e6e42609724c9c5e0e07f381d2455d2631cc22
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2018-11-16 02:42:41 -08:00
Rajasekaran Kalidoss
e268d7d64c cnss2: cnss_bus_get_wake_irq should return int
For error conditions,this api returns negative value.
currently the return type is unsigned int, this should
be changed to integer type.

Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
Change-Id: Ifaeea4d76f5d2c2e8f0f67eab97df50dae09462c
2018-11-13 22:53:35 -08:00
Rajasekaran Kalidoss
7a18627fbf cnss2: call remove driver_ops in cnss_wlan_unregister
rmmod of wlan triggers cnss_wlan_unregister. wlan driver_ops
remove should be called for QCN7605 standalone and
composite devices to finish the rmmod path.

Change-Id: I0047eb65b68b7e81b9b9c9fd79825a0d3f27c640
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2018-10-30 01:46:39 -07:00
Linux Build Service Account
403ca80f89 Merge "cnss2: Update QMI files with cold cal data changes" 2018-10-22 04:36:45 -07:00
Rajasekaran Kalidoss
639b259c8f cnss2: Update QMI files with cold cal data changes
QCN7605 supports cold boot cal data upload/download
over QMI for HL transports. QMI structures are updated
to support this.

Change-Id: Ic91f856ced8d30ab31cb305396ec476c6ca55f40
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2018-10-19 03:31:07 +05:30
Rajasekaran Kalidoss
9acfcb8c05 cnss2: Update WLAN composite USB I/F number for QCN7605
For QCN7605 composite usb ,the WLAN interface number is 2.
update this number to register CNSS as driver for WLAN
I/F.

Change-Id: I8dd97d18bf57e4268f194f846ad7c2e7b77afe50
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2018-10-18 20:32:15 +05:30
Rajasekaran Kalidoss
616ea9d08b cnss2: Add support for USB transport
Changes in state machine and boot flow to support usb bus
based behaviour. Handler functions added to support USB
boot flow.

Change-Id: I51c4751c8d8669a8b54ae692ae3ec1bb32d1e7be
Signed-off-by: Rajasekaran Kalidoss <rkalidos@codeaurora.org>
2018-10-16 12:05:55 -07:00
Linux Build Service Account
fad2fb7e75 Merge "cnss2: Add QMI updates for Genoa PCIe" 2018-10-11 07:01:19 -07:00
Jayachandran Sreekumaran
b00eda857b cnss2: Add QMI updates for Genoa PCIe
Add qmi updates to pass the msi config for copy engine and
host memory information for CE to update the read index.

Change-Id: I8861659e54cfb25ae64a23a3f02f1e0fce6d372d
Signed-off-by: Jayachandran Sreekumaran <jsreekum@codeaurora.org>
2018-10-09 22:01:12 -07:00
Yue Ma
abbfad73a8 cnss2: Add force wake support
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 support in CNSS driver and expose the APIs
for WLAN host driver.

Change-Id: I69688c229121c12575dde4938961d60bc067751f
Signed-off-by: Yue Ma <yuem@codeaurora.org>
2018-10-08 12:40:07 -07:00
Jayachandran Sreekumaran
5d33cdfa53 cnss2: Add support for genoa pcie
Add genoa pcie specific qmi and power up/down handling.

Change-Id: I08e640f775de5436071b457225a8b61f13574d01
CRs-fixed: 2272303
Signed-off-by: Jayachandran Sreekumaran <jsreekum@codeaurora.org>
2018-10-03 06:40:57 -07:00
Yue Ma
4bb119b248 cnss2: Clear CNSS_DEV_ERR_NOTIFY after collecting firmware dump
CNSS_DEV_ERR_NOTIFY should not be cleared before collecting firmware
dump as device is still in asserted state. Clear it after collecting
firmware dump.

Change-Id: Ic57c65d8ffa1806a0af83e653d6573f19ab1e705
Signed-off-by: Yue Ma <yuem@codeaurora.org>
2018-09-14 12:20:35 -07:00
Yue Ma
ee4241b768 cnss2: Add API to check if WLAN PCIe device is down
API provision for WLAN host driver to check if WLAN PCIe device
is down.

Change-Id: I91efcd781af67c72b787c89e6b619c4cc49da34b
Signed-off-by: Yue Ma <yuem@codeaurora.org>
2018-09-13 11:04:22 -07:00
Linux Build Service Account
7f6b5aa038 Merge "cnss2: Clear flag CNSS_DRIVER_UNLOADING after unregister driver finished" 2018-08-06 21:52:22 -07:00
Linux Build Service Account
5e1e802655 Merge "cnss2: Skip PCIe link suspend if link has already been suspended" 2018-08-06 21:52:18 -07:00
Kai Liu
6afee6e21a cnss2: Clear flag CNSS_DRIVER_UNLOADING after unregister driver finished
Flag CNSS_DRIVER_UNLOADING is set when unregister wlan started, but it's
cleared in cnss_shutdown, which is also used in other call flow. Clear this
flag after unregister finished.

Change-Id: I0b5d63e5570c2604ff66d7852d7c7ca1c008a475
Signed-off-by: Kai Liu <kaliu@codeaurora.org>
2018-08-05 22:04:53 +08:00
Frank Liu
26eff67153 cnss2: Add support for PCIe WLAN IPA uc SMMU feature
To add support for PCIe WLAN IPA uc SMMU feature, prvoide related
platform api for wlan driver to get the smmu map handle and do the
mapping.

Change-Id: I672b1a48879ada65b3ddb3f16c4bd787dc1b70a6
Signed-off-by: Frank Liu <qiliu@codeaurora.org>
2018-08-01 03:21:40 -07:00