From patchwork Wed Aug 24 08:52:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9297195 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 BC554607EE for ; Wed, 24 Aug 2016 08:56:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AA8CA28AE7 for ; Wed, 24 Aug 2016 08:56:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9DFF128EA3; Wed, 24 Aug 2016 08:56:02 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8ACBA28AE7 for ; Wed, 24 Aug 2016 08:56:01 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bcTxG-0002JA-KN; Wed, 24 Aug 2016 08:54:38 +0000 Received: from mail-lf0-x231.google.com ([2a00:1450:4010:c07::231]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bcTw1-0001lN-1u for linux-arm-kernel@lists.infradead.org; Wed, 24 Aug 2016 08:53:23 +0000 Received: by mail-lf0-x231.google.com with SMTP id f93so7034985lfi.2 for ; Wed, 24 Aug 2016 01:53:04 -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:in-reply-to:references; bh=8Otd1zDHIOkN1EeNEfOt1qc1JvINqF2qoFR4IXstwa8=; b=LnC8EyLI4MS9EIAS+DcZ6h3oo6NQYmGgZxuqKac0niGtu9QtuHuaFZdrbLAgP8orKd Kcbw7YVngyyvAi/OKDg1gdGpE5cPCSlY82VdNQyG2BwRBHjtoyO8Gbk5zryoa4y/2HIR 8cmxHyp/ZR+oKWHEkVE2Ea7Ksk5Xz0rW++b6o= 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:in-reply-to :references; bh=8Otd1zDHIOkN1EeNEfOt1qc1JvINqF2qoFR4IXstwa8=; b=hI/nacuMP5NsYLTWBygnHwSYzSsnWEoF27r8HfVPkpq9HNDQdgNTTVo8Eme328uyBx scdwCMQ6aIq/DO3zX/QvrlVk9R8jumxzKyRfnrn8AUWr5daKW3wMlfL9eM46Zgr0c6Fm peml1VhcGUL4V/KiPJ/9yIm7/QsuTr71CMaBIpekUmChEQpmFdBdRN+RmrAeTiquRIt9 eOk2E/vvQNlm2ZilGKhWpcRukxmeO6Ab9W/djTUF0lQNZ7eGr2JU9vwsi1FM7EIrmK6f slWzctG/NlKvE2G0EAoTl6l7y1o8Q99T6I3Wt6CYH+H6NanK/uBVqCWhDMwkWhgTUciX OZfg== X-Gm-Message-State: AEkoouuB68U6YQF7mxTD7zrmTWoKQybrdqEYT3upAQ1Tz1X8PHnu7UwUzrnGN0txsF33eBAJ X-Received: by 10.46.9.71 with SMTP id 68mr522249ljj.0.1472028782532; Wed, 24 Aug 2016 01:53:02 -0700 (PDT) Received: from linuslaptop.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id e65sm1694253lji.32.2016.08.24.01.53.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Aug 2016 01:53:01 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, Andy Gross Subject: [PATCH 4/4 v2] ARM: dts: add SMSC ethernet on the APQ8060 Dragonboard Date: Wed, 24 Aug 2016 10:52:38 +0200 Message-Id: <1472028758-29272-5-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1472028758-29272-1-git-send-email-linus.walleij@linaro.org> References: <1472028758-29272-1-git-send-email-linus.walleij@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160824_015321_524670_C9681D06 X-CRM114-Status: GOOD ( 17.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Brown , Linus Walleij , Stephen Boyd , Bjorn Andersson MIME-Version: 1.0 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 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 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 | 130 +++++++++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts b/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts index 0abc93e5bb00..7e09a3ac0b90 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,41 @@ bias-pull-up; }; }; + + dragon_ebi2_pins: ebi2 { + /* + * Pins used by EBI2 on the Dragonboard, actually only + * only CS2 is used by a real peripheral. CS0 is just + * routed to a test point. + */ + mux0 { + /* + * Pins used by EBI2 on the Dragonboard, actually only + * only CS2 is used by a real peripheral. CS0 is just + * routed to a test point. + */ + 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 +259,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 +305,15 @@ power-source = ; }; }; + dragon_veth_gpios: veth-gpios { + pinconf { + pins = "gpio40"; + function = "normal"; + bias-disable; + drive-push-pull; + // power-source = ; + }; + }; }; }; }; @@ -283,6 +359,60 @@ }; }; + ebi2@1a100000 { + /* The EBI2 will instantiate first, then populate its children */ + status = "ok"; + pinctrl-names = "default"; + pinctrl-0 = <&dragon_ebi2_pins>; + + /* + * SLOW chipselect config + * Delay 9 cycles (140ns@64MHz) between SMSC LAN9221 + * Ethernet controller reads and writes on CS2. + */ + qcom,xmem-recovery-cycles = <0>, <0>, <0>, + <0>, <0>, <0>; + qcom,xmem-write-hold-cycles = <0>, <0>, <3>, + <0>, <0>, <0>; + qcom,xmem-write-delta-cycles = <0>, <0>, <31>, + <0>, <0>, <0>; + qcom,xmem-read-delta-cycles = <0>, <0>, <28>, + <0>, <0>, <0>; + qcom,xmem-write-wait-cycles = <0>, <0>, <9>, + <0>, <0>, <0>; + qcom,xmem-read-wait-cycles = <0>, <0>, <9>, + <0>, <0>, <0>; + + /* + * 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,1b800000 { + 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; + }; + }; + rpm@104000 { /* * Set up of the PMIC RPM regulators for this board