From patchwork Mon Oct 24 22:22:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 79102 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp2813609qge; Mon, 24 Oct 2016 15:22:28 -0700 (PDT) X-Received: by 10.98.100.207 with SMTP id y198mr33238774pfb.49.1477347748189; Mon, 24 Oct 2016 15:22:28 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m65si17506435pfj.199.2016.10.24.15.22.27; Mon, 24 Oct 2016 15:22:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965176AbcJXWW1 (ORCPT + 10 others); Mon, 24 Oct 2016 18:22:27 -0400 Received: from mail-lf0-f47.google.com ([209.85.215.47]:33075 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965165AbcJXWW0 (ORCPT ); Mon, 24 Oct 2016 18:22:26 -0400 Received: by mail-lf0-f47.google.com with SMTP id x79so211573738lff.0 for ; Mon, 24 Oct 2016 15:22:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=3Y2MnR9odEz25U9Gr+VhzP6zvtE+P75M2725IIrDOx0=; b=j1oMva5XouFw66gYrR7K0/2fzyEMPoclwAzGtJDWDfbBUDmeksX6M38GK3Bcn5Olap mOuaG+2sJ/VfptojewOPDlPUTF3Wmz5BQL0pF8WczhWSE7E32Kvc+R5nlckL6m3fvA2p wC7aXBi1ufjrjPaJMd2rz8KCn9NZpsCX9Rpp0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3Y2MnR9odEz25U9Gr+VhzP6zvtE+P75M2725IIrDOx0=; b=T3nGryhBMcvqp+K52xnnlf17Khbrd7f/zDFkhzJKGLVixFJesIoHbfF7dlHkG1hM2a e9yWyaAxXk1N8xTpiS2IQYCIsD0fmx3t4Ozf6aeQtyA1bSG9jSCSk6lBPPjzI7feuH0L BgV9cpPmKJ+GJs0lEartNhObRbuiUi6PuEvKPqWBaxjdcTPynhkW5E5Hxfmrj3CHaaJ1 Wap0gyJbczxsXCao+g/Cf5bMvla026zHkYjsgfBqvAIz7exOwOai+htLGxJiGcvI7o7P BOxxeIcZXwZ4UVXCOSCwSf+X29hcZZn0eMwxrfQg6Z0Fp3GYStQLIBvZ7zsPpOX9lEFl DzqQ== X-Gm-Message-State: ABUngvclDkJRYTZPpEgeQSV0Y14hAoIY4eR/d9fd4qG7/AlhwfnpLUq0oG5E4EUa7XOXf52T X-Received: by 10.25.234.141 with SMTP id y13mr8792877lfi.25.1477347744557; Mon, 24 Oct 2016 15:22:24 -0700 (PDT) Received: from localhost.localdomain.localdomain (c-357171d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.113.53]) by smtp.gmail.com with ESMTPSA id z204sm3426737lfa.11.2016.10.24.15.22.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Oct 2016 15:22:24 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Andy Gross Cc: Stephen Boyd , Bjorn Andersson , David Brown , Linus Walleij Subject: [PATCH 2/2 v5] ARM: dts: add SMSC ethernet on the APQ8060 Dragonboard Date: Tue, 25 Oct 2016 00:22:20 +0200 Message-Id: <1477347740-10432-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The SMSC9112 ethernet controller is connected to chip select 2 on the EBI2 bus on the APQ8060 Dragonboard. We set this up by activating EBI2, creating a chipselect entry as a subnode, and then putting the ethernet controller in a subnode of the chipselect. After the chipselect is configured, the SMSC device will be instantiated. Signed-off-by: Linus Walleij --- ChangeLog v4->v5: - Rename "ebi2@" to "external-bus@" - Drop double comment. - Drop double "only" in comment. - Can we apply this now? ChangeLog v3->v4: - Rebase on kernel v4.9-rc1 - Bindings and driver are merged so should be clear to apply. ChangeLog v2->v3: - Name chipselected device to ethernet-ebi2@2,0 - Update to the latest (v5) version of the bindings and what the EBI2 driver expects. - The SMSC911x bindings were ACKed by Arnd Bergmann and are merged to the netdev tree by David Miller. - The EBI2 bindings were ACKed by Rob Herring and a pull request for both bindings and driver is pending for ARM SoC. - This should be safe to merge for v4.9. ChangeLog v1->v2: - Use the new bindings with the first address cell indicating the chipselect - Use offset zero into the range in the EBI2 node (the range defines the base address of the chipselect) - Move all the XMEM setup to arrays in the EBI2 node --- arch/arm/boot/dts/qcom-apq8060-dragonboard.dts | 119 +++++++++++++++++++++++++ 1 file changed, 119 insertions(+) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts b/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts index 6c0038398ef2..4b8872cc8bf9 100644 --- a/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts +++ b/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts @@ -51,6 +51,29 @@ regulator-boot-on; }; + /* GPIO controlled ethernet power regulator */ + dragon_veth: xc622a331mrg { + compatible = "regulator-fixed"; + regulator-name = "XC6222A331MR-G"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vph>; + gpio = <&pm8058_gpio 40 GPIO_ACTIVE_HIGH>; + enable-active-high; + pinctrl-names = "default"; + pinctrl-0 = <&dragon_veth_gpios>; + regulator-always-on; + }; + + /* VDDvario fixed regulator */ + dragon_vario: nds332p { + compatible = "regulator-fixed"; + regulator-name = "NDS332P"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + vin-supply = <&pm8058_s3>; + }; + /* This is a levelshifter for SDCC5 */ dragon_vio_txb: txb0104rgyr { compatible = "regulator-fixed"; @@ -167,6 +190,36 @@ bias-pull-up; }; }; + + dragon_ebi2_pins: ebi2 { + /* + * Pins used by EBI2 on the Dragonboard, actually only + * CS2 is used by a real peripheral. CS0 is just + * routed to a test point. + */ + mux0 { + pins = + /* "gpio39", CS1A_N this is not good to mux */ + "gpio40", /* CS2A_N */ + "gpio134"; /* CS0_N testpoint TP29 */ + function = "ebi2cs"; + }; + mux1 { + pins = + /* EBI2_ADDR_7 downto EBI2_ADDR_0 address bus */ + "gpio123", "gpio124", "gpio125", "gpio126", + "gpio127", "gpio128", "gpio129", "gpio130", + /* EBI2_DATA_15 downto EBI2_DATA_0 data bus */ + "gpio135", "gpio136", "gpio137", "gpio138", + "gpio139", "gpio140", "gpio141", "gpio142", + "gpio143", "gpio144", "gpio145", "gpio146", + "gpio147", "gpio148", "gpio149", "gpio150", + "gpio151", /* EBI2_OE_N */ + "gpio153", /* EBI2_ADV */ + "gpio157"; /* EBI2_WE_N */ + function = "ebi2"; + }; + }; }; qcom,ssbi@500000 { @@ -201,6 +254,15 @@ }; gpio@150 { + dragon_ethernet_gpios: ethernet-gpios { + pinconf { + pins = "gpio7"; + function = "normal"; + input-enable; + bias-disable; + power-source = ; + }; + }; dragon_bmp085_gpios: bmp085-gpios { pinconf { pins = "gpio16"; @@ -238,6 +300,14 @@ power-source = ; }; }; + dragon_veth_gpios: veth-gpios { + pinconf { + pins = "gpio40"; + function = "normal"; + bias-disable; + drive-push-pull; + }; + }; }; led@48 { @@ -322,6 +392,55 @@ }; }; + external-bus@1a100000 { + /* The EBI2 will instantiate first, then populate its children */ + status = "ok"; + pinctrl-names = "default"; + pinctrl-0 = <&dragon_ebi2_pins>; + + /* + * An on-board SMSC LAN9221 chip for "debug ethernet", + * which is actually just an ordinary ethernet on the + * EBI2. This has a 25MHz chrystal next to it, so no + * clocking is needed. + */ + ethernet-ebi2@2,0 { + compatible = "smsc,lan9221", "smsc,lan9115"; + reg = <2 0x0 0x100>; + /* + * GPIO7 has interrupt 198 on the PM8058 + * The second interrupt is the PME interrupt + * for network wakeup, connected to the TLMM. + */ + interrupts-extended = <&pmicintc 198 IRQ_TYPE_EDGE_FALLING>, + <&tlmm 29 IRQ_TYPE_EDGE_RISING>; + reset-gpios = <&tlmm 30 GPIO_ACTIVE_LOW>; + vdd33a-supply = <&dragon_veth>; + vddvario-supply = <&dragon_vario>; + pinctrl-names = "default"; + pinctrl-0 = <&dragon_ethernet_gpios>; + phy-mode = "mii"; + reg-io-width = <2>; + smsc,force-external-phy; + /* IRQ on edge falling = active low */ + smsc,irq-active-low; + smsc,irq-push-pull; + + /* + * SLOW chipselect config + * Delay 9 cycles (140ns@64MHz) between SMSC + * LAN9221 Ethernet controller reads and writes + * on CS2. + */ + qcom,xmem-recovery-cycles = <0>; + qcom,xmem-write-hold-cycles = <3>; + qcom,xmem-write-delta-cycles = <31>; + qcom,xmem-read-delta-cycles = <28>; + qcom,xmem-write-wait-cycles = <9>; + qcom,xmem-read-wait-cycles = <9>; + }; + }; + rpm@104000 { /* * Set up of the PMIC RPM regulators for this board