hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
....@@ -8,7 +8,7 @@
88 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
99 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
1010 * Copyright(c) 2016 Intel Deutschland GmbH
11
- * Copyright(c) 2018 Intel Corporation
11
+ * Copyright(c) 2018 - 2019 Intel Corporation
1212 *
1313 * This program is free software; you can redistribute it and/or modify
1414 * it under the terms of version 2 of the GNU General Public License as
....@@ -18,11 +18,6 @@
1818 * WITHOUT ANY WARRANTY; without even the implied warranty of
1919 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2020 * General Public License for more details.
21
- *
22
- * You should have received a copy of the GNU General Public License
23
- * along with this program; if not, write to the Free Software
24
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
25
- * USA
2621 *
2722 * The full GNU General Public License is included in this distribution
2823 * in the file called COPYING.
....@@ -35,7 +30,7 @@
3530 *
3631 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
3732 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
38
- * Copyright(c) 2018 Intel Corporation
33
+ * Copyright(c) 2018 - 2019 Intel Corporation
3934 * All rights reserved.
4035 *
4136 * Redistribution and use in source and binary forms, with or without
....@@ -152,6 +147,16 @@
152147 #define CSR_MAC_SHADOW_REG_CTL2 (CSR_BASE + 0x0AC)
153148 #define CSR_MAC_SHADOW_REG_CTL2_RX_WAKE 0xFFFF
154149
150
+/* LTR control (since IWL_DEVICE_FAMILY_22000) */
151
+#define CSR_LTR_LONG_VAL_AD (CSR_BASE + 0x0D4)
152
+#define CSR_LTR_LONG_VAL_AD_NO_SNOOP_REQ 0x80000000
153
+#define CSR_LTR_LONG_VAL_AD_NO_SNOOP_SCALE 0x1c000000
154
+#define CSR_LTR_LONG_VAL_AD_NO_SNOOP_VAL 0x03ff0000
155
+#define CSR_LTR_LONG_VAL_AD_SNOOP_REQ 0x00008000
156
+#define CSR_LTR_LONG_VAL_AD_SNOOP_SCALE 0x00001c00
157
+#define CSR_LTR_LONG_VAL_AD_SNOOP_VAL 0x000003ff
158
+#define CSR_LTR_LONG_VAL_AD_SCALE_USEC 2
159
+
155160 /* GIO Chicken Bits (PCI Express bus link power management) */
156161 #define CSR_GIO_CHICKEN_BITS (CSR_BASE+0x100)
157162
....@@ -185,9 +190,11 @@
185190 /* Bits for CSR_HW_IF_CONFIG_REG */
186191 #define CSR_HW_IF_CONFIG_REG_MSK_MAC_DASH (0x00000003)
187192 #define CSR_HW_IF_CONFIG_REG_MSK_MAC_STEP (0x0000000C)
193
+#define CSR_HW_IF_CONFIG_REG_BIT_MONITOR_SRAM (0x00000080)
188194 #define CSR_HW_IF_CONFIG_REG_MSK_BOARD_VER (0x000000C0)
189195 #define CSR_HW_IF_CONFIG_REG_BIT_MAC_SI (0x00000100)
190196 #define CSR_HW_IF_CONFIG_REG_BIT_RADIO_SI (0x00000200)
197
+#define CSR_HW_IF_CONFIG_REG_D3_DEBUG (0x00000200)
191198 #define CSR_HW_IF_CONFIG_REG_MSK_PHY_TYPE (0x00000C00)
192199 #define CSR_HW_IF_CONFIG_REG_MSK_PHY_DASH (0x00003000)
193200 #define CSR_HW_IF_CONFIG_REG_MSK_PHY_STEP (0x0000C000)
....@@ -259,6 +266,7 @@
259266 /* RESET */
260267 #define CSR_RESET_REG_FLAG_NEVO_RESET (0x00000001)
261268 #define CSR_RESET_REG_FLAG_FORCE_NMI (0x00000002)
269
+#define CSR_RESET_REG_FLAG_SW_RESET (0x00000080)
262270 #define CSR_RESET_REG_FLAG_MASTER_DISABLED (0x00000100)
263271 #define CSR_RESET_REG_FLAG_STOP_MASTER (0x00000200)
264272 #define CSR_RESET_LINK_PWR_MGMT_DISABLED (0x80000000)
....@@ -281,9 +289,34 @@
281289 * 4: GOING_TO_SLEEP
282290 * Indicates MAC is entering a power-saving sleep power-down.
283291 * Not a good time to access device-internal resources.
292
+ * 3: MAC_ACCESS_REQ
293
+ * Host sets this to request and maintain MAC wakeup, to allow host
294
+ * access to device-internal resources. Host must wait for
295
+ * MAC_CLOCK_READY (and !GOING_TO_SLEEP) before accessing non-CSR
296
+ * device registers.
297
+ * 2: INIT_DONE
298
+ * Host sets this to put device into fully operational D0 power mode.
299
+ * Host resets this after SW_RESET to put device into low power mode.
300
+ * 0: MAC_CLOCK_READY
301
+ * Indicates MAC (ucode processor, etc.) is powered up and can run.
302
+ * Internal resources are accessible.
303
+ * NOTE: This does not indicate that the processor is actually running.
304
+ * NOTE: This does not indicate that device has completed
305
+ * init or post-power-down restore of internal SRAM memory.
306
+ * Use CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP as indication that
307
+ * SRAM is restored and uCode is in normal operation mode.
308
+ * Later devices (5xxx/6xxx/1xxx) use non-volatile SRAM, and
309
+ * do not need to save/restore it.
310
+ * NOTE: After device reset, this bit remains "0" until host sets
311
+ * INIT_DONE
284312 */
285
-#define CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP (0x00000010)
313
+#define CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY (0x00000001)
314
+#define CSR_GP_CNTRL_REG_FLAG_INIT_DONE (0x00000004)
315
+#define CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ (0x00000008)
316
+#define CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP (0x00000010)
286317 #define CSR_GP_CNTRL_REG_FLAG_XTAL_ON (0x00000400)
318
+
319
+#define CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN (0x00000001)
287320
288321 #define CSR_GP_CNTRL_REG_MSK_POWER_SAVE_TYPE (0x07000000)
289322 #define CSR_GP_CNTRL_REG_FLAG_RFKILL_WAKE_L1A_EN (0x04000000)
....@@ -293,6 +326,7 @@
293326 /* HW REV */
294327 #define CSR_HW_REV_DASH(_val) (((_val) & 0x0000003) >> 0)
295328 #define CSR_HW_REV_STEP(_val) (((_val) & 0x000000C) >> 2)
329
+#define CSR_HW_REV_TYPE(_val) (((_val) & 0x000FFF0) >> 4)
296330
297331 /* HW RFID */
298332 #define CSR_HW_RFID_FLAVOR(_val) (((_val) & 0x000000F) >> 0)
....@@ -329,12 +363,21 @@
329363 #define CSR_HW_REV_TYPE_7265D (0x0000210)
330364 #define CSR_HW_REV_TYPE_NONE (0x00001F0)
331365 #define CSR_HW_REV_TYPE_QNJ (0x0000360)
366
+#define CSR_HW_REV_TYPE_QNJ_B0 (0x0000364)
367
+#define CSR_HW_REV_TYPE_QU_B0 (0x0000334)
368
+#define CSR_HW_REV_TYPE_QU_C0 (0x0000338)
369
+#define CSR_HW_REV_TYPE_QUZ (0x0000354)
332370 #define CSR_HW_REV_TYPE_HR_CDB (0x0000340)
371
+#define CSR_HW_REV_TYPE_SO (0x0000370)
372
+#define CSR_HW_REV_TYPE_TY (0x0000420)
333373
334374 /* RF_ID value */
335375 #define CSR_HW_RF_ID_TYPE_JF (0x00105100)
336376 #define CSR_HW_RF_ID_TYPE_HR (0x0010A000)
377
+#define CSR_HW_RF_ID_TYPE_HR1 (0x0010c100)
337378 #define CSR_HW_RF_ID_TYPE_HRCDB (0x00109F00)
379
+#define CSR_HW_RF_ID_TYPE_GF (0x0010D000)
380
+#define CSR_HW_RF_ID_TYPE_GF4 (0x0010E000)
338381
339382 /* HW_RF CHIP ID */
340383 #define CSR_HW_RF_ID_TYPE_CHIP_ID(_val) (((_val) >> 12) & 0xFFF)
....@@ -371,7 +414,7 @@
371414
372415
373416 /* CSR GIO */
374
-#define CSR_GIO_REG_VAL_L0S_ENABLED (0x00000002)
417
+#define CSR_GIO_REG_VAL_L0S_DISABLED (0x00000002)
375418
376419 /*
377420 * UCODE-DRIVER GP (general purpose) mailbox register 1
....@@ -595,8 +638,7 @@
595638 enum msix_hw_int_causes {
596639 MSIX_HW_INT_CAUSES_REG_ALIVE = BIT(0),
597640 MSIX_HW_INT_CAUSES_REG_WAKEUP = BIT(1),
598
- MSIX_HW_INT_CAUSES_REG_IPC = BIT(1),
599
- MSIX_HW_INT_CAUSES_REG_SW_ERR_V2 = BIT(5),
641
+ MSIX_HW_INT_CAUSES_REG_IML = BIT(2),
600642 MSIX_HW_INT_CAUSES_REG_CT_KILL = BIT(6),
601643 MSIX_HW_INT_CAUSES_REG_RF_KILL = BIT(7),
602644 MSIX_HW_INT_CAUSES_REG_PERIODIC = BIT(8),