forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/net/wireless/rsi/rsi_hal.h
....@@ -81,6 +81,21 @@
8181 #define RSI_WATCH_DOG_DELAY_TIMER_2 0x16f
8282 #define RSI_WATCH_DOG_TIMER_ENABLE 0x170
8383
84
+/* Watchdog timer addresses for 9116 */
85
+#define NWP_AHB_BASE_ADDR 0x41300000
86
+#define NWP_WWD_INTERRUPT_TIMER (NWP_AHB_BASE_ADDR + 0x300)
87
+#define NWP_WWD_SYSTEM_RESET_TIMER (NWP_AHB_BASE_ADDR + 0x304)
88
+#define NWP_WWD_WINDOW_TIMER (NWP_AHB_BASE_ADDR + 0x308)
89
+#define NWP_WWD_TIMER_SETTINGS (NWP_AHB_BASE_ADDR + 0x30C)
90
+#define NWP_WWD_MODE_AND_RSTART (NWP_AHB_BASE_ADDR + 0x310)
91
+#define NWP_WWD_RESET_BYPASS (NWP_AHB_BASE_ADDR + 0x314)
92
+#define NWP_FSM_INTR_MASK_REG (NWP_AHB_BASE_ADDR + 0x104)
93
+
94
+/* Watchdog timer values */
95
+#define NWP_WWD_INT_TIMER_CLKS 5
96
+#define NWP_WWD_SYS_RESET_TIMER_CLKS 4
97
+#define NWP_WWD_TIMER_DISABLE 0xAA0001
98
+
8499 #define RSI_ULP_WRITE_0 00
85100 #define RSI_ULP_WRITE_2 02
86101 #define RSI_ULP_WRITE_50 50
....@@ -124,9 +139,18 @@
124139 #define BBP_INFO_40MHZ 0x6
125140
126141 #define FW_FLASH_OFFSET 0x820
127
-#define LMAC_VER_OFFSET (FW_FLASH_OFFSET + 0x200)
142
+#define LMAC_VER_OFFSET_9113 (FW_FLASH_OFFSET + 0x200)
143
+#define LMAC_VER_OFFSET_9116 0x22C2
128144 #define MAX_DWORD_ALIGN_BYTES 64
129145 #define RSI_COMMON_REG_SIZE 2
146
+#define RSI_9116_REG_SIZE 4
147
+#define FW_ALIGN_SIZE 4
148
+#define RSI_9116_FW_MAGIC_WORD 0x5aa5
149
+
150
+#define MEM_ACCESS_CTRL_FROM_HOST 0x41300000
151
+#define RAM_384K_ACCESS_FROM_TA (BIT(2) | BIT(3) | BIT(4) | BIT(5) | \
152
+ BIT(20) | BIT(21) | BIT(22) | \
153
+ BIT(23) | BIT(24) | BIT(25))
130154
131155 struct bl_header {
132156 __le32 flags;
....@@ -141,6 +165,24 @@
141165 unsigned int address;
142166 };
143167
168
+#define RSI_BL_CTRL_LEN_MASK 0xFFFFFF
169
+#define RSI_BL_CTRL_SPI_32BIT_MODE BIT(27)
170
+#define RSI_BL_CTRL_REL_TA_SOFTRESET BIT(28)
171
+#define RSI_BL_CTRL_START_FROM_ROM_PC BIT(29)
172
+#define RSI_BL_CTRL_SPI_8BIT_MODE BIT(30)
173
+#define RSI_BL_CTRL_LAST_ENTRY BIT(31)
174
+struct bootload_entry {
175
+ __le32 control;
176
+ __le32 dst_addr;
177
+} __packed;
178
+
179
+struct bootload_ds {
180
+ __le16 fixed_pattern;
181
+ __le16 offset;
182
+ __le32 reserved;
183
+ struct bootload_entry bl_entry[7];
184
+} __packed;
185
+
144186 struct rsi_mgmt_desc {
145187 __le16 len_qno;
146188 u8 frame_type;