wcnss: Add two registers to wcnss dump

When a WDI timeout or Watchdog bite happens at WCNSS, certain WCNSS
registers are logged for debug purpose.  Add alarms txctl and alarms
tactl registers to the dump

Change-Id: Id79345666dd7e5b3d43b13fff5d8230e4fd38655
CRs-fixed: 587892
Acked-by: Yuanyuan Liu <yuanliu@qca.qualcomm.com>
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
wlan: Store avoid channel list

Store avoid channel list into recoverable location.
If Softap mode detects current channel is not safe to use,
WLAN kernel module will be restarted.
Then WLAN kernel module internal storage will lost
unsafe channel information.
To avoid start softap with unsafe channel, channel information
should be stored in static location.

Change-Id: I5a6d7ab7314936d7bbaaf7a005e58179a4dc0613
CRs-fixed: 576020
Signed-off-by: Leo Chang <leochang@codeaurora.org>

Conflicts:
	drivers/net/wireless/wcnss/wcnss_wlan.c
wcnss: Add support to configure the Wlan MAC addr

This change introduces a sysfs entry to allow userspace to
configure the wlan MAC addr and exports an API which allows
WLAN and other wireless technologies to query the wlan MAC
addr

Change-Id: I751b2cf2db1321926e8e16ef1baaa4fa3d8d06cf
CRs-Fixed: 583465
Signed-off-by:  <hkpatel@codeaurora.org>

Conflicts:
	include/linux/wcnss_wlan.h
wcnss: Correct the logging sequence of certain registers

PMU_PLL_STATUS and PMU_CPU_AHB_CFG_RCGR registers should be dumped
despite common_ss being collapsed.

CRs-fixed: 615461
Change-Id: Iac7da726ad70420d29411e0c9f6bcd75c776ba50
Signed-off-by: Yue Ma <yuem@codeaurora.org>
wcnss: Retry PIL on error ready timeout

When the first PIL on wcnss fails; and when it times out on smp2p
error ready, retry PIL a couple more times. We have seen instances where
wcnss does bootup on PIL retry.

CRs-Fixed: 613487
Change-Id: I92569559cb8022c831036ec50ccf2e7475f0278c
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
wcnss: Increse the log level for WCNSS register dump

WCNSS register dump is only performed during WCNSS fatal errors such as
WDI timeout leading to SSR or WDOG bite scenarios. So these register
dumps should always be logged to provide the only information available
to debug these fatal errors.

CRs-Fixed: 586351
Change-Id: Id380327b23aa9caa43befa1953ee96c06ee83282
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
wcnss: Add MCU debug registers to the register dump list

When firmware crashes happen, add the support to log MCU registers for
debugging purpose.

CRs-fixed: 613889
Change-Id: I8f1d4f9a26912151de2594f41ac8e09648650ff2
Signed-off-by: Yue Ma <yuem@codeaurora.org>
wcnss: dump apb2phy_status register on subsystem restart

apb2phy_status register is required for debugging certain
issues due to watchdog bite on the wcn chip. Dump the
register when watchdog bite occurs on the wcn subsystem
or the subsystem is going for a restart for any other
reason.

Change-Id: I90851d023dff5c62d66a9855fff9b16d244f5190
CRs-Fixed: 631088
Signed-off-by: Mihir Shete <smihir@codeaurora.org>
wcnss: add API to check if wcnss is undergoing an SSR

Wlan driver should not read registers from wcnss or
try to communicate with the chip when it is undergoing
a subsystem-restart. Added an API with the wcnss platform
driver to check if ssr is in progress, this API will be
used by the wlan driver to protect register access and
other prohibited operations.

Change-Id: Ia0d93e774af126d84dbaabf5c36a2c90fdbd58be
CRs-Fixed: 621974
Signed-off-by: Mihir Shete <smihir@codeaurora.org>

Conflicts:
	drivers/net/wireless/wcnss/wcnss_wlan.c
wcnss: Configure WLAN MAC addr through user control interface

wcnss userspace service will use user control interface to configure
certain parameters required by wcnss driver. This interface is required
to configure the WLAN MAC address. These parameter was earlier written
thru module parameters from wcnss service, however that required the
wcnss userspace daemon to have the root permission.

Change-Id: I6e928a44c7f1f9ba7ab193c882bad102d8c2bd5a
CRs-fixed: 636953
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
wcnss: Send FIQ to firmware after smp2p error ready happens

In order to get firmware dump, send FIQ when it times out on smp2p
error ready during cold boot.

Change-Id: I5edfed83dc12b00865066f2c8028d34b9857e116
CRs-Fixed: 608693
Signed-off-by: Yue Ma <yuem@codeaurora.org>
wcnss: Unregister subsys notifier

Unregister subsys notifier for WCNSS on reaching
maximum number of retries.

Change-Id: I665398ec46b1bb3252dbbff58201c947f262bff3
CRs-Fixed: 655314
Signed-off-by: Pradeep Kumar Goudagunta <gpradeep@codeaurora.org>

Conflicts:
	drivers/net/wireless/wcnss/wcnss_wlan.c
wcnss: Reset IRIS card before Starting IRIS XO configuration

Set iris_reset bit of PMU CFG register to reset the IRIS
card before Starting IRIS XO configuration.

Change-Id: Id1cfd7e3e3df29919089725b2233c6f95afbbfb5
CRs-Fixed: 664642
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
wcnss: LDO change for WCNSS

Send LDO notification through SMD channel to FW which use
to update the pmic pam map.

Change-Id: I7a893570489e65d92df65728d09fd20e61d6b0fc
CRs-Fixed: 660361
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
wcnss: Fix AXIM select and CTRL select bit fields

When a WDI timeout happens, WLAN driver will initiate SSR. Dumping
these registers before performing the reset helps to debug the root
cause of the timeout. Fix AXIM select and CTRL select bit fields
of testbus register while doing the A2XB testbus register dump.

Change-Id: Ic9c7ddf2e4cee07b43cc8fe06afca04755856eeb
CRs-Fixed: 540586
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
wcnss: Reduce the pil_retry count value

wcnss driver doing multiple pil retry which causing boot process
block upto all pil retry finish. reduce the pil retry count so
it will not delay other boot process.

Change-Id: I646f444042ee7b64995a1117ae4cc7191ab85708
CRs-Fixed: 688990
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
wcnss: add null check in pm_ops unregister

Add null check for pm_ops in pm_ops unregister to avoid
null pointer dereference.

Change-Id: I885618a3244b91ba5eddcadb81ae08e965db63b3
CRs-Fixed: 690191
Signed-off-by: Mahesh A Saptasagar <msapta@codeaurora.org>
wcnss: Add API to get monotonic boot time

Add CNSS platform driver API to expose monotonic boot time so that
WLAN host driver can get the timestamp.

Change-Id: I722fa42600bf910254ac01a7305bbbaa35dfa83e
CRs-Fixed: 706813
Signed-off-by: Hardik Kantilal Patel <hkpatel@codeaurora.org>
wcnss: Change WCNSS_VBATT_GUARD value from 200uV to 20mV

To avoid ADC_TM interrupts at 3.5V battery threshold
Change WCNSS_VBATT_GUARD value from 200uV to 20mV.

Change-Id: I2d7a637ff4c3eb820c43fcb73d1720e94edf3c4c
CRs-Fixed: 705609
Signed-off-by: Anand N Sunkad <asunka@codeaurora.org>
wcnss: add a2xb bus stall detection logic

Detect A2XB bus stall by profiling Read, Write and Cmd
fifo registers.

Change-Id: I33b45e79c52677ef998011511a6fc3fb76eecc24
Crs-Fixed: 705962
Signed-off-by: Siddharth Bhal <sbhal@codeaurora.org>