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: 722364 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (unknown [IPv6:2001:1868:a000:17::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vCvxN2TCYz9t2D for ; Wed, 1 Feb 2017 18:33:11 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RPwB3+Pz"; dkim-atps=neutral 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-3X; 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-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:4010:c07:0:0:0:241 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zajec5[at]gmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (zajec5[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list 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+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org 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;