6df17d8556d6b27e5b20af03242014ba3f30d06a
[openwrt/svn-archive/archive.git] / target / linux / ifxmips / files / arch / mips / ifxmips / board.c
1 /*
2 * arch/mips/ifxmips/board.c
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
17 *
18 * Copyright (C) 2007 John Crispin <blogic@openwrt.org>
19 *
20 */
21
22 #include <linux/autoconf.h>
23 #include <linux/init.h>
24 #include <linux/module.h>
25 #include <linux/types.h>
26 #include <linux/string.h>
27 #include <linux/mtd/physmap.h>
28 #include <linux/kernel.h>
29 #include <linux/reboot.h>
30 #include <linux/platform_device.h>
31 #include <asm/bootinfo.h>
32 #include <asm/reboot.h>
33 #include <asm/time.h>
34 #include <asm/irq.h>
35 #include <asm/io.h>
36
37 #define MAX_IFXMIPS_DEVS 5
38
39 static struct platform_device *ifxmips_devs[MAX_IFXMIPS_DEVS];
40
41 static struct platform_device ifxmips_led[] =
42 {
43 {
44 .id = 0,
45 .name = "ifxmips_led",
46 },
47 };
48
49 static struct platform_device ifxmips_gpio[] =
50 {
51 {
52 .id = 0,
53 .name = "ifxmips_gpio",
54 },
55 };
56
57 static struct platform_device ifxmips_mii[] =
58 {
59 {
60 .id = 0,
61 .name = "ifxmips_mii0",
62 },
63 };
64
65 int __init ifxmips_init_devices(void)
66 {
67 /*
68 * This is where we detect what chip we are running on
69 * Currently we support 3 chips
70 * 1.) Danube
71 * 2.) Twinpass (Danube without dsl phy)
72 * 3.) KDbg74 (used for debuging)
73 */
74
75 int dev = 0;
76
77 /* the following devices are generic for all targets */
78
79 ifxmips_devs[dev++] = ifxmips_led;
80 ifxmips_devs[dev++] = ifxmips_gpio;
81 ifxmips_devs[dev++] = ifxmips_mii;
82
83 return platform_add_devices(ifxmips_devs, dev);
84 }
85
86 arch_initcall(ifxmips_init_devices);