aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Shiyan <shc_work@mail.ru>2012-11-17 08:57:07 -0500
committerOlof Johansson <olof@lixom.net>2012-11-21 01:21:39 -0500
commit200daa367c59b4952f1e86ed9761859b1bcc3dbd (patch)
tree98856570c2886254b0ed18a4037097e00b86afab
parenta93d620159524088d9633f60a8f746e3dd2e791e (diff)
ARM: clps711x: Using platform_driver for ethernet device
This patch removes static mappings for ethernet devices. Now we will use platform_driver for ethernet devices. Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--arch/arm/mach-clps711x/Kconfig2
-rw-r--r--arch/arm/mach-clps711x/autcpu12.c27
-rw-r--r--arch/arm/mach-clps711x/cdb89712.c28
-rw-r--r--arch/arm/mach-clps711x/edb7211.c26
-rw-r--r--arch/arm/mach-clps711x/include/mach/autcpu12.h3
-rw-r--r--arch/arm/mach-clps711x/include/mach/hardware.h11
6 files changed, 43 insertions, 54 deletions
diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig
index 263242da2cb..2d00165e85e 100644
--- a/arch/arm/mach-clps711x/Kconfig
+++ b/arch/arm/mach-clps711x/Kconfig
@@ -10,7 +10,6 @@ config ARCH_AUTCPU12
10 10
11config ARCH_CDB89712 11config ARCH_CDB89712
12 bool "CDB89712" 12 bool "CDB89712"
13 select ISA
14 help 13 help
15 This is an evaluation board from Cirrus for the CS89712 processor. 14 This is an evaluation board from Cirrus for the CS89712 processor.
16 The board includes 2 serial ports, Ethernet, IRDA, and expansion 15 The board includes 2 serial ports, Ethernet, IRDA, and expansion
@@ -25,7 +24,6 @@ config ARCH_EDB7211
25 bool "EDB7211" 24 bool "EDB7211"
26 select ARCH_SELECT_MEMORY_MODEL 25 select ARCH_SELECT_MEMORY_MODEL
27 select ARCH_SPARSEMEM_ENABLE 26 select ARCH_SPARSEMEM_ENABLE
28 select ISA
29 help 27 help
30 Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211 28 Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211
31 evaluation board. 29 evaluation board.
diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c
index 214547b5c51..d9b7f94a7ec 100644
--- a/arch/arm/mach-clps711x/autcpu12.c
+++ b/arch/arm/mach-clps711x/autcpu12.c
@@ -24,6 +24,7 @@
24#include <linux/mm.h> 24#include <linux/mm.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/ioport.h> 26#include <linux/ioport.h>
27#include <linux/interrupt.h>
27#include <linux/platform_device.h> 28#include <linux/platform_device.h>
28 29
29#include <mach/hardware.h> 30#include <mach/hardware.h>
@@ -39,21 +40,13 @@
39 40
40#include "common.h" 41#include "common.h"
41 42
42static struct map_desc autcpu12_io_desc[] __initdata = { 43#define AUTCPU12_CS8900_BASE (CS2_PHYS_BASE + 0x300)
43 /* Memory-mapped extra io and CS8900A Ethernet chip */ 44#define AUTCPU12_CS8900_IRQ (IRQ_EINT3)
44 {
45 .virtual = IO_ADDRESS(AUTCPU12_PHYS_CS8900A),
46 .pfn = __phys_to_pfn(AUTCPU12_PHYS_CS8900A),
47 .length = SZ_1M,
48 .type = MT_DEVICE
49 }
50};
51 45
52void __init autcpu12_map_io(void) 46static struct resource autcpu12_cs8900_resource[] __initdata = {
53{ 47 DEFINE_RES_MEM(AUTCPU12_CS8900_BASE, SZ_1K),
54 clps711x_map_io(); 48 DEFINE_RES_IRQ(AUTCPU12_CS8900_IRQ),
55 iotable_init(autcpu12_io_desc, ARRAY_SIZE(autcpu12_io_desc)); 49};
56}
57 50
58static struct resource autcpu12_nvram_resource[] __initdata = { 51static struct resource autcpu12_nvram_resource[] __initdata = {
59 DEFINE_RES_MEM_NAMED(AUTCPU12_PHYS_NVRAM, SZ_128K, "SRAM"), 52 DEFINE_RES_MEM_NAMED(AUTCPU12_PHYS_NVRAM, SZ_128K, "SRAM"),
@@ -68,16 +61,18 @@ static struct platform_device autcpu12_nvram_pdev __initdata = {
68 61
69static void __init autcpu12_init(void) 62static void __init autcpu12_init(void)
70{ 63{
64 platform_device_register_simple("cs89x0", 0, autcpu12_cs8900_resource,
65 ARRAY_SIZE(autcpu12_cs8900_resource));
71 platform_device_register(&autcpu12_nvram_pdev); 66 platform_device_register(&autcpu12_nvram_pdev);
72} 67}
73 68
74MACHINE_START(AUTCPU12, "autronix autcpu12") 69MACHINE_START(AUTCPU12, "autronix autcpu12")
75 /* Maintainer: Thomas Gleixner */ 70 /* Maintainer: Thomas Gleixner */
76 .atag_offset = 0x20000, 71 .atag_offset = 0x20000,
77 .init_machine = autcpu12_init, 72 .map_io = clps711x_map_io,
78 .map_io = autcpu12_map_io,
79 .init_irq = clps711x_init_irq, 73 .init_irq = clps711x_init_irq,
80 .timer = &clps711x_timer, 74 .timer = &clps711x_timer,
75 .init_machine = autcpu12_init,
81 .restart = clps711x_restart, 76 .restart = clps711x_restart,
82MACHINE_END 77MACHINE_END
83 78
diff --git a/arch/arm/mach-clps711x/cdb89712.c b/arch/arm/mach-clps711x/cdb89712.c
index d90d25c67ac..235e6256775 100644
--- a/arch/arm/mach-clps711x/cdb89712.c
+++ b/arch/arm/mach-clps711x/cdb89712.c
@@ -23,6 +23,8 @@
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/mm.h> 24#include <linux/mm.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/interrupt.h>
27#include <linux/platform_device.h>
26 28
27#include <mach/hardware.h> 29#include <mach/hardware.h>
28#include <asm/pgtable.h> 30#include <asm/pgtable.h>
@@ -34,30 +36,26 @@
34 36
35#include "common.h" 37#include "common.h"
36 38
37/* 39#define CDB89712_CS8900_BASE (CS2_PHYS_BASE + 0x300)
38 * Map the CS89712 Ethernet port. That should be moved to the 40#define CDB89712_CS8900_IRQ (IRQ_EINT3)
39 * ethernet driver, perhaps. 41
40 */ 42static struct resource cdb89712_cs8900_resource[] __initdata = {
41static struct map_desc cdb89712_io_desc[] __initdata = { 43 DEFINE_RES_MEM(CDB89712_CS8900_BASE, SZ_1K),
42 { 44 DEFINE_RES_IRQ(CDB89712_CS8900_IRQ),
43 .virtual = IO_ADDRESS(ETHER_PHYS_BASE),
44 .pfn = __phys_to_pfn(ETHER_PHYS_BASE),
45 .length = ETHER_SIZE,
46 .type = MT_DEVICE
47 }
48}; 45};
49 46
50static void __init cdb89712_map_io(void) 47static void __init cdb89712_init(void)
51{ 48{
52 clps711x_map_io(); 49 platform_device_register_simple("cs89x0", 0, cdb89712_cs8900_resource,
53 iotable_init(cdb89712_io_desc, ARRAY_SIZE(cdb89712_io_desc)); 50 ARRAY_SIZE(cdb89712_cs8900_resource));
54} 51}
55 52
56MACHINE_START(CDB89712, "Cirrus-CDB89712") 53MACHINE_START(CDB89712, "Cirrus-CDB89712")
57 /* Maintainer: Ray Lehtiniemi */ 54 /* Maintainer: Ray Lehtiniemi */
58 .atag_offset = 0x100, 55 .atag_offset = 0x100,
59 .map_io = cdb89712_map_io, 56 .map_io = clps711x_map_io,
60 .init_irq = clps711x_init_irq, 57 .init_irq = clps711x_init_irq,
61 .timer = &clps711x_timer, 58 .timer = &clps711x_timer,
59 .init_machine = cdb89712_init,
62 .restart = clps711x_restart, 60 .restart = clps711x_restart,
63MACHINE_END 61MACHINE_END
diff --git a/arch/arm/mach-clps711x/edb7211.c b/arch/arm/mach-clps711x/edb7211.c
index 88f46908de2..7add9add5bf 100644
--- a/arch/arm/mach-clps711x/edb7211.c
+++ b/arch/arm/mach-clps711x/edb7211.c
@@ -10,6 +10,8 @@
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/memblock.h> 11#include <linux/memblock.h>
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/interrupt.h>
14#include <linux/platform_device.h>
13 15
14#include <asm/setup.h> 16#include <asm/setup.h>
15#include <asm/mach/map.h> 17#include <asm/mach/map.h>
@@ -20,7 +22,15 @@
20 22
21#include "common.h" 23#include "common.h"
22 24
23#define VIDEORAM_SIZE SZ_128K 25#define VIDEORAM_SIZE SZ_128K
26
27#define EDB7211_CS8900_BASE (CS2_PHYS_BASE + 0x300)
28#define EDB7211_CS8900_IRQ (IRQ_EINT3)
29
30static struct resource edb7211_cs8900_resource[] __initdata = {
31 DEFINE_RES_MEM(EDB7211_CS8900_BASE, SZ_1K),
32 DEFINE_RES_IRQ(EDB7211_CS8900_IRQ),
33};
24 34
25static struct map_desc edb7211_io_desc[] __initdata = { 35static struct map_desc edb7211_io_desc[] __initdata = {
26 { /* Memory-mapped extra keyboard row */ 36 { /* Memory-mapped extra keyboard row */
@@ -28,11 +38,6 @@ static struct map_desc edb7211_io_desc[] __initdata = {
28 .pfn = __phys_to_pfn(EP7211_PHYS_EXTKBD), 38 .pfn = __phys_to_pfn(EP7211_PHYS_EXTKBD),
29 .length = SZ_1M, 39 .length = SZ_1M,
30 .type = MT_DEVICE, 40 .type = MT_DEVICE,
31 }, { /* CS8900A Ethernet chip */
32 .virtual = IO_ADDRESS(EP7211_PHYS_CS8900A),
33 .pfn = __phys_to_pfn(EP7211_PHYS_CS8900A),
34 .length = SZ_1M,
35 .type = MT_DEVICE,
36 }, { /* Flash bank 0 */ 41 }, { /* Flash bank 0 */
37 .virtual = IO_ADDRESS(EP7211_PHYS_FLASH1), 42 .virtual = IO_ADDRESS(EP7211_PHYS_FLASH1),
38 .pfn = __phys_to_pfn(EP7211_PHYS_FLASH1), 43 .pfn = __phys_to_pfn(EP7211_PHYS_FLASH1),
@@ -76,13 +81,20 @@ fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi)
76 mi->nr_banks = 2; 81 mi->nr_banks = 2;
77} 82}
78 83
84static void __init edb7211_init(void)
85{
86 platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource,
87 ARRAY_SIZE(edb7211_cs8900_resource));
88}
89
79MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)") 90MACHINE_START(EDB7211, "CL-EDB7211 (EP7211 eval board)")
80 /* Maintainer: Jon McClintock */ 91 /* Maintainer: Jon McClintock */
81 .atag_offset = VIDEORAM_SIZE + 0x100, 92 .atag_offset = VIDEORAM_SIZE + 0x100,
82 .fixup = fixup_edb7211, 93 .fixup = fixup_edb7211,
83 .map_io = edb7211_map_io,
84 .reserve = edb7211_reserve, 94 .reserve = edb7211_reserve,
95 .map_io = edb7211_map_io,
85 .init_irq = clps711x_init_irq, 96 .init_irq = clps711x_init_irq,
86 .timer = &clps711x_timer, 97 .timer = &clps711x_timer,
98 .init_machine = edb7211_init,
87 .restart = clps711x_restart, 99 .restart = clps711x_restart,
88MACHINE_END 100MACHINE_END
diff --git a/arch/arm/mach-clps711x/include/mach/autcpu12.h b/arch/arm/mach-clps711x/include/mach/autcpu12.h
index f95ce6f2911..b077abd8a47 100644
--- a/arch/arm/mach-clps711x/include/mach/autcpu12.h
+++ b/arch/arm/mach-clps711x/include/mach/autcpu12.h
@@ -20,9 +20,6 @@
20#ifndef __ASM_ARCH_AUTCPU12_H 20#ifndef __ASM_ARCH_AUTCPU12_H
21#define __ASM_ARCH_AUTCPU12_H 21#define __ASM_ARCH_AUTCPU12_H
22 22
23/* The CS8900A ethernet chip has its I/O registers wired to chip select 2 */
24#define AUTCPU12_PHYS_CS8900A CS2_PHYS_BASE
25
26/* 23/*
27 * The flash bank is wired to chip select 0 24 * The flash bank is wired to chip select 0
28 */ 25 */
diff --git a/arch/arm/mach-clps711x/include/mach/hardware.h b/arch/arm/mach-clps711x/include/mach/hardware.h
index 0a3df25ffea..bd919e7bb86 100644
--- a/arch/arm/mach-clps711x/include/mach/hardware.h
+++ b/arch/arm/mach-clps711x/include/mach/hardware.h
@@ -64,22 +64,11 @@
64#define CS7_PHYS_BASE (0x00000000) 64#define CS7_PHYS_BASE (0x00000000)
65#endif 65#endif
66 66
67#if defined (CONFIG_ARCH_CDB89712)
68
69#define ETHER_PHYS_BASE CS2_PHYS_BASE
70#define ETHER_SIZE 0x1000
71
72#endif
73
74
75#if defined (CONFIG_ARCH_EDB7211) 67#if defined (CONFIG_ARCH_EDB7211)
76 68
77/* The extra 8 lines of the keyboard matrix are wired to chip select 3 */ 69/* The extra 8 lines of the keyboard matrix are wired to chip select 3 */
78#define EP7211_PHYS_EXTKBD CS3_PHYS_BASE 70#define EP7211_PHYS_EXTKBD CS3_PHYS_BASE
79 71
80/* The CS8900A ethernet chip has its I/O registers wired to chip select 2 */
81#define EP7211_PHYS_CS8900A CS2_PHYS_BASE
82
83/* The two flash banks are wired to chip selects 0 and 1 */ 72/* The two flash banks are wired to chip selects 0 and 1 */
84#define EP7211_PHYS_FLASH1 CS0_PHYS_BASE 73#define EP7211_PHYS_FLASH1 CS0_PHYS_BASE
85#define EP7211_PHYS_FLASH2 CS1_PHYS_BASE 74#define EP7211_PHYS_FLASH2 CS1_PHYS_BASE