From patchwork Tue Mar 26 14:12:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2337401 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 9E612DF264 for ; Tue, 26 Mar 2013 14:10:24 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UKUXl-0007cU-Tu; Tue, 26 Mar 2013 14:08:05 +0000 Received: from mail-pb0-f53.google.com ([209.85.160.53]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UKUWm-0007H7-T7 for linux-arm-kernel@lists.infradead.org; Tue, 26 Mar 2013 14:07:06 +0000 Received: by mail-pb0-f53.google.com with SMTP id un1so4725599pbc.40 for ; Tue, 26 Mar 2013 07:07:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:date:message-id:in-reply-to:references :subject; bh=WlWhN6eQ1feb/Z2ATrX3XhxfnQe3OuNItTSeP5tTIjI=; b=fS7H535rgaZk/hro1HydMi8Zl/legRS/0pwErRUcwUPwRV/OZvpHU0Yw0W8VdlgZi0 4M2VeHObITB49YfQ9f+IJ0E9xMFdmo1YbsHTJVjGbOE8rVI6vlRgO2rKNFggpfEgijUG tEgqrW5V6kGSwBae8Dk/E05MvjOJUmO42T4vbgpAYdvDepOSlXMLqXA1n1U9oxsSg5BY Z1XA7wc8dta5acnC5+WZnaeQvlL1gnGCoMiQoqfqii4Pfck+Zcu82mMSiOTA8HZuUrnL WtwtFGHageM74F7QOu+ogF9PeM4mE3eRd8chCqbM/KTc57guKACQqi51Y/v9um38HGzs KlXg== X-Received: by 10.68.14.233 with SMTP id s9mr23367833pbc.154.1364306821521; Tue, 26 Mar 2013 07:07:01 -0700 (PDT) Received: from [127.0.0.1] (FLH1All083.tky.mesh.ad.jp. [211.13.49.83]) by mx.google.com with ESMTPS id ky10sm2589655pab.23.2013.03.26.07.06.58 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Mar 2013 07:07:00 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Tue, 26 Mar 2013 23:12:56 +0900 Message-Id: <20130326141256.19958.260.sendpatchset@w520> In-Reply-To: <20130326141228.19958.93081.sendpatchset@w520> References: <20130326141228.19958.93081.sendpatchset@w520> Subject: [PATCH 03/03 v2] ARM: shmobile: APE6EVM LAN9220 support X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130326_100705_138034_F65D47E4 X-CRM114-Status: GOOD ( 12.44 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.53 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (magnus.damm[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_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 -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: kuninori.morimoto.gx@renesas.com, arnd@arndb.de, Magnus Damm , horms@verge.net.au, olof@lixom.net, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Magnus Damm Add LAN9220 support to the APE6EVM board using C and DT. At this point the PFC driver lacks DT bindings so to configure the PFC we use PINCTRL in C board code. Signed-off-by: Magnus Damm --- Changes since V1: - Use PINCTRL instead of function GPIOs. - Modify bootargs to enable DHCP and NFS root. arch/arm/boot/dts/r8a73a4-ape6evm.dts | 23 ++++++++++++++++++- arch/arm/mach-shmobile/board-ape6evm.c | 38 ++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) --- 0020/arch/arm/boot/dts/r8a73a4-ape6evm.dts +++ work/arch/arm/boot/dts/r8a73a4-ape6evm.dts 2013-03-26 23:06:31.000000000 +0900 @@ -16,11 +16,32 @@ compatible = "renesas,ape6evm", "renesas,r8a73a4"; chosen { - bootargs = "console=ttySC0,115200 ignore_loglevel"; + bootargs = "console=ttySC0,115200 ignore_loglevel root=/dev/nfs ip=dhcp"; }; memory@40000000 { device_type = "memory"; reg = <0x40000000 0x40000000>; }; + + ape6evm_fixed_3v3: fixedregulator@0 { + compatible = "regulator-fixed"; + regulator-name = "3V3"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + + ethernet@8000000 { + compatible = "smsc,lan9118", "smsc,lan9115"; + reg = <0x08000000 0x1000>; + interrupt-parent = <&irqc1>; + interrupts = <8 0x4>; + phy-mode = "mii"; + reg-io-width = <4>; + smsc,irq-active-high; + smsc,irq-push-pull; + vdd33a-supply = <&ape6evm_fixed_3v3>; + vddvario-supply = <&ape6evm_fixed_3v3>; + }; }; --- 0021/arch/arm/mach-shmobile/board-ape6evm.c +++ work/arch/arm/mach-shmobile/board-ape6evm.c 2013-03-26 23:06:14.000000000 +0900 @@ -18,20 +18,49 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include #include #include #include +#include +#include +#include #include +#include #include #include #include +/* Dummy supplies, where voltage doesn't matter */ +static struct regulator_consumer_supply dummy_supplies[] = { + REGULATOR_SUPPLY("vddvario", "smsc911x"), + REGULATOR_SUPPLY("vdd33a", "smsc911x"), +}; + +/* SMSC LAN9220 */ +static const struct resource lan9220_res[] = { + DEFINE_RES_MEM(0x08000000, 0x1000), + { + .start = irq_pin(40), /* IRQ40 */ + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH, + }, +}; + +static const struct smsc911x_platform_config lan9220_data = { + .flags = SMSC911X_USE_32BIT, + .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH, +}; + static const struct pinctrl_map ape6evm_pinctrl_map[] = { /* SCIFA0 console */ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.0", "pfc-r8a73a4", "scifa0_data", "scifa0"), + /* SMSC */ + PIN_MAP_MUX_GROUP_DEFAULT("smsc911x", "pfc-r8a73a4", + "irqc_irq40", "irqc"), }; static void __init ape6evm_add_standard_devices(void) @@ -41,6 +70,15 @@ static void __init ape6evm_add_standard_ ARRAY_SIZE(ape6evm_pinctrl_map)); r8a73a4_pinmux_init(); r8a73a4_add_standard_devices(); + + /* LAN9220 ethernet */ + gpio_request_one(270, GPIOF_OUT_INIT_HIGH, NULL); /* smsc9220 RESET */ + + regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); + + platform_device_register_resndata(&platform_bus, "smsc911x", -1, + lan9220_res, ARRAY_SIZE(lan9220_res), + &lan9220_data, sizeof(lan9220_data)); } static const char *ape6evm_boards_compat_dt[] __initdata = {