2 * Bluetooth supports for Qualcomm Atheros ROME chips
4 * Copyright (c) 2015 The Linux Foundation. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #define EDL_PATCH_CMD_OPCODE (0xFC00)
22 #define EDL_NVM_ACCESS_OPCODE (0xFC0B)
23 #define EDL_WRITE_BD_ADDR_OPCODE (0xFC14)
24 #define EDL_PATCH_CMD_LEN (1)
25 #define EDL_PATCH_VER_REQ_CMD (0x19)
26 #define EDL_PATCH_TLV_REQ_CMD (0x1E)
27 #define EDL_NVM_ACCESS_SET_REQ_CMD (0x01)
28 #define MAX_SIZE_PER_TLV_SEGMENT (243)
30 #define EDL_CMD_REQ_RES_EVT (0x00)
31 #define EDL_PATCH_VER_RES_EVT (0x19)
32 #define EDL_APP_VER_RES_EVT (0x02)
33 #define EDL_TVL_DNLD_RES_EVT (0x04)
34 #define EDL_CMD_EXE_STATUS_EVT (0x00)
35 #define EDL_SET_BAUDRATE_RSP_EVT (0x92)
36 #define EDL_NVM_ACCESS_CODE_EVT (0x0B)
38 #define EDL_TAG_ID_HCI (17)
39 #define EDL_TAG_ID_DEEP_SLEEP (27)
41 #define QCA_WCN3990_POWERON_PULSE 0xFC
42 #define QCA_WCN3990_POWEROFF_PULSE 0xC0
45 QCA_BAUDRATE_115200 = 0,
64 QCA_BAUDRATE_AUTO = 0xFE,
68 enum rome_tlv_dnld_mode {
83 uint8_t user_baud_rate;
84 enum rome_tlv_dnld_mode dnld_mode;
87 struct edl_event_hdr {
100 struct tlv_seg_resp {
104 struct tlv_type_patch {
113 __le16 patch_version;
118 struct tlv_type_nvm {
126 struct tlv_type_hdr {
131 enum qca_btsoc_type {
139 #if IS_ENABLED(CONFIG_BT_QCA)
141 int qca_set_bdaddr_rome(struct hci_dev *hdev, const bdaddr_t *bdaddr);
142 int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
143 enum qca_btsoc_type soc_type, u32 soc_ver);
144 int qca_read_soc_version(struct hci_dev *hdev, u32 *soc_version);
145 int qca_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
146 static inline bool qca_is_wcn399x(enum qca_btsoc_type soc_type)
148 return soc_type == QCA_WCN3990 || soc_type == QCA_WCN3998;
152 static inline int qca_set_bdaddr_rome(struct hci_dev *hdev, const bdaddr_t *bdaddr)
157 static inline int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
158 enum qca_btsoc_type soc_type, u32 soc_ver)
163 static inline int qca_read_soc_version(struct hci_dev *hdev, u32 *soc_version)
168 static inline int qca_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
173 static inline bool qca_is_wcn399x(enum qca_btsoc_type soc_type)