2 * Platform device support for Philips PNX8550 SoCs
4 * Copyright 2005, Embedded Alley Solutions, Inc
6 * Based on arch/mips/au1000/common/platform.c
7 * Platform device support for Au1x00 SoCs.
9 * Copyright 2004, Matt Porter <mporter@kernel.crashing.org>
11 * This file is licensed under the terms of the GNU General Public
12 * License version 2. This program is licensed "as is" without any
13 * warranty of any kind, whether express or implied.
15 #include <linux/device.h>
16 #include <linux/kernel.h>
17 #include <linux/init.h>
18 #include <linux/resource.h>
19 #include <linux/serial.h>
20 #include <linux/serial_ip3106.h>
26 extern struct uart_ops ip3106_pops;
28 static struct resource pnx8550_usb_ohci_resources[] = {
30 .start = PNX8550_USB_OHCI_OP_BASE,
31 .end = PNX8550_USB_OHCI_OP_BASE +
32 PNX8550_USB_OHCI_OP_LEN,
33 .flags = IORESOURCE_MEM,
36 .start = PNX8550_INT_USB,
37 .end = PNX8550_INT_USB,
38 .flags = IORESOURCE_IRQ,
42 static struct resource pnx8550_uart_resources[] = {
44 .start = PNX8550_UART_PORT0,
45 .end = PNX8550_UART_PORT0 + 0xfff,
46 .flags = IORESOURCE_MEM,
49 .start = PNX8550_UART_INT(0),
50 .end = PNX8550_UART_INT(0),
51 .flags = IORESOURCE_IRQ,
54 .start = PNX8550_UART_PORT1,
55 .end = PNX8550_UART_PORT1 + 0xfff,
56 .flags = IORESOURCE_MEM,
59 .start = PNX8550_UART_INT(1),
60 .end = PNX8550_UART_INT(1),
61 .flags = IORESOURCE_IRQ,
65 struct ip3106_port ip3106_ports[] = {
69 .iotype = SERIAL_IO_MEM,
70 .membase = (void __iomem *)PNX8550_UART_PORT0,
71 .mapbase = PNX8550_UART_PORT0,
72 .irq = PNX8550_UART_INT(0),
76 .flags = ASYNC_BOOT_AUTOCONF,
83 .iotype = SERIAL_IO_MEM,
84 .membase = (void __iomem *)PNX8550_UART_PORT1,
85 .mapbase = PNX8550_UART_PORT1,
86 .irq = PNX8550_UART_INT(1),
90 .flags = ASYNC_BOOT_AUTOCONF,
96 /* The dmamask must be set for OHCI to work */
97 static u64 ohci_dmamask = ~(u32)0;
99 static u64 uart_dmamask = ~(u32)0;
101 static struct platform_device pnx8550_usb_ohci_device = {
102 .name = "pnx8550-ohci",
105 .dma_mask = &ohci_dmamask,
106 .coherent_dma_mask = 0xffffffff,
108 .num_resources = ARRAY_SIZE(pnx8550_usb_ohci_resources),
109 .resource = pnx8550_usb_ohci_resources,
112 static struct platform_device pnx8550_uart_device = {
113 .name = "ip3106-uart",
116 .dma_mask = &uart_dmamask,
117 .coherent_dma_mask = 0xffffffff,
118 .platform_data = ip3106_ports,
120 .num_resources = ARRAY_SIZE(pnx8550_uart_resources),
121 .resource = pnx8550_uart_resources,
124 static struct platform_device *pnx8550_platform_devices[] __initdata = {
125 &pnx8550_usb_ohci_device,
126 &pnx8550_uart_device,
129 int pnx8550_platform_init(void)
131 return platform_add_devices(pnx8550_platform_devices,
132 ARRAY_SIZE(pnx8550_platform_devices));
135 arch_initcall(pnx8550_platform_init);