dt: bindings: add ath10k wireless device

Document how calibration data can be provided to ath10k via Device Tree.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: read calibration data from Device Tree

This patch adds support for reading calibration data from Device Tree.
It looks for the calibration data in Device Tree if it can't find it
in a file. If there's no node in Device Tree, ath10k will try to find the
calibration data from OTP.

The node for the calibration data should be defined like this:

pci {
        pcie@0 {
                reg = <0 0 0 0 0>;
                #interrupt-cells = <1>;
                #size-cells = <2>;
                #address-cells = <3>;
                device_type = "pci";

                ath10k@0,0 {
                        reg = <0 0 0 0 0>;
                        device_type = "pci";
                        qcom,ath10k-calibration-data = [ 01 02 03 ... ];
                };
        };
};

Signed-off-by: Toshi Kikuchi <toshik@chromium.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: create a chip revision whitelist

This will make it easier to extend and maintain
list of supported hardware.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: put board size into hw_params

This makes it easier to extend the list of
supported hardware.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: move uart pin config into hw_params

This will make it possible to easily support
different hardware with different uart pin
configuration.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: clean up error handling in ath10k_core_probe_fw()

Use the error handling style preferred in ath10k. Makes it easier to add
ath10k_init_firmware_features() function in the next patch.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: create ath10k_core_init_features()

It's easier to manage firmware version differences when we configure them in
one place. Rename ath10k_core_init_max_sta_count() to
ath10k_core_init_firmware_features() and start moving most of the firmware
version ("features") handling to that function.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: add ATH10K_FW_IE_WMI_OP_VERSION

Instead of using feature flags, add new 32 bit variable for managing different
WMI versions. This makes it firmware interface tests a bit less convoluted,
especially when we add one more interface.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: set max_num_pending_tx in ath10k_core_init_firmware_features()

Better to have this in same place as other firmware interface handling.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: implement intermediate event args

This splits the actual event parsing into
intermediary structures to facilitate future
support of vastly different ABI WMI backends.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: introduce wmi ops

Since the 10.x fw branch support was introduced it
became apparent ath10k will need to be able to
deal with different fw ABIs eventually.

The patch creates an abstraction for dealing with
command and event structures across different ABIs
and mostly gets rid of the
ATH10K_FW_FEATURE_WMI_10X flag usage.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: make some wmi functions public

Some functions can be shared across different WMI
ABIs. Make them public so different WMI backends
can use them from different source files in the
future.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: implement wmi-tlv backend

Latest main firmware branch introduced a new WMI
ABI called wmi-tlv. It is not a tlv strictly
speaking but something that resembles it because
it is ordered and may have duplicate id entries.

This prepares ath10k to support new hw.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: add new pdev parameters for fw 10.2

New pdev paramters have been added to firmware 10.2,
hence update wmi interfaces to sync with.

Signed-off-by: Peter Oh <poh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: add new wmi interface of NF cal period

Introduce a new wmi interface controls noise floor (NF) calibration
period via debugfs as firmware has introduced it on v10.2.

It allows users to modify frequency of NF calibration in millisecond
and changes RSSI reporting frequency consequently.
Short calibration period will trigger more frequent NF calibration,
so that RSSI reported in receive frames is more realistic.

Till now calibration was done at 30 seconds.

Signed-off-by: Peter Oh <poh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: unregister and remove frag_threshold callback

Setting fragmentation threshold has not been supported by
any of firmware versions, hence unregister the callback and
remove the function.

Signed-off-by: Peter Oh <poh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>