From patchwork Wed Mar 7 11:28:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 10263851 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5B2026016D for ; Wed, 7 Mar 2018 11:29:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D7462932E for ; Wed, 7 Mar 2018 11:29:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41B372945F; Wed, 7 Mar 2018 11:29:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 91C8B2932E for ; Wed, 7 Mar 2018 11:29:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Subject:References: In-Reply-To:Message-ID:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hcN2O+B0C9eyZPKuDzfaICx6S40lU+7uXEO93Bh42sI=; b=vAOWcMyRjhgsU8 PX1ou7xHEzP5IC+ofQwks3RqUpYNbXHzarKD6vWGWPCzhmPmeZZPrszNCdsU3WzIydl9YlRoVyXOn FY4en9zkACKzYnYRJJ9vkcNJ+YyLFKXmq0xMUC/fyrO/WhIjZhB0u82cESlRe50XrUqHowhh5OpAW /kt941IDpXx2H0nE7ZX8QISMP1MqNCFlH3VYLbUeUjTDBXOgX/eVbfWoQfCRpvwbZ+uPGHdK4mYyt EdZouz2dcoNu469rkHUgf1GM+iHBntzeHU0288AZWc/j+025tLsPQUlA2qs33OSgapQu24PIIYMW3 lyvx+ZzD1ONjhxpLrcTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1etXFk-0004W0-0l; Wed, 07 Mar 2018 11:29:00 +0000 Received: from mout.kundenserver.de ([212.227.126.134]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1etXFd-0004UT-Ou; Wed, 07 Mar 2018 11:28:56 +0000 Received: from null ([172.19.246.44]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.167]) with ESMTPSA (Nemesis) id 0LgBEG-1eNXwo2JMa-00nefn; Wed, 07 Mar 2018 12:28:30 +0100 Date: Wed, 7 Mar 2018 12:28:28 +0100 (CET) From: Stefan Wahren To: Marcel Holtmann Message-ID: <438185389.274708.1520422108782@email.1und1.de> In-Reply-To: <9D6209F2-5389-4F4E-844D-6A8683044F88@holtmann.org> References: <1519567855-26105-1-git-send-email-stefan.wahren@i2se.com> <1519567855-26105-4-git-send-email-stefan.wahren@i2se.com> <84F7E645-59B4-4618-8C91-A5CD654E16A6@holtmann.org> <648118289.71086.1519593373795@email.1und1.de> <9D6209F2-5389-4F4E-844D-6A8683044F88@holtmann.org> Subject: Re: [PATCH 3/4] ARM: dts: bcm2835-rpi-zero-w: Add bcm43438 serial slave MIME-Version: 1.0 X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.4-Rev22 X-Originating-Client: open-xchange-appsuite X-Provags-ID: V03:K0:H1rZ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22es= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180307_032854_227444_248270D0 X-CRM114-Status: GOOD ( 20.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Florian Fainelli , Johan Hedberg , =?UTF-8?Q?Fr=C3=A9d=C3=A9ric_Danis?= , Phil Elwell , linux-bluetooth@vger.kernel.org, Rob Herring , Eric Anholt , Lukas Wunner , linux-rpi-kernel@lists.infradead.org, Loic Poulain , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Marcel, > Marcel Holtmann hat am 25. Februar 2018 um 22:38 geschrieben: > > > Hi Stefan, > > >>> Add BCM43438 (bluetooth) as a serdev slave device of uart0 (pl011/ttyAMA0). > >>> This allows to automatically insert the bcm43438 to the bluetooth > >>> subsystem instead of relying on patched userspace helpers (hciattach). > >>> > >>> In order to keep a debug UART we need to switch to uart1. > >>> > >>> Signed-off-by: Stefan Wahren > >>> --- > >>> arch/arm/boot/dts/bcm2835-rpi-zero-w.dts | 14 +++++++++++++- > >>> 1 file changed, 13 insertions(+), 1 deletion(-) > >>> > >>> diff --git a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts > >>> index cf53436..b7f79f1 100644 > >>> --- a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts > >>> +++ b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts > >>> @@ -131,6 +131,18 @@ > >>> > >>> &uart0 { > >>> pinctrl-names = "default"; > >>> - pinctrl-0 = <&uart0_gpio14>; > >>> + pinctrl-0 = <&uart0_gpio32 &uart0_ctsrts_gpio30>; > >>> + status = "okay"; > >>> + > >>> + bluetooth { > >>> + compatible = "brcm,bcm43438-bt"; > >>> + max-speed = <2000000>; > >>> + shutdown-gpios = <&gpio 45 GPIO_ACTIVE_HIGH>; > >>> + }; > >>> +}; > >> > >> is the shutdown GPIO working as expected with this hardware. So even module unload and reload works fine? > > > > Yes, unload and reload works fine. > > > >> Meaning we are getting back to the 115200 default baud rate on the UART? > > > > I assume that, because reload works as expected. > > awesome. That is good news. > > Since you said that the GPIO expander driver for the RPi 3 has been accepted, did you test it there as well? If so, then it would be good to get a patch that also provides shutdown-gpios for RPi 3. after applying Loic's patch and the necessary patch for the RPi 3 dts file (see below), i will get this output: [ 4.873246] Bluetooth: HCI UART driver ver 2.3 [ 4.873260] Bluetooth: HCI UART protocol H4 registered [ 4.873265] Bluetooth: HCI UART protocol Three-wire (H5) registered [ 4.873751] Bluetooth: HCI UART protocol Broadcom registered [ 4.877279] uart-pl011 3f201000.serial: no DMA platform data [ 6.952382] Bluetooth: hci0: command 0xfc18 tx timeout [ 15.192298] Bluetooth: hci0: BCM: failed to write update baudrate (-110) [ 15.192312] Bluetooth: hci0: Failed to set baudrate [ 15.316415] Bluetooth: hci0: BCM: chip id 94 [ 15.318567] Bluetooth: hci0: BCM: features 0x2e [ 15.341538] Bluetooth: hci0: BCM43430A1 [ 15.341560] Bluetooth: hci0: BCM43430A1 (001.002.009) build 0000 [ 19.112670] Bluetooth: hci0: BCM (001.002.009) build 0360 [ 274.713732] Bluetooth: hci0: command 0x0c14 tx timeout [ 274.714085] Bluetooth: hci0: Frame reassembly failed (-84) [ 317.275941] Bluetooth: hci0: last event is not cmd complete (0x0f) I don't see these errors on RPi Zero W. Maybe the reason for this is the lack of hardware flowcontrol on RPi 3. Or some of the downstream patches on BlueZ must be adapted for the kernel [1]. Btw the bcm43438 is detected even after unloading and reloading the driver. But the timeout occurs also on driver reload. Reducing the baudrate to 115200 doesn't help here. Sorry in case this patch gets corrupted by my webmailer. Stefan [1] - https://gist.github.com/pelwell/c8230c48ea24698527cd > > Regards > > Marcel > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts index 0b31d99..3e87ed0 100644 --- a/arch/arm/boot/dts/bcm2837-rpi-3-b.dts +++ b/arch/arm/boot/dts/bcm2837-rpi-3-b.dts @@ -20,9 +20,14 @@ leds { act { - gpios = <&gpio 47 GPIO_ACTIVE_HIGH>; + gpios = <&expgpio 2 GPIO_ACTIVE_HIGH>; }; }; + + wifi_pwrseq: wifi-pwrseq { + compatible = "mmc-pwrseq-simple"; + reset-gpios = <&expgpio 1 GPIO_ACTIVE_HIGH>; + }; }; &firmware { @@ -42,6 +47,10 @@ }; }; +&hdmi { + hpd-gpios = <&expgpio 4 GPIO_ACTIVE_LOW>; +}; + /* uart0 communicates with the BT module */ &uart0 { pinctrl-names = "default"; @@ -51,6 +60,7 @@ bluetooth { compatible = "brcm,bcm43438-bt"; max-speed = <2000000>; + shutdown-gpios = <&expgpio 0 GPIO_ACTIVE_HIGH>; }; }; @@ -63,11 +73,19 @@ /* SDHCI is used to control the SDIO for wireless */ &sdhci { + #address-cells = <1>; + #size-cells = <0>; pinctrl-names = "default"; pinctrl-0 = <&emmc_gpio34>; status = "okay"; bus-width = <4>; non-removable; + mmc-pwrseq = <&wifi_pwrseq>; + + brcmf: wifi@1 { + reg = <1>; + compatible = "brcm,bcm4329-fmac"; + }; }; /* SDHOST is used to drive the SD card */