bluez5: add support for qca6564 bluetooth chip
Port the bluez5 qca6564 support based on 5.19 to the current version 5.33. The ported version is based on qualcomm tag r110048.3. https://jira.digi.com/browse/DEL-2581 Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
This commit is contained in:
parent
2edc86c877
commit
325c3b9da9
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,28 @@
|
|||
From: Anantha Krishnan <ananthk@codeaurora.org>
|
||||
Date: Thu, 11 Sep 2014 19:20:02 +0530
|
||||
Subject: [PATCH] bluetooth: Enable bluetooth low power mode functionality
|
||||
|
||||
During periods of inactivity the bluetooth controller and the
|
||||
application processor will indicate each other to enter into
|
||||
low power mode and signal each other when they have data to be
|
||||
exchanged, thereby saving considerable amount of power.
|
||||
|
||||
Change-Id: I9e0d579ac8a9d61a2ebde78b031f4101cb6bc443
|
||||
Signed-off-by: Rupesh Tatiya <rtatiya@codeaurora.org>
|
||||
---
|
||||
tools/hciattach.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/hciattach.c b/tools/hciattach.c
|
||||
index d3917a0d503e..3041e28ff82a 100644
|
||||
--- a/tools/hciattach.c
|
||||
+++ b/tools/hciattach.c
|
||||
@@ -1156,7 +1156,7 @@ struct uart_t uart[] = {
|
||||
FLOW_CTL, DISABLE_PM, NULL, ath3k_ps, ath3k_pm },
|
||||
|
||||
/* QCA ROME */
|
||||
- { "qca", 0x0000, 0x0000, HCI_UART_H4, 115200, 115200,
|
||||
+ { "qca", 0x0000, 0x0000, HCI_UART_IBS, 115200, 115200,
|
||||
FLOW_CTL, DISABLE_PM, NULL, qca, NULL },
|
||||
|
||||
/* QUALCOMM BTS */
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
From: Anantha Krishnan <ananthk@codeaurora.org>
|
||||
Date: Thu, 11 Sep 2014 18:57:45 +0530
|
||||
Subject: [PATCH] bluetooth: Fix bug in firmware parsing mechanism
|
||||
|
||||
Reorganize the RAMPATCH members to be present as part of the
|
||||
RAMPATCH header structre instead of the main firmware structure
|
||||
|
||||
Change-Id: If523e1bb20edcd52b7c6f623c07af492e6305bd0
|
||||
Signed-off-by: Rupesh Tatiya <rtatiya@codeaurora.org>
|
||||
---
|
||||
tools/hciattach_rome.c | 4 ++--
|
||||
tools/hciattach_rome.h | 4 ++--
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index f31be43c09e4..122a0f4b89bc 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -851,8 +851,8 @@ int rome_get_tlv_file(char *file_path)
|
||||
fprintf(stderr, "Length\t\t\t : %d bytes\n", (ptlv_header->tlv_length1) |
|
||||
(ptlv_header->tlv_length2 << 8) |
|
||||
(ptlv_header->tlv_length3 << 16));
|
||||
- fprintf(stderr, "Total Length\t\t\t : %d bytes\n", ptlv_header->tlv_data_len);
|
||||
- fprintf(stderr, "Patch Data Length\t\t\t : %d bytes\n",ptlv_header->tlv_patch_data_len);
|
||||
+ fprintf(stderr, "Total Length\t\t\t : %d bytes\n", ptlv_header->tlv.patch.tlv_data_len);
|
||||
+ fprintf(stderr, "Patch Data Length\t\t\t : %d bytes\n",ptlv_header->tlv.patch.tlv_patch_data_len);
|
||||
fprintf(stderr, "Signing Format Version\t : 0x%x\n", ptlv_header->tlv.patch.sign_ver);
|
||||
fprintf(stderr, "Signature Algorithm\t\t : 0x%x\n", ptlv_header->tlv.patch.sign_algorithm);
|
||||
fprintf(stderr, "Reserved\t\t\t : 0x%x\n", ptlv_header->tlv.patch.reserved1);
|
||||
diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h
|
||||
index aa59965643ec..07127f30a70a 100644
|
||||
--- a/tools/hciattach_rome.h
|
||||
+++ b/tools/hciattach_rome.h
|
||||
@@ -236,6 +236,8 @@ typedef struct {
|
||||
} __attribute__ ((packed)) patch_info;
|
||||
|
||||
typedef struct {
|
||||
+ unsigned int tlv_data_len;
|
||||
+ unsigned int tlv_patch_data_len;
|
||||
unsigned char sign_ver;
|
||||
unsigned char sign_algorithm;
|
||||
unsigned short reserved1;
|
||||
@@ -258,8 +260,6 @@ typedef struct {
|
||||
unsigned char tlv_length1;
|
||||
unsigned char tlv_length2;
|
||||
unsigned char tlv_length3;
|
||||
- unsigned int tlv_data_len;
|
||||
- unsigned int tlv_patch_data_len;
|
||||
|
||||
union{
|
||||
tlv_patch_hdr patch;
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
From: Anantha Krishnan <ananthk@codeaurora.org>
|
||||
Date: Mon, 8 Sep 2014 15:11:02 +0530
|
||||
Subject: [PATCH] bluetooth: Configure BD Address
|
||||
|
||||
Read the BD Address programmed by user from persist location.
|
||||
If there is no user programmed BD address then use the default
|
||||
BD address present in the firmware file.
|
||||
|
||||
Change-Id: Id702d1476bae765dfd23f88542bfd5a8a1f26056
|
||||
Signed-off-by: Rupesh Tatiya <rtatiya@codeaurora.org>
|
||||
---
|
||||
tools/hciattach_rome.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++---
|
||||
tools/hciattach_rome.h | 7 +++++++
|
||||
2 files changed, 60 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index 122a0f4b89bc..947e1abb96c4 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -809,6 +809,7 @@ int rome_get_tlv_file(char *file_path)
|
||||
tlv_nvm_hdr *nvm_ptr;
|
||||
unsigned char data_buf[PRINT_BUF_SIZE]={0,};
|
||||
unsigned char *nvm_byte_ptr;
|
||||
+ unsigned char bdaddr[6];
|
||||
|
||||
fprintf(stderr, "File Open (%s)\n", file_path);
|
||||
pFile = fopen ( file_path , "r" );
|
||||
@@ -886,9 +887,10 @@ int rome_get_tlv_file(char *file_path)
|
||||
nvm_byte_ptr+=sizeof(tlv_nvm_hdr);
|
||||
|
||||
/* Write BD Address */
|
||||
- if(nvm_ptr->tag_id == TAG_NUM_2){
|
||||
- memcpy(nvm_byte_ptr, vnd_local_bd_addr, 6);
|
||||
- fprintf(stderr, "BD Address: %.02x:%.02x:%.02x:%.02x:%.02x:%.02x\n",
|
||||
+ if(nvm_ptr->tag_id == TAG_NUM_2 && read_bd_address(&bdaddr) == 0) {
|
||||
+ memcpy(nvm_byte_ptr, bdaddr, 6);
|
||||
+ fprintf(stderr, "Overriding default BD ADDR with user"
|
||||
+ " programmed BD Address: %02x:%02x:%02x:%02x:%02x:%02x\n",
|
||||
*nvm_byte_ptr, *(nvm_byte_ptr+1), *(nvm_byte_ptr+2),
|
||||
*(nvm_byte_ptr+3), *(nvm_byte_ptr+4), *(nvm_byte_ptr+5));
|
||||
}
|
||||
@@ -1451,6 +1453,54 @@ error:
|
||||
|
||||
}
|
||||
|
||||
+int read_bd_address(unsigned char *bdaddr)
|
||||
+{
|
||||
+ int fd = -1;
|
||||
+ int readPtr = 0;
|
||||
+ unsigned char data[BD_ADDR_LEN];
|
||||
+
|
||||
+ /* Open the persist file for reading device address*/
|
||||
+ fd = open("/etc/bluetooth/.bt_nv.bin", O_RDONLY);
|
||||
+ if(fd < 0)
|
||||
+ {
|
||||
+ fprintf(stderr, "%s: Open failed: Programming default BD ADDR\n", __func__);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ /* Read the NVM Header : fp will be advanced by readPtr number of bytes */
|
||||
+ readPtr = read(fd, data, PERSIST_HEADER_LEN);
|
||||
+ if (readPtr > 0)
|
||||
+ fprintf(stderr, "%s: Persist header data: %02x \t %02x \t %02x\n", __func__,
|
||||
+ data[NVITEM], data[RDWR_PROT], data[NVITEM_SIZE]);
|
||||
+ else {
|
||||
+ fprintf(stderr, "%s: Read from persist memory failed : Programming default"
|
||||
+ " BD ADDR\n");
|
||||
+ close(fd);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ /* Check for BD ADDR length before programming */
|
||||
+ if(data[NVITEM_SIZE] != BD_ADDR_LEN) {
|
||||
+ fprintf(stderr, "Invalid BD ADDR: Programming default BD ADDR!\n");
|
||||
+ close(fd);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ /* Read the BD ADDR info */
|
||||
+ readPtr = read(fd, data, BD_ADDR_LEN);
|
||||
+ if (readPtr > 0)
|
||||
+ fprintf(stderr, "BD-ADDR: ==> %02x:%02x:%02x:%02x:%02x:%02x\n", data[0],
|
||||
+ data[1], data[2], data[3], data[4], data[5]);
|
||||
+ else {
|
||||
+ fprintf(stderr, "%s: Read from persist memory failed : Programming default"
|
||||
+ " BD ADDR\n");
|
||||
+ close(fd);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ memcpy(bdaddr, data, BD_ADDR_LEN);
|
||||
+ close(fd);
|
||||
+ return 0;
|
||||
+}
|
||||
|
||||
int qca_soc_init(int fd, char *bdaddr)
|
||||
{
|
||||
diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h
|
||||
index 07127f30a70a..a4abe9f73080 100644
|
||||
--- a/tools/hciattach_rome.h
|
||||
+++ b/tools/hciattach_rome.h
|
||||
@@ -34,6 +34,13 @@
|
||||
#define HCI_EVENT_PKT 0x04
|
||||
#define HCI_VENDOR_PKT 0xff
|
||||
#define cmd_opcode_pack(ogf, ocf) (unsigned short)((ocf & 0x03ff)|(ogf << 10))
|
||||
+
|
||||
+#define NVITEM 0
|
||||
+#define RDWR_PROT 1
|
||||
+#define NVITEM_SIZE 2
|
||||
+#define PERSIST_HEADER_LEN 3
|
||||
+#define BD_ADDR_LEN 6
|
||||
+
|
||||
unsigned char vnd_local_bd_addr[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
typedef enum {
|
||||
USERIAL_OP_FLOW_ON,
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
From: Anantha Krishnan <ananthk@codeaurora.org>
|
||||
Date: Mon, 8 Sep 2014 14:33:24 +0530
|
||||
Subject: [PATCH] bluetooth: Remove unused functions in the firmware download
|
||||
process
|
||||
|
||||
rome_disable_sleep() function is not used anywhere in the code and
|
||||
hence remove it.
|
||||
|
||||
Change-Id: Iec1f9b1478850af3023ff297493693283a5338d7
|
||||
Signed-off-by: Rupesh Tatiya <rtatiya@codeaurora.org>
|
||||
---
|
||||
tools/hciattach_rome.c | 48 ------------------------------------------------
|
||||
1 file changed, 48 deletions(-)
|
||||
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index 947e1abb96c4..4fcbdf2ab82a 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -1317,54 +1317,6 @@ error:
|
||||
|
||||
}
|
||||
|
||||
-int rome_disable_sleep(int fd)
|
||||
-{
|
||||
- int size, err = 0;
|
||||
- unsigned char cmd[HCI_MAX_CMD_SIZE];
|
||||
- unsigned char rsp[HCI_MAX_EVENT_SIZE];
|
||||
- hci_command_hdr *cmd_hdr;
|
||||
- int flags;
|
||||
-
|
||||
- memset(cmd, 0x0, HCI_MAX_CMD_SIZE);
|
||||
-
|
||||
- cmd_hdr = (void *) (cmd + 1);
|
||||
- cmd[0] = HCI_COMMAND_PKT;
|
||||
- cmd_hdr->opcode = cmd_opcode_pack(HCI_VENDOR_CMD_OGF, NVM_ACCESS_CODE);
|
||||
- cmd_hdr->plen = VSC_DISABLE_IBS_LEN;
|
||||
- cmd[4] = 0x01;
|
||||
- cmd[5] = 0x1B;
|
||||
- cmd[6] = 0x01;
|
||||
- cmd[7] = 0x00;
|
||||
-
|
||||
- /* Total length of the packet to be sent to the Controller */
|
||||
- size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + VSC_DISABLE_IBS_LEN);
|
||||
- /* Send the HCI command packet to UART for transmission */
|
||||
- fprintf(stderr, "%s: HCI CMD: 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n", __FUNCTION__, cmd[0], cmd[1], cmd[2], cmd[3], cmd[4], cmd[5], cmd[6], cmd[7]) ;
|
||||
- err = write(fd, cmd, size);
|
||||
- if (err != size) {
|
||||
- fprintf(stderr, "%s: Send failed with ret value: %d\n", __FUNCTION__, err);
|
||||
- goto error;
|
||||
- }
|
||||
-
|
||||
- /* Check for response from the Controller */
|
||||
- if ((err =read_vs_hci_event(fd, rsp, HCI_MAX_EVENT_SIZE)) < 0) {
|
||||
- fprintf(stderr, "%s: Failed to get HCI-VS Event from SOC\n", __FUNCTION__);
|
||||
- goto error;
|
||||
- }
|
||||
-
|
||||
- fprintf(stderr, "%s: Received HCI-Vendor Specific Event from SOC\n", __FUNCTION__);
|
||||
-
|
||||
- /* Wait for command complete event */
|
||||
- err = read_hci_event(fd, rsp, HCI_MAX_EVENT_SIZE);
|
||||
- if ( err < 0) {
|
||||
- fprintf(stderr, "%s: Failed to set patch info on Controller\n", __FUNCTION__);
|
||||
- goto error;
|
||||
- }
|
||||
- fprintf(stderr, "%s\n", __FUNCTION__);
|
||||
-error:
|
||||
- return err;
|
||||
-
|
||||
-}
|
||||
|
||||
int rome_set_baudrate_req(int fd)
|
||||
{
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
From: Anantha Krishnan <ananthk@codeaurora.org>
|
||||
Date: Mon, 8 Sep 2014 14:31:18 +0530
|
||||
Subject: [PATCH] bluetooth: Enable 3Mbps baud rate support
|
||||
|
||||
Allow APPS PROC and BT Controller to operate at 3Mbps baud rate
|
||||
for faster exchange of commands, events and data between the two
|
||||
|
||||
Change-Id: I55651633027ea60a762b11abea84fe1abd6574a9
|
||||
Signed-off-by: Rupesh Tatiya <rtatiya@codeaurora.org>
|
||||
---
|
||||
tools/hciattach_rome.c | 63 ++++++++++++++++++++++++++++++++++++++------------
|
||||
1 file changed, 48 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index 4fcbdf2ab82a..d0e2935b9997 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -166,6 +166,7 @@ int userial_vendor_ioctl(int fd, userial_vendor_ioctl_op_t op, int *p_data)
|
||||
}
|
||||
cfmakeraw(&ti);
|
||||
ti.c_cflag |= CLOCAL;
|
||||
+ ti.c_cflag |= CREAD;
|
||||
|
||||
switch(op)
|
||||
{
|
||||
@@ -332,6 +333,8 @@ int read_vs_hci_event(int fd, unsigned char* buf, int size)
|
||||
{
|
||||
int remain, r;
|
||||
int count = 0;
|
||||
+ fd_set infids;
|
||||
+ struct timeval timeout;
|
||||
|
||||
if (size <= 0) {
|
||||
fprintf(stderr, "Invalid size arguement!\n");
|
||||
@@ -340,6 +343,16 @@ int read_vs_hci_event(int fd, unsigned char* buf, int size)
|
||||
|
||||
fprintf(stderr, "%s: Wait for HCI-Vendor Specfic Event from SOC\n", __FUNCTION__);
|
||||
|
||||
+ FD_ZERO (&infids);
|
||||
+ FD_SET (fd, &infids);
|
||||
+ timeout.tv_sec = 3;
|
||||
+ timeout.tv_usec = 0; /* half second is a long time at 115.2 Kbps */
|
||||
+
|
||||
+ if (select (fd + 1, &infids, NULL, NULL, &timeout) < 1)
|
||||
+ fprintf(stderr, "%s: Timing out on select for 3 secs.\n", __FUNCTION__);
|
||||
+ else
|
||||
+ fprintf(stderr, "%s: Data available in TTY Serial buffer\n", __FUNCTION__);
|
||||
+
|
||||
/* The first byte identifies the packet type. For HCI event packets, it
|
||||
* should be 0x04, so we read until we get to the 0x04. */
|
||||
/* It will keep reading until find 0x04 byte */
|
||||
@@ -1332,10 +1345,16 @@ int rome_set_baudrate_req(int fd)
|
||||
cmd[0] = HCI_COMMAND_PKT;
|
||||
cmd_hdr->opcode = cmd_opcode_pack(HCI_VENDOR_CMD_OGF, EDL_SET_BAUDRATE_CMD_OCF);
|
||||
cmd_hdr->plen = VSC_SET_BAUDRATE_REQ_LEN;
|
||||
- cmd[4] = BAUDRATE_115200;
|
||||
+ cmd[4] = BAUDRATE_3000000;
|
||||
|
||||
/* Total length of the packet to be sent to the Controller */
|
||||
size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + VSC_SET_BAUDRATE_REQ_LEN);
|
||||
+ /* Flow off during baudrate change */
|
||||
+ if ((err = userial_vendor_ioctl(fd, USERIAL_OP_FLOW_OFF , &flags)) < 0)
|
||||
+ {
|
||||
+ fprintf(stderr, "%s: HW Flow-off error: 0x%x\n", __FUNCTION__, err);
|
||||
+ goto error;
|
||||
+ }
|
||||
/* Send the HCI command packet to UART for transmission */
|
||||
fprintf(stderr, "%s: HCI CMD: 0x%x 0x%x 0x%x 0x%x 0x%x\n", __FUNCTION__, cmd[0], cmd[1], cmd[2], cmd[3],cmd[4]) ;
|
||||
err = write(fd, cmd, size);
|
||||
@@ -1343,7 +1362,15 @@ int rome_set_baudrate_req(int fd)
|
||||
fprintf(stderr, "%s: Send failed with ret value: %d\n", __FUNCTION__, err);
|
||||
goto error;
|
||||
}
|
||||
+ /* Change Local UART baudrate to high speed UART */
|
||||
+ userial_vendor_set_baud(USERIAL_BAUD_3M);
|
||||
|
||||
+ /* Flow on after changing local uart baudrate */
|
||||
+ if ((err = userial_vendor_ioctl(fd, USERIAL_OP_FLOW_ON , &flags)) < 0)
|
||||
+ {
|
||||
+ fprintf(stderr, "%s: HW Flow-on error: 0x%x \n", __FUNCTION__, err);
|
||||
+ return err;
|
||||
+ }
|
||||
/* Check for response from the Controller */
|
||||
if ((err =read_vs_hci_event(fd, rsp, HCI_MAX_EVENT_SIZE)) < 0) {
|
||||
fprintf(stderr, "%s: Failed to get HCI-VS Event from SOC\n", __FUNCTION__);
|
||||
@@ -1385,6 +1412,12 @@ int rome_hci_reset_req(int fd)
|
||||
/* Total length of the packet to be sent to the Controller */
|
||||
size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE);
|
||||
|
||||
+ /* Flow off during baudrate change */
|
||||
+ if ((err = userial_vendor_ioctl(fd, USERIAL_OP_FLOW_OFF , &flags)) < 0)
|
||||
+ {
|
||||
+ fprintf(stderr, "%s: HW Flow-off error: 0x%x\n", __FUNCTION__, err);
|
||||
+ goto error;
|
||||
+ }
|
||||
/* Send the HCI command packet to UART for transmission */
|
||||
fprintf(stderr, "%s: HCI CMD: 0x%x 0x%x 0x%x 0x%x\n", __FUNCTION__, cmd[0], cmd[1], cmd[2], cmd[3]);
|
||||
err = write(fd, cmd, size);
|
||||
@@ -1393,6 +1426,15 @@ int rome_hci_reset_req(int fd)
|
||||
goto error;
|
||||
}
|
||||
|
||||
+ /* Change Local UART baudrate to high speed UART */
|
||||
+ userial_vendor_set_baud(USERIAL_BAUD_3M);
|
||||
+
|
||||
+ /* Flow on after changing local uart baudrate */
|
||||
+ if ((err = userial_vendor_ioctl(fd, USERIAL_OP_FLOW_ON , &flags)) < 0)
|
||||
+ {
|
||||
+ fprintf(stderr, "%s: HW Flow-on error: 0x%x \n", __FUNCTION__, err);
|
||||
+ return err;
|
||||
+ }
|
||||
/* Wait for command complete event */
|
||||
err = read_hci_event(fd, rsp, HCI_MAX_EVENT_SIZE);
|
||||
if ( err < 0) {
|
||||
@@ -1534,16 +1576,7 @@ int qca_soc_init(int fd, char *bdaddr)
|
||||
nvm_file_path = ROME_NVM_TLV_3_0_0_PATH;
|
||||
|
||||
download:
|
||||
- /* Donwload TLV files (rampatch, NVM) */
|
||||
- err = rome_download_tlv_file(fd);
|
||||
- if (err < 0) {
|
||||
- fprintf(stderr, "%s: Download TLV file failed!\n", __FUNCTION__);
|
||||
- goto error;
|
||||
- }
|
||||
- fprintf(stderr, "%s: Download TLV file successfully \n", __FUNCTION__);
|
||||
-
|
||||
- /* Change baud rate back to user requested */
|
||||
- fprintf(stderr, "Changing baud rate back from 3M --> 115K\n");
|
||||
+ /* Change baud rate 115.2 kbps to 3Mbps*/
|
||||
err = rome_set_baudrate_req(fd);
|
||||
if (err < 0) {
|
||||
fprintf(stderr, "%s: Baud rate change failed!\n", __FUNCTION__);
|
||||
@@ -1551,13 +1584,13 @@ download:
|
||||
}
|
||||
fprintf(stderr, "%s: Baud rate changed successfully \n", __FUNCTION__);
|
||||
|
||||
- fprintf(stderr, "%s: Disabling In Band Sleep functionality\n", __FUNCTION__);
|
||||
- err = rome_disable_sleep(fd);
|
||||
+ /* Donwload TLV files (rampatch, NVM) */
|
||||
+ err = rome_download_tlv_file(fd);
|
||||
if (err < 0) {
|
||||
- fprintf(stderr, "%s: Failed to disable IBS!\n", __FUNCTION__);
|
||||
+ fprintf(stderr, "%s: Download TLV file failed!\n", __FUNCTION__);
|
||||
goto error;
|
||||
}
|
||||
- fprintf(stderr, "%s: IBS disabled successfully \n", __FUNCTION__);
|
||||
+ fprintf(stderr, "%s: Download TLV file successfully \n", __FUNCTION__);
|
||||
|
||||
/* Perform HCI reset here*/
|
||||
err = rome_hci_reset_req(fd);
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
From: Anantha Krishnan <ananthk@codeaurora.org>
|
||||
Date: Tue, 30 Sep 2014 12:13:00 +0530
|
||||
Subject: [PATCH] bluetooth: Check TTY buffer for data availability before
|
||||
reading
|
||||
|
||||
When operating at higher baud rates check the TTY buffer for
|
||||
availability of data before proceeding to read. Call select() with
|
||||
a 3 sec timeout value to check for the availablitiy of data.
|
||||
select() will return once data is available in the TTY buffers
|
||||
and will allow read() to fetch the data. If data is not available
|
||||
in the TTY buffer until the timeout valueexpires, do not proceed
|
||||
to read the data from the TTY buffers as there is none.
|
||||
|
||||
Occasionally corrupt data is received on UART lines while we wait
|
||||
for vendor specific event from Controller. Expected vendor specific
|
||||
events are received after the corrupt data. But we do not retry
|
||||
and exit and this causes firmware download failures. So, retry once
|
||||
if we did not get HCI event.
|
||||
|
||||
Change-Id: I3b672a7762403690f8b934ca216492f16285e8da
|
||||
Signed-off-by: Rupesh Tatiya <rtatiya@codeaurora.org>
|
||||
---
|
||||
tools/hciattach.c | 20 ++++++++++++-
|
||||
tools/hciattach_rome.c | 77 +++++++++++++++++++++++++++++++++++++++-----------
|
||||
tools/hciattach_rome.h | 3 ++
|
||||
3 files changed, 83 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/tools/hciattach.c b/tools/hciattach.c
|
||||
index 3041e28ff82a..13f073325c43 100644
|
||||
--- a/tools/hciattach.c
|
||||
+++ b/tools/hciattach.c
|
||||
@@ -163,16 +163,34 @@ int read_hci_event(int fd, unsigned char* buf, int size)
|
||||
{
|
||||
int remain, r;
|
||||
int count = 0;
|
||||
+ fd_set infids;
|
||||
+ struct timeval timeout;
|
||||
|
||||
if (size <= 0)
|
||||
return -1;
|
||||
|
||||
+ FD_ZERO (&infids);
|
||||
+ FD_SET (fd, &infids);
|
||||
+ timeout.tv_sec = 3;
|
||||
+ timeout.tv_usec = 0;
|
||||
+
|
||||
+ /* Check whether data is available in TTY buffer before calling read() */
|
||||
+ if (select (fd + 1, &infids, NULL, NULL, &timeout) < 1) {
|
||||
+ fprintf(stderr, "%s: Timing out on select for 3 secs.\n", __FUNCTION__);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ else
|
||||
+ fprintf(stderr, "%s: Data(HCI-CMD-COMP-EVENT) available in TTY Serial buffer\n", __FUNCTION__);
|
||||
+
|
||||
/* The first byte identifies the packet type. For HCI event packets, it
|
||||
* should be 0x04, so we read until we get to the 0x04. */
|
||||
while (1) {
|
||||
r = read(fd, buf, 1);
|
||||
- if (r <= 0)
|
||||
+ if (r <= 0) {
|
||||
+ fprintf(stderr, "%s: read() failed with return value: %d\n",
|
||||
+ __FUNCTION__, r);
|
||||
return -1;
|
||||
+ }
|
||||
if (buf[0] == 0x04)
|
||||
break;
|
||||
}
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index d0e2935b9997..d2687b1ef01a 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -326,42 +326,87 @@ failed:
|
||||
}
|
||||
|
||||
|
||||
+int wait_for_data(int fd, int maxTimeOut)
|
||||
+{
|
||||
+ fd_set infids;
|
||||
+ struct timeval timeout;
|
||||
+
|
||||
+ if (maxTimeOut <= 0) {
|
||||
+ fprintf(stderr, "%s: Invalid timeout value specified", __func__);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ FD_ZERO (&infids);
|
||||
+ FD_SET (fd, &infids);
|
||||
+ timeout.tv_sec = maxTimeOut;
|
||||
+ timeout.tv_usec = 0;
|
||||
+
|
||||
+ /* Check whether data is available in TTY buffer before calling read() */
|
||||
+ if (select (fd + 1, &infids, NULL, NULL, &timeout) < 1) {
|
||||
+ fprintf(stderr, "%s: Timing out on select for %d secs.\n", __FUNCTION__, maxTimeOut);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ else
|
||||
+ fprintf(stderr, "%s: HCI-VS-EVENT available in TTY Serial buffer\n",
|
||||
+ __FUNCTION__);
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* Read an VS HCI event from the given file descriptor.
|
||||
*/
|
||||
int read_vs_hci_event(int fd, unsigned char* buf, int size)
|
||||
{
|
||||
- int remain, r;
|
||||
+ int remain, r, retry = 0;
|
||||
int count = 0;
|
||||
- fd_set infids;
|
||||
- struct timeval timeout;
|
||||
|
||||
if (size <= 0) {
|
||||
fprintf(stderr, "Invalid size arguement!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
- fprintf(stderr, "%s: Wait for HCI-Vendor Specfic Event from SOC\n", __FUNCTION__);
|
||||
-
|
||||
- FD_ZERO (&infids);
|
||||
- FD_SET (fd, &infids);
|
||||
- timeout.tv_sec = 3;
|
||||
- timeout.tv_usec = 0; /* half second is a long time at 115.2 Kbps */
|
||||
+ fprintf(stderr, "%s: Wait for HCI-Vendor Specfic Event from SOC\n",
|
||||
+ __FUNCTION__);
|
||||
|
||||
- if (select (fd + 1, &infids, NULL, NULL, &timeout) < 1)
|
||||
- fprintf(stderr, "%s: Timing out on select for 3 secs.\n", __FUNCTION__);
|
||||
- else
|
||||
- fprintf(stderr, "%s: Data available in TTY Serial buffer\n", __FUNCTION__);
|
||||
+ /* Check whether data is available in TTY buffer before calling read() */
|
||||
+ if (wait_for_data(fd, SELECT_TIMEOUT) < 1)
|
||||
+ return -1;
|
||||
|
||||
/* The first byte identifies the packet type. For HCI event packets, it
|
||||
* should be 0x04, so we read until we get to the 0x04. */
|
||||
/* It will keep reading until find 0x04 byte */
|
||||
while (1) {
|
||||
+ /* Read UART Buffer for HCI-DATA */
|
||||
r = read(fd, buf, 1);
|
||||
- if (r <= 0)
|
||||
- return -1;
|
||||
- if (buf[0] == 0x04)
|
||||
+ if (r <= 0) {
|
||||
+ fprintf(stderr, "%s: read() failed. error: %d\n",
|
||||
+ __FUNCTION__, r);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ /* Check if received data is HCI-DATA or not.
|
||||
+ * If not HCI-DATA, then retry reading the UART Buffer once.
|
||||
+ * Sometimes there could be corruption on the UART lines and to
|
||||
+ * avoid that retry once reading the UART Buffer for HCI-DATA.
|
||||
+ */
|
||||
+ if (buf[0] == 0x04) { /* Recvd. HCI DATA */
|
||||
+ retry = 0;
|
||||
break;
|
||||
+ }
|
||||
+ else if (retry < MAX_RETRY_CNT){ /* Retry mechanism */
|
||||
+ retry++;
|
||||
+ fprintf(stderr, "%s: Not an HCI-VS-Event! buf[0]: %d",
|
||||
+ __FUNCTION__, buf[0]);
|
||||
+ if (wait_for_data(fd, SELECT_TIMEOUT) < 1)
|
||||
+ return -1;
|
||||
+ else /* Data available in UART Buffer: Continue to read */
|
||||
+ continue;
|
||||
+ }
|
||||
+ else { /* RETRY failed : Exiting with failure */
|
||||
+ fprintf(stderr, "%s: RETRY failed!", __FUNCTION__);
|
||||
+ return -1;
|
||||
+ }
|
||||
}
|
||||
count++;
|
||||
|
||||
diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h
|
||||
index a4abe9f73080..3efb71995c45 100644
|
||||
--- a/tools/hciattach_rome.h
|
||||
+++ b/tools/hciattach_rome.h
|
||||
@@ -179,6 +179,9 @@ typedef struct
|
||||
#define TAG_NUM_2 2
|
||||
#define TAG_BDADDR_OFFSET 7
|
||||
|
||||
+#define MAX_RETRY_CNT 1
|
||||
+#define SELECT_TIMEOUT 3
|
||||
+
|
||||
/* NVM Tags specifically used for ROME 1.0 */
|
||||
#define ROME_1_0_100022_1 0x101000221
|
||||
#define ROME_1_0_100019 0x101000190
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
From: Anantha Krishnan <ananthk@codeaurora.org>
|
||||
Date: Wed, 20 Aug 2014 12:13:19 +0530
|
||||
Subject: [PATCH] bluetooth : Add support for TUFEELO firmware download
|
||||
|
||||
Add TUFELLO chip version to allow firmware download.
|
||||
|
||||
Change-Id: Ie3760fa64e8345bf9a84b2f047fde0ac1003b393
|
||||
---
|
||||
tools/hciattach_rome.c | 5 ++++-
|
||||
tools/hciattach_rome.h | 3 ++-
|
||||
2 files changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index d2687b1ef01a..84dfc97b5140 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -1616,9 +1616,12 @@ int qca_soc_init(int fd, char *bdaddr)
|
||||
nvm_file_path = ROME_NVM_TLV_2_0_1_PATH;
|
||||
goto download;
|
||||
case ROME_VER_3_0:
|
||||
- case TUFELLO_VER_1_0:
|
||||
rampatch_file_path = ROME_RAMPATCH_TLV_3_0_0_PATH;
|
||||
nvm_file_path = ROME_NVM_TLV_3_0_0_PATH;
|
||||
+ goto download;
|
||||
+ case TUFELLO_VER_1_0:
|
||||
+ rampatch_file_path = TF_RAMPATCH_TLV_1_0_0_PATH;
|
||||
+ nvm_file_path = TF_NVM_TLV_1_0_0_PATH;
|
||||
|
||||
download:
|
||||
/* Change baud rate 115.2 kbps to 3Mbps*/
|
||||
diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h
|
||||
index 3efb71995c45..9d18c576fcae 100644
|
||||
--- a/tools/hciattach_rome.h
|
||||
+++ b/tools/hciattach_rome.h
|
||||
@@ -204,7 +204,8 @@ typedef struct
|
||||
#define ROME_NVM_TLV_2_0_1_PATH "/lib/firmware/nvm_tlv_2.1.bin"
|
||||
#define ROME_RAMPATCH_TLV_3_0_0_PATH "/lib/firmware/qca/rampatch_tlv_3.0.tlv"
|
||||
#define ROME_NVM_TLV_3_0_0_PATH "/lib/firmware/qca/nvm_tlv_3.0.bin"
|
||||
-
|
||||
+#define TF_RAMPATCH_TLV_1_0_0_PATH "/lib/firmware/rampatch_tlv_tf_1.0.tlv"
|
||||
+#define TF_NVM_TLV_1_0_0_PATH "/lib/firmware/nvm_tlv_tf_1.0.bin"
|
||||
|
||||
/******************************************************************************
|
||||
** Local type definitions
|
||||
|
|
@ -0,0 +1,236 @@
|
|||
From: Anantha Krishnan <ananthk@codeaurora.org>
|
||||
Date: Mon, 8 Dec 2014 14:52:16 +0530
|
||||
Subject: [PATCH] bluetooth: Add support for ROME 3.2 SOC.
|
||||
|
||||
Add firmware download support for ROME 3.2 version. As part
|
||||
of this, the Bluetooth on time is optimized based on event
|
||||
handling while downloading rampatch files.From ROME 3.2 onwards,
|
||||
the VS and command complete events will be sent depending the flag
|
||||
indication present in the header. HOST can wait for VS and command
|
||||
complete events only if specified in the header info. This greatly
|
||||
reduces the time spent by HOST in waiting for 2 events from the
|
||||
Controller before downloading each segment of the RAMPATCH file
|
||||
|
||||
Change-Id: I9c4227a7a529455f4d120b2c9d065f3ec6b439e9
|
||||
---
|
||||
tools/hciattach_rome.c | 104 ++++++++++++++++++++++++++++++++++++++++++-------
|
||||
tools/hciattach_rome.h | 16 +++++++-
|
||||
2 files changed, 103 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index 84dfc97b5140..c6d528f118e1 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -62,9 +62,11 @@ unsigned char *pdata_buffer = NULL;
|
||||
patch_info rampatch_patch_info;
|
||||
int rome_ver = ROME_VER_UNKNOWN;
|
||||
unsigned char gTlv_type;
|
||||
+unsigned char gtlv_dwndcfg;
|
||||
char *rampatch_file_path;
|
||||
char *nvm_file_path;
|
||||
vnd_userial_cb_t vnd_userial;
|
||||
+unsigned char wait_vsc_evt = TRUE;
|
||||
/******************************************************************************
|
||||
** Extern variables
|
||||
******************************************************************************/
|
||||
@@ -455,14 +457,16 @@ int hci_send_vs_cmd(int fd, unsigned char *cmd, unsigned char *rsp, int size)
|
||||
goto failed;
|
||||
}
|
||||
|
||||
- /* Check for response from the Controller */
|
||||
- if (read_vs_hci_event(fd, rsp, HCI_MAX_EVENT_SIZE) < 0) {
|
||||
- ret = -ETIMEDOUT;
|
||||
- fprintf(stderr, "%s: Failed to get HCI-VS Event from SOC\n", __FUNCTION__);
|
||||
- goto failed;
|
||||
+ if (wait_vsc_evt) {
|
||||
+ /* Check for response from the Controller */
|
||||
+ if (read_vs_hci_event(fd, rsp, HCI_MAX_EVENT_SIZE) < 0) {
|
||||
+ ret = -ETIMEDOUT;
|
||||
+ fprintf(stderr, "%s: Failed to get HCI-VS Event from SOC\n", __FUNCTION__);
|
||||
+ goto failed;
|
||||
+ }
|
||||
+ fprintf(stderr, "%s: Received HCI-Vendor Specific Event from SOC\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
- fprintf(stderr, "%s: Received HCI-Vendor Specific Event from SOC\n", __FUNCTION__);
|
||||
failed:
|
||||
return ret;
|
||||
}
|
||||
@@ -903,6 +907,7 @@ int rome_get_tlv_file(char *file_path)
|
||||
|
||||
/* To handle different event between rampatch and NVM */
|
||||
gTlv_type = ptlv_header->tlv_type;
|
||||
+ gtlv_dwndcfg = ptlv_header->tlv.patch.dwnd_cfg;
|
||||
|
||||
if(ptlv_header->tlv_type == TLV_TYPE_PATCH){
|
||||
fprintf(stderr, "====================================================\n");
|
||||
@@ -914,6 +919,7 @@ int rome_get_tlv_file(char *file_path)
|
||||
fprintf(stderr, "Patch Data Length\t\t\t : %d bytes\n",ptlv_header->tlv.patch.tlv_patch_data_len);
|
||||
fprintf(stderr, "Signing Format Version\t : 0x%x\n", ptlv_header->tlv.patch.sign_ver);
|
||||
fprintf(stderr, "Signature Algorithm\t\t : 0x%x\n", ptlv_header->tlv.patch.sign_algorithm);
|
||||
+ fprintf(stderr, "Event Handling\t\t\t : 0x%x", ptlv_header->tlv.patch.dwnd_cfg);
|
||||
fprintf(stderr, "Reserved\t\t\t : 0x%x\n", ptlv_header->tlv.patch.reserved1);
|
||||
fprintf(stderr, "Product ID\t\t\t : 0x%04x\n", ptlv_header->tlv.patch.prod_id);
|
||||
fprintf(stderr, "Rom Build Version\t\t : 0x%04x\n", ptlv_header->tlv.patch.build_ver);
|
||||
@@ -1023,19 +1029,83 @@ int rome_tlv_dnld_req(int fd, int tlv_size)
|
||||
fprintf(stderr, "%s: TLV size: %d, Total Seg num: %d, remain size: %d\n",
|
||||
__FUNCTION__,tlv_size, total_segment, remain_size);
|
||||
|
||||
- for(i=0;i<total_segment ;i++){
|
||||
- /* In case of ROME 1.1, last rampatch segment command will not wait for
|
||||
- command complete event */
|
||||
- wait_cc_evt = ((rome_ver >= ROME_VER_1_1) && (gTlv_type == TLV_TYPE_PATCH )
|
||||
- && !remain_size && ((i+1) == total_segment))? FALSE: TRUE;
|
||||
+ if (gTlv_type == TLV_TYPE_PATCH) {
|
||||
+ /* Prior to Rome version 3.2(including inital few rampatch release of
|
||||
+ * Rome 3.2), the event handling mechanism is ROME_SKIP_EVT_NONE. After
|
||||
+ * few release of rampatch for Rome 3.2, the mechamism is changed to
|
||||
+ * ROME_SKIP_EVT_VSE_CC. Rest of the mechanism is not used for now
|
||||
+ */
|
||||
+ switch(gtlv_dwndcfg)
|
||||
+ {
|
||||
+ case ROME_SKIP_EVT_NONE:
|
||||
+ wait_vsc_evt = TRUE;
|
||||
+ wait_cc_evt = TRUE;
|
||||
+ fprintf(stderr, "%s: Event handling type: ROME_SKIP_EVT_NONE", __func__);
|
||||
+ break;
|
||||
+ case ROME_SKIP_EVT_VSE_CC:
|
||||
+ wait_vsc_evt = FALSE;
|
||||
+ wait_cc_evt = FALSE;
|
||||
+ fprintf(stderr, "%s: Event handling type: ROME_SKIP_EVT_VSE_CC", __func__);
|
||||
+ break;
|
||||
+ /* Not handled for now */
|
||||
+ case ROME_SKIP_EVT_VSE:
|
||||
+ case ROME_SKIP_EVT_CC:
|
||||
+ default:
|
||||
+ fprintf(stderr, "%s: Unsupported Event handling: %d", __func__, gtlv_dwndcfg);
|
||||
+ break;
|
||||
+ }
|
||||
+ } else {
|
||||
+ wait_vsc_evt = TRUE;
|
||||
+ wait_cc_evt = TRUE;
|
||||
+ }
|
||||
+
|
||||
+ for(i = 0; i < total_segment; i++) {
|
||||
+ if((i+1) == total_segment) {
|
||||
+ if ((rome_ver >= ROME_VER_1_1) && (rome_ver < ROME_VER_3_2) &&
|
||||
+ (gTlv_type == TLV_TYPE_PATCH)) {
|
||||
+ /* If the Rome version is from 1.1 to 3.1
|
||||
+ * 1. No CCE for the last command segment but all other segment
|
||||
+ * 2. All the command segments get VSE including the last one
|
||||
+ */
|
||||
+ wait_cc_evt = !remain_size ? FALSE: TRUE;
|
||||
+ } else if ((rome_ver == ROME_VER_3_2) && (gTlv_type == TLV_TYPE_PATCH)) {
|
||||
+ /* If the Rome version is 3.2
|
||||
+ * 1. None of the command segments receive CCE
|
||||
+ * 2. No command segments receive VSE except the last one
|
||||
+ * 3. If gtlv_dwndcfg is ROME_SKIP_EVT_NONE then the logic is
|
||||
+ * same as Rome 2.1, 2.2, 3.0
|
||||
+ */
|
||||
+ if (gtlv_dwndcfg == ROME_SKIP_EVT_NONE) {
|
||||
+ wait_cc_evt = !remain_size ? FALSE: TRUE;
|
||||
+ } else if (gtlv_dwndcfg == ROME_SKIP_EVT_VSE_CC) {
|
||||
+ wait_vsc_evt = !remain_size ? TRUE: FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if((err = rome_tlv_dnld_segment(fd, i, MAX_SIZE_PER_TLV_SEGMENT, wait_cc_evt )) < 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
- /* In case remain data still remain, last rampatch segment command will not wait
|
||||
- for command complete event here */
|
||||
- wait_cc_evt = ((rome_ver >= ROME_VER_1_1) && (gTlv_type == TLV_TYPE_PATCH )
|
||||
- && remain_size )? FALSE:TRUE;
|
||||
+ if ((rome_ver >= ROME_VER_1_1) && (rome_ver < ROME_VER_3_2) && (gTlv_type == TLV_TYPE_PATCH)) {
|
||||
+ /* If the Rome version is from 1.1 to 3.1
|
||||
+ * 1. No CCE for the last command segment but all other segment
|
||||
+ * 2. All the command segments get VSE including the last one
|
||||
+ */
|
||||
+ wait_cc_evt = remain_size ? FALSE: TRUE;
|
||||
+ } else if ((rome_ver == ROME_VER_3_2) && (gTlv_type == TLV_TYPE_PATCH)) {
|
||||
+ /* If the Rome version is 3.2
|
||||
+ * 1. None of the command segments receive CCE
|
||||
+ * 2. No command segments receive VSE except the last one
|
||||
+ * 3. If gtlv_dwndcfg is ROME_SKIP_EVT_NONE then the logic is
|
||||
+ * same as Rome 2.1, 2.2, 3.0
|
||||
+ */
|
||||
+ if (gtlv_dwndcfg == ROME_SKIP_EVT_NONE) {
|
||||
+ wait_cc_evt = remain_size ? FALSE: TRUE;
|
||||
+ } else if (gtlv_dwndcfg == ROME_SKIP_EVT_VSE_CC) {
|
||||
+ wait_vsc_evt = remain_size ? TRUE: FALSE;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
if(remain_size) err =rome_tlv_dnld_segment(fd, i, remain_size, wait_cc_evt);
|
||||
|
||||
@@ -1619,6 +1689,10 @@ int qca_soc_init(int fd, char *bdaddr)
|
||||
rampatch_file_path = ROME_RAMPATCH_TLV_3_0_0_PATH;
|
||||
nvm_file_path = ROME_NVM_TLV_3_0_0_PATH;
|
||||
goto download;
|
||||
+ case ROME_VER_3_2:
|
||||
+ rampatch_file_path = ROME_RAMPATCH_TLV_3_0_2_PATH;
|
||||
+ nvm_file_path = ROME_NVM_TLV_3_0_2_PATH;
|
||||
+ goto download;
|
||||
case TUFELLO_VER_1_0:
|
||||
rampatch_file_path = TF_RAMPATCH_TLV_1_0_0_PATH;
|
||||
nvm_file_path = TF_NVM_TLV_1_0_0_PATH;
|
||||
diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h
|
||||
index 9d18c576fcae..77e85e7e7b19 100644
|
||||
--- a/tools/hciattach_rome.h
|
||||
+++ b/tools/hciattach_rome.h
|
||||
@@ -204,9 +204,17 @@ typedef struct
|
||||
#define ROME_NVM_TLV_2_0_1_PATH "/lib/firmware/nvm_tlv_2.1.bin"
|
||||
#define ROME_RAMPATCH_TLV_3_0_0_PATH "/lib/firmware/qca/rampatch_tlv_3.0.tlv"
|
||||
#define ROME_NVM_TLV_3_0_0_PATH "/lib/firmware/qca/nvm_tlv_3.0.bin"
|
||||
+#define ROME_RAMPATCH_TLV_3_0_2_PATH "/lib/firmware/qca/rampatch_tlv_3.2.tlv"
|
||||
+#define ROME_NVM_TLV_3_0_2_PATH "/lib/firmware/qca/nvm_tlv_3.2.bin"
|
||||
#define TF_RAMPATCH_TLV_1_0_0_PATH "/lib/firmware/rampatch_tlv_tf_1.0.tlv"
|
||||
#define TF_NVM_TLV_1_0_0_PATH "/lib/firmware/nvm_tlv_tf_1.0.bin"
|
||||
|
||||
+/* This header value in rampatch file decides event handling mechanism in the HOST */
|
||||
+#define ROME_SKIP_EVT_NONE 0x00
|
||||
+#define ROME_SKIP_EVT_VSE 0x01
|
||||
+#define ROME_SKIP_EVT_CC 0x02
|
||||
+#define ROME_SKIP_EVT_VSE_CC 0x03
|
||||
+
|
||||
/******************************************************************************
|
||||
** Local type definitions
|
||||
******************************************************************************/
|
||||
@@ -251,7 +259,8 @@ typedef struct {
|
||||
unsigned int tlv_patch_data_len;
|
||||
unsigned char sign_ver;
|
||||
unsigned char sign_algorithm;
|
||||
- unsigned short reserved1;
|
||||
+ unsigned char dwnd_cfg;
|
||||
+ unsigned char reserved1;
|
||||
unsigned short prod_id;
|
||||
unsigned short build_ver;
|
||||
unsigned short patch_ver;
|
||||
@@ -306,7 +315,8 @@ enum{
|
||||
ROME_PATCH_VER_0100 = 0x0100,
|
||||
ROME_PATCH_VER_0101 = 0x0101,
|
||||
ROME_PATCH_VER_0200 = 0x0200,
|
||||
- ROME_PATCH_VER_0300 = 0x0300
|
||||
+ ROME_PATCH_VER_0300 = 0x0300,
|
||||
+ ROME_PATCH_VER_0302 = 0x0302
|
||||
};
|
||||
|
||||
enum{
|
||||
@@ -314,6 +324,7 @@ enum{
|
||||
ROME_SOC_ID_11 = 0x00000011,
|
||||
ROME_SOC_ID_13 = 0x00000013,
|
||||
ROME_SOC_ID_22 = 0x00000022,
|
||||
+ ROME_SOC_ID_44 = 0x00000044
|
||||
};
|
||||
|
||||
enum{
|
||||
@@ -323,6 +334,7 @@ enum{
|
||||
ROME_VER_1_3 = ((ROME_PATCH_VER_0200 << 16 ) | ROME_SOC_ID_00 ),
|
||||
ROME_VER_2_1 = ((ROME_PATCH_VER_0200 << 16 ) | ROME_SOC_ID_11 ),
|
||||
ROME_VER_3_0 = ((ROME_PATCH_VER_0300 << 16 ) | ROME_SOC_ID_22 ),
|
||||
+ ROME_VER_3_2 = ((ROME_PATCH_VER_0302 << 16 ) | ROME_SOC_ID_44 ),
|
||||
TUFELLO_VER_1_0 = ((ROME_PATCH_VER_0300 << 16 ) | ROME_SOC_ID_13 )
|
||||
};
|
||||
#endif /* HW_ROME_H */
|
||||
|
|
@ -0,0 +1,189 @@
|
|||
From: Anantha Krishnan <ananthk@codeaurora.org>
|
||||
Date: Thu, 4 Dec 2014 17:23:58 +0530
|
||||
Subject: [PATCH] bluetooth: Use correct TTY ioctl calls for flow control
|
||||
operations
|
||||
|
||||
BT firmware download application is using incorrect APIs for
|
||||
performing flow off and flow on operations. As a result, the local
|
||||
UART Controller is detecting breaks errors on the UART HW lines.
|
||||
|
||||
Appliaction should use TIOCMGET and TIOCMSET ioctl()'s for flow
|
||||
control operations instead of the tcsetattr() call. Also, the
|
||||
application should set the value of "number of bits per character"
|
||||
value to 8 and not as 5.
|
||||
|
||||
Due to incorrect APIs used for flow control operation and wrong
|
||||
value configured for CSIZE parameter, the local UART Controller
|
||||
detected break errors on the UART HW lines. This caused the
|
||||
firmware download operation to fail and resulted in BT ON failure.
|
||||
|
||||
Change-Id: Id0ac1276609eceb528163860cc87267aaa50fede
|
||||
---
|
||||
tools/hciattach_rome.c | 67 +++++++++++++++++++++++++++++++++-----------------
|
||||
tools/hciattach_rome.h | 6 +++--
|
||||
2 files changed, 49 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index c6d528f118e1..1e689273b851 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
- * Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution.
|
||||
*
|
||||
* Copyright 2012 The Android Open Source Project
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
#define LOG_TAG "bt_vendor"
|
||||
#include <stdio.h>
|
||||
+#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -139,6 +140,16 @@ void userial_vendor_set_baud(unsigned char userial_baud)
|
||||
unsigned int tcio_baud;
|
||||
fprintf(stderr, "## userial_vendor_set_baud: %d\n", userial_baud);
|
||||
|
||||
+ if (tcgetattr(vnd_userial.fd, &vnd_userial.termios) < 0) {
|
||||
+ perror("Can't get port settings");
|
||||
+ return;
|
||||
+ }
|
||||
+ cfmakeraw(&vnd_userial.termios);
|
||||
+ vnd_userial.termios.c_cflag |= CLOCAL;
|
||||
+ vnd_userial.termios.c_cflag |= CREAD;
|
||||
+ vnd_userial.termios.c_cflag |= CS8;
|
||||
+ tcsetattr(vnd_userial.fd, TCSANOW, &vnd_userial.termios);
|
||||
+
|
||||
userial_to_tcio_baud(userial_baud, &tcio_baud);
|
||||
|
||||
cfsetospeed(&vnd_userial.termios, tcio_baud);
|
||||
@@ -169,6 +180,7 @@ int userial_vendor_ioctl(int fd, userial_vendor_ioctl_op_t op, int *p_data)
|
||||
cfmakeraw(&ti);
|
||||
ti.c_cflag |= CLOCAL;
|
||||
ti.c_cflag |= CREAD;
|
||||
+ ti.c_cflag |= CS8;
|
||||
|
||||
switch(op)
|
||||
{
|
||||
@@ -1445,6 +1457,29 @@ error:
|
||||
|
||||
}
|
||||
|
||||
+static void flow_control(int fd, int opt)
|
||||
+{
|
||||
+ struct termios c_opt;
|
||||
+
|
||||
+ ioctl(fd, TIOCMGET, &c_opt);
|
||||
+ c_opt.c_cc[VTIME] = 0; /* inter-character timer unused */
|
||||
+ c_opt.c_cc[VMIN] = 0; /* blocking read until 8 chars received */
|
||||
+ c_opt.c_cflag &= ~CSIZE;
|
||||
+ c_opt.c_cflag |= (CS8 | CLOCAL | CREAD);
|
||||
+ if (MSM_ENABLE_FLOW_CTRL)
|
||||
+ c_opt.c_cflag |= CRTSCTS;
|
||||
+ else if (MSM_DISABLE_FLOW_CTRL)
|
||||
+ c_opt.c_cflag |= ~CRTSCTS;
|
||||
+ else {
|
||||
+ fprintf(stderr, "%s: Incorrect option passed for TIOCMSET\n", __func__);
|
||||
+ return;
|
||||
+ }
|
||||
+ c_opt.c_iflag = IGNPAR;
|
||||
+ c_opt.c_oflag = 0;
|
||||
+ c_opt.c_lflag = 0;
|
||||
+ ioctl(fd, TIOCMSET, &c_opt);
|
||||
+}
|
||||
+
|
||||
|
||||
int rome_set_baudrate_req(int fd)
|
||||
{
|
||||
@@ -1464,12 +1499,10 @@ int rome_set_baudrate_req(int fd)
|
||||
|
||||
/* Total length of the packet to be sent to the Controller */
|
||||
size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + VSC_SET_BAUDRATE_REQ_LEN);
|
||||
+
|
||||
/* Flow off during baudrate change */
|
||||
- if ((err = userial_vendor_ioctl(fd, USERIAL_OP_FLOW_OFF , &flags)) < 0)
|
||||
- {
|
||||
- fprintf(stderr, "%s: HW Flow-off error: 0x%x\n", __FUNCTION__, err);
|
||||
- goto error;
|
||||
- }
|
||||
+ flow_control(fd, MSM_DISABLE_FLOW_CTRL);
|
||||
+
|
||||
/* Send the HCI command packet to UART for transmission */
|
||||
fprintf(stderr, "%s: HCI CMD: 0x%x 0x%x 0x%x 0x%x 0x%x\n", __FUNCTION__, cmd[0], cmd[1], cmd[2], cmd[3],cmd[4]) ;
|
||||
err = write(fd, cmd, size);
|
||||
@@ -1481,11 +1514,8 @@ int rome_set_baudrate_req(int fd)
|
||||
userial_vendor_set_baud(USERIAL_BAUD_3M);
|
||||
|
||||
/* Flow on after changing local uart baudrate */
|
||||
- if ((err = userial_vendor_ioctl(fd, USERIAL_OP_FLOW_ON , &flags)) < 0)
|
||||
- {
|
||||
- fprintf(stderr, "%s: HW Flow-on error: 0x%x \n", __FUNCTION__, err);
|
||||
- return err;
|
||||
- }
|
||||
+ flow_control(fd, MSM_ENABLE_FLOW_CTRL);
|
||||
+
|
||||
/* Check for response from the Controller */
|
||||
if ((err =read_vs_hci_event(fd, rsp, HCI_MAX_EVENT_SIZE)) < 0) {
|
||||
fprintf(stderr, "%s: Failed to get HCI-VS Event from SOC\n", __FUNCTION__);
|
||||
@@ -1528,11 +1558,8 @@ int rome_hci_reset_req(int fd)
|
||||
size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE);
|
||||
|
||||
/* Flow off during baudrate change */
|
||||
- if ((err = userial_vendor_ioctl(fd, USERIAL_OP_FLOW_OFF , &flags)) < 0)
|
||||
- {
|
||||
- fprintf(stderr, "%s: HW Flow-off error: 0x%x\n", __FUNCTION__, err);
|
||||
- goto error;
|
||||
- }
|
||||
+ flow_control(fd, MSM_DISABLE_FLOW_CTRL);
|
||||
+
|
||||
/* Send the HCI command packet to UART for transmission */
|
||||
fprintf(stderr, "%s: HCI CMD: 0x%x 0x%x 0x%x 0x%x\n", __FUNCTION__, cmd[0], cmd[1], cmd[2], cmd[3]);
|
||||
err = write(fd, cmd, size);
|
||||
@@ -1545,11 +1572,8 @@ int rome_hci_reset_req(int fd)
|
||||
userial_vendor_set_baud(USERIAL_BAUD_3M);
|
||||
|
||||
/* Flow on after changing local uart baudrate */
|
||||
- if ((err = userial_vendor_ioctl(fd, USERIAL_OP_FLOW_ON , &flags)) < 0)
|
||||
- {
|
||||
- fprintf(stderr, "%s: HW Flow-on error: 0x%x \n", __FUNCTION__, err);
|
||||
- return err;
|
||||
- }
|
||||
+ flow_control(fd, MSM_ENABLE_FLOW_CTRL);
|
||||
+
|
||||
/* Wait for command complete event */
|
||||
err = read_hci_event(fd, rsp, HCI_MAX_EVENT_SIZE);
|
||||
if ( err < 0) {
|
||||
@@ -1616,7 +1640,6 @@ int qca_soc_init(int fd, char *bdaddr)
|
||||
int err = -1;
|
||||
int size;
|
||||
|
||||
- fprintf(stderr, " %s \n", __FUNCTION__);
|
||||
vnd_userial.fd = fd;
|
||||
/* Get Rome version information */
|
||||
if((err = rome_patch_ver_req(fd)) <0){
|
||||
diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h
|
||||
index 77e85e7e7b19..ef3647e6a69b 100644
|
||||
--- a/tools/hciattach_rome.h
|
||||
+++ b/tools/hciattach_rome.h
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
- * Copyright 2012 The Android Open Source Project
|
||||
- * Copyright (c) 2013, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution.
|
||||
+ * Copyright 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -40,6 +40,8 @@
|
||||
#define NVITEM_SIZE 2
|
||||
#define PERSIST_HEADER_LEN 3
|
||||
#define BD_ADDR_LEN 6
|
||||
+#define MSM_ENABLE_FLOW_CTRL 16
|
||||
+#define MSM_DISABLE_FLOW_CTRL 17
|
||||
|
||||
unsigned char vnd_local_bd_addr[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
typedef enum {
|
||||
|
|
@ -0,0 +1,256 @@
|
|||
From: Anantha Krishnan <ananthk@codeaurora.org>
|
||||
Date: Tue, 20 Jan 2015 12:43:20 +0530
|
||||
Subject: [PATCH] bluetooth: Add support for multi baud rate
|
||||
|
||||
Currently BT operates only at 3M baud rate. Provide option
|
||||
to configure the pre-defined baud rate values as supported by the
|
||||
target platform.
|
||||
|
||||
Change-Id: I4bbaf7db01ffb983c38dca7c4a4a56f579c678a8
|
||||
---
|
||||
tools/hciattach.c | 2 +-
|
||||
tools/hciattach.h | 2 +-
|
||||
tools/hciattach_rome.c | 109 ++++++++++++++++++++++++++++++++++++++++++-------
|
||||
tools/hciattach_rome.h | 23 +++++++++++
|
||||
4 files changed, 119 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/tools/hciattach.c b/tools/hciattach.c
|
||||
index 13f073325c43..6de4129dfd8f 100644
|
||||
--- a/tools/hciattach.c
|
||||
+++ b/tools/hciattach.c
|
||||
@@ -340,7 +340,7 @@ static int ath3k_pm(int fd, struct uart_t *u, struct termios *ti)
|
||||
static int qca(int fd, struct uart_t *u, struct termios *ti)
|
||||
{
|
||||
fprintf(stderr,"qca\n");
|
||||
- return qca_soc_init(fd, u->bdaddr);
|
||||
+ return qca_soc_init(fd, u->speed, u->bdaddr);
|
||||
}
|
||||
|
||||
static int qualcomm(int fd, struct uart_t *u, struct termios *ti)
|
||||
diff --git a/tools/hciattach.h b/tools/hciattach.h
|
||||
index 2021c33a9824..c5aa495ac3ee 100644
|
||||
--- a/tools/hciattach.h
|
||||
+++ b/tools/hciattach.h
|
||||
@@ -63,7 +63,7 @@ int ath3k_init(int fd, int speed, int init_speed, char *bdaddr,
|
||||
struct termios *ti);
|
||||
int ath3k_post(int fd, int pm);
|
||||
int qualcomm_init(int fd, int speed, struct termios *ti, const char *bdaddr);
|
||||
-int qca_soc_init(int fd, char *bdaddr);
|
||||
+int qca_soc_init(int fd, int speed, char *bdaddr);
|
||||
int intel_init(int fd, int init_speed, int *speed, struct termios *ti);
|
||||
int bcm43xx_init(int fd, int def_speed, int speed, struct termios *ti,
|
||||
const char *bdaddr);
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index 1e689273b851..37974290ae0a 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -1481,7 +1481,7 @@ static void flow_control(int fd, int opt)
|
||||
}
|
||||
|
||||
|
||||
-int rome_set_baudrate_req(int fd)
|
||||
+int rome_set_baudrate_req(int fd, int local_baud_rate, int controller_baud_rate)
|
||||
{
|
||||
int size, err = 0;
|
||||
unsigned char cmd[HCI_MAX_CMD_SIZE];
|
||||
@@ -1495,7 +1495,7 @@ int rome_set_baudrate_req(int fd)
|
||||
cmd[0] = HCI_COMMAND_PKT;
|
||||
cmd_hdr->opcode = cmd_opcode_pack(HCI_VENDOR_CMD_OGF, EDL_SET_BAUDRATE_CMD_OCF);
|
||||
cmd_hdr->plen = VSC_SET_BAUDRATE_REQ_LEN;
|
||||
- cmd[4] = BAUDRATE_3000000;
|
||||
+ cmd[4] = controller_baud_rate;
|
||||
|
||||
/* Total length of the packet to be sent to the Controller */
|
||||
size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + VSC_SET_BAUDRATE_REQ_LEN);
|
||||
@@ -1511,7 +1511,7 @@ int rome_set_baudrate_req(int fd)
|
||||
goto error;
|
||||
}
|
||||
/* Change Local UART baudrate to high speed UART */
|
||||
- userial_vendor_set_baud(USERIAL_BAUD_3M);
|
||||
+ userial_vendor_set_baud(local_baud_rate);
|
||||
|
||||
/* Flow on after changing local uart baudrate */
|
||||
flow_control(fd, MSM_ENABLE_FLOW_CTRL);
|
||||
@@ -1537,7 +1537,7 @@ error:
|
||||
}
|
||||
|
||||
|
||||
-int rome_hci_reset_req(int fd)
|
||||
+int rome_hci_reset_req(int fd, char baud)
|
||||
{
|
||||
int size, err = 0;
|
||||
unsigned char cmd[HCI_MAX_CMD_SIZE];
|
||||
@@ -1569,7 +1569,7 @@ int rome_hci_reset_req(int fd)
|
||||
}
|
||||
|
||||
/* Change Local UART baudrate to high speed UART */
|
||||
- userial_vendor_set_baud(USERIAL_BAUD_3M);
|
||||
+ userial_vendor_set_baud(baud);
|
||||
|
||||
/* Flow on after changing local uart baudrate */
|
||||
flow_control(fd, MSM_ENABLE_FLOW_CTRL);
|
||||
@@ -1635,10 +1635,69 @@ int read_bd_address(unsigned char *bdaddr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-int qca_soc_init(int fd, char *bdaddr)
|
||||
+int isSpeedValid(int speed, int *local_baud_rate, int *controller_baud_rate)
|
||||
+{
|
||||
+ switch(speed) {
|
||||
+ case 9600:
|
||||
+ *local_baud_rate = USERIAL_BAUD_9600;
|
||||
+ *controller_baud_rate = BAUDRATE_9600;
|
||||
+ break;
|
||||
+ case 19200:
|
||||
+ *local_baud_rate = USERIAL_BAUD_19200;
|
||||
+ *controller_baud_rate = BAUDRATE_19200;
|
||||
+ break;
|
||||
+ case 57600:
|
||||
+ *local_baud_rate = USERIAL_BAUD_57600;
|
||||
+ *controller_baud_rate = BAUDRATE_57600;
|
||||
+ break;
|
||||
+ case 115200:
|
||||
+ *local_baud_rate = USERIAL_BAUD_115200;
|
||||
+ *controller_baud_rate = BAUDRATE_115200;
|
||||
+ break;
|
||||
+ case 230400:
|
||||
+ *local_baud_rate = USERIAL_BAUD_230400;
|
||||
+ *controller_baud_rate = BAUDRATE_230400;
|
||||
+ break;
|
||||
+ case 460800:
|
||||
+ *local_baud_rate = USERIAL_BAUD_460800;
|
||||
+ *controller_baud_rate = BAUDRATE_460800;
|
||||
+ break;
|
||||
+ case 921600:
|
||||
+ *local_baud_rate = USERIAL_BAUD_921600;
|
||||
+ *controller_baud_rate = BAUDRATE_921600;
|
||||
+ break;
|
||||
+ case 1000000:
|
||||
+ *local_baud_rate = USERIAL_BAUD_1M;
|
||||
+ *controller_baud_rate = BAUDRATE_1000000;
|
||||
+ break;
|
||||
+ case 2000000:
|
||||
+ *local_baud_rate = USERIAL_BAUD_2M;
|
||||
+ *controller_baud_rate = BAUDRATE_2000000;
|
||||
+ break;
|
||||
+ case 3000000:
|
||||
+ *local_baud_rate = USERIAL_BAUD_3M;
|
||||
+ *controller_baud_rate = BAUDRATE_3000000;
|
||||
+ break;
|
||||
+ case 4000000:
|
||||
+ *local_baud_rate = USERIAL_BAUD_4M;
|
||||
+ *controller_baud_rate = BAUDRATE_4000000;
|
||||
+ break;
|
||||
+ case 300:
|
||||
+ case 600:
|
||||
+ case 1200:
|
||||
+ case 2400:
|
||||
+ default:
|
||||
+ fprintf(stderr, "Invalid baud rate passed!\n");
|
||||
+ *local_baud_rate = *controller_baud_rate = -1;
|
||||
+ break;
|
||||
+ }
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
+int qca_soc_init(int fd, int speed, char *bdaddr)
|
||||
{
|
||||
int err = -1;
|
||||
- int size;
|
||||
+ int size, local_baud_rate = 0, controller_baud_rate = 0;
|
||||
|
||||
vnd_userial.fd = fd;
|
||||
/* Get Rome version information */
|
||||
@@ -1687,7 +1746,7 @@ int qca_soc_init(int fd, char *bdaddr)
|
||||
}
|
||||
|
||||
/* Change baud rate 115.2 kbps to 3Mbps*/
|
||||
- err = rome_hci_reset_req(fd);
|
||||
+ err = rome_hci_reset_req(fd, local_baud_rate);
|
||||
if ( err <0 ) {
|
||||
fprintf(stderr, "HCI Reset Failed !!\n");
|
||||
goto error;
|
||||
@@ -1721,13 +1780,23 @@ int qca_soc_init(int fd, char *bdaddr)
|
||||
nvm_file_path = TF_NVM_TLV_1_0_0_PATH;
|
||||
|
||||
download:
|
||||
- /* Change baud rate 115.2 kbps to 3Mbps*/
|
||||
- err = rome_set_baudrate_req(fd);
|
||||
- if (err < 0) {
|
||||
- fprintf(stderr, "%s: Baud rate change failed!\n", __FUNCTION__);
|
||||
- goto error;
|
||||
+ /* Check if user requested for 115200 kbps */
|
||||
+ if (speed == 115200) {
|
||||
+ local_baud_rate = USERIAL_BAUD_115200;
|
||||
+ controller_baud_rate = BAUDRATE_115200;
|
||||
}
|
||||
- fprintf(stderr, "%s: Baud rate changed successfully \n", __FUNCTION__);
|
||||
+ else {
|
||||
+ /* Change only if baud rate requested is valid or not */
|
||||
+ isSpeedValid(speed, &local_baud_rate, &controller_baud_rate);
|
||||
+ if (local_baud_rate < 0 || controller_baud_rate < 0)
|
||||
+ goto error;
|
||||
+
|
||||
+ err = rome_set_baudrate_req(fd, local_baud_rate, controller_baud_rate);
|
||||
+ if (err < 0) {
|
||||
+ fprintf(stderr, "%s: Baud rate change failed!\n", __FUNCTION__);
|
||||
+ goto error;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
/* Donwload TLV files (rampatch, NVM) */
|
||||
err = rome_download_tlv_file(fd);
|
||||
@@ -1737,8 +1806,18 @@ download:
|
||||
}
|
||||
fprintf(stderr, "%s: Download TLV file successfully \n", __FUNCTION__);
|
||||
|
||||
+ /*
|
||||
+ * Overriding the baud rate value in NVM file with the user
|
||||
+ * requested baud rate, since default baud rate in NVM file is 3M.
|
||||
+ */
|
||||
+ err = rome_set_baudrate_req(fd, local_baud_rate, controller_baud_rate);
|
||||
+ if (err < 0) {
|
||||
+ fprintf(stderr, "%s: Baud rate change failed!\n", __FUNCTION__);
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
/* Perform HCI reset here*/
|
||||
- err = rome_hci_reset_req(fd);
|
||||
+ err = rome_hci_reset_req(fd, local_baud_rate);
|
||||
if ( err <0 ) {
|
||||
fprintf(stderr, "HCI Reset Failed !!!\n");
|
||||
goto error;
|
||||
diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h
|
||||
index ef3647e6a69b..1500ddd3a79f 100644
|
||||
--- a/tools/hciattach_rome.h
|
||||
+++ b/tools/hciattach_rome.h
|
||||
@@ -78,6 +78,29 @@ typedef struct
|
||||
#define USERIAL_BAUD_4M 15
|
||||
#define USERIAL_BAUD_AUTO 16
|
||||
|
||||
+/* Vendor specific baud rate values */
|
||||
+#define UART_Baud_Rate_Baud_9600 4
|
||||
+#define UART_Baud_Rate_Baud_19200 3
|
||||
+#define UART_Baud_Rate_Baud_57600 1
|
||||
+#define UART_Baud_Rate_Baud_115200 0
|
||||
+#define UART_Baud_Rate_Baud_230400 5
|
||||
+#define UART_Baud_Rate_Baud_460800 7
|
||||
+#define UART_Baud_Rate_Baud_921600 10
|
||||
+#define UART_Baud_Rate_Baud_1000000 11
|
||||
+#define UART_Baud_Rate_Baud_2000000 13
|
||||
+#define UART_Baud_Rate_Baud_3000000 14
|
||||
+#define UART_Baud_Rate_Baud_4000000 15
|
||||
+
|
||||
+#define UART_Baud_Rate_Baud_250000 6
|
||||
+#define UART_Baud_Rate_Baud_500000 8
|
||||
+#define UART_Baud_Rate_Baud_720000 9
|
||||
+#define UART_Baud_Rate_Baud_125000 12
|
||||
+#define UART_Baud_Rate_Baud_1600000 16
|
||||
+#define UART_Baud_Rate_Baud_3200000 17
|
||||
+#define UART_Baud_Rate_Baud_3500000 18
|
||||
+
|
||||
+
|
||||
+
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
From: Kamal Negi <kamaln@codeaurora.org>
|
||||
Date: Tue, 30 Dec 2014 19:15:08 +0530
|
||||
Subject: [PATCH] Override PCM Settings by reading configuration file
|
||||
|
||||
Configure the PCM role as master or slave depending upon
|
||||
the platform's support. This configuration is provided
|
||||
in the config file which is read during the firmware
|
||||
download process and the default PCM configuration is
|
||||
overwritten with this value.
|
||||
|
||||
Change-Id: If0eae58b4cd32d75b3bcb669bc73dca67652473c
|
||||
Signed-off-by: Kamal Negi <kamaln@codeaurora.org>
|
||||
---
|
||||
tools/hciattach_rome.c | 67 +++++++++++++++++++++++++++++++++++++++++++++++---
|
||||
tools/hciattach_rome.h | 8 ++++++
|
||||
2 files changed, 71 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index 37974290ae0a..99866e23e99e 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
- * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
|
||||
* Not a Contribution.
|
||||
*
|
||||
* Copyright 2012 The Android Open Source Project
|
||||
@@ -873,6 +873,44 @@ error:
|
||||
return err;
|
||||
}
|
||||
|
||||
+int get_value_from_config(char *file_path,char *param)
|
||||
+{
|
||||
+ FILE *pfile = NULL;
|
||||
+ char *line = NULL;
|
||||
+ char *pch = NULL;
|
||||
+ char param_str[20];
|
||||
+ int bytes_read = 0, position;
|
||||
+ int ret = -1;
|
||||
+
|
||||
+ if (!file_path || !param) {
|
||||
+ fprintf(stderr,"Invalid arguments\n");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ pfile = fopen(file_path, "r" );
|
||||
+ if (!pfile) {
|
||||
+ fprintf(stderr, "Failed to open %s\n", file_path);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ while (getline(&line, &bytes_read, pfile) > 0 ) {
|
||||
+ if (line[0] != '#' && line[0] != '\n') {
|
||||
+ pch = memchr(line, '=', strlen(line));
|
||||
+ if (pch != NULL) {
|
||||
+ position = pch - line;
|
||||
+ strncpy(param_str, line, position);
|
||||
+ if (strncmp(param_str, param, position) == 0) {
|
||||
+ ret = atoi(pch + 1);
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ free(line);
|
||||
+ fclose(pfile);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
int rome_get_tlv_file(char *file_path)
|
||||
{
|
||||
FILE * pFile;
|
||||
@@ -884,7 +922,7 @@ int rome_get_tlv_file(char *file_path)
|
||||
unsigned char data_buf[PRINT_BUF_SIZE]={0,};
|
||||
unsigned char *nvm_byte_ptr;
|
||||
unsigned char bdaddr[6];
|
||||
-
|
||||
+ unsigned short pcm_value;
|
||||
fprintf(stderr, "File Open (%s)\n", file_path);
|
||||
pFile = fopen ( file_path , "r" );
|
||||
if (pFile==NULL) {;
|
||||
@@ -970,9 +1008,30 @@ int rome_get_tlv_file(char *file_path)
|
||||
*nvm_byte_ptr, *(nvm_byte_ptr+1), *(nvm_byte_ptr+2),
|
||||
*(nvm_byte_ptr+3), *(nvm_byte_ptr+4), *(nvm_byte_ptr+5));
|
||||
}
|
||||
+ /* Read from file and check what PCM Configuration is required:
|
||||
+ * Master = 0 /Slave = 1 */
|
||||
+ /* Override PCM configuration */
|
||||
+ if (nvm_ptr->tag_id == TAG_NUM_44) {
|
||||
+ if ((pcm_value =
|
||||
+ get_value_from_config(PCM_CONFIG_FILE_PATH, "PCM")) >= 0) {
|
||||
+
|
||||
+ if (pcm_value == PCM_SLAVE) {
|
||||
+ nvm_byte_ptr[PCM_MS_OFFSET_1] |=
|
||||
+ (1 << PCM_ROLE_BIT_OFFSET);
|
||||
+ nvm_byte_ptr[PCM_MS_OFFSET_2] |=
|
||||
+ (1 << PCM_ROLE_BIT_OFFSET);
|
||||
+ } else if (pcm_value == PCM_MASTER) {
|
||||
+ nvm_byte_ptr[PCM_MS_OFFSET_1] &=
|
||||
+ (~(1 << PCM_ROLE_BIT_OFFSET));
|
||||
+ nvm_byte_ptr[PCM_MS_OFFSET_2] &=
|
||||
+ (~(1 << PCM_ROLE_BIT_OFFSET));
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- for(i =0;(i<nvm_ptr->tag_len && (i*3 + 2) <PRINT_BUF_SIZE);i++)
|
||||
- snprintf((char *) data_buf, PRINT_BUF_SIZE, "%s%.02x ", (char *)data_buf, *(nvm_byte_ptr + i));
|
||||
+ for(i =0;(i<nvm_ptr->tag_len && (i*3 + 2) < PRINT_BUF_SIZE);i++)
|
||||
+ snprintf((char *) data_buf, PRINT_BUF_SIZE, "%s%.02x ",
|
||||
+ (char *)data_buf, *(nvm_byte_ptr + i));
|
||||
|
||||
fprintf(stderr, "TAG Data\t\t\t : %s\n", data_buf);
|
||||
|
||||
diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h
|
||||
index 1500ddd3a79f..f591c10e4f2b 100644
|
||||
--- a/tools/hciattach_rome.h
|
||||
+++ b/tools/hciattach_rome.h
|
||||
@@ -202,8 +202,15 @@ typedef struct
|
||||
#define NVM_ACCESS_SET 0x01
|
||||
#define TAG_NUM_OFFSET 5
|
||||
#define TAG_NUM_2 2
|
||||
+#define TAG_NUM_44 44
|
||||
#define TAG_BDADDR_OFFSET 7
|
||||
|
||||
+#define PCM_MS_OFFSET_1 9
|
||||
+#define PCM_MS_OFFSET_2 33
|
||||
+
|
||||
+#define PCM_SLAVE 1
|
||||
+#define PCM_MASTER 0
|
||||
+#define PCM_ROLE_BIT_OFFSET 4
|
||||
#define MAX_RETRY_CNT 1
|
||||
#define SELECT_TIMEOUT 3
|
||||
|
||||
@@ -240,6 +247,7 @@ typedef struct
|
||||
#define ROME_SKIP_EVT_CC 0x02
|
||||
#define ROME_SKIP_EVT_VSE_CC 0x03
|
||||
|
||||
+#define PCM_CONFIG_FILE_PATH "/etc/bluetooth/pcm.conf"
|
||||
/******************************************************************************
|
||||
** Local type definitions
|
||||
******************************************************************************/
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
From: Rupesh Tatiya <rtatiya@codeaurora.org>
|
||||
Date: Thu, 29 Jan 2015 15:36:27 +0530
|
||||
Subject: [PATCH] Add support for Tufello 1.1 SOC
|
||||
|
||||
Enable mechanism to download firmware for Tufello 1.1 SOC.
|
||||
Also, use correct firmware file path for Tufello 1.0.
|
||||
|
||||
Change-Id: I915e48023e45de9e2550336a3de9a07f2b788189
|
||||
Signed-off-by: Rupesh Tatiya <rtatiya@codeaurora.org>
|
||||
---
|
||||
tools/hciattach_rome.c | 29 ++++++++++++++++++-----------
|
||||
tools/hciattach_rome.h | 10 +++++++---
|
||||
2 files changed, 25 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index 99866e23e99e..fee36f904e04 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -621,7 +621,7 @@ int rome_edl_set_patch_request(int fd)
|
||||
-1, PATCH_HDR_LEN + 1);
|
||||
|
||||
/* Total length of the packet to be sent to the Controller */
|
||||
- size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + cmd[PLEN]);
|
||||
+ size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + cmd[PLEN]);
|
||||
|
||||
/* Send HCI Command packet to Controller */
|
||||
err = hci_send_vs_cmd(fd, (unsigned char *)cmd, rsp, size);
|
||||
@@ -670,7 +670,7 @@ int rome_edl_patch_download_request(int fd)
|
||||
index, MAX_DATA_PER_SEGMENT);
|
||||
|
||||
/* Total length of the packet to be sent to the Controller */
|
||||
- size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + cmd[PLEN]);
|
||||
+ size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + cmd[PLEN]);
|
||||
|
||||
/* Initialize the RSP packet everytime to 0 */
|
||||
memset(rsp, 0x0, HCI_MAX_EVENT_SIZE);
|
||||
@@ -707,7 +707,7 @@ int rome_edl_patch_download_request(int fd)
|
||||
memset(rsp, 0x0, HCI_MAX_EVENT_SIZE);
|
||||
|
||||
/* Total length of the packet to be sent to the Controller */
|
||||
- size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + cmd[PLEN]);
|
||||
+ size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + cmd[PLEN]);
|
||||
|
||||
/* Send HCI Command packet to Controller */
|
||||
err = hci_send_vs_cmd(fd, (unsigned char *)cmd, rsp, size);
|
||||
@@ -824,7 +824,7 @@ int rome_attach_rampatch(int fd)
|
||||
-1, EDL_PATCH_CMD_LEN);
|
||||
|
||||
/* Total length of the packet to be sent to the Controller */
|
||||
- size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + cmd[PLEN]);
|
||||
+ size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + cmd[PLEN]);
|
||||
|
||||
/* Send HCI Command packet to Controller */
|
||||
err = hci_send_vs_cmd(fd, (unsigned char *)cmd, rsp, size);
|
||||
@@ -854,7 +854,7 @@ int rome_rampatch_reset(int fd)
|
||||
-1, EDL_PATCH_CMD_LEN);
|
||||
|
||||
/* Total length of the packet to be sent to the Controller */
|
||||
- size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + EDL_PATCH_CMD_LEN);
|
||||
+ size = (HCI_CMD_IND + HCI_COMMAND_HDR_SIZE + EDL_PATCH_CMD_LEN);
|
||||
|
||||
/* Send HCI Command packet to Controller */
|
||||
err = write(fd, cmd, size);
|
||||
@@ -1058,7 +1058,7 @@ int rome_tlv_dnld_segment(int fd, int index, int seg_size, unsigned char wait_cc
|
||||
unsigned char cmd[HCI_MAX_CMD_SIZE];
|
||||
unsigned char rsp[HCI_MAX_EVENT_SIZE];
|
||||
|
||||
- fprintf(stderr, "%s: Downloading TLV Patch segment no.%d, size:%d\n", __FUNCTION__, index, seg_size);
|
||||
+ fprintf(stderr, "%s: Downloading TLV Patch segment no.%d, size:%d wait_cc_evt = 0x%x\n", __FUNCTION__, index, seg_size, wait_cc_evt);
|
||||
|
||||
/* Frame the HCI CMD PKT to be sent to Controller*/
|
||||
frame_hci_cmd_pkt(cmd, EDL_PATCH_TLV_REQ_CMD, 0, index, seg_size);
|
||||
@@ -1092,6 +1092,7 @@ int rome_tlv_dnld_req(int fd, int tlv_size)
|
||||
{
|
||||
int total_segment, remain_size, i, err = -1;
|
||||
unsigned char wait_cc_evt;
|
||||
+ unsigned int rom = rome_ver >> 16;
|
||||
|
||||
total_segment = tlv_size/MAX_SIZE_PER_TLV_SEGMENT;
|
||||
remain_size = (tlv_size < MAX_SIZE_PER_TLV_SEGMENT)?\
|
||||
@@ -1132,14 +1133,15 @@ int rome_tlv_dnld_req(int fd, int tlv_size)
|
||||
|
||||
for(i = 0; i < total_segment; i++) {
|
||||
if((i+1) == total_segment) {
|
||||
- if ((rome_ver >= ROME_VER_1_1) && (rome_ver < ROME_VER_3_2) &&
|
||||
+ if ((rom >= ROME_PATCH_VER_0100) && (rom < ROME_PATCH_VER_0302) &&
|
||||
(gTlv_type == TLV_TYPE_PATCH)) {
|
||||
/* If the Rome version is from 1.1 to 3.1
|
||||
* 1. No CCE for the last command segment but all other segment
|
||||
* 2. All the command segments get VSE including the last one
|
||||
*/
|
||||
wait_cc_evt = !remain_size ? FALSE: TRUE;
|
||||
- } else if ((rome_ver == ROME_VER_3_2) && (gTlv_type == TLV_TYPE_PATCH)) {
|
||||
+ } else if ((rom == ROME_PATCH_VER_0302) &&
|
||||
+ (gTlv_type == TLV_TYPE_PATCH)) {
|
||||
/* If the Rome version is 3.2
|
||||
* 1. None of the command segments receive CCE
|
||||
* 2. No command segments receive VSE except the last one
|
||||
@@ -1158,13 +1160,14 @@ int rome_tlv_dnld_req(int fd, int tlv_size)
|
||||
goto error;
|
||||
}
|
||||
|
||||
- if ((rome_ver >= ROME_VER_1_1) && (rome_ver < ROME_VER_3_2) && (gTlv_type == TLV_TYPE_PATCH)) {
|
||||
+ if ((rom >= ROME_PATCH_VER_0100) && (rom < ROME_PATCH_VER_0302) &&
|
||||
+ (gTlv_type == TLV_TYPE_PATCH)) {
|
||||
/* If the Rome version is from 1.1 to 3.1
|
||||
* 1. No CCE for the last command segment but all other segment
|
||||
* 2. All the command segments get VSE including the last one
|
||||
*/
|
||||
wait_cc_evt = remain_size ? FALSE: TRUE;
|
||||
- } else if ((rome_ver == ROME_VER_3_2) && (gTlv_type == TLV_TYPE_PATCH)) {
|
||||
+ } else if ((rom == ROME_PATCH_VER_0302) && (gTlv_type == TLV_TYPE_PATCH)) {
|
||||
/* If the Rome version is 3.2
|
||||
* 1. None of the command segments receive CCE
|
||||
* 2. No command segments receive VSE except the last one
|
||||
@@ -1837,6 +1840,10 @@ int qca_soc_init(int fd, int speed, char *bdaddr)
|
||||
case TUFELLO_VER_1_0:
|
||||
rampatch_file_path = TF_RAMPATCH_TLV_1_0_0_PATH;
|
||||
nvm_file_path = TF_NVM_TLV_1_0_0_PATH;
|
||||
+ goto download;
|
||||
+ case TUFELLO_VER_1_1:
|
||||
+ rampatch_file_path = TF_RAMPATCH_TLV_1_0_1_PATH;
|
||||
+ nvm_file_path = TF_NVM_TLV_1_0_1_PATH;
|
||||
|
||||
download:
|
||||
/* Check if user requested for 115200 kbps */
|
||||
@@ -1881,7 +1888,7 @@ download:
|
||||
fprintf(stderr, "HCI Reset Failed !!!\n");
|
||||
goto error;
|
||||
}
|
||||
- fprintf(stderr, "HCI Reset is done\n");
|
||||
+ fprintf(stderr, "HCI Reset is done\n");
|
||||
|
||||
break;
|
||||
case ROME_VER_UNKNOWN:
|
||||
diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h
|
||||
index f591c10e4f2b..95d5f1e8a5c2 100644
|
||||
--- a/tools/hciattach_rome.h
|
||||
+++ b/tools/hciattach_rome.h
|
||||
@@ -238,8 +238,10 @@ typedef struct
|
||||
#define ROME_NVM_TLV_3_0_0_PATH "/lib/firmware/qca/nvm_tlv_3.0.bin"
|
||||
#define ROME_RAMPATCH_TLV_3_0_2_PATH "/lib/firmware/qca/rampatch_tlv_3.2.tlv"
|
||||
#define ROME_NVM_TLV_3_0_2_PATH "/lib/firmware/qca/nvm_tlv_3.2.bin"
|
||||
-#define TF_RAMPATCH_TLV_1_0_0_PATH "/lib/firmware/rampatch_tlv_tf_1.0.tlv"
|
||||
-#define TF_NVM_TLV_1_0_0_PATH "/lib/firmware/nvm_tlv_tf_1.0.bin"
|
||||
+#define TF_RAMPATCH_TLV_1_0_0_PATH "/lib/firmware/qca/rampatch_tlv_tf_1.0.tlv"
|
||||
+#define TF_NVM_TLV_1_0_0_PATH "/lib/firmware/qca/nvm_tlv_tf_1.0.bin"
|
||||
+#define TF_RAMPATCH_TLV_1_0_1_PATH "/lib/firmware/qca/rampatch_tlv_tf_1.1.tlv"
|
||||
+#define TF_NVM_TLV_1_0_1_PATH "/lib/firmware/qca/nvm_tlv_tf_1.1.bin"
|
||||
|
||||
/* This header value in rampatch file decides event handling mechanism in the HOST */
|
||||
#define ROME_SKIP_EVT_NONE 0x00
|
||||
@@ -357,6 +359,7 @@ enum{
|
||||
ROME_SOC_ID_11 = 0x00000011,
|
||||
ROME_SOC_ID_13 = 0x00000013,
|
||||
ROME_SOC_ID_22 = 0x00000022,
|
||||
+ ROME_SOC_ID_23 = 0x00000023,
|
||||
ROME_SOC_ID_44 = 0x00000044
|
||||
};
|
||||
|
||||
@@ -368,6 +371,7 @@ enum{
|
||||
ROME_VER_2_1 = ((ROME_PATCH_VER_0200 << 16 ) | ROME_SOC_ID_11 ),
|
||||
ROME_VER_3_0 = ((ROME_PATCH_VER_0300 << 16 ) | ROME_SOC_ID_22 ),
|
||||
ROME_VER_3_2 = ((ROME_PATCH_VER_0302 << 16 ) | ROME_SOC_ID_44 ),
|
||||
- TUFELLO_VER_1_0 = ((ROME_PATCH_VER_0300 << 16 ) | ROME_SOC_ID_13 )
|
||||
+ TUFELLO_VER_1_0 = ((ROME_PATCH_VER_0300 << 16 ) | ROME_SOC_ID_13 ),
|
||||
+ TUFELLO_VER_1_1 = ((ROME_PATCH_VER_0302 << 16 ) | ROME_SOC_ID_23 )
|
||||
};
|
||||
#endif /* HW_ROME_H */
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
From: Anantha Krishnan <ananthk@codeaurora.org>
|
||||
Date: Wed, 4 Feb 2015 12:29:07 +0530
|
||||
Subject: [PATCH] bluetooth: Vote UART CLK ON prior to firmware download
|
||||
process
|
||||
|
||||
Before starting the firmware download process, vote UART CLK ON
|
||||
to avoid triggering the dynamic suspend of UART driver. Post
|
||||
firmware download and in error scenarios vote UART CLK OFF.
|
||||
|
||||
As per design, the UART driver enters into dynamic suspend if
|
||||
there are no activity on the UART lines for 100ms. Depending upon
|
||||
the rampatch size, the BT Controller takes time to apply the
|
||||
downloaded rampatch segments and in sending the vendor specific
|
||||
event. If the BT Controller takes > 100ms time in sending the
|
||||
vendor specific event, the UART driver enters into suspend state.
|
||||
|
||||
As a result, UART driver fails to process the last vendor specific
|
||||
event sent by the BT Controller. The VSE sent by BT Controller
|
||||
wakes up the UART driver, but the data is not processed causing
|
||||
firmware download failures.
|
||||
|
||||
Hence, vote UART CLK ON prior to firmware download process and
|
||||
vote UART CLK OFF post firmware download proess and in error
|
||||
scenarios.
|
||||
|
||||
Change-Id: I447ded33ad1cfaa020b491effce368fbfe41f894
|
||||
---
|
||||
tools/hciattach_rome.c | 13 +++++++++++++
|
||||
tools/hciattach_rome.h | 2 ++
|
||||
2 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index fee36f904e04..574ceac6c750 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -1762,6 +1762,14 @@ int qca_soc_init(int fd, int speed, char *bdaddr)
|
||||
int size, local_baud_rate = 0, controller_baud_rate = 0;
|
||||
|
||||
vnd_userial.fd = fd;
|
||||
+
|
||||
+ /* Vote for UART CLK prior to FW download */
|
||||
+ err = ioctl(fd, USERIAL_OP_CLK_ON);
|
||||
+ if (err < 0) {
|
||||
+ fprintf(stderr, "%s: Failed to vote UART CLK ON\n", __func__);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
/* Get Rome version information */
|
||||
if((err = rome_patch_ver_req(fd)) <0){
|
||||
fprintf(stderr, "%s: Fail to get Rome Version (0x%x)\n", __FUNCTION__, err);
|
||||
@@ -1899,5 +1907,10 @@ download:
|
||||
}
|
||||
|
||||
error:
|
||||
+ /* Vote UART CLK OFF post to FW download */
|
||||
+ err = ioctl(fd, USERIAL_OP_CLK_OFF);
|
||||
+ if (err < 0)
|
||||
+ fprintf(stderr, "%s: Failed to vote UART CLK OFF!!!\n", __func__);
|
||||
+
|
||||
return err;
|
||||
}
|
||||
diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h
|
||||
index 95d5f1e8a5c2..20264f9978d9 100644
|
||||
--- a/tools/hciattach_rome.h
|
||||
+++ b/tools/hciattach_rome.h
|
||||
@@ -42,6 +42,8 @@
|
||||
#define BD_ADDR_LEN 6
|
||||
#define MSM_ENABLE_FLOW_CTRL 16
|
||||
#define MSM_DISABLE_FLOW_CTRL 17
|
||||
+#define USERIAL_OP_CLK_ON 0x5441
|
||||
+#define USERIAL_OP_CLK_OFF 0x5442
|
||||
|
||||
unsigned char vnd_local_bd_addr[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
typedef enum {
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
From: Kamal Negi <kamaln@codeaurora.org>
|
||||
Date: Thu, 30 Apr 2015 15:53:06 +0530
|
||||
Subject: [PATCH] Override IBS settings by reading configuration file
|
||||
|
||||
Configure the IBS value in Firmware by reading the
|
||||
configuration file.This configuration value is
|
||||
provided in the config file which is read during
|
||||
the firmware download process and the default
|
||||
configuration value is overwritten with this value.
|
||||
|
||||
Change-Id: I47992a573b3137ac9bfb80538727981f56b328c4
|
||||
Signed-off-by: Kamal Negi <kamaln@codeaurora.org>
|
||||
---
|
||||
tools/hciattach_rome.c | 42 +++++++++++++++++++++++++++++-------------
|
||||
tools/hciattach_rome.h | 24 ++++++++++++++++--------
|
||||
2 files changed, 45 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index 574ceac6c750..6a3f33867c12 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -922,7 +922,8 @@ int rome_get_tlv_file(char *file_path)
|
||||
unsigned char data_buf[PRINT_BUF_SIZE]={0,};
|
||||
unsigned char *nvm_byte_ptr;
|
||||
unsigned char bdaddr[6];
|
||||
- unsigned short pcm_value;
|
||||
+ unsigned short pcm_value, ibs_value;
|
||||
+
|
||||
fprintf(stderr, "File Open (%s)\n", file_path);
|
||||
pFile = fopen ( file_path , "r" );
|
||||
if (pFile==NULL) {;
|
||||
@@ -1008,23 +1009,38 @@ int rome_get_tlv_file(char *file_path)
|
||||
*nvm_byte_ptr, *(nvm_byte_ptr+1), *(nvm_byte_ptr+2),
|
||||
*(nvm_byte_ptr+3), *(nvm_byte_ptr+4), *(nvm_byte_ptr+5));
|
||||
}
|
||||
+
|
||||
+ if (nvm_ptr->tag_id == TAG_NUM_17) {
|
||||
+ if ((ibs_value =
|
||||
+ get_value_from_config(FW_CONFIG_FILE_PATH, "IBS")) >= 0) {
|
||||
+ if (ibs_value == FWCONF_IBS_DISABLE) {
|
||||
+ nvm_byte_ptr[FWCONF_IBS_VAL_OFFSET] &=
|
||||
+ (~(FWCONF_IBS_ENABLE <<
|
||||
+ FWCONF_IBS_VAL_BIT));
|
||||
+ } else if (ibs_value == FWCONF_IBS_ENABLE) {
|
||||
+ nvm_byte_ptr[FWCONF_IBS_VAL_OFFSET] |=
|
||||
+ (FWCONF_IBS_ENABLE <<
|
||||
+ FWCONF_IBS_VAL_BIT);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
/* Read from file and check what PCM Configuration is required:
|
||||
* Master = 0 /Slave = 1 */
|
||||
/* Override PCM configuration */
|
||||
if (nvm_ptr->tag_id == TAG_NUM_44) {
|
||||
if ((pcm_value =
|
||||
- get_value_from_config(PCM_CONFIG_FILE_PATH, "PCM")) >= 0) {
|
||||
-
|
||||
- if (pcm_value == PCM_SLAVE) {
|
||||
- nvm_byte_ptr[PCM_MS_OFFSET_1] |=
|
||||
- (1 << PCM_ROLE_BIT_OFFSET);
|
||||
- nvm_byte_ptr[PCM_MS_OFFSET_2] |=
|
||||
- (1 << PCM_ROLE_BIT_OFFSET);
|
||||
- } else if (pcm_value == PCM_MASTER) {
|
||||
- nvm_byte_ptr[PCM_MS_OFFSET_1] &=
|
||||
- (~(1 << PCM_ROLE_BIT_OFFSET));
|
||||
- nvm_byte_ptr[PCM_MS_OFFSET_2] &=
|
||||
- (~(1 << PCM_ROLE_BIT_OFFSET));
|
||||
+ get_value_from_config(FW_CONFIG_FILE_PATH, "PCM")) >= 0) {
|
||||
+
|
||||
+ if (pcm_value == FWCONF_PCM_SLAVE) {
|
||||
+ nvm_byte_ptr[FWCONF_PCM_MS_OFFSET_1] |=
|
||||
+ (1 << FWCONF_PCM_ROLE_BIT_OFFSET);
|
||||
+ nvm_byte_ptr[FWCONF_PCM_MS_OFFSET_2] |=
|
||||
+ (1 << FWCONF_PCM_ROLE_BIT_OFFSET);
|
||||
+ } else if (pcm_value == FWCONF_PCM_MASTER) {
|
||||
+ nvm_byte_ptr[FWCONF_PCM_MS_OFFSET_1] &=
|
||||
+ (~(1 << FWCONF_PCM_ROLE_BIT_OFFSET));
|
||||
+ nvm_byte_ptr[FWCONF_PCM_MS_OFFSET_2] &=
|
||||
+ (~(1 << FWCONF_PCM_ROLE_BIT_OFFSET));
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h
|
||||
index 20264f9978d9..8eaeeed8bc96 100644
|
||||
--- a/tools/hciattach_rome.h
|
||||
+++ b/tools/hciattach_rome.h
|
||||
@@ -203,16 +203,24 @@ typedef struct
|
||||
#define TAG_END 0xFF
|
||||
#define NVM_ACCESS_SET 0x01
|
||||
#define TAG_NUM_OFFSET 5
|
||||
-#define TAG_NUM_2 2
|
||||
-#define TAG_NUM_44 44
|
||||
+#define TAG_NUM_2 2
|
||||
+#define TAG_NUM_17 (17)
|
||||
+#define TAG_NUM_44 44
|
||||
#define TAG_BDADDR_OFFSET 7
|
||||
|
||||
-#define PCM_MS_OFFSET_1 9
|
||||
-#define PCM_MS_OFFSET_2 33
|
||||
+/* FW PCM Configuration */
|
||||
+#define FWCONF_PCM_MS_OFFSET_1 9
|
||||
+#define FWCONF_PCM_MS_OFFSET_2 33
|
||||
+#define FWCONF_PCM_SLAVE 1
|
||||
+#define FWCONF_PCM_MASTER 0
|
||||
+#define FWCONF_PCM_ROLE_BIT_OFFSET 4
|
||||
+
|
||||
+/* FW IBS Configuration */
|
||||
+#define FWCONF_IBS_DISABLE (0)
|
||||
+#define FWCONF_IBS_ENABLE (1)
|
||||
+#define FWCONF_IBS_VAL_BIT (7)
|
||||
+#define FWCONF_IBS_VAL_OFFSET (0)
|
||||
|
||||
-#define PCM_SLAVE 1
|
||||
-#define PCM_MASTER 0
|
||||
-#define PCM_ROLE_BIT_OFFSET 4
|
||||
#define MAX_RETRY_CNT 1
|
||||
#define SELECT_TIMEOUT 3
|
||||
|
||||
@@ -251,7 +259,7 @@ typedef struct
|
||||
#define ROME_SKIP_EVT_CC 0x02
|
||||
#define ROME_SKIP_EVT_VSE_CC 0x03
|
||||
|
||||
-#define PCM_CONFIG_FILE_PATH "/etc/bluetooth/pcm.conf"
|
||||
+#define FW_CONFIG_FILE_PATH "/etc/bluetooth/firmware.conf"
|
||||
/******************************************************************************
|
||||
** Local type definitions
|
||||
******************************************************************************/
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
From: Kamal Negi <kamaln@codeaurora.org>
|
||||
Date: Fri, 8 May 2015 15:01:02 +0530
|
||||
Subject: [PATCH] Handle NULL Pointer derefrencing in AVRCP Target role
|
||||
|
||||
Check NULL pointer to AVRCP controller role initialized or not.
|
||||
If remote device don't support the AVRCP target role, then HOST dont
|
||||
initialize AVRCP controller role and directly dereference the controller
|
||||
role and segfault happens.
|
||||
|
||||
Change-Id: Ibbb9452f17a576c3a79a53ea72e0211982752144
|
||||
Signed-off-by: Kamal Negi <kamaln@codeaurora.org>
|
||||
---
|
||||
profiles/audio/avrcp.c | 27 ++++++++++++++++++++++-----
|
||||
1 file changed, 22 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
|
||||
index d66f67032624..9fa939d9548b 100644
|
||||
--- a/profiles/audio/avrcp.c
|
||||
+++ b/profiles/audio/avrcp.c
|
||||
@@ -1808,13 +1808,19 @@ static gboolean avrcp_get_play_status_rsp(struct avctp *conn,
|
||||
void *user_data)
|
||||
{
|
||||
struct avrcp *session = user_data;
|
||||
- struct avrcp_player *player = session->controller->player;
|
||||
- struct media_player *mp = player->user_data;
|
||||
+ struct avrcp_player *player;
|
||||
+ struct media_player *mp;
|
||||
struct avrcp_header *pdu = (void *) operands;
|
||||
uint32_t duration;
|
||||
uint32_t position;
|
||||
uint8_t status;
|
||||
|
||||
+ if (!session || !session->controller)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ player = session->controller->player;
|
||||
+ mp = player->user_data;
|
||||
+
|
||||
if (pdu == NULL || code == AVC_CTYPE_REJECTED ||
|
||||
ntohs(pdu->params_len) != 9)
|
||||
return FALSE;
|
||||
@@ -1872,12 +1878,18 @@ static gboolean avrcp_player_value_rsp(struct avctp *conn,
|
||||
void *user_data)
|
||||
{
|
||||
struct avrcp *session = user_data;
|
||||
- struct avrcp_player *player = session->controller->player;
|
||||
- struct media_player *mp = player->user_data;
|
||||
+ struct avrcp_player *player;
|
||||
+ struct media_player *mp;
|
||||
struct avrcp_header *pdu = (void *) operands;
|
||||
uint8_t count;
|
||||
int i;
|
||||
|
||||
+ if (!session || !session->controller)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ player = session->controller->player;
|
||||
+ mp = player->user_data;
|
||||
+
|
||||
if (pdu == NULL) {
|
||||
media_player_set_setting(mp, "Error", "Timeout");
|
||||
return FALSE;
|
||||
@@ -2028,10 +2040,15 @@ static gboolean avrcp_get_element_attributes_rsp(struct avctp *conn,
|
||||
void *user_data)
|
||||
{
|
||||
struct avrcp *session = user_data;
|
||||
- struct avrcp_player *player = session->controller->player;
|
||||
+ struct avrcp_player *player;
|
||||
struct avrcp_header *pdu = (void *) operands;
|
||||
uint8_t count;
|
||||
|
||||
+ if (!session || !session->controller)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ player = session->controller->player;
|
||||
+
|
||||
if (code == AVC_CTYPE_REJECTED)
|
||||
return FALSE;
|
||||
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
From: Dibyendu Roy <dibyen@codeaurora.org>
|
||||
Date: Fri, 22 May 2015 18:57:05 +0530
|
||||
Subject: [PATCH] bluetooth: Fix flow control operation
|
||||
|
||||
Flow off operation was not actually happening at the UART line level,
|
||||
since the argument passed was not being used correctly. As a result,
|
||||
sometimes command complete and VS event were sent by BT SOC even
|
||||
before the local UART Controller could change its baud rate to the
|
||||
newer one(3 Mbps). This led to VS event being processed
|
||||
incorrectly which in turn causes baud rate change to fail.
|
||||
|
||||
CRs-Fixed: 844730
|
||||
Change-Id: I06d8c4ed7807aa47dd5498642c7a23c9189a1cff
|
||||
Signed-off-by: Dibyendu Roy <dibyen@codeaurora.org>
|
||||
---
|
||||
tools/hciattach_rome.c | 6 +++---
|
||||
tools/hciattach_rome.h | 4 ++--
|
||||
2 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index 6a3f33867c12..0d7014f1d2f6 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -1544,10 +1544,10 @@ static void flow_control(int fd, int opt)
|
||||
c_opt.c_cc[VMIN] = 0; /* blocking read until 8 chars received */
|
||||
c_opt.c_cflag &= ~CSIZE;
|
||||
c_opt.c_cflag |= (CS8 | CLOCAL | CREAD);
|
||||
- if (MSM_ENABLE_FLOW_CTRL)
|
||||
+ if (opt == MSM_ENABLE_FLOW_CTRL)
|
||||
c_opt.c_cflag |= CRTSCTS;
|
||||
- else if (MSM_DISABLE_FLOW_CTRL)
|
||||
- c_opt.c_cflag |= ~CRTSCTS;
|
||||
+ else if (opt == MSM_DISABLE_FLOW_CTRL)
|
||||
+ c_opt.c_cflag &= ~CRTSCTS;
|
||||
else {
|
||||
fprintf(stderr, "%s: Incorrect option passed for TIOCMSET\n", __func__);
|
||||
return;
|
||||
diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h
|
||||
index 8eaeeed8bc96..3fdaf208e522 100644
|
||||
--- a/tools/hciattach_rome.h
|
||||
+++ b/tools/hciattach_rome.h
|
||||
@@ -40,8 +40,8 @@
|
||||
#define NVITEM_SIZE 2
|
||||
#define PERSIST_HEADER_LEN 3
|
||||
#define BD_ADDR_LEN 6
|
||||
-#define MSM_ENABLE_FLOW_CTRL 16
|
||||
-#define MSM_DISABLE_FLOW_CTRL 17
|
||||
+#define MSM_DISABLE_FLOW_CTRL 0
|
||||
+#define MSM_ENABLE_FLOW_CTRL 1
|
||||
#define USERIAL_OP_CLK_ON 0x5441
|
||||
#define USERIAL_OP_CLK_OFF 0x5442
|
||||
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
From: Dibyendu Roy <dibyen@codeaurora.org>
|
||||
Date: Thu, 11 Jun 2015 12:07:43 +0530
|
||||
Subject: [PATCH] Adding MDM specific code under _PLATFORM_MDM_
|
||||
|
||||
This patch is added to comment out the commit
|
||||
84cc0e12983b5761c67789ef93fd6fb164c7314d in x86 as
|
||||
dynamic suspend feature is not available in x86. However,
|
||||
this code shall be active for MDM platform due to
|
||||
dynamic suspend feature.
|
||||
|
||||
Change-Id: I998f0521b4a5f9744412db40f2c2d3bff2ac3d11
|
||||
---
|
||||
tools/hciattach_rome.c | 5 ++++-
|
||||
tools/hciattach_rome.h | 3 +++
|
||||
2 files changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index 0d7014f1d2f6..1891de24e21a 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -1779,13 +1779,14 @@ int qca_soc_init(int fd, int speed, char *bdaddr)
|
||||
|
||||
vnd_userial.fd = fd;
|
||||
|
||||
+#ifdef _PLATFORM_MDM_
|
||||
/* Vote for UART CLK prior to FW download */
|
||||
err = ioctl(fd, USERIAL_OP_CLK_ON);
|
||||
if (err < 0) {
|
||||
fprintf(stderr, "%s: Failed to vote UART CLK ON\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
/* Get Rome version information */
|
||||
if((err = rome_patch_ver_req(fd)) <0){
|
||||
fprintf(stderr, "%s: Fail to get Rome Version (0x%x)\n", __FUNCTION__, err);
|
||||
@@ -1923,10 +1924,12 @@ download:
|
||||
}
|
||||
|
||||
error:
|
||||
+#ifdef _PLATFORM_MDM_
|
||||
/* Vote UART CLK OFF post to FW download */
|
||||
err = ioctl(fd, USERIAL_OP_CLK_OFF);
|
||||
if (err < 0)
|
||||
fprintf(stderr, "%s: Failed to vote UART CLK OFF!!!\n", __func__);
|
||||
+#endif
|
||||
|
||||
return err;
|
||||
}
|
||||
diff --git a/tools/hciattach_rome.h b/tools/hciattach_rome.h
|
||||
index 3fdaf208e522..89f7db3bef86 100644
|
||||
--- a/tools/hciattach_rome.h
|
||||
+++ b/tools/hciattach_rome.h
|
||||
@@ -42,8 +42,11 @@
|
||||
#define BD_ADDR_LEN 6
|
||||
#define MSM_DISABLE_FLOW_CTRL 0
|
||||
#define MSM_ENABLE_FLOW_CTRL 1
|
||||
+
|
||||
+#ifdef _PLATFORM_MDM_
|
||||
#define USERIAL_OP_CLK_ON 0x5441
|
||||
#define USERIAL_OP_CLK_OFF 0x5442
|
||||
+#endif
|
||||
|
||||
unsigned char vnd_local_bd_addr[6] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
typedef enum {
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
From: Dibyendu Roy <dibyen@codeaurora.org>
|
||||
Date: Mon, 6 Jul 2015 13:30:53 +0530
|
||||
Subject: [PATCH] Bluetooth: Fix static analysis issues
|
||||
|
||||
Change-Id: Ida91f012544c39a8aaa6e7db23f1d5b68d3bec08
|
||||
---
|
||||
tools/hciattach.c | 9 ++++++++-
|
||||
tools/hciattach_rome.c | 10 ++++++++--
|
||||
2 files changed, 16 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tools/hciattach.c b/tools/hciattach.c
|
||||
index 6de4129dfd8f..c9a5feffca2b 100644
|
||||
--- a/tools/hciattach.c
|
||||
+++ b/tools/hciattach.c
|
||||
@@ -1395,7 +1395,14 @@ int main(int argc, char *argv[])
|
||||
dev[0] = 0;
|
||||
if (!strchr(opt, '/'))
|
||||
strcpy(dev, "/dev/");
|
||||
- strcat(dev, opt);
|
||||
+
|
||||
+ if (strlen(opt) + 1 > sizeof(dev) - strlen(dev)) {
|
||||
+ fprintf(stderr, "error: string truncated\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ strncat(dev, opt, sizeof(dev) - strlen(dev) - 1);
|
||||
+
|
||||
break;
|
||||
|
||||
case 1:
|
||||
diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c
|
||||
index 1891de24e21a..59bdc16e4e8f 100644
|
||||
--- a/tools/hciattach_rome.c
|
||||
+++ b/tools/hciattach_rome.c
|
||||
@@ -933,7 +933,13 @@ int rome_get_tlv_file(char *file_path)
|
||||
|
||||
/* Get File Size */
|
||||
fseek (pFile , 0 , SEEK_END);
|
||||
- fileSize = ftell (pFile);
|
||||
+
|
||||
+ if((fileSize = ftell(pFile)) < 0) {
|
||||
+ fprintf(stderr, "%s: fail to get current file position\n", file_path);
|
||||
+ fclose (pFile);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
rewind (pFile);
|
||||
|
||||
pdata_buffer = (unsigned char*) malloc (sizeof(char)*fileSize);
|
||||
@@ -1107,7 +1113,7 @@ int rome_tlv_dnld_segment(int fd, int index, int seg_size, unsigned char wait_cc
|
||||
int rome_tlv_dnld_req(int fd, int tlv_size)
|
||||
{
|
||||
int total_segment, remain_size, i, err = -1;
|
||||
- unsigned char wait_cc_evt;
|
||||
+ unsigned char wait_cc_evt = FALSE;
|
||||
unsigned int rom = rome_ver >> 16;
|
||||
|
||||
total_segment = tlv_size/MAX_SIZE_PER_TLV_SEGMENT;
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# Copyright (C) 2015 Digi International.
|
||||
|
||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
|
||||
SRC_URI += "file://bluez-init"
|
||||
|
||||
inherit update-rc.d
|
||||
|
||||
PACKAGECONFIG_append = " experimental"
|
||||
|
||||
do_install_append() {
|
||||
install -d ${D}${sysconfdir}/init.d/
|
||||
install -m 0755 ${WORKDIR}/bluez-init ${D}${sysconfdir}/init.d/bluez
|
||||
}
|
||||
|
||||
INITSCRIPT_NAME = "bluez"
|
||||
INITSCRIPT_PARAMS = "start 10 5 ."
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
# Copyright (C) 2015 Digi International.
|
||||
|
||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:"
|
||||
|
||||
SRC_URI += "file://bluez-init"
|
||||
|
||||
SRC_URI_append_ccimx6ul = " \
|
||||
file://0001-bluetooth-Add-bluetooth-support-for-QCA6174-chip.patch \
|
||||
file://0002-bluetooth-Enable-bluetooth-low-power-mode-functional.patch \
|
||||
file://0003-bluetooth-Fix-bug-in-firmware-parsing-mechanism.patch \
|
||||
file://0004-bluetooth-Configure-BD-Address.patch \
|
||||
file://0005-bluetooth-Remove-unused-functions-in-the-firmware-do.patch \
|
||||
file://0006-bluetooth-Enable-3Mbps-baud-rate-support.patch \
|
||||
file://0007-bluetooth-Check-TTY-buffer-for-data-availability-bef.patch \
|
||||
file://0008-bluetooth-Add-support-for-TUFEELO-firmware-download.patch \
|
||||
file://0009-bluetooth-Add-support-for-ROME-3.2-SOC.patch \
|
||||
file://0010-bluetooth-Use-correct-TTY-ioctl-calls-for-flow-contr.patch \
|
||||
file://0011-bluetooth-Add-support-for-multi-baud-rate.patch \
|
||||
file://0012-Override-PCM-Settings-by-reading-configuration-file.patch \
|
||||
file://0013-Add-support-for-Tufello-1.1-SOC.patch \
|
||||
file://0014-bluetooth-Vote-UART-CLK-ON-prior-to-firmware-downloa.patch \
|
||||
file://0015-Override-IBS-settings-by-reading-configuration-file.patch \
|
||||
file://0016-Handle-NULL-Pointer-derefrencing-in-AVRCP-Target-rol.patch \
|
||||
file://0017-bluetooth-Fix-flow-control-operation.patch \
|
||||
file://0018-Adding-MDM-specific-code-under-_PLATFORM_MDM_.patch \
|
||||
file://0019-Bluetooth-Fix-static-analysis-issues.patch \
|
||||
"
|
||||
|
||||
inherit update-rc.d
|
||||
|
||||
PACKAGECONFIG_append = " experimental"
|
||||
|
||||
do_install_append() {
|
||||
install -d ${D}${sysconfdir}/init.d/
|
||||
install -m 0755 ${WORKDIR}/bluez-init ${D}${sysconfdir}/init.d/bluez
|
||||
}
|
||||
|
||||
INITSCRIPT_NAME = "bluez"
|
||||
INITSCRIPT_PARAMS = "start 10 5 ."
|
||||
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
||||
Loading…
Reference in New Issue