Lines Matching +full:fw +full:- +full:download +full:- +full:speed
4 * SPDX-License-Identifier: Apache-2.0
186 const uint8_t *fw; member
218 len--; in fw_upload_read_data()
264 return -EIO; in fw_upload_wait_for_hdr_sig()
282 return -EINVAL; in fw_upload_request_check_crc()
288 return -EINVAL; in fw_upload_request_check_crc()
331 return -EINVAL; in fw_upload_wait_req()
363 return -EINVAL; in fw_upload_wait_req()
414 retry--; in fw_upload_change_timeout()
419 return -ENOTSUP; in fw_upload_change_timeout()
424 return -ENOTSUP; in fw_upload_change_timeout()
428 return -EINVAL; in fw_upload_change_timeout()
443 static int fw_upload_change_speed_config(struct change_speed_config *config, uint32_t speed) in fw_upload_change_speed_config() argument
445 config->clk_div_addr = 0x7f00008fU; in fw_upload_change_speed_config()
446 config->uart_clk_div_addr = 0x7f000090U; in fw_upload_change_speed_config()
447 config->mcr_addr = 0x7f000091U; in fw_upload_change_speed_config()
448 config->reinit_addr = 0x7f000092U; in fw_upload_change_speed_config()
449 config->icr_addr = 0x7f000093U; in fw_upload_change_speed_config()
450 config->fcr_addr = 0x7f000094U; in fw_upload_change_speed_config()
452 config->mcr_val = 0x00000022U; in fw_upload_change_speed_config()
453 config->reinit_val = 0x00000001U; in fw_upload_change_speed_config()
454 config->icr_val = 0x000000c7U; in fw_upload_change_speed_config()
455 config->fcr_val = 0x000000c7U; in fw_upload_change_speed_config()
458 if (speed == clk_div_map[i].uartBaudRate) { in fw_upload_change_speed_config()
459 config->clk_div_val = clk_div_map[i].uartClkDivisor; in fw_upload_change_speed_config()
460 config->uart_clk_div_val = clk_div_map[i].uartDivisio; in fw_upload_change_speed_config()
464 return -ENOTSUP; in fw_upload_change_speed_config()
558 return -EINVAL; in fw_upload_len_valid()
590 return -EINVAL; in fw_upload_get_last_5bytes()
644 LOG_DBG("Download Complete"); in fw_upload_write_hdr_and_payload()
652 fw_upload_write_data(buffer, len_to_send - 1); in fw_upload_write_hdr_and_payload()
657 fw_upload_write_data(&buffer[CMD_HDR_LEN], len_to_send - 1); in fw_upload_write_hdr_and_payload()
688 static int fw_upload_uart_reconfig(uint32_t speed, bool flow_control) in fw_upload_uart_reconfig() argument
693 config.baudrate = speed; in fw_upload_uart_reconfig()
750 return -ETIME; in fw_upload_change_speed()
754 LOG_ERR("HDR cannot be received by using second speed. receovery " in fw_upload_change_speed()
755 "speed"); in fw_upload_change_speed()
772 return -EINVAL; in fw_upload_change_speed()
786 LOG_DBG("Change speed to %d", uart_dev_data.secondary_speed); in fw_upload_change_speed()
797 LOG_DBG("Change speed to %d", uart_dev_data.secondary_speed); in fw_upload_change_speed()
829 LOG_DBG("Change speed to %d", in fw_upload_change_speed()
858 if ((fw_upload.fw_length - fw_upload.current_length) < len) { in fw_upload_v1_send_data()
859 len = fw_upload.fw_length - fw_upload.current_length; in fw_upload_v1_send_data()
862 memcpy(fw_upload.send_buffer, fw_upload.fw + fw_upload.current_length, len); in fw_upload_v1_send_data()
870 if ((data_len > (sizeof(fw_upload.send_buffer) - len)) || in fw_upload_v1_send_data()
872 LOG_ERR("Invalid FW at %d/%d", fw_upload.current_length, in fw_upload_v1_send_data()
874 return -EINVAL; in fw_upload_v1_send_data()
876 memcpy(&fw_upload.send_buffer[len], fw_upload.fw + fw_upload.current_length, in fw_upload_v1_send_data()
886 LOG_DBG("FW upload %d/%d", fw_upload.current_length, fw_upload.fw_length); in fw_upload_v1_send_data()
902 start = fw_upload.offset - fw_upload.cmd7_change_timeout_len - in fw_upload_v3_send_data()
905 LOG_ERR("Invalid fw offset"); in fw_upload_v3_send_data()
906 return -EINVAL; in fw_upload_v3_send_data()
910 fw_upload.length = fw_upload.fw_length - start; in fw_upload_v3_send_data()
912 memcpy(fw_upload.send_buffer, fw_upload.fw + start, fw_upload.length); in fw_upload_v3_send_data()
921 static int fw_uploading(const uint8_t *fw, uint32_t fw_length) in fw_uploading() argument
944 LOG_DBG("Change speed to %d", uart_dev_data.secondary_speed); in fw_uploading()
947 LOG_ERR("Fail to change speed"); in fw_uploading()
955 fw_upload.fw = fw; in fw_uploading()
960 return -ETIME; in fw_uploading()
975 LOG_DBG("FW download done"); in fw_uploading()
978 LOG_ERR("FW download failed"); in fw_uploading()
995 LOG_ERR("FW download failed"); in fw_uploading()
1010 LOG_DBG("FW download done"); in fw_uploading()
1022 return -ENOTSUP; in fw_uploading()
1025 return -EINVAL; in fw_uploading()
1047 count--; in bt_nxp_ctlr_uart_isr()
1054 uint32_t speed; in bt_nxp_ctlr_init() local
1058 return -ENODEV; in bt_nxp_ctlr_init()
1061 speed = DT_PROP(DT_INST_GPARENT(0), current_speed); in bt_nxp_ctlr_init()
1062 uart_dev_data.primary_speed = DT_PROP_OR(DT_DRV_INST(0), fw_download_primary_speed, speed); in bt_nxp_ctlr_init()
1064 DT_PROP_OR(DT_DRV_INST(0), fw_download_secondary_speed, speed); in bt_nxp_ctlr_init()
1077 LOG_ERR("Error: failed to configure sdio_reset %s pin %d", sdio_reset.port->name, in bt_nxp_ctlr_init()
1079 return -EIO; in bt_nxp_ctlr_init()
1086 sdio_reset.port->name, sdio_reset.pin); in bt_nxp_ctlr_init()
1098 LOG_ERR("Error: failed to configure w_disable %s pin %d", w_disable.port->name, in bt_nxp_ctlr_init()
1100 return -EIO; in bt_nxp_ctlr_init()
1107 w_disable.port->name, w_disable.pin); in bt_nxp_ctlr_init()
1162 (void)fw_upload_uart_reconfig(speed, flowcontrol_of_hci); in bt_nxp_ctlr_init()
1175 return -EINVAL; in bt_hci_transport_setup()
1193 return -ENOBUFS; in bt_hci_baudrate_update()
1216 return -EINVAL; in bt_h4_vnd_setup()
1220 return -ENODEV; in bt_h4_vnd_setup()