2 * arch/arm/mach-ks8695/devices.c
4 * Copyright (C) 2006 Andrew Victor
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #include <asm/mach/arch.h>
21 #include <asm/mach/map.h>
23 #include <linux/platform_device.h>
25 #include <asm/arch/regs-wan.h>
26 #include <asm/arch/regs-lan.h>
27 #include <asm/arch/regs-hpna.h>
30 /* --------------------------------------------------------------------
32 * -------------------------------------------------------------------- */
34 #if defined(CONFIG_ARM_KS8695_ETHER) || defined(CONFIG_ARM_KS8695_ETHER_MODULE)
35 static u64 eth_dmamask
= 0xffffffffUL
;
37 static struct resource ks8695_wan_resources
[] = {
39 .start
= KS8695_WAN_VA
,
40 .end
= KS8695_WAN_VA
+ 0x00ff,
41 .flags
= IORESOURCE_MEM
,
45 .start
= KS8695_IRQ_WAN_RX_STATUS
,
46 .end
= KS8695_IRQ_WAN_RX_STATUS
,
47 .flags
= IORESOURCE_IRQ
,
51 .start
= KS8695_IRQ_WAN_TX_STATUS
,
52 .end
= KS8695_IRQ_WAN_TX_STATUS
,
53 .flags
= IORESOURCE_IRQ
,
57 .start
= KS8695_IRQ_WAN_LINK
,
58 .end
= KS8695_IRQ_WAN_LINK
,
59 .flags
= IORESOURCE_IRQ
,
63 static struct platform_device ks8695_wan_device
= {
64 .name
= "ks8695_ether",
67 .dma_mask
= ð_dmamask
,
68 .coherent_dma_mask
= 0xffffffff,
70 .resource
= ks8695_wan_resources
,
71 .num_resources
= ARRAY_SIZE(ks8695_wan_resources
),
75 static struct resource ks8695_lan_resources
[] = {
77 .start
= KS8695_LAN_VA
,
78 .end
= KS8695_LAN_VA
+ 0x00ff,
79 .flags
= IORESOURCE_MEM
,
83 .start
= KS8695_IRQ_LAN_RX_STATUS
,
84 .end
= KS8695_IRQ_LAN_RX_STATUS
,
85 .flags
= IORESOURCE_IRQ
,
89 .start
= KS8695_IRQ_LAN_TX_STATUS
,
90 .end
= KS8695_IRQ_LAN_TX_STATUS
,
91 .flags
= IORESOURCE_IRQ
,
95 static struct platform_device ks8695_lan_device
= {
96 .name
= "ks8695_ether",
99 .dma_mask
= ð_dmamask
,
100 .coherent_dma_mask
= 0xffffffff,
102 .resource
= ks8695_lan_resources
,
103 .num_resources
= ARRAY_SIZE(ks8695_lan_resources
),
107 static struct resource ks8695_hpna_resources
[] = {
109 .start
= KS8695_HPNA_VA
,
110 .end
= KS8695_HPNA_VA
+ 0x00ff,
111 .flags
= IORESOURCE_MEM
,
115 .start
= KS8695_IRQ_HPNA_RX_STATUS
,
116 .end
= KS8695_IRQ_HPNA_RX_STATUS
,
117 .flags
= IORESOURCE_IRQ
,
121 .start
= KS8695_IRQ_HPNA_TX_STATUS
,
122 .end
= KS8695_IRQ_HPNA_TX_STATUS
,
123 .flags
= IORESOURCE_IRQ
,
127 static struct platform_device ks8695_hpna_device
= {
128 .name
= "ks8695_ether",
131 .dma_mask
= ð_dmamask
,
132 .coherent_dma_mask
= 0xffffffff,
134 .resource
= ks8695_hpna_resources
,
135 .num_resources
= ARRAY_SIZE(ks8695_hpna_resources
),
138 void __init
ks8695_add_device_wan(void)
140 platform_device_register(&ks8695_wan_device
);
143 void __init
ks8695_add_device_lan(void)
145 platform_device_register(&ks8695_lan_device
);
148 void __init
ks8696_add_device_hpna(void)
150 platform_device_register(&ks8695_hpna_device
);
153 void __init
ks8695_add_device_wan(void) {}
154 void __init
ks8695_add_device_lan(void) {}
155 void __init
ks8696_add_device_hpna(void) {}
159 /* --------------------------------------------------------------------
161 * -------------------------------------------------------------------- */
163 #if defined(CONFIG_KS8695_WATCHDOG) || defined(CONFIG_KS8695_WATCHDOG_MODULE)
164 static struct platform_device ks8695_wdt_device
= {
165 .name
= "ks8695_wdt",
170 static void __init
ks8695_add_device_watchdog(void)
172 platform_device_register(&ks8695_wdt_device
);
175 static void __init
ks8695_add_device_watchdog(void) {}
179 /* -------------------------------------------------------------------- */
182 * These devices are always present and don't need any board-specific
185 static int __init
ks8695_add_standard_devices(void)
187 ks8695_add_device_watchdog();
191 arch_initcall(ks8695_add_standard_devices
);