From patchwork Thu Nov 1 09:26:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 1683661 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 EBE743FCDF for ; Thu, 1 Nov 2012 09:33:48 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TTr7I-00069m-VG; Thu, 01 Nov 2012 09:31:13 +0000 Received: from smtp1.mail.ru ([94.100.176.129]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TTr3Q-0005C4-Qa for linux-arm-kernel@lists.infradead.org; Thu, 01 Nov 2012 09:27:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=ZM0OrFF99lO8df8+b0PULJUBha0+GMSBN7kdRrsgfWw=; b=E889N9+C6qkk9YEk9GW4f0X1/y6sHtLTbrW6ifodCS4kUrJWOzfoaeAcaO5F3LjxcLyYL0Vlicaa2oovrkcTZ8q/l5SWJB2+uR+dBG3cRIVejQcbAJYg3HWXa0h6yRXx; Received: from [188.134.40.128] (port=33548 helo=shc.zet) by smtp1.mail.ru with esmtpa (envelope-from ) id 1TTr3P-0001ZR-Er; Thu, 01 Nov 2012 13:27:11 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 02/15] ARM: clps711x: Using platform_driver for ethernet device Date: Thu, 1 Nov 2012 13:26:32 +0400 Message-Id: <1351762006-27368-2-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1351762006-27368-1-git-send-email-shc_work@mail.ru> References: <1351762006-27368-1-git-send-email-shc_work@mail.ru> X-Spam: Not detected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121101_052713_324525_046AD282 X-CRM114-Status: GOOD ( 16.71 ) 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 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [94.100.176.129 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (shc_work[at]mail.ru) -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: Olof Johansson , Russell King , Alexander Shiyan , Arnd Bergmann X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This patch removes static mappings for ethernet devices. Now we will use platform_driver for ethernet devices. Signed-off-by: Alexander Shiyan --- arch/arm/mach-clps711x/Kconfig | 2 - arch/arm/mach-clps711x/autcpu12.c | 27 ++++++++++------------ arch/arm/mach-clps711x/cdb89712.c | 29 +++++++++-------------- arch/arm/mach-clps711x/edb7211.c | 19 ++++++++++----- arch/arm/mach-clps711x/include/mach/autcpu12.h | 3 -- arch/arm/mach-clps711x/include/mach/hardware.h | 11 --------- 6 files changed, 36 insertions(+), 55 deletions(-) diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig index 263242d..2d00165 100644 --- a/arch/arm/mach-clps711x/Kconfig +++ b/arch/arm/mach-clps711x/Kconfig @@ -10,7 +10,6 @@ config ARCH_AUTCPU12 config ARCH_CDB89712 bool "CDB89712" - select ISA help This is an evaluation board from Cirrus for the CS89712 processor. The board includes 2 serial ports, Ethernet, IRDA, and expansion @@ -25,7 +24,6 @@ config ARCH_EDB7211 bool "EDB7211" select ARCH_SELECT_MEMORY_MODEL select ARCH_SPARSEMEM_ENABLE - select ISA help Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211 evaluation board. diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c index f4f122d..d845dea 100644 --- a/arch/arm/mach-clps711x/autcpu12.c +++ b/arch/arm/mach-clps711x/autcpu12.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -39,21 +40,13 @@ #include "common.h" -static struct map_desc autcpu12_io_desc[] __initdata = { - /* Memory-mapped extra io and CS8900A Ethernet chip */ - { - .virtual = IO_ADDRESS(AUTCPU12_PHYS_CS8900A), - .pfn = __phys_to_pfn(AUTCPU12_PHYS_CS8900A), - .length = SZ_1M, - .type = MT_DEVICE - } -}; +#define AUTCPU12_CS8900_BASE (CS2_PHYS_BASE + 0x300) +#define AUTCPU12_CS8900_IRQ (IRQ_EINT3) -void __init autcpu12_map_io(void) -{ - clps711x_map_io(); - iotable_init(autcpu12_io_desc, ARRAY_SIZE(autcpu12_io_desc)); -} +static struct resource autcpu12_cs8900_resource[] __initdata = { + DEFINE_RES_MEM(AUTCPU12_CS8900_BASE, SZ_1K), + DEFINE_RES_IRQ(AUTCPU12_CS8900_IRQ), +}; static struct resource autcpu12_nvram_resource[] __initdata = { DEFINE_RES_MEM_NAMED(AUTCPU12_PHYS_NVRAM, SZ_128K, "SRAM"), @@ -69,13 +62,17 @@ static struct platform_device autcpu12_nvram_pdev __initdata = { static void __init autcpu12_init(void) { platform_device_register_simple("uart-clps711x", 0, NULL, 0); + + platform_device_register_simple("cs89x0", 0, autcpu12_cs8900_resource, + ARRAY_SIZE(autcpu12_cs8900_resource)); + platform_device_register(&autcpu12_nvram_pdev); } MACHINE_START(AUTCPU12, "autronix autcpu12") /* Maintainer: Thomas Gleixner */ .atag_offset = 0x20000, - .map_io = autcpu12_map_io, + .map_io = clps711x_map_io, .init_machine = autcpu12_init, .init_irq = clps711x_init_irq, .restart = clps711x_restart, diff --git a/arch/arm/mach-clps711x/cdb89712.c b/arch/arm/mach-clps711x/cdb89712.c index 5a03888..695ca70 100644 --- a/arch/arm/mach-clps711x/cdb89712.c +++ b/arch/arm/mach-clps711x/cdb89712.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -35,34 +36,26 @@ #include "common.h" -/* - * Map the CS89712 Ethernet port. That should be moved to the - * ethernet driver, perhaps. - */ -static struct map_desc cdb89712_io_desc[] __initdata = { - { - .virtual = IO_ADDRESS(ETHER_PHYS_BASE), - .pfn = __phys_to_pfn(ETHER_PHYS_BASE), - .length = ETHER_SIZE, - .type = MT_DEVICE - } -}; +#define CDB89712_CS8900_BASE (CS2_PHYS_BASE + 0x300) +#define CDB89712_CS8900_IRQ (IRQ_EINT3) -static void __init cdb89712_map_io(void) -{ - clps711x_map_io(); - iotable_init(cdb89712_io_desc, ARRAY_SIZE(cdb89712_io_desc)); -} +static struct resource cdb89712_cs8900_resource[] __initdata = { + DEFINE_RES_MEM(CDB89712_CS8900_BASE, SZ_1K), + DEFINE_RES_IRQ(CDB89712_CS8900_IRQ), +}; static void __init cdb89712_init(void) { platform_device_register_simple("uart-clps711x", 0, NULL, 0); + + platform_device_register_simple("cs89x0", 0, cdb89712_cs8900_resource, + ARRAY_SIZE(cdb89712_cs8900_resource)); } MACHINE_START(CDB89712, "Cirrus-CDB89712") /* Maintainer: Ray Lehtiniemi */ .atag_offset = 0x100, - .map_io = cdb89712_map_io, + .map_io = clps711x_map_io, .init_machine = cdb89712_init, .init_irq = clps711x_init_irq, .restart = clps711x_restart, diff --git a/arch/arm/mach-clps711x/edb7211.c b/arch/arm/mach-clps711x/edb7211.c index 119610b..7eaaafa 100644 --- a/arch/arm/mach-clps711x/edb7211.c +++ b/arch/arm/mach-clps711x/edb7211.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -21,7 +22,15 @@ #include "common.h" -#define VIDEORAM_SIZE SZ_128K +#define VIDEORAM_SIZE SZ_128K + +#define EDB7211_CS8900_BASE (CS2_PHYS_BASE + 0x300) +#define EDB7211_CS8900_IRQ (IRQ_EINT3) + +static struct resource edb7211_cs8900_resource[] __initdata = { + DEFINE_RES_MEM(EDB7211_CS8900_BASE, SZ_1K), + DEFINE_RES_IRQ(EDB7211_CS8900_IRQ), +}; static struct map_desc edb7211_io_desc[] __initdata = { { /* Memory-mapped extra keyboard row */ @@ -29,11 +38,6 @@ static struct map_desc edb7211_io_desc[] __initdata = { .pfn = __phys_to_pfn(EP7211_PHYS_EXTKBD), .length = SZ_1M, .type = MT_DEVICE, - }, { /* CS8900A Ethernet chip */ - .virtual = IO_ADDRESS(EP7211_PHYS_CS8900A), - .pfn = __phys_to_pfn(EP7211_PHYS_CS8900A), - .length = SZ_1M, - .type = MT_DEVICE, }, { /* Flash bank 0 */ .virtual = IO_ADDRESS(EP7211_PHYS_FLASH1), .pfn = __phys_to_pfn(EP7211_PHYS_FLASH1), @@ -80,6 +84,9 @@ fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi) static void __init edb7211_init(void) { platform_device_register_simple("uart-clps711x", 0, NULL, 0); + + platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource, + ARRAY_SIZE(edb7211_cs8900_resource)); } MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") diff --git a/arch/arm/mach-clps711x/include/mach/autcpu12.h b/arch/arm/mach-clps711x/include/mach/autcpu12.h index f95ce6f..b077abd 100644 --- a/arch/arm/mach-clps711x/include/mach/autcpu12.h +++ b/arch/arm/mach-clps711x/include/mach/autcpu12.h @@ -20,9 +20,6 @@ #ifndef __ASM_ARCH_AUTCPU12_H #define __ASM_ARCH_AUTCPU12_H -/* The CS8900A ethernet chip has its I/O registers wired to chip select 2 */ -#define AUTCPU12_PHYS_CS8900A CS2_PHYS_BASE - /* * The flash bank is wired to chip select 0 */ diff --git a/arch/arm/mach-clps711x/include/mach/hardware.h b/arch/arm/mach-clps711x/include/mach/hardware.h index 0a3df25..bd919e7 100644 --- a/arch/arm/mach-clps711x/include/mach/hardware.h +++ b/arch/arm/mach-clps711x/include/mach/hardware.h @@ -64,22 +64,11 @@ #define CS7_PHYS_BASE (0x00000000) #endif -#if defined (CONFIG_ARCH_CDB89712) - -#define ETHER_PHYS_BASE CS2_PHYS_BASE -#define ETHER_SIZE 0x1000 - -#endif - - #if defined (CONFIG_ARCH_EDB7211) /* The extra 8 lines of the keyboard matrix are wired to chip select 3 */ #define EP7211_PHYS_EXTKBD CS3_PHYS_BASE -/* The CS8900A ethernet chip has its I/O registers wired to chip select 2 */ -#define EP7211_PHYS_CS8900A CS2_PHYS_BASE - /* The two flash banks are wired to chip selects 0 and 1 */ #define EP7211_PHYS_FLASH1 CS0_PHYS_BASE #define EP7211_PHYS_FLASH2 CS1_PHYS_BASE