From patchwork Thu Jan 19 18:13:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaccon Bastiaansen X-Patchwork-Id: 136892 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CE38CB6EE8 for ; Fri, 20 Jan 2012 05:25:47 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1RnwUt-0001Jm-BV; Thu, 19 Jan 2012 18:14:03 +0000 Received: from mail-ee0-f49.google.com ([74.125.83.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RnwUp-0001GM-E2 for linux-arm-kernel@lists.infradead.org; Thu, 19 Jan 2012 18:13:59 +0000 Received: by mail-ee0-f49.google.com with SMTP id b15so84153eek.36 for ; Thu, 19 Jan 2012 10:13:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; bh=IKP0pEcjGeY+guwyKaDl2rVtBl85y2XcpFeuFI+2KUc=; b=BpFYTVPgKgyWpxwKHyRBWPSKwbRdmHWSa8/t4ahw2UUF9i0BrbYt9GlGWmcGykAIYk pQ3yZC+OXzA5HwD8lCsCR1P8tUdhF/58zgJTpe9SAyszB4LPQO3OzfvaBaOY0TP3bPFQ cQEksfBuTKYgxqQwIP1oahliMgfCZVvz2F7SE= Received: by 10.14.2.67 with SMTP id 43mr2035943eee.97.1326996839078; Thu, 19 Jan 2012 10:13:59 -0800 (PST) Received: from localhost.localdomain (s529d540e.adsl.wanadoo.nl. [82.157.84.14]) by mx.google.com with ESMTPS id x4sm605412eeb.4.2012.01.19.10.13.56 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 19 Jan 2012 10:13:57 -0800 (PST) From: Jaccon Bastiaansen To: s.hauer@pengutronix.de, kernel@pengutronix.de, u.kleine-koenig@pengutronix.de, davem@davemloft.net, cavokz@gmail.com, linux@arm.linux.org.uk Subject: [PATCH V4 2/4] CS89x0 : add CS89x0 platform device to the iMX21ADS board Date: Thu, 19 Jan 2012 19:13:50 +0100 Message-Id: <1326996830-13548-1-git-send-email-jaccon.bastiaansen@gmail.com> X-Mailer: git-send-email 1.7.1 X-Spam-Note: CRM114 invocation failed 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 [74.125.83.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (jaccon.bastiaansen[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: netdev@vger.kernel.org, Jaccon Bastiaansen , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Add CS89x0 networking support to the iMX21ADS board by using the platform driver support in the CS89x0 driver. Signed-off-by: Jaccon Bastiaansen --- arch/arm/configs/imx_v4_v5_defconfig | 2 ++ arch/arm/mach-imx/mach-mx21ads.c | 31 ++++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig index 11a4192..fc0106f 100644 --- a/arch/arm/configs/imx_v4_v5_defconfig +++ b/arch/arm/configs/imx_v4_v5_defconfig @@ -81,6 +81,8 @@ CONFIG_NET_ETHERNET=y CONFIG_SMC91X=y CONFIG_DM9000=y CONFIG_SMC911X=y +CONFIG_CS89x0=y +CONFIG_CS89x0_PLATFORM=y # CONFIG_NETDEV_1000 is not set # CONFIG_NETDEV_10000 is not set # CONFIG_INPUT_MOUSEDEV is not set diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c index 25f8402..4fd37fc 100644 --- a/arch/arm/mach-imx/mach-mx21ads.c +++ b/arch/arm/mach-imx/mach-mx21ads.c @@ -37,8 +37,8 @@ #define MX21ADS_REG_ADDR(offset) (void __force __iomem *) \ (MX21ADS_MMIO_BASE_ADDR + (offset)) +#define MX21ADS_CS8900A_MMIO_SIZE 0x200000 #define MX21ADS_CS8900A_IRQ IRQ_GPIOE(11) -#define MX21ADS_CS8900A_IOBASE_REG MX21ADS_REG_ADDR(0x000000) #define MX21ADS_ST16C255_IOBASE_REG MX21ADS_REG_ADDR(0x200000) #define MX21ADS_VERSION_REG MX21ADS_REG_ADDR(0x400000) #define MX21ADS_IO_REG MX21ADS_REG_ADDR(0x800000) @@ -159,6 +159,26 @@ static struct platform_device mx21ads_nor_mtd_device = { .resource = &mx21ads_flash_resource, }; +static const struct resource mx21ads_cs8900_resources[] __initconst = { + { + .start = MX21_CS1_BASE_ADDR, + .end = MX21_CS1_BASE_ADDR + MX21ADS_CS8900A_MMIO_SIZE - 1, + .flags = IORESOURCE_MEM, + }, + { + .start = MX21ADS_CS8900A_IRQ, + .end = MX21ADS_CS8900A_IRQ, + .flags = IORESOURCE_IRQ, + } +}; + +static const struct platform_device_info mx21ads_cs8900_devinfo __initconst = { + .name = "cs89x0", + .id = 0, + .res = mx21ads_cs8900_resources, + .num_res = ARRAY_SIZE(mx21ads_cs8900_resources), +}; + static const struct imxuart_platform_data uart_pdata_rts __initconst = { .flags = IMXUART_HAVE_RTSCTS, }; @@ -254,14 +274,17 @@ mx21ads_nand_board_info __initconst = { static struct map_desc mx21ads_io_desc[] __initdata = { /* * Memory-mapped I/O on MX21ADS Base board: - * - CS8900A Ethernet controller * - ST16C2552CJ UART * - CPU and Base board version * - Base board I/O register + * + * Note that the CS8900 uses the first MX21ADS_CS8900A_MMIO_SIZE + * bytes of the CS1 memory range. */ { .virtual = MX21ADS_MMIO_BASE_ADDR, - .pfn = __phys_to_pfn(MX21_CS1_BASE_ADDR), + .pfn = __phys_to_pfn(MX21_CS1_BASE_ADDR + + MX21ADS_CS8900A_MMIO_SIZE), .length = MX21ADS_MMIO_SIZE, .type = MT_DEVICE, }, @@ -292,6 +315,8 @@ static void __init mx21ads_board_init(void) imx21_add_mxc_nand(&mx21ads_nand_board_info); platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); + platform_device_register_full( + (struct platform_device_info *)&mx21ads_cs8900_devinfo); } static void __init mx21ads_timer_init(void)