From patchwork Thu Mar 7 19:00:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guennadi Liakhovetski X-Patchwork-Id: 2233431 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A4C583FCF6 for ; Thu, 7 Mar 2013 19:00:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759464Ab3CGTAl (ORCPT ); Thu, 7 Mar 2013 14:00:41 -0500 Received: from moutng.kundenserver.de ([212.227.126.171]:56547 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757202Ab3CGTAk (ORCPT ); Thu, 7 Mar 2013 14:00:40 -0500 Received: from axis700.grange (dslb-178-001-151-034.pools.arcor-ip.net [178.1.151.34]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MdEqR-1UW1qq3Fo3-00IZUs; Thu, 07 Mar 2013 20:00:35 +0100 Received: by axis700.grange (Postfix, from userid 1000) id 5DEAF40BB4; Thu, 7 Mar 2013 20:00:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by axis700.grange (Postfix) with ESMTP id 5AE5640BB3; Thu, 7 Mar 2013 20:00:35 +0100 (CET) Date: Thu, 7 Mar 2013 20:00:35 +0100 (CET) From: Guennadi Liakhovetski X-X-Sender: lyakh@axis700.grange To: Magnus Damm cc: Simon Horman , Linux-SH Subject: [no-PATCH 2/3] ARM: shmobile: add ethernet support to kzm9g-reference In-Reply-To: Message-ID: References: <20130301110802.GB24364@verge.net.au> <20130301122805.GD24364@verge.net.au> <20130304130035.GA31626@verge.net.au> MIME-Version: 1.0 X-Provags-ID: V02:K0:qZpg9yDl8D//kRn9Ba4uQ7rOqCjGgaSZQIhYP1mT3T4 5gkjiMrDaSWEOIks7YAQYeydB0315JEK01JKk1o/8hYpfpbc4M L1Ezg0S4NHzwVgoxZb0Ul6bOKR1jlvj5ZaHqB43OnaVC5wmxBH rPlyDAqIVx4HHg3COXi4iZcpWE4KrnNTQvbuN8c2RDT1a/dlAn Ne/GrGU+jlrGN6cP1webctLjn/U2uO6OZ5clIRPWIyebaJ3v9/ rbPvwxZOfHXOzzx+vgp7/CxXmY78qosPPtYvWX5qjlGb7HjJUc kLKp8HN86REAfwF2Jt3KBhO+XCC7KovRJTxQWOJkKgzHBKz9hv Qxsn6E3+6FM3MVeEDWD4r/bKIIftzqkOIVRXFbO5KUr/Powwb3 EQ80ArDDFdkiw== Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Enable the smsc9221 ethernet controller on kzm9g-reference in the board .c file, because INTCS initialisation from DT isn't supported yet. Not-Signed-off-by: Guennadi Liakhovetski --- arch/arm/mach-shmobile/board-kzm9g-reference.c | 44 ++++++++++++++++++++++++ 1 files changed, 44 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c index fbbaa55..81d44d8 100644 --- a/arch/arm/mach-shmobile/board-kzm9g-reference.c +++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c @@ -28,12 +28,53 @@ #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.0"), + REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), +}; + +/* SMSC 9221 */ +static struct resource smsc9221_resources[] = { + [0] = { + .start = 0x10000000, /* CS4 */ + .end = 0x100000ff, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = irq_pin(3), /* IRQ3 */ + .flags = IORESOURCE_IRQ, + }, +}; + +static struct smsc911x_platform_config smsc9221_platdata = { + .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS, + .phy_interface = PHY_INTERFACE_MODE_MII, + .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, + .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL, +}; + +static struct platform_device smsc_device = { + .name = "smsc911x", + .dev = { + .platform_data = &smsc9221_platdata, + }, + .resource = smsc9221_resources, + .num_resources = ARRAY_SIZE(smsc9221_resources), +}; + static const struct pinctrl_map kzm_pinctrl_map[] = { PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0", "i2c3_1", "i2c3"), @@ -49,6 +90,9 @@ static void __init kzm_init(void) pinctrl_register_mappings(kzm_pinctrl_map, ARRAY_SIZE(kzm_pinctrl_map)); sh73a0_pinmux_init(); + regulator_register_fixed(2, dummy_supplies, ARRAY_SIZE(dummy_supplies)); + platform_device_register(&smsc_device); + /* enable MMCIF */ gpio_request(GPIO_FN_MMCCLK0, NULL); gpio_request(GPIO_FN_MMCCMD0_PU, NULL);