1 --- a/arch/mips/ar7/platform.c 2009-11-18 14:57:44.000000000 +0800
2 +++ b/arch/mips/ar7/platform.c 2009-11-18 15:43:04.000000000 +0800
7 +static struct resource cpmac_low_res_titan[] = {
10 + .flags = IORESOURCE_MEM,
11 + .start = TITAN_REGS_MAC0,
12 + .end = TITAN_REGS_MAC0 + 0x7ff,
16 + .flags = IORESOURCE_IRQ,
22 +static struct resource cpmac_high_res_titan[] = {
25 + .flags = IORESOURCE_MEM,
26 + .start = TITAN_REGS_MAC1,
27 + .end = TITAN_REGS_MAC1 + 0x7ff,
31 + .flags = IORESOURCE_IRQ,
37 static struct resource vlynq_low_res[] = {
44 +static struct resource vlynq_low_res_titan[] = {
47 + .flags = IORESOURCE_MEM,
48 + .start = TITAN_REGS_VLYNQ0,
49 + .end = TITAN_REGS_VLYNQ0 + 0xff,
53 + .flags = IORESOURCE_IRQ,
59 + .flags = IORESOURCE_MEM,
60 + .start = 0x0c000000,
65 + .flags = IORESOURCE_IRQ,
71 +static struct resource vlynq_high_res_titan[] = {
74 + .flags = IORESOURCE_MEM,
75 + .start = TITAN_REGS_VLYNQ1,
76 + .end = TITAN_REGS_VLYNQ1 + 0xff,
80 + .flags = IORESOURCE_IRQ,
86 + .flags = IORESOURCE_MEM,
87 + .start = 0x40000000,
92 + .flags = IORESOURCE_IRQ,
98 static struct resource usb_res[] = {
102 .phy_mask = 0x7fffffff,
105 +static struct plat_cpmac_data cpmac_low_data_titan = {
108 + .phy_mask = 0x40000000,
111 +static struct plat_cpmac_data cpmac_high_data_titan = {
114 + .phy_mask = 0x80000000,
117 static struct plat_vlynq_data vlynq_low_data = {
119 .ops.off = vlynq_off,
124 +static struct plat_vlynq_data vlynq_low_data_titan = {
125 + .ops.on = vlynq_on,
126 + .ops.off = vlynq_off,
131 +static struct plat_vlynq_data vlynq_high_data_titan = {
132 + .ops.on = vlynq_on,
133 + .ops.off = vlynq_off,
138 static struct platform_device physmap_flash = {
140 .name = "physmap-flash",
142 .num_resources = ARRAY_SIZE(cpmac_high_res),
145 +static struct platform_device cpmac_low_titan = {
149 + .dma_mask = &cpmac_dma_mask,
150 + .coherent_dma_mask = DMA_32BIT_MASK,
151 + .platform_data = &cpmac_low_data_titan,
153 + .resource = cpmac_low_res_titan,
154 + .num_resources = ARRAY_SIZE(cpmac_low_res_titan),
157 +static struct platform_device cpmac_high_titan = {
161 + .dma_mask = &cpmac_dma_mask,
162 + .coherent_dma_mask = DMA_32BIT_MASK,
163 + .platform_data = &cpmac_high_data_titan,
165 + .resource = cpmac_high_res_titan,
166 + .num_resources = ARRAY_SIZE(cpmac_high_res_titan),
169 static struct platform_device vlynq_low = {
173 .num_resources = ARRAY_SIZE(vlynq_high_res),
176 +static struct platform_device vlynq_low_titan = {
179 + .dev.platform_data = &vlynq_low_data_titan,
180 + .resource = vlynq_low_res_titan,
181 + .num_resources = ARRAY_SIZE(vlynq_low_res_titan),
184 +static struct platform_device vlynq_high_titan = {
187 + .dev.platform_data = &vlynq_high_data_titan,
188 + .resource = vlynq_high_res_titan,
189 + .num_resources = ARRAY_SIZE(vlynq_high_res_titan),
193 /* This is proper way to define uart ports, but they are then detected
194 * as xscale and, obviously, don't work...
196 { .name = "status", .gpio = 8, .active_low = 1, },
199 +static struct gpio_led titan_leds[] = {
200 + { .name = "status", .gpio = 8, .active_low = 1, },
201 + { .name = "wifi", .gpio = 13, .active_low = 1, },
204 static struct gpio_led dsl502t_leds[] = {
205 { .name = "status", .gpio = 9, .active_low = 1, },
206 { .name = "ethernet", .gpio = 7, .active_low = 1, },
208 /* FIXME: the whole thing is unreliable */
209 prId = prom_getenv("ProductID");
210 usb_prod = prom_getenv("usb_prod");
213 /* If we can't get the product id from PROM, use the default LEDs */
217 } else if (strstr(prId, "DG834")) {
218 ar7_led_data.num_leds = ARRAY_SIZE(dg834g_leds);
219 ar7_led_data.leds = dg834g_leds;
220 + } else if (strstr(prId, "CYWM")) {
221 + ar7_led_data.num_leds = ARRAY_SIZE(titan_leds);
222 + ar7_led_data.leds = titan_leds;
226 @@ -502,14 +660,18 @@
230 - ar7_device_disable(vlynq_low_data.reset_bit);
231 - res = platform_device_register(&vlynq_low);
232 + ar7_device_disable(ar7_is_titan() ? vlynq_low_data_titan.reset_bit :
233 + vlynq_low_data.reset_bit);
234 + res = platform_device_register(ar7_is_titan() ? &vlynq_low_titan :
239 if (ar7_has_high_vlynq()) {
240 - ar7_device_disable(vlynq_high_data.reset_bit);
241 - res = platform_device_register(&vlynq_high);
242 + ar7_device_disable(ar7_is_titan() ? vlynq_high_data_titan.reset_bit :
243 + vlynq_high_data.reset_bit);
244 + res = platform_device_register(ar7_is_titan() ? &vlynq_high_titan :