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_PATCH_CMD_LEN (1)
24 #define EDL_PATCH_VER_REQ_CMD (0x19)
25 #define EDL_PATCH_TLV_REQ_CMD (0x1E)
26 #define EDL_NVM_ACCESS_SET_REQ_CMD (0x01)
27 #define MAX_SIZE_PER_TLV_SEGMENT (243)
29 #define EDL_CMD_REQ_RES_EVT (0x00)
30 #define EDL_PATCH_VER_RES_EVT (0x19)
31 #define EDL_APP_VER_RES_EVT (0x02)
32 #define EDL_TVL_DNLD_RES_EVT (0x04)
33 #define EDL_CMD_EXE_STATUS_EVT (0x00)
34 #define EDL_SET_BAUDRATE_RSP_EVT (0x92)
35 #define EDL_NVM_ACCESS_CODE_EVT (0x0B)
37 #define EDL_TAG_ID_HCI (17)
38 #define EDL_TAG_ID_DEEP_SLEEP (27)
40 #define QCA_WCN3990_POWERON_PULSE 0xFC
41 #define QCA_WCN3990_POWEROFF_PULSE 0xC0
44 QCA_BAUDRATE_115200
= 0,
63 QCA_BAUDRATE_AUTO
= 0xFE,
67 enum rome_tlv_dnld_mode
{
82 uint8_t user_baud_rate
;
83 enum rome_tlv_dnld_mode dnld_mode
;
86 struct edl_event_hdr
{
103 struct tlv_type_patch
{
112 __le16 patch_version
;
117 struct tlv_type_nvm
{
125 struct tlv_type_hdr
{
130 enum qca_btsoc_type
{
137 #if IS_ENABLED(CONFIG_BT_QCA)
139 int qca_set_bdaddr_rome(struct hci_dev
*hdev
, const bdaddr_t
*bdaddr
);
140 int qca_uart_setup(struct hci_dev
*hdev
, uint8_t baudrate
,
141 enum qca_btsoc_type soc_type
, u32 soc_ver
);
142 int qca_read_soc_version(struct hci_dev
*hdev
, u32
*soc_version
);
146 static inline int qca_set_bdaddr_rome(struct hci_dev
*hdev
, const bdaddr_t
*bdaddr
)
151 static inline int qca_uart_setup(struct hci_dev
*hdev
, uint8_t baudrate
,
152 enum qca_btsoc_type soc_type
, u32 soc_ver
)
157 static inline int qca_read_soc_version(struct hci_dev
*hdev
, u32
*soc_version
)