From patchwork Mon Mar 18 15:10:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 2293761 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 5247F3FCF6 for ; Mon, 18 Mar 2013 15:37:26 +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 1UHc5D-0008Dd-KN; Mon, 18 Mar 2013 15:34:43 +0000 Received: from mail-da0-x229.google.com ([2607:f8b0:400e:c00::229]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UHbbz-0002Su-TP for linux-arm-kernel@lists.infradead.org; Mon, 18 Mar 2013 15:04:34 +0000 Received: by mail-da0-f41.google.com with SMTP id w4so559704dam.14 for ; Mon, 18 Mar 2013 08:04:28 -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=Oam35CXfZexvMlkAsHxcvlmK+nmRyfJKOf6T03KbK4k=; b=OL3LMYZ5MWcbbqOfGUhuBu37JzJX20mW6I0y9sHFugnPtnmb47/fVw5lv7jyT5uOXf Q1A6CU+hjsWwwifOS7LXXe1QkHCd/vYHIKBizbn6BdTbSHh2g0zuOLkcB7StkAZA5Z+E 6WnqXORZ3OoTg/43i6cJuAhK/xcuzzz48PQmckspa735VyWiodOEJbOrQglBG8tTFKrH VdLsTUYAkQ8i6PYJAhAl8Iurz7n7nfMUASflpM8TWrkyZKk/ScdspLZTVy3IbwQQIO7+ TU2SALOw+yWWEextFRAbkWRyjjMX8lecc36dvPCbg60tJDfYEPRnM1mFX+kGowp1NnjB /cUA== X-Received: by 10.66.150.198 with SMTP id uk6mr10875617pab.57.1363619068595; Mon, 18 Mar 2013 08:04:28 -0700 (PDT) Received: from [127.0.0.1] (FLH1All083.tky.mesh.ad.jp. [211.13.49.83]) by mx.google.com with ESMTPS id rt13sm8537275pac.14.2013.03.18.08.04.25 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 18 Mar 2013 08:04:27 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Date: Tue, 19 Mar 2013 00:10:21 +0900 Message-Id: <20130318151021.28231.51294.sendpatchset@w520> In-Reply-To: <20130318150953.28231.73454.sendpatchset@w520> References: <20130318150953.28231.73454.sendpatchset@w520> Subject: [PATCH 03/03] ARM: shmobile: APE6EVM LAN9220 support X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130318_110433_474570_02A5C997 X-CRM114-Status: GOOD ( 11.52 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 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 lacks DT bindings so to configure the pinmux we need to use C. Signed-off-by: Magnus Damm --- Written against "next" renesas.git 811689afc214564c4a5f238ecf4d8bdc0e52b615 Depends on the following two series: [PATCH 00/04] ARM: shmobile: r8a73a4 SoC support V2 [PATCH 00/02] sh-pfc: Initial r8a73a4 PFC support arch/arm/boot/dts/r8a73a4-ape6evm.dts | 21 ++++++++++++++++++ arch/arm/mach-shmobile/Kconfig | 1 arch/arm/mach-shmobile/board-ape6evm.c | 36 ++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) --- 0009/arch/arm/boot/dts/r8a73a4-ape6evm.dts +++ work/arch/arm/boot/dts/r8a73a4-ape6evm.dts 2013-03-18 22:13:31.000000000 +0900 @@ -23,4 +23,25 @@ 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>; + }; }; --- 0010/arch/arm/mach-shmobile/Kconfig +++ work/arch/arm/mach-shmobile/Kconfig 2013-03-18 22:13:44.000000000 +0900 @@ -83,6 +83,7 @@ config MACH_APE6EVM bool "APE6EVM board" depends on ARCH_R8A73A4 select ARCH_REQUIRE_GPIOLIB + select REGULATOR_FIXED_VOLTAGE if REGULATOR select USE_OF config MACH_MACKEREL --- 0010/arch/arm/mach-shmobile/board-ape6evm.c +++ work/arch/arm/mach-shmobile/board-ape6evm.c 2013-03-18 22:13:31.000000000 +0900 @@ -23,11 +23,36 @@ #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 void __init ape6evm_add_standard_devices(void) { r8a73a4_clock_init(); @@ -38,6 +63,17 @@ static void __init ape6evm_add_standard_ gpio_request(GPIO_FN_SCIFA0_RXD, NULL); r8a73a4_add_standard_devices(); + + /* LAN9220 ethernet */ + gpio_request(GPIO_FN_IRQ40, NULL); /* smsc9220 IRQ */ + gpio_request(GPIO_PORT270, NULL); /* smsc9220 RESET */ + gpio_direction_output(GPIO_PORT270, 1); + + 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 = {