old mode 100644new mode 100755.. | .. |
---|
190 | 190 | DBG_MEM_MASK_WRITE_REQ, |
---|
191 | 191 | /// Memory mask write confirm |
---|
192 | 192 | DBG_MEM_MASK_WRITE_CFM, |
---|
| 193 | + |
---|
| 194 | + DBG_RFTEST_CMD_REQ, |
---|
| 195 | + DBG_RFTEST_CMD_CFM, |
---|
| 196 | + DBG_BINDING_REQ, |
---|
| 197 | + DBG_BINDING_CFM, |
---|
| 198 | + DBG_BINDING_IND, |
---|
| 199 | + |
---|
193 | 200 | /// Max number of Debug messages |
---|
194 | 201 | DBG_MAX, |
---|
195 | 202 | }; |
---|
.. | .. |
---|
257 | 264 | u32 bootstatus; |
---|
258 | 265 | }; |
---|
259 | 266 | |
---|
| 267 | +struct dbg_binding_ind { |
---|
| 268 | + u8 enc_data[16]; |
---|
| 269 | +}; |
---|
| 270 | + |
---|
| 271 | +struct dbg_binding_req { |
---|
| 272 | + u8 driver_data[16]; |
---|
| 273 | +}; |
---|
| 274 | + |
---|
260 | 275 | int rwnx_send_dbg_mem_read_req(struct aic_sdio_dev *sdiodev, u32 mem_addr, |
---|
261 | 276 | struct dbg_mem_read_cfm *cfm); |
---|
262 | 277 | int rwnx_send_dbg_mem_block_write_req(struct aic_sdio_dev *sdiodev, u32 mem_addr, |
---|
.. | .. |
---|
264 | 279 | int rwnx_send_dbg_mem_write_req(struct aic_sdio_dev *sdiodev, u32 mem_addr, u32 mem_data); |
---|
265 | 280 | int rwnx_send_dbg_mem_mask_write_req(struct aic_sdio_dev *sdiodev, u32 mem_addr, |
---|
266 | 281 | u32 mem_mask, u32 mem_data); |
---|
267 | | -int rwnx_send_dbg_start_app_req(struct aic_sdio_dev *sdiodev, u32 boot_addr, u32 boot_type); |
---|
| 282 | +int rwnx_send_dbg_start_app_req(struct aic_sdio_dev *sdiodev, u32 boot_addr, u32 boot_type, struct dbg_start_app_cfm *start_app_cfm); |
---|
268 | 283 | |
---|
| 284 | +int rwnx_send_dbg_binding_req(struct aic_sdio_dev *sdiodev, u8 *dout, u8 *binding_status); |
---|
269 | 285 | void rwnx_rx_handle_msg(struct aic_sdio_dev *sdiodev, struct ipc_e2a_msg *msg); |
---|
270 | 286 | |
---|
271 | 287 | int aicbsp_platform_init(struct aic_sdio_dev *sdiodev); |
---|
272 | 288 | void aicbsp_platform_deinit(struct aic_sdio_dev *sdiodev); |
---|
273 | | -void aicbsp_driver_fw_init(struct aic_sdio_dev *sdiodev); |
---|
| 289 | +int aicbsp_driver_fw_init(struct aic_sdio_dev *sdiodev); |
---|
| 290 | +int aicbsp_resv_mem_init(void); |
---|
| 291 | +int aicbsp_resv_mem_deinit(void); |
---|
274 | 292 | |
---|
275 | | -#define AICBSP_FW_PATH "/vendor/etc/firmware" |
---|
276 | | -#define AICBSP_FW_PATH_MAX 200 |
---|
277 | | - |
---|
278 | | -#define RAM_FW_ADDR 0x00100000 |
---|
279 | | -#define RAM_FMAC_FW_ADDR 0x00110000 |
---|
| 293 | +#define RAM_FMAC_FW_ADDR 0x00120000 |
---|
280 | 294 | #define FW_RAM_ADID_BASE_ADDR 0x00161928 |
---|
281 | | -#define FW_RAM_PATCH_BASE_ADDR 0x0016ad64 |
---|
282 | | -#define FW_PATCH_TEST_BASE_ADDR 0x00100000 |
---|
283 | | -#define FW_WIFI_RAM_ADDR 0x00110000 |
---|
| 295 | +#define FW_RAM_ADID_BASE_ADDR_U03 0x00161928 |
---|
| 296 | +#define FW_RAM_PATCH_BASE_ADDR 0x00100000 |
---|
284 | 297 | |
---|
285 | 298 | #define AICBT_PT_TAG "AICBT_PT_TAG" |
---|
286 | 299 | |
---|
.. | .. |
---|
290 | 303 | AICBT_PT_BTMODE, |
---|
291 | 304 | AICBT_PT_PWRON, |
---|
292 | 305 | AICBT_PT_AF, |
---|
| 306 | + AICBT_PT_VER, |
---|
293 | 307 | }; |
---|
294 | 308 | |
---|
295 | | -enum aicbsp_mode_num { |
---|
296 | | - AICBSP_MODE_BT_ONLY_SW = 0x0, // bt only mode with switch |
---|
297 | | - AICBSP_MODE_BT_WIFI_COMBO, // wifi/bt combo mode |
---|
298 | | - AICBSP_MODE_BT_ONLY, // bt only mode without switch |
---|
299 | | - AICBSP_MODE_BT_ONLY_TEST, // bt only test mode |
---|
300 | | - AICBSP_MODE_COMBO_TEST, // wifi/bt combo test mode |
---|
| 309 | +enum aicbt_btport_type { |
---|
| 310 | + AICBT_BTPORT_NULL, |
---|
| 311 | + AICBT_BTPORT_MB, |
---|
| 312 | + AICBT_BTPORT_UART, |
---|
301 | 313 | }; |
---|
302 | 314 | |
---|
303 | | -#define AICBSP_MODE_DEFAULT AICBSP_MODE_BT_WIFI_COMBO |
---|
| 315 | +/* btmode |
---|
| 316 | + * used for force bt mode,if not AICBSP_MODE_NULL |
---|
| 317 | + * efuse valid and vendor_info will be invalid, even has beed set valid |
---|
| 318 | +*/ |
---|
| 319 | +enum aicbt_btmode_type { |
---|
| 320 | + AICBT_BTMODE_BT_ONLY_SW = 0x0, // bt only mode with switch |
---|
| 321 | + AICBT_BTMODE_BT_WIFI_COMBO, // wifi/bt combo mode |
---|
| 322 | + AICBT_BTMODE_BT_ONLY, // bt only mode without switch |
---|
| 323 | + AICBT_BTMODE_BT_ONLY_TEST, // bt only test mode |
---|
| 324 | + AICBT_BTMODE_BT_WIFI_COMBO_TEST, // wifi/bt combo test mode |
---|
| 325 | + AICBT_MODE_NULL = 0xFF, // invalid value |
---|
| 326 | +}; |
---|
304 | 327 | |
---|
305 | | -#define FEATURE_5G_SUPPORT 0x01 |
---|
| 328 | +/* uart_baud |
---|
| 329 | + * used for config uart baud when btport set to uart, |
---|
| 330 | + * otherwise meaningless |
---|
| 331 | +*/ |
---|
| 332 | +enum aicbt_uart_baud_type { |
---|
| 333 | + AICBT_UART_BAUD_115200 = 115200, |
---|
| 334 | + AICBT_UART_BAUD_921600 = 921600, |
---|
| 335 | + AICBT_UART_BAUD_1_5M = 1500000, |
---|
| 336 | + AICBT_UART_BAUD_3_25M = 3250000, |
---|
| 337 | +}; |
---|
| 338 | + |
---|
| 339 | +enum aicbt_uart_flowctrl_type { |
---|
| 340 | + AICBT_UART_FLOWCTRL_DISABLE = 0x0, // uart without flow ctrl |
---|
| 341 | + AICBT_UART_FLOWCTRL_ENABLE, // uart with flow ctrl |
---|
| 342 | +}; |
---|
| 343 | + |
---|
| 344 | +enum aicbsp_cpmode_type { |
---|
| 345 | + AICBSP_CPMODE_WORK, |
---|
| 346 | + AICBSP_CPMODE_TEST, |
---|
| 347 | + AICBSP_CPMODE_MAX, |
---|
| 348 | +}; |
---|
| 349 | + |
---|
| 350 | +enum chip_rev { |
---|
| 351 | + CHIP_REV_U02 = 3, |
---|
| 352 | + CHIP_REV_U03 = 7, |
---|
| 353 | + CHIP_REV_U04 = 7, |
---|
| 354 | +}; |
---|
| 355 | + |
---|
| 356 | +///aic bt tx pwr lvl :lsb->msb: first byte, min pwr lvl; second byte, max pwr lvl; |
---|
| 357 | +///pwr lvl:20(min), 30 , 40 , 50 , 60(max) |
---|
| 358 | +#define AICBT_TXPWR_LVL 0x00006020 |
---|
| 359 | + |
---|
| 360 | +#define AICBSP_HWINFO_DEFAULT (-1) |
---|
| 361 | +#define AICBSP_CPMODE_DEFAULT AICBSP_CPMODE_WORK |
---|
| 362 | + |
---|
| 363 | +#define AICBT_BTMODE_DEFAULT AICBT_MODE_NULL |
---|
| 364 | +#define AICBT_BTPORT_DEFAULT AICBT_BTPORT_UART |
---|
| 365 | +#define AICBT_UART_BAUD_DEFAULT AICBT_UART_BAUD_1_5M |
---|
| 366 | +#define AICBT_UART_FC_DEFAULT AICBT_UART_FLOWCTRL_ENABLE |
---|
| 367 | +#define AICBT_LPM_ENABLE_DEFAULT 1 |
---|
| 368 | +#define AICBT_TXPWR_LVL_DEFAULT AICBT_TXPWR_LVL |
---|
| 369 | + |
---|
306 | 370 | #define FEATURE_SDIO_CLOCK 70000000 // 0: default, other: target clock rate |
---|
307 | 371 | #define FEATURE_SDIO_PHASE 2 // 0: default, 2: 180° |
---|
308 | 372 | |
---|
.. | .. |
---|
314 | 378 | struct aicbt_patch_table *next; |
---|
315 | 379 | }; |
---|
316 | 380 | |
---|
| 381 | +struct aicbt_info_t { |
---|
| 382 | + uint32_t btmode; |
---|
| 383 | + uint32_t btport; |
---|
| 384 | + uint32_t uart_baud; |
---|
| 385 | + uint32_t uart_flowctrl; |
---|
| 386 | + uint32_t lpm_enable; |
---|
| 387 | + uint32_t txpwr_lvl; |
---|
| 388 | +}; |
---|
| 389 | + |
---|
317 | 390 | struct aicbsp_firmware { |
---|
318 | 391 | const char *desc; |
---|
319 | 392 | const char *bt_adid; |
---|
320 | 393 | const char *bt_patch; |
---|
321 | 394 | const char *bt_table; |
---|
322 | | - const char *bt_patch_test; |
---|
323 | 395 | const char *wl_fw; |
---|
324 | 396 | }; |
---|
325 | 397 | |
---|
326 | | -extern uint32_t aicbsp_mode_index; |
---|
| 398 | +struct aicbsp_info_t { |
---|
| 399 | + int hwinfo; |
---|
| 400 | + int hwinfo_r; |
---|
| 401 | + uint32_t cpmode; |
---|
| 402 | + uint32_t chip_rev; |
---|
| 403 | + bool fwlog_en; |
---|
| 404 | +}; |
---|
| 405 | + |
---|
| 406 | +extern struct aicbsp_info_t aicbsp_info; |
---|
327 | 407 | extern struct mutex aicbsp_power_lock; |
---|
328 | | -extern const struct aicbsp_firmware aicbsp_firmware_list[]; |
---|
| 408 | +extern const struct aicbsp_firmware *aicbsp_firmware_list; |
---|
| 409 | +extern const struct aicbsp_firmware fw_u02[]; |
---|
| 410 | +extern const struct aicbsp_firmware fw_u03[]; |
---|
329 | 411 | |
---|
330 | 412 | #endif |
---|