]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - arch/arm/mach-ep93xx/micro9.c
[ARM] Convert asm/io.h to linux/io.h
[linux-2.6-omap-h63xx.git] / arch / arm / mach-ep93xx / micro9.c
1 /*
2  *  linux/arch/arm/mach-ep93xx/micro9.c
3  *
4  * Copyright (C) 2006 Contec Steuerungstechnik & Automation GmbH
5  *                   Manfred Gruber <manfred.gruber@contec.at>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  */
11
12 #include <linux/init.h>
13 #include <linux/interrupt.h>
14 #include <linux/ioport.h>
15 #include <linux/kernel.h>
16 #include <linux/mm.h>
17 #include <linux/platform_device.h>
18 #include <linux/sched.h>
19 #include <linux/io.h>
20 #include <linux/mtd/physmap.h>
21
22 #include <mach/hardware.h>
23
24 #include <asm/mach/arch.h>
25 #include <asm/mach-types.h>
26
27 static struct ep93xx_eth_data micro9_eth_data = {
28        .phy_id                 = 0x1f,
29 };
30
31 static struct resource micro9_eth_resource[] = {
32        {
33                .start  = EP93XX_ETHERNET_PHYS_BASE,
34                .end    = EP93XX_ETHERNET_PHYS_BASE + 0xffff,
35                .flags  = IORESOURCE_MEM,
36        }, {
37                .start  = IRQ_EP93XX_ETHERNET,
38                .end    = IRQ_EP93XX_ETHERNET,
39                .flags  = IORESOURCE_IRQ,
40        }
41 };
42
43 static struct platform_device micro9_eth_device = {
44        .name           = "ep93xx-eth",
45        .id             = -1,
46        .dev            = {
47                .platform_data  = &micro9_eth_data,
48        },
49        .num_resources = ARRAY_SIZE(micro9_eth_resource),
50        .resource       = micro9_eth_resource,
51 };
52
53 static void __init micro9_eth_init(void)
54 {
55        memcpy(micro9_eth_data.dev_addr,
56                (void *)(EP93XX_ETHERNET_BASE + 0x50), 6);
57        platform_device_register(&micro9_eth_device);
58 }
59
60 static void __init micro9_init(void)
61 {
62        micro9_eth_init();
63 }
64
65 /*
66  * Micro9-H
67  */
68 #ifdef CONFIG_MACH_MICRO9H
69 static struct physmap_flash_data micro9h_flash_data = {
70        .width          = 4,
71 };
72
73 static struct resource micro9h_flash_resource = {
74        .start          = 0x10000000,
75        .end            = 0x13ffffff,
76        .flags          = IORESOURCE_MEM,
77 };
78
79 static struct platform_device micro9h_flash = {
80        .name           = "physmap-flash",
81        .id             = 0,
82        .dev            = {
83                .platform_data  = &micro9h_flash_data,
84        },
85        .num_resources  = 1,
86        .resource       = &micro9h_flash_resource,
87 };
88
89 static void __init micro9h_init(void)
90 {
91        platform_device_register(&micro9h_flash);
92 }
93
94 static void __init micro9h_init_machine(void)
95 {
96        ep93xx_init_devices();
97        micro9_init();
98        micro9h_init();
99 }
100
101 MACHINE_START(MICRO9, "Contec Hypercontrol Micro9-H")
102        /* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */
103        .phys_io        = EP93XX_APB_PHYS_BASE,
104        .io_pg_offst    = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
105        .boot_params    = 0x00000100,
106        .map_io         = ep93xx_map_io,
107        .init_irq       = ep93xx_init_irq,
108        .timer          = &ep93xx_timer,
109        .init_machine   = micro9h_init_machine,
110 MACHINE_END
111 #endif
112
113 /*
114  * Micro9-M
115  */
116 #ifdef CONFIG_MACH_MICRO9M
117 static void __init micro9m_init_machine(void)
118 {
119        ep93xx_init_devices();
120        micro9_init();
121 }
122
123 MACHINE_START(MICRO9M, "Contec Hypercontrol Micro9-M")
124        /* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */
125        .phys_io        = EP93XX_APB_PHYS_BASE,
126        .io_pg_offst    = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
127        .boot_params    = 0x00000100,
128        .map_io         = ep93xx_map_io,
129        .init_irq       = ep93xx_init_irq,
130        .timer          = &ep93xx_timer,
131        .init_machine   = micro9m_init_machine,
132 MACHINE_END
133 #endif
134
135 /*
136  * Micro9-L
137  */
138 #ifdef CONFIG_MACH_MICRO9L
139 static void __init micro9l_init_machine(void)
140 {
141        ep93xx_init_devices();
142        micro9_init();
143 }
144
145 MACHINE_START(MICRO9L, "Contec Hypercontrol Micro9-L")
146        /* Maintainer: Manfred Gruber <manfred.gruber@contec.at> */
147        .phys_io        = EP93XX_APB_PHYS_BASE,
148        .io_pg_offst    = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc,
149        .boot_params    = 0x00000100,
150        .map_io         = ep93xx_map_io,
151        .init_irq       = ep93xx_init_irq,
152        .timer          = &ep93xx_timer,
153        .init_machine   = micro9l_init_machine,
154 MACHINE_END
155 #endif
156