From patchwork Wed Feb 1 07:32:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9548975 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 5AA1960415 for ; Wed, 1 Feb 2017 07:33:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AD72281A7 for ; Wed, 1 Feb 2017 07:33:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E7B82831C; Wed, 1 Feb 2017 07:33:11 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 9DFC9281A7 for ; Wed, 1 Feb 2017 07:33:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cYpPh-0002Dw-0F; Wed, 01 Feb 2017 07:33:09 +0000 Received: from mail-lf0-x241.google.com ([2a00:1450:4010:c07::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cYpPc-0002C0-KY for linux-arm-kernel@lists.infradead.org; Wed, 01 Feb 2017 07:33:06 +0000 Received: by mail-lf0-x241.google.com with SMTP id x1so35817678lff.0 for ; Tue, 31 Jan 2017 23:32:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ETeTYRK24c6RXbYre0nf+L9RMw0EXud7iTnJ7CUixGo=; b=RPwB3+PzJbsfWzIgxhrUPNnJVA4lNsXTIeRzdGIANcGlVxdzDoJioRQtdadC5gX5GN fpQUiFOtrRsZYCjgNi//K478F7FK+FjXBuBA8Nk81OwvXYnBxA4gkQa9GxGoCOcxjcoY WixkEZCrzXqMGPDW3+6YYUDgYgWetTOLC91/RGApE2e8MoVlppscnmZPYeUMwJ51NBf5 QlxiIlP3j4rzXorrMxtWgLNDnrtuN+oX+vfLLEh8N5193ouNbBUiTPURxkmAxwyT7xB/ uKxnIbW7CoimM8vMYxMngggG7WWdrWhN+CibndmftVHXvKZiWRirPkv7ShayouoOLazp WgWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ETeTYRK24c6RXbYre0nf+L9RMw0EXud7iTnJ7CUixGo=; b=FTKVXIof/C0mKDEkzz3lX+x98I2Rv8oOAk6dTgrdt9vv64S+g8Mr3mqL7o+r8h12ll f9OZKp0Eta7dZYGKhGhTO02d1WaxUBTXoGVZjbayyW4+VtOYpNAMOoe4R43nddBlEKwO hArSHsMRkmYfip0OVUovsE77E//CQsWN7mfMAxw7dloO6P54T6mNWPtZbQX1Hv99hv1y F2QlVu+2B9jjP5DRKO9SGk5JlqhOci2UF2Ng6RIy+8Cv87M5r4eMLZuswlexCkRZD0zf dknovSBRWDkEWOjAeKVSHr+NYb6LeUOAsSQPEENAHpKYmmMb/hZlvZ88iraU4rhSRoP4 H/TA== X-Gm-Message-State: AIkVDXKOHxToUsVyPm/r+ktFHPFr+QshJvxkODaxrsl2zlxSoD9/GC4bdO57/BNV4xgVLg== X-Received: by 10.25.227.14 with SMTP id a14mr411942lfh.43.1485934359301; Tue, 31 Jan 2017 23:32:39 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id c18sm5435710ljb.8.2017.01.31.23.32.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jan 2017 23:32:38 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: linux-arm-kernel@lists.infradead.org Subject: [PATCH RFC] ARM: dts: BCM53573: Specify PCIe card with bcma and ChipCommon (DT ranges mess) Date: Wed, 1 Feb 2017 08:32:18 +0100 Message-Id: <20170201073218.30026-1-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170131_233304_890447_8D38E5F3 X-CRM114-Status: GOOD ( 13.33 ) 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 , Hauke Mehrtens , Russell King , Rob Herring , bcm-kernel-feedback-list@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= 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 From: Rafał Miłecki Tenda AC9 has PCIe controller with just one card connected to it: 0000:00:00.0 14e4:d145 Bridge Device └─ 0000:01:00.0 14e4:a8db Network Controller This card has bcma bus with GPIO controller on its ChipCommon core. We need to describe that if we want to reference that GPIO controller in DT. This patch adds nested DT entries for: 1) PCIe controller 2) PCIe bridge 3) PCIe wireless card 4) ChipCommon that is on the wireless card Signed-off-by: Rafał Miłecki --- This DT change seems to work, it only requires a simple change in bcma code of adding bcma_of_fill_device call for PCIe hosted bus. I'm not convinced about these ranges though. I need them because bcma uses of_translate_address. AFAIU this function requires ranges to be specified all the way up till the root node. It means I need to specify them for every nested node. I also can't simply use: ranges; because it works only for #address-cells 1 and #size-cells 1. Also since ranges expects parent #address-cells, child #address-cells, #size-cells I needed different values depending on the node. Does it look OK to you? Or is there some easier solution? --- arch/arm/boot/dts/bcm47189-tenda-ac9.dts | 10 ++++++++++ arch/arm/boot/dts/bcm53573.dtsi | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/arch/arm/boot/dts/bcm47189-tenda-ac9.dts b/arch/arm/boot/dts/bcm47189-tenda-ac9.dts index 4403ae8790c2..1c36ee1f94a0 100644 --- a/arch/arm/boot/dts/bcm47189-tenda-ac9.dts +++ b/arch/arm/boot/dts/bcm47189-tenda-ac9.dts @@ -48,6 +48,16 @@ }; }; + pcie0_leds { + compatible = "gpio-leds"; + + 2ghz { + label = "bcm53xx:blue:2ghz"; + gpios = <&pcie0_chipcommon 3 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "default-off"; + }; + }; + gpio-keys { compatible = "gpio-keys"; #address-cells = <1>; diff --git a/arch/arm/boot/dts/bcm53573.dtsi b/arch/arm/boot/dts/bcm53573.dtsi index 2da04d0a7348..b55491da63d7 100644 --- a/arch/arm/boot/dts/bcm53573.dtsi +++ b/arch/arm/boot/dts/bcm53573.dtsi @@ -113,6 +113,39 @@ }; }; + pcie0: pcie@12000 { + reg = <0x00002000 0x1000>; + + /* All code below looks device specific and should go to + * the device DT. It's here only for RFC patch needs to + * make it easier to review. + */ + ranges = <0x00000000 0 0 0 0 0x00100000>; + #address-cells = <3>; + #size-cells = <2>; + + bridge@0,0,0 { + reg = <0x0000 0 0 0 0>; + ranges = <0x00000000 0 0 0 0 0 0 0x00100000>; + #address-cells = <3>; + #size-cells = <2>; + + wifi@0,1,0 { + reg = <0x0000 0 0 0 0>; + ranges = <0x00000000 0 0 0 0x00100000>; + #address-cells = <1>; + #size-cells = <1>; + + pcie0_chipcommon: chipcommon@0 { + reg = <0 0x1000>; + + gpio-controller; + #gpio-cells = <2>; + }; + }; + }; + }; + usb2: usb2@4000 { reg = <0x4000 0x1000>; ranges;