Merge "wil6210: store FW RF calibration result"

This commit is contained in:
Linux Build Service Account 2017-09-03 04:06:41 -07:00 committed by Gerrit - the friendly Code Review server
commit 4a8c1aa57f
4 changed files with 19 additions and 0 deletions

View file

@ -1039,6 +1039,12 @@ int wil_reset(struct wil6210_priv *wil, bool load_fw)
wil_s(wil, RGF_CAF_ICR + offsetof(struct RGF_ICR, ICR), 0);
wil_w(wil, RGF_CAF_ICR + offsetof(struct RGF_ICR, IMV), ~0);
if (wil->fw_calib_result > 0) {
__le32 val = cpu_to_le32(wil->fw_calib_result |
(CALIB_RESULT_SIGNATURE << 8));
wil_w(wil, RGF_USER_FW_CALIB_RESULT, (u32 __force)val);
}
wil_release_cpu(wil);
}

View file

@ -175,6 +175,10 @@ struct RGF_ICR {
#define RGF_USER_USER_SCRATCH_PAD (0x8802bc)
#define RGF_USER_BL (0x880A3C) /* Boot Loader */
#define RGF_USER_FW_REV_ID (0x880a8c) /* chip revision */
#define RGF_USER_FW_CALIB_RESULT (0x880a90) /* b0-7:result
* b8-15:signature
*/
#define CALIB_RESULT_SIGNATURE (0x11)
#define RGF_USER_CLKS_CTL_0 (0x880abc)
#define BIT_USER_CLKS_CAR_AHB_SW_SEL BIT(1) /* ref clk/PLL */
#define BIT_USER_CLKS_RST_PWGD BIT(11) /* reset on "power good" */
@ -736,6 +740,8 @@ struct wil6210_priv {
bool tt_data_set;
struct wmi_tt_data tt_data;
int fw_calib_result;
#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
struct notifier_block pm_notify;

View file

@ -345,6 +345,11 @@ static void wmi_evt_ready(struct wil6210_priv *wil, int id, void *d, int len)
strlcpy(wdev->wiphy->fw_version, wil->fw_version,
sizeof(wdev->wiphy->fw_version));
if (len > offsetof(struct wmi_ready_event, rfc_read_calib_result)) {
wil_dbg_wmi(wil, "rfc calibration result %d\n",
evt->rfc_read_calib_result);
wil->fw_calib_result = evt->rfc_read_calib_result;
}
wil_set_recovery_state(wil, fw_recovery_idle);
set_bit(wil_status_fwready, wil->status);
/* let the reset sequence continue */

View file

@ -1300,6 +1300,8 @@ struct wmi_ready_event {
/* enum wmi_phy_capability */
u8 phy_capability;
u8 numof_additional_mids;
u8 rfc_read_calib_result;
u8 reserved[3];
} __packed;
/* WMI_NOTIFY_REQ_DONE_EVENTID */