19 #include <linux/slab.h>
29 unsigned int old_state)
31 #ifdef CONFIG_SERIAL_8250
48 #define PORT(_base, _irq) \
54 .flags = UPF_SKIP_TEST | UPF_IOREMAP | \
56 .type = PORT_16550A, \
57 .pm = alchemy_8250_pm, \
102 int c = alchemy_get_uarts(ctype);
110 memcpy(ports, au1x00_uart_data[ctype], s * c);
111 au1xx0_uart_device.
dev.platform_data = ports;
114 for (s = 0; s <
c; s++)
115 ports[s].uartclk = uartclk;
125 static unsigned long alchemy_ohci_data[][2] __initdata = {
134 static unsigned long alchemy_ehci_data[][2] __initdata = {
151 (*d)->num_resources = 2;
157 static void __init alchemy_setup_usb(
int ctype)
163 if (_new_usbres(&res, &pdev))
167 res[0].
end = res[0].
start + 0x100 - 1;
172 pdev->
name =
"au1xxx-ohci";
174 pdev->
dev.dma_mask = &alchemy_ohci_dmamask;
182 if (_new_usbres(&res, &pdev))
186 res[0].
end = res[0].
start + 0x100 - 1;
191 pdev->
name =
"au1xxx-ehci";
193 pdev->
dev.dma_mask = &alchemy_ehci_dmamask;
201 if (_new_usbres(&res, &pdev))
205 res[0].
end = res[0].
start + 0x100 - 1;
210 pdev->
name =
"au1xxx-ohci";
212 pdev->
dev.dma_mask = &alchemy_ohci_dmamask;
220 #define MAC_RES_COUNT 4
221 #define MAC_RES(_base, _enable, _irq, _macdma) \
224 .end = _base + 0xffff, \
225 .flags = IORESOURCE_MEM, \
229 .end = _enable + 0x3, \
230 .flags = IORESOURCE_MEM, \
235 .flags = IORESOURCE_IRQ \
239 .end = _macdma + 0x1ff, \
240 .flags = IORESOURCE_MEM, \
271 .phy1_search_mac0 = 1,
275 .name =
"au1000-eth",
278 .dev.platform_data = &au1xxx_eth0_platform_data,
303 .phy1_search_mac0 = 1,
307 .name =
"au1000-eth",
310 .dev.platform_data = &au1xxx_eth1_platform_data,
316 if (!eth_data || port > 1)
320 memcpy(&au1xxx_eth0_platform_data, eth_data,
323 memcpy(&au1xxx_eth1_platform_data, eth_data,
327 static void __init alchemy_setup_macs(
int ctype)
330 unsigned char ethaddr[6];
334 if (alchemy_get_macs(ctype) < 1)
337 macres =
kmemdup(au1xxx_eth0_resources[ctype],
343 au1xxx_eth0_device.
resource = macres;
346 if (!i && !is_valid_ether_addr(au1xxx_eth0_platform_data.
mac))
347 memcpy(au1xxx_eth0_platform_data.
mac, ethaddr, 6);
355 if (alchemy_get_macs(ctype) < 2)
358 macres =
kmemdup(au1xxx_eth1_resources[ctype],
364 au1xxx_eth1_device.
resource = macres;
367 if (!i && !is_valid_ether_addr(au1xxx_eth1_platform_data.
mac))
368 memcpy(au1xxx_eth1_platform_data.
mac, ethaddr, 6);
378 static int __init au1xxx_platform_init(
void)
380 int ctype = alchemy_get_cputype();
382 alchemy_setup_uarts(ctype);
383 alchemy_setup_macs(ctype);
384 alchemy_setup_usb(ctype);