Lines Matching refs:rtwdev
11 void rtw_set_channel_mac(struct rtw_dev *rtwdev, u8 channel, u8 bw, in rtw_set_channel_mac() argument
23 rtw_write8(rtwdev, REG_DATA_SC, in rtw_set_channel_mac()
26 value32 = rtw_read32(rtwdev, REG_WMAC_TRXPTCL_CTL); in rtw_set_channel_mac()
39 rtw_write32(rtwdev, REG_WMAC_TRXPTCL_CTL, value32); in rtw_set_channel_mac()
41 value32 = rtw_read32(rtwdev, REG_AFE_CTRL1) & ~(BIT_MAC_CLK_SEL); in rtw_set_channel_mac()
43 rtw_write32(rtwdev, REG_AFE_CTRL1, value32); in rtw_set_channel_mac()
45 rtw_write8(rtwdev, REG_USTIME_TSF, MAC_CLK_SPEED); in rtw_set_channel_mac()
46 rtw_write8(rtwdev, REG_USTIME_EDCA, MAC_CLK_SPEED); in rtw_set_channel_mac()
48 value8 = rtw_read8(rtwdev, REG_CCK_CHECK); in rtw_set_channel_mac()
52 rtw_write8(rtwdev, REG_CCK_CHECK, value8); in rtw_set_channel_mac()
55 static int rtw_mac_pre_system_cfg(struct rtw_dev *rtwdev) in rtw_mac_pre_system_cfg() argument
60 rtw_write8(rtwdev, REG_RSV_CTRL, 0); in rtw_mac_pre_system_cfg()
62 switch (rtw_hci_type(rtwdev)) { in rtw_mac_pre_system_cfg()
64 rtw_write32_set(rtwdev, REG_HCI_OPT_CTRL, BIT_BT_DIG_CLK_EN); in rtw_mac_pre_system_cfg()
73 value32 = rtw_read32(rtwdev, REG_PAD_CTRL1); in rtw_mac_pre_system_cfg()
75 rtw_write32(rtwdev, REG_PAD_CTRL1, value32); in rtw_mac_pre_system_cfg()
77 value32 = rtw_read32(rtwdev, REG_LED_CFG); in rtw_mac_pre_system_cfg()
79 rtw_write32(rtwdev, REG_LED_CFG, value32); in rtw_mac_pre_system_cfg()
81 value32 = rtw_read32(rtwdev, REG_GPIO_MUXCFG); in rtw_mac_pre_system_cfg()
83 rtw_write32(rtwdev, REG_GPIO_MUXCFG, value32); in rtw_mac_pre_system_cfg()
86 value8 = rtw_read8(rtwdev, REG_SYS_FUNC_EN); in rtw_mac_pre_system_cfg()
88 rtw_write8(rtwdev, REG_SYS_FUNC_EN, value8); in rtw_mac_pre_system_cfg()
90 value8 = rtw_read8(rtwdev, REG_RF_CTRL); in rtw_mac_pre_system_cfg()
92 rtw_write8(rtwdev, REG_RF_CTRL, value8); in rtw_mac_pre_system_cfg()
94 value32 = rtw_read32(rtwdev, REG_WLRF1); in rtw_mac_pre_system_cfg()
96 rtw_write32(rtwdev, REG_WLRF1, value32); in rtw_mac_pre_system_cfg()
101 static int rtw_pwr_cmd_polling(struct rtw_dev *rtwdev, in rtw_pwr_cmd_polling() argument
116 value = rtw_read8(rtwdev, offset); in rtw_pwr_cmd_polling()
121 if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE && in rtw_pwr_cmd_polling()
123 value = rtw_read8(rtwdev, REG_SYS_PW_CTRL); in rtw_pwr_cmd_polling()
125 rtw_write8(rtwdev, REG_SYS_PW_CTRL, value); in rtw_pwr_cmd_polling()
127 rtw_write8(rtwdev, REG_SYS_PW_CTRL, value); in rtw_pwr_cmd_polling()
139 static int rtw_sub_pwr_seq_parser(struct rtw_dev *rtwdev, u8 intf_mask, in rtw_sub_pwr_seq_parser() argument
158 value = rtw_read8(rtwdev, offset); in rtw_sub_pwr_seq_parser()
161 rtw_write8(rtwdev, offset, value); in rtw_sub_pwr_seq_parser()
164 if (rtw_pwr_cmd_polling(rtwdev, cur_cmd)) in rtw_sub_pwr_seq_parser()
183 static int rtw_pwr_seq_parser(struct rtw_dev *rtwdev, in rtw_pwr_seq_parser() argument
193 cut = rtwdev->hal.cut_version; in rtw_pwr_seq_parser()
195 switch (rtw_hci_type(rtwdev)) { in rtw_pwr_seq_parser()
211 ret = rtw_sub_pwr_seq_parser(rtwdev, intf_mask, cut_mask, cmd); in rtw_pwr_seq_parser()
221 static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on) in rtw_mac_power_switch() argument
223 struct rtw_chip_info *chip = rtwdev->chip; in rtw_mac_power_switch()
228 rpwm = rtw_read8(rtwdev, rtwdev->hci.rpwm_addr); in rtw_mac_power_switch()
231 if (rtw_read16(rtwdev, REG_MCUFW_CTRL) == 0xC078) { in rtw_mac_power_switch()
233 rtw_write8(rtwdev, rtwdev->hci.rpwm_addr, rpwm); in rtw_mac_power_switch()
236 if (rtw_read8(rtwdev, REG_CR) == 0xea) in rtw_mac_power_switch()
238 else if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_USB && in rtw_mac_power_switch()
239 (rtw_read8(rtwdev, REG_SYS_STATUS1 + 1) & BIT(0))) in rtw_mac_power_switch()
248 if (rtw_pwr_seq_parser(rtwdev, pwr_seq)) in rtw_mac_power_switch()
254 static int rtw_mac_init_system_cfg(struct rtw_dev *rtwdev) in rtw_mac_init_system_cfg() argument
256 u8 sys_func_en = rtwdev->chip->sys_func_en; in rtw_mac_init_system_cfg()
260 value = rtw_read32(rtwdev, REG_CPU_DMEM_CON); in rtw_mac_init_system_cfg()
262 rtw_write32(rtwdev, REG_CPU_DMEM_CON, value); in rtw_mac_init_system_cfg()
264 rtw_write8(rtwdev, REG_SYS_FUNC_EN + 1, sys_func_en); in rtw_mac_init_system_cfg()
265 value8 = (rtw_read8(rtwdev, REG_CR_EXT + 3) & 0xF0) | 0x0C; in rtw_mac_init_system_cfg()
266 rtw_write8(rtwdev, REG_CR_EXT + 3, value8); in rtw_mac_init_system_cfg()
269 tmp = rtw_read32(rtwdev, REG_MCUFW_CTRL); in rtw_mac_init_system_cfg()
271 rtw_write32(rtwdev, REG_MCUFW_CTRL, tmp & (~BIT_BOOT_FSPI_EN)); in rtw_mac_init_system_cfg()
272 value = rtw_read32(rtwdev, REG_GPIO_MUXCFG) & (~BIT_FSPI_EN); in rtw_mac_init_system_cfg()
273 rtw_write32(rtwdev, REG_GPIO_MUXCFG, value); in rtw_mac_init_system_cfg()
279 int rtw_mac_power_on(struct rtw_dev *rtwdev) in rtw_mac_power_on() argument
283 ret = rtw_mac_pre_system_cfg(rtwdev); in rtw_mac_power_on()
287 ret = rtw_mac_power_switch(rtwdev, true); in rtw_mac_power_on()
289 rtw_mac_power_switch(rtwdev, false); in rtw_mac_power_on()
290 ret = rtw_mac_power_switch(rtwdev, true); in rtw_mac_power_on()
297 ret = rtw_mac_init_system_cfg(rtwdev); in rtw_mac_power_on()
304 rtw_err(rtwdev, "mac power on failed"); in rtw_mac_power_on()
308 void rtw_mac_power_off(struct rtw_dev *rtwdev) in rtw_mac_power_off() argument
310 rtw_mac_power_switch(rtwdev, false); in rtw_mac_power_off()
335 static void wlan_cpu_enable(struct rtw_dev *rtwdev, bool enable) in wlan_cpu_enable() argument
339 rtw_write8_set(rtwdev, REG_RSV_CTRL + 1, BIT_WLMCU_IOIF); in wlan_cpu_enable()
342 rtw_write8_set(rtwdev, REG_SYS_FUNC_EN + 1, BIT_FEN_CPUEN); in wlan_cpu_enable()
345 rtw_write8_clr(rtwdev, REG_SYS_FUNC_EN + 1, BIT_FEN_CPUEN); in wlan_cpu_enable()
348 rtw_write8_clr(rtwdev, REG_RSV_CTRL + 1, BIT_WLMCU_IOIF); in wlan_cpu_enable()
354 static void download_firmware_reg_backup(struct rtw_dev *rtwdev, in download_firmware_reg_backup() argument
363 bckp[bckp_idx].val = rtw_read8(rtwdev, REG_TXDMA_PQ_MAP + 1); in download_firmware_reg_backup()
366 rtw_write8(rtwdev, REG_TXDMA_PQ_MAP + 1, tmp); in download_firmware_reg_backup()
371 bckp[bckp_idx].val = rtw_read8(rtwdev, REG_CR); in download_firmware_reg_backup()
378 rtw_write8(rtwdev, REG_CR, tmp); in download_firmware_reg_backup()
379 rtw_write32(rtwdev, REG_H2CQ_CSR, BIT_H2CQ_FULL); in download_firmware_reg_backup()
384 bckp[bckp_idx].val = rtw_read16(rtwdev, REG_FIFOPAGE_INFO_1); in download_firmware_reg_backup()
388 bckp[bckp_idx].val = rtw_read32(rtwdev, REG_RQPN_CTRL_2) | BIT_LD_RQPN; in download_firmware_reg_backup()
390 rtw_write16(rtwdev, REG_FIFOPAGE_INFO_1, 0x200); in download_firmware_reg_backup()
391 rtw_write32(rtwdev, REG_RQPN_CTRL_2, bckp[bckp_idx - 1].val); in download_firmware_reg_backup()
394 tmp = rtw_read8(rtwdev, REG_BCN_CTRL); in download_firmware_reg_backup()
400 rtw_write8(rtwdev, REG_BCN_CTRL, tmp); in download_firmware_reg_backup()
405 static void download_firmware_reset_platform(struct rtw_dev *rtwdev) in download_firmware_reset_platform() argument
407 rtw_write8_clr(rtwdev, REG_CPU_DMEM_CON + 2, BIT_WL_PLATFORM_RST >> 16); in download_firmware_reset_platform()
408 rtw_write8_clr(rtwdev, REG_SYS_CLK_CTRL + 1, BIT_CPU_CLK_EN >> 8); in download_firmware_reset_platform()
409 rtw_write8_set(rtwdev, REG_CPU_DMEM_CON + 2, BIT_WL_PLATFORM_RST >> 16); in download_firmware_reset_platform()
410 rtw_write8_set(rtwdev, REG_SYS_CLK_CTRL + 1, BIT_CPU_CLK_EN >> 8); in download_firmware_reset_platform()
413 static void download_firmware_reg_restore(struct rtw_dev *rtwdev, in download_firmware_reg_restore() argument
417 rtw_restore_reg(rtwdev, bckp, bckp_num); in download_firmware_reg_restore()
422 static int send_firmware_pkt_rsvd_page(struct rtw_dev *rtwdev, u16 pg_addr, in send_firmware_pkt_rsvd_page() argument
432 ret = rtw_fw_write_data_rsvd_page(rtwdev, pg_addr, buf, size); in send_firmware_pkt_rsvd_page()
438 send_firmware_pkt(struct rtw_dev *rtwdev, u16 pg_addr, const u8 *data, u32 size) in send_firmware_pkt() argument
442 if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_USB && in send_firmware_pkt()
446 ret = send_firmware_pkt_rsvd_page(rtwdev, pg_addr, data, size); in send_firmware_pkt()
448 rtw_err(rtwdev, "failed to download rsvd page\n"); in send_firmware_pkt()
454 iddma_enable(struct rtw_dev *rtwdev, u32 src, u32 dst, u32 ctrl) in iddma_enable() argument
456 rtw_write32(rtwdev, REG_DDMA_CH0SA, src); in iddma_enable()
457 rtw_write32(rtwdev, REG_DDMA_CH0DA, dst); in iddma_enable()
458 rtw_write32(rtwdev, REG_DDMA_CH0CTRL, ctrl); in iddma_enable()
460 if (!check_hw_ready(rtwdev, REG_DDMA_CH0CTRL, BIT_DDMACH0_OWN, 0)) in iddma_enable()
466 static int iddma_download_firmware(struct rtw_dev *rtwdev, u32 src, u32 dst, in iddma_download_firmware() argument
471 if (!check_hw_ready(rtwdev, REG_DDMA_CH0CTRL, BIT_DDMACH0_OWN, 0)) in iddma_download_firmware()
478 if (iddma_enable(rtwdev, src, dst, ch0_ctrl)) in iddma_download_firmware()
485 check_fw_checksum(struct rtw_dev *rtwdev, u32 addr) in check_fw_checksum() argument
489 fw_ctrl = rtw_read8(rtwdev, REG_MCUFW_CTRL); in check_fw_checksum()
491 if (rtw_read32(rtwdev, REG_DDMA_CH0CTRL) & BIT_DDMACH0_CHKSUM_STS) { in check_fw_checksum()
495 rtw_write8(rtwdev, REG_MCUFW_CTRL, fw_ctrl); in check_fw_checksum()
499 rtw_write8(rtwdev, REG_MCUFW_CTRL, fw_ctrl); in check_fw_checksum()
502 rtw_err(rtwdev, "invalid fw checksum\n"); in check_fw_checksum()
509 rtw_write8(rtwdev, REG_MCUFW_CTRL, fw_ctrl); in check_fw_checksum()
512 rtw_write8(rtwdev, REG_MCUFW_CTRL, fw_ctrl); in check_fw_checksum()
519 download_firmware_to_mem(struct rtw_dev *rtwdev, const u8 *data, in download_firmware_to_mem() argument
522 struct rtw_chip_info *chip = rtwdev->chip; in download_firmware_to_mem()
536 val = rtw_read32(rtwdev, REG_DDMA_CH0CTRL); in download_firmware_to_mem()
538 rtw_write32(rtwdev, REG_DDMA_CH0CTRL, val); in download_firmware_to_mem()
546 ret = send_firmware_pkt(rtwdev, (u16)(src >> 7), in download_firmware_to_mem()
551 ret = iddma_download_firmware(rtwdev, OCPBASE_TXBUF_88XX + in download_firmware_to_mem()
563 if (!check_fw_checksum(rtwdev, dst)) in download_firmware_to_mem()
569 static void update_firmware_info(struct rtw_dev *rtwdev, in update_firmware_info() argument
581 rtw_dbg(rtwdev, RTW_DBG_FW, "fw h2c version: %x\n", fw->h2c_version); in update_firmware_info()
582 rtw_dbg(rtwdev, RTW_DBG_FW, "fw version: %x\n", fw->version); in update_firmware_info()
583 rtw_dbg(rtwdev, RTW_DBG_FW, "fw sub version: %x\n", fw->sub_version); in update_firmware_info()
584 rtw_dbg(rtwdev, RTW_DBG_FW, "fw sub index: %x\n", fw->sub_index); in update_firmware_info()
588 start_download_firmware(struct rtw_dev *rtwdev, const u8 *data, u32 size) in start_download_firmware() argument
606 val = (u16)(rtw_read16(rtwdev, REG_MCUFW_CTRL) & 0x3800); in start_download_firmware()
608 rtw_write16(rtwdev, REG_MCUFW_CTRL, val); in start_download_firmware()
613 ret = download_firmware_to_mem(rtwdev, cur_fw, 0, addr, dmem_size); in start_download_firmware()
620 ret = download_firmware_to_mem(rtwdev, cur_fw, 0, addr, imem_size); in start_download_firmware()
628 ret = download_firmware_to_mem(rtwdev, cur_fw, 0, addr, in start_download_firmware()
637 static int download_firmware_validate(struct rtw_dev *rtwdev) in download_firmware_validate() argument
641 if (!check_hw_ready(rtwdev, REG_MCUFW_CTRL, FW_READY_MASK, FW_READY)) { in download_firmware_validate()
642 fw_key = rtw_read32(rtwdev, REG_FW_DBG7) & FW_KEY_MASK; in download_firmware_validate()
644 rtw_err(rtwdev, "invalid fw key\n"); in download_firmware_validate()
651 static void download_firmware_end_flow(struct rtw_dev *rtwdev) in download_firmware_end_flow() argument
655 rtw_write32(rtwdev, REG_TXDMA_STATUS, BTI_PAGE_OVF); in download_firmware_end_flow()
658 fw_ctrl = rtw_read16(rtwdev, REG_MCUFW_CTRL); in download_firmware_end_flow()
663 rtw_write16(rtwdev, REG_MCUFW_CTRL, fw_ctrl); in download_firmware_end_flow()
666 int rtw_download_firmware(struct rtw_dev *rtwdev, struct rtw_fw_state *fw) in rtw_download_firmware() argument
677 if (!ltecoex_read_reg(rtwdev, 0x38, <ecoex_bckp)) in rtw_download_firmware()
680 wlan_cpu_enable(rtwdev, false); in rtw_download_firmware()
682 download_firmware_reg_backup(rtwdev, bckp); in rtw_download_firmware()
683 download_firmware_reset_platform(rtwdev); in rtw_download_firmware()
685 ret = start_download_firmware(rtwdev, data, size); in rtw_download_firmware()
689 download_firmware_reg_restore(rtwdev, bckp, DLFW_RESTORE_REG_NUM); in rtw_download_firmware()
691 download_firmware_end_flow(rtwdev); in rtw_download_firmware()
693 wlan_cpu_enable(rtwdev, true); in rtw_download_firmware()
695 if (!ltecoex_reg_write(rtwdev, 0x38, ltecoex_bckp)) in rtw_download_firmware()
698 ret = download_firmware_validate(rtwdev); in rtw_download_firmware()
702 update_firmware_info(rtwdev, fw); in rtw_download_firmware()
705 rtw_hci_setup(rtwdev); in rtw_download_firmware()
707 rtwdev->h2c.last_box_num = 0; in rtw_download_firmware()
708 rtwdev->h2c.seq = 0; in rtw_download_firmware()
710 rtw_flag_set(rtwdev, RTW_FLAG_FW_RUNNING); in rtw_download_firmware()
716 rtw_write8_clr(rtwdev, REG_MCUFW_CTRL, BIT_MCUFWDL_EN); in rtw_download_firmware()
717 rtw_write8_set(rtwdev, REG_SYS_FUNC_EN + 1, BIT_FEN_CPUEN); in rtw_download_firmware()
722 static int txdma_queue_mapping(struct rtw_dev *rtwdev) in txdma_queue_mapping() argument
724 struct rtw_chip_info *chip = rtwdev->chip; in txdma_queue_mapping()
728 switch (rtw_hci_type(rtwdev)) { in txdma_queue_mapping()
733 if (rtwdev->hci.bulkout_num == 2) in txdma_queue_mapping()
735 else if (rtwdev->hci.bulkout_num == 3) in txdma_queue_mapping()
737 else if (rtwdev->hci.bulkout_num == 4) in txdma_queue_mapping()
752 rtw_write16(rtwdev, REG_TXDMA_PQ_MAP, txdma_pq_map); in txdma_queue_mapping()
754 rtw_write8(rtwdev, REG_CR, 0); in txdma_queue_mapping()
755 rtw_write8(rtwdev, REG_CR, MAC_TRX_ENABLE); in txdma_queue_mapping()
756 rtw_write32(rtwdev, REG_H2CQ_CSR, BIT_H2CQ_FULL); in txdma_queue_mapping()
761 static int set_trx_fifo_info(struct rtw_dev *rtwdev) in set_trx_fifo_info() argument
763 struct rtw_fifo_conf *fifo = &rtwdev->fifo; in set_trx_fifo_info()
764 struct rtw_chip_info *chip = rtwdev->chip; in set_trx_fifo_info()
802 rtw_err(rtwdev, "wrong rsvd driver address\n"); in set_trx_fifo_info()
809 static int priority_queue_cfg(struct rtw_dev *rtwdev) in priority_queue_cfg() argument
811 struct rtw_fifo_conf *fifo = &rtwdev->fifo; in priority_queue_cfg()
812 struct rtw_chip_info *chip = rtwdev->chip; in priority_queue_cfg()
817 ret = set_trx_fifo_info(rtwdev); in priority_queue_cfg()
821 switch (rtw_hci_type(rtwdev)) { in priority_queue_cfg()
826 if (rtwdev->hci.bulkout_num == 2) in priority_queue_cfg()
828 else if (rtwdev->hci.bulkout_num == 3) in priority_queue_cfg()
830 else if (rtwdev->hci.bulkout_num == 4) in priority_queue_cfg()
841 rtw_write16(rtwdev, REG_FIFOPAGE_INFO_1, pg_tbl->hq_num); in priority_queue_cfg()
842 rtw_write16(rtwdev, REG_FIFOPAGE_INFO_2, pg_tbl->lq_num); in priority_queue_cfg()
843 rtw_write16(rtwdev, REG_FIFOPAGE_INFO_3, pg_tbl->nq_num); in priority_queue_cfg()
844 rtw_write16(rtwdev, REG_FIFOPAGE_INFO_4, pg_tbl->exq_num); in priority_queue_cfg()
845 rtw_write16(rtwdev, REG_FIFOPAGE_INFO_5, pubq_num); in priority_queue_cfg()
846 rtw_write32_set(rtwdev, REG_RQPN_CTRL_2, BIT_LD_RQPN); in priority_queue_cfg()
848 rtw_write16(rtwdev, REG_FIFOPAGE_CTRL_2, fifo->rsvd_boundary); in priority_queue_cfg()
849 rtw_write8_set(rtwdev, REG_FWHW_TXQ_CTRL + 2, BIT_EN_WR_FREE_TAIL >> 16); in priority_queue_cfg()
851 rtw_write16(rtwdev, REG_BCNQ_BDNY_V1, fifo->rsvd_boundary); in priority_queue_cfg()
852 rtw_write16(rtwdev, REG_FIFOPAGE_CTRL_2 + 2, fifo->rsvd_boundary); in priority_queue_cfg()
853 rtw_write16(rtwdev, REG_BCNQ1_BDNY_V1, fifo->rsvd_boundary); in priority_queue_cfg()
854 rtw_write32(rtwdev, REG_RXFF_BNDY, chip->rxff_size - C2H_PKT_BUF - 1); in priority_queue_cfg()
855 rtw_write8_set(rtwdev, REG_AUTO_LLT_V1, BIT_AUTO_INIT_LLT_V1); in priority_queue_cfg()
857 if (!check_hw_ready(rtwdev, REG_AUTO_LLT_V1, BIT_AUTO_INIT_LLT_V1, 0)) in priority_queue_cfg()
860 rtw_write8(rtwdev, REG_CR + 3, 0); in priority_queue_cfg()
865 static int init_h2c(struct rtw_dev *rtwdev) in init_h2c() argument
867 struct rtw_fifo_conf *fifo = &rtwdev->fifo; in init_h2c()
878 value32 = rtw_read32(rtwdev, REG_H2C_HEAD); in init_h2c()
880 rtw_write32(rtwdev, REG_H2C_HEAD, value32); in init_h2c()
882 value32 = rtw_read32(rtwdev, REG_H2C_READ_ADDR); in init_h2c()
884 rtw_write32(rtwdev, REG_H2C_READ_ADDR, value32); in init_h2c()
886 value32 = rtw_read32(rtwdev, REG_H2C_TAIL); in init_h2c()
889 rtw_write32(rtwdev, REG_H2C_TAIL, value32); in init_h2c()
891 value8 = rtw_read8(rtwdev, REG_H2C_INFO); in init_h2c()
893 rtw_write8(rtwdev, REG_H2C_INFO, value8); in init_h2c()
895 value8 = rtw_read8(rtwdev, REG_H2C_INFO); in init_h2c()
897 rtw_write8(rtwdev, REG_H2C_INFO, value8); in init_h2c()
899 value8 = rtw_read8(rtwdev, REG_TXDMA_OFFSET_CHK + 1); in init_h2c()
901 rtw_write8(rtwdev, REG_TXDMA_OFFSET_CHK + 1, value8); in init_h2c()
903 wp = rtw_read32(rtwdev, REG_H2C_PKT_WRITEADDR) & 0x3FFFF; in init_h2c()
904 rp = rtw_read32(rtwdev, REG_H2C_PKT_READADDR) & 0x3FFFF; in init_h2c()
908 rtw_err(rtwdev, "H2C queue mismatch\n"); in init_h2c()
915 static int rtw_init_trx_cfg(struct rtw_dev *rtwdev) in rtw_init_trx_cfg() argument
919 ret = txdma_queue_mapping(rtwdev); in rtw_init_trx_cfg()
923 ret = priority_queue_cfg(rtwdev); in rtw_init_trx_cfg()
927 ret = init_h2c(rtwdev); in rtw_init_trx_cfg()
934 static int rtw_drv_info_cfg(struct rtw_dev *rtwdev) in rtw_drv_info_cfg() argument
938 rtw_write8(rtwdev, REG_RX_DRVINFO_SZ, PHY_STATUS_SIZE); in rtw_drv_info_cfg()
939 value8 = rtw_read8(rtwdev, REG_TRXFF_BNDY + 1); in rtw_drv_info_cfg()
943 rtw_write8(rtwdev, REG_TRXFF_BNDY + 1, value8); in rtw_drv_info_cfg()
944 rtw_write32_set(rtwdev, REG_RCR, BIT_APP_PHYSTS); in rtw_drv_info_cfg()
945 rtw_write32_clr(rtwdev, REG_WMAC_OPTION_FUNCTION + 4, BIT(8) | BIT(9)); in rtw_drv_info_cfg()
950 int rtw_mac_init(struct rtw_dev *rtwdev) in rtw_mac_init() argument
952 struct rtw_chip_info *chip = rtwdev->chip; in rtw_mac_init()
955 ret = rtw_init_trx_cfg(rtwdev); in rtw_mac_init()
959 ret = chip->ops->mac_init(rtwdev); in rtw_mac_init()
963 ret = rtw_drv_info_cfg(rtwdev); in rtw_mac_init()