1 #include <linux/init.h>
2 #include <linux/platform_device.h>
3 #include <linux/leds.h>
4 #include <linux/gpio.h>
5 #include <linux/gpio_buttons.h>
6 #include <linux/mtd/mtd.h>
7 #include <linux/mtd/partitions.h>
8 #include <linux/mtd/physmap.h>
9 #include <linux/input.h>
10 #include <linux/etherdevice.h>
14 #include <ifxmips_prom.h>
16 #include "arcaydian.h"
19 #define ARV45XX_BRN 0x3f0000
20 #define ARV45XX_BRN_MAC 0x3f0016
22 #define ARV45XX_EBU_GPIO_START 0x14000000
23 #define ARV45XX_EBU_GPIO_SIZE 0x00001000
25 #define ARV4520_LATCH_SWITCH (1 << 10)
27 #ifdef CONFIG_MTD_PARTITIONS
28 static struct mtd_partition arv45xx_partitions
[] =
51 .name
= "board_config",
63 static struct physmap_flash_data arv45xx_flash_data
= {
64 #ifdef CONFIG_MTD_PARTITIONS
65 .nr_parts
= ARRAY_SIZE(arv45xx_partitions
),
66 .parts
= arv45xx_partitions
,
70 static struct gpio_led
71 arv4518_leds_gpio
[] __initdata
= {
72 { .name
= "ifx:blue:power", .gpio
= 3, .active_low
= 1, },
73 { .name
= "ifx:blue:adsl", .gpio
= 4, .active_low
= 1, },
74 { .name
= "ifx:blue:internet", .gpio
= 5, .active_low
= 1, },
75 { .name
= "ifx:red:power", .gpio
= 6, .active_low
= 1, },
76 { .name
= "ifx:yello:wps", .gpio
= 7, .active_low
= 1, },
77 { .name
= "ifx:red:wps", .gpio
= 9, .active_low
= 1, },
78 { .name
= "ifx:blue:voip", .gpio
= 32, .active_low
= 1, },
79 { .name
= "ifx:blue:fxs1", .gpio
= 33, .active_low
= 1, },
80 { .name
= "ifx:blue:fxs2", .gpio
= 34, .active_low
= 1, },
81 { .name
= "ifx:blue:fxo", .gpio
= 35, .active_low
= 1, },
82 { .name
= "ifx:blue:voice", .gpio
= 36, .active_low
= 1, },
83 { .name
= "ifx:blue:usb", .gpio
= 37, .active_low
= 1, },
84 { .name
= "ifx:blue:wlan", .gpio
= 38, .active_low
= 1, },
87 static struct gpio_led
88 arv4520_leds_gpio
[] __initdata
= {
89 { .name
= "ifx:blue:power", .gpio
= 3, .active_low
= 1, },
90 { .name
= "ifx:blue:adsl", .gpio
= 4, .active_low
= 1, },
91 { .name
= "ifx:blue:internet", .gpio
= 5, .active_low
= 1, },
92 { .name
= "ifx:red:power", .gpio
= 6, .active_low
= 1, },
93 { .name
= "ifx:yello:wps", .gpio
= 7, .active_low
= 1, },
94 { .name
= "ifx:red:wps", .gpio
= 9, .active_low
= 1, },
95 { .name
= "ifx:blue:voip", .gpio
= 32, .active_low
= 1, },
96 { .name
= "ifx:blue:fxs1", .gpio
= 33, .active_low
= 1, },
97 { .name
= "ifx:blue:fxs2", .gpio
= 34, .active_low
= 1, },
98 { .name
= "ifx:blue:fxo", .gpio
= 35, .active_low
= 1, },
99 { .name
= "ifx:blue:voice", .gpio
= 36, .active_low
= 1, },
100 { .name
= "ifx:blue:usb", .gpio
= 37, .active_low
= 1, },
101 { .name
= "ifx:blue:wlan", .gpio
= 38, .active_low
= 1, },
104 static struct gpio_led arv4525_leds_gpio
[] __initdata
= {
105 { .name
= "ifx:green:festnetz", .gpio
= 4, .active_low
= 1, },
106 { .name
= "ifx:green:internet", .gpio
= 5, .active_low
= 1, },
107 { .name
= "ifx:green:dsl", .gpio
= 6, .active_low
= 1, },
108 { .name
= "ifx:green:wlan", .gpio
= 8, .active_low
= 1, },
109 { .name
= "ifx:green:online", .gpio
= 9, .active_low
= 1, },
112 static struct resource arv45xx_ebu_resource
=
115 .start
= ARV45XX_EBU_GPIO_START
,
116 .end
= ARV45XX_EBU_GPIO_START
+ ARV45XX_EBU_GPIO_SIZE
- 1,
117 .flags
= IORESOURCE_MEM
,
123 static unsigned char mac
[6];
124 if(!ifxmix_detect_brn_block(ARV45XX_BRN
))
125 ifxmips_find_brn_mac(ARV45XX_BRN_MAC
, mac
);
127 random_ether_addr(mac
);
128 ifxmips_register_gpio();
129 danube_register_ebu_gpio(&arv45xx_ebu_resource
, ARV4520_LATCH_SWITCH
);
130 ifxmips_register_mtd(&arv45xx_flash_data
);
131 danube_register_pci(PCI_CLOCK_EXT
, 0);
132 ifxmips_register_wdt();
133 ifxmips_register_gpio_leds(arv4518_leds_gpio
, ARRAY_SIZE(arv4518_leds_gpio
));
134 danube_register_ethernet(mac
, REV_MII_MODE
);
135 danube_register_tapi();
138 MIPS_MACHINE(IFXMIPS_MACH_ARV4518
,
140 "ARV4518 - SMC7908A-ISP",
146 static unsigned char mac
[6];
147 if(!ifxmix_detect_brn_block(ARV45XX_BRN
))
148 ifxmips_find_brn_mac(ARV45XX_BRN_MAC
, mac
);
150 random_ether_addr(mac
);
151 ifxmips_register_gpio();
152 danube_register_ebu_gpio(&arv45xx_ebu_resource
, ARV4520_LATCH_SWITCH
);
153 ifxmips_register_mtd(&arv45xx_flash_data
);
154 danube_register_pci(PCI_CLOCK_EXT
, 0);
155 ifxmips_register_wdt();
156 ifxmips_register_gpio_leds(arv4520_leds_gpio
, ARRAY_SIZE(arv4520_leds_gpio
));
157 danube_register_ethernet(mac
, REV_MII_MODE
);
158 danube_register_tapi();
161 MIPS_MACHINE(IFXMIPS_MACH_ARV4520
,
163 "ARV4520 - Airties WAV-281, Arcor A800",
169 static unsigned char mac
[6];
170 if(!ifxmix_detect_brn_block(ARV45XX_BRN
))
171 ifxmips_find_brn_mac(ARV45XX_BRN_MAC
, mac
);
173 random_ether_addr(mac
);
174 ifxmips_register_gpio();
175 ifxmips_register_mtd(&arv45xx_flash_data
);
176 danube_register_pci(PCI_CLOCK_INT
, 0);
177 ifxmips_register_wdt();
178 ifxmips_register_gpio_leds(arv4525_leds_gpio
, ARRAY_SIZE(arv4525_leds_gpio
));
179 danube_register_ethernet(mac
, MII_MODE
);
180 danube_register_tapi();
183 MIPS_MACHINE(IFXMIPS_MACH_ARV4525
,
185 "ARV4525 - Speedport W502V",