From patchwork Thu Aug 31 09:49:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 808146 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xjczd72mFz9s7G for ; Thu, 31 Aug 2017 19:49:49 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8AC9A88488; Thu, 31 Aug 2017 09:49:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KN+uafwUWHPJ; Thu, 31 Aug 2017 09:49:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A68AE8847E; Thu, 31 Aug 2017 09:49:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 3707F1C411E for ; Thu, 31 Aug 2017 09:49:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2DCD187254 for ; Thu, 31 Aug 2017 09:49:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y3d2irKFAFaR for ; Thu, 31 Aug 2017 09:49:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by whitealder.osuosl.org (Postfix) with ESMTPS id EB90982019 for ; Thu, 31 Aug 2017 09:49:39 +0000 (UTC) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3xjczN0lGBz101D for ; Thu, 31 Aug 2017 11:49:35 +0200 (CEST) Received: from mail.embedded.rocks ([127.0.0.1]) by localhost (mail.embedded.rocks [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 2QXb05E5R_D1; Thu, 31 Aug 2017 11:49:34 +0200 (CEST) Received: from nzxt.fritz.box (port-92-195-126-231.dynamic.qsc.de [92.195.126.231]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Thu, 31 Aug 2017 11:49:34 +0200 (CEST) From: =?utf-8?q?J=C3=B6rg_Krause?= To: buildroot@buildroot.org Date: Thu, 31 Aug 2017 11:49:31 +0200 Message-Id: <20170831094932.11121-1-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/2] bluez5_utils: define FIRMWARE_DIR for hciattach_bcm43xx X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The tool hciattach_bcm43xx defines the default firmware path in `/etc/firmware`, but the Broadcom firmware blobs are usually stored in `/lib/firmware`. Signed-off-by: Jörg Krause --- package/bluez5_utils/bluez5_utils.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/bluez5_utils/bluez5_utils.mk b/package/bluez5_utils/bluez5_utils.mk index 13658cd050..af3dfbe38d 100644 --- a/package/bluez5_utils/bluez5_utils.mk +++ b/package/bluez5_utils/bluez5_utils.mk @@ -80,6 +80,10 @@ define BLUEZ5_UTILS_INSTALL_GATTTOOL $(INSTALL) -D -m 0755 $(@D)/attrib/gatttool $(TARGET_DIR)/usr/bin/gatttool endef BLUEZ5_UTILS_POST_INSTALL_TARGET_HOOKS += BLUEZ5_UTILS_INSTALL_GATTTOOL +# hciattach_bcm43xx defines default firmware path in `/etc/firmware`, but +# Broadcom firmware blobs are usually located in `/lib/firmware`. +BLUEZ5_UTILS_CONF_ENV += \ + CPPFLAGS='$(TARGET_CPPFLAGS) -DFIRMWARE_DIR=\"/lib/firmware\"' BLUEZ5_UTILS_CONF_OPTS += --enable-deprecated else BLUEZ5_UTILS_CONF_OPTS += --disable-deprecated From patchwork Thu Aug 31 09:49:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 808145 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xjczc4H1cz9s7G for ; Thu, 31 Aug 2017 19:49:47 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id DBA8C3095D; Thu, 31 Aug 2017 09:49:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0fZXI-By+Eax; Thu, 31 Aug 2017 09:49:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 9E03230956; Thu, 31 Aug 2017 09:49:43 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 320D91C0D4C for ; Thu, 31 Aug 2017 09:49:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 1B48889C6A for ; Thu, 31 Aug 2017 09:49:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7WNEIwuXDEN6 for ; Thu, 31 Aug 2017 09:49:40 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by hemlock.osuosl.org (Postfix) with ESMTPS id AC77E89C62 for ; Thu, 31 Aug 2017 09:49:39 +0000 (UTC) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3xjczP0XG7z10Hm for ; Thu, 31 Aug 2017 11:49:37 +0200 (CEST) Received: from mail.embedded.rocks ([127.0.0.1]) by localhost (mail.embedded.rocks [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id LTYeddI6EfCS; Thu, 31 Aug 2017 11:49:35 +0200 (CEST) Received: from nzxt.fritz.box (port-92-195-126-231.dynamic.qsc.de [92.195.126.231]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Thu, 31 Aug 2017 11:49:35 +0200 (CEST) From: =?utf-8?q?J=C3=B6rg_Krause?= To: buildroot@buildroot.org Date: Thu, 31 Aug 2017 11:49:32 +0200 Message-Id: <20170831094932.11121-2-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170831094932.11121-1-joerg.krause@embedded.rocks> References: <20170831094932.11121-1-joerg.krause@embedded.rocks> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] bluez5_utils: add upstream patch to fix timeout issue with fw download X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add upstream patch [1] for the hciattach tool to fix timeout issue when downloading firmware to Broadcom bluetooth chips. [1] https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=76255f732d68aef2b90d36d9c7be51a9e1739ce7 Signed-off-by: Jörg Krause --- ...cm43xx-fix-the-delay-timer-for-firmware-d.patch | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 package/bluez5_utils/0002-hciattach-bcm43xx-fix-the-delay-timer-for-firmware-d.patch diff --git a/package/bluez5_utils/0002-hciattach-bcm43xx-fix-the-delay-timer-for-firmware-d.patch b/package/bluez5_utils/0002-hciattach-bcm43xx-fix-the-delay-timer-for-firmware-d.patch new file mode 100644 index 0000000000..2802510b98 --- /dev/null +++ b/package/bluez5_utils/0002-hciattach-bcm43xx-fix-the-delay-timer-for-firmware-d.patch @@ -0,0 +1,38 @@ +From 3b341fb421ef61db7782bf1314ec693828467de9 Mon Sep 17 00:00:00 2001 +From: Andy Duan +Date: Wed, 23 Nov 2016 17:12:12 +0800 +Subject: [PATCH] hciattach: bcm43xx: fix the delay timer for firmware download + +From the log in .bcm43xx_load_firmware(): + /* Wait 50ms to let the firmware placed in download mode */ + nanosleep(&tm_mode, NULL); + +But timespec tm_mode is real is 50us. Correct the delayed timer count. + +Backported from: +https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=76255f732d68aef2b90d36d9c7be51a9e1739ce7 + +Signed-off-by: Fugang Duan +Signed-off-by: Jörg Krause +--- + tools/hciattach_bcm43xx.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tools/hciattach_bcm43xx.c b/tools/hciattach_bcm43xx.c +index 81f38cb..ac1b3c1 100644 +--- a/tools/hciattach_bcm43xx.c ++++ b/tools/hciattach_bcm43xx.c +@@ -228,8 +228,8 @@ static int bcm43xx_set_speed(int fd, struct termios *ti, uint32_t speed) + static int bcm43xx_load_firmware(int fd, const char *fw) + { + unsigned char cmd[] = { HCI_COMMAND_PKT, 0x2e, 0xfc, 0x00 }; +- struct timespec tm_mode = { 0, 50000 }; +- struct timespec tm_ready = { 0, 2000000 }; ++ struct timespec tm_mode = { 0, 50000000 }; ++ struct timespec tm_ready = { 0, 200000000 }; + unsigned char resp[CC_MIN_SIZE]; + unsigned char tx_buf[1024]; + int len, fd_fw, n; +-- +1.9.1 +