2 * Platform device support for NXP 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_pnx8xxx.h>
21 #include <linux/platform_device.h>
27 static struct resource pnx8550_usb_ohci_resources[] = {
29 .start = PNX8550_USB_OHCI_OP_BASE,
30 .end = PNX8550_USB_OHCI_OP_BASE +
31 PNX8550_USB_OHCI_OP_LEN,
32 .flags = IORESOURCE_MEM,
35 .start = PNX8550_INT_USB,
36 .end = PNX8550_INT_USB,
37 .flags = IORESOURCE_IRQ,
41 static struct resource pnx8550_uart_resources[] = {
43 .start = PNX8550_UART_PORT0,
44 .end = PNX8550_UART_PORT0 + 0xfff,
45 .flags = IORESOURCE_MEM,
48 .start = PNX8550_UART_INT(0),
49 .end = PNX8550_UART_INT(0),
50 .flags = IORESOURCE_IRQ,
53 .start = PNX8550_UART_PORT1,
54 .end = PNX8550_UART_PORT1 + 0xfff,
55 .flags = IORESOURCE_MEM,
58 .start = PNX8550_UART_INT(1),
59 .end = PNX8550_UART_INT(1),
60 .flags = IORESOURCE_IRQ,
64 struct pnx8xxx_port pnx8xxx_ports[] = {
69 .membase = (void __iomem *)PNX8550_UART_PORT0,
70 .mapbase = PNX8550_UART_PORT0,
71 .irq = PNX8550_UART_INT(0),
74 .flags = UPF_BOOT_AUTOCONF,
82 .membase = (void __iomem *)PNX8550_UART_PORT1,
83 .mapbase = PNX8550_UART_PORT1,
84 .irq = PNX8550_UART_INT(1),
87 .flags = UPF_BOOT_AUTOCONF,
93 /* The dmamask must be set for OHCI to work */
94 static u64 ohci_dmamask = ~(u32)0;
96 static u64 uart_dmamask = ~(u32)0;
98 static struct platform_device pnx8550_usb_ohci_device = {
99 .name = "pnx8550-ohci",
102 .dma_mask = &ohci_dmamask,
103 .coherent_dma_mask = 0xffffffff,
105 .num_resources = ARRAY_SIZE(pnx8550_usb_ohci_resources),
106 .resource = pnx8550_usb_ohci_resources,
109 static struct platform_device pnx8550_uart_device = {
110 .name = "pnx8xxx-uart",
113 .dma_mask = &uart_dmamask,
114 .coherent_dma_mask = 0xffffffff,
115 .platform_data = pnx8xxx_ports,
117 .num_resources = ARRAY_SIZE(pnx8550_uart_resources),
118 .resource = pnx8550_uart_resources,
121 static struct platform_device *pnx8550_platform_devices[] __initdata = {
122 &pnx8550_usb_ohci_device,
123 &pnx8550_uart_device,
126 static int __init pnx8550_platform_init(void)
128 return platform_add_devices(pnx8550_platform_devices,
129 ARRAY_SIZE(pnx8550_platform_devices));
132 arch_initcall(pnx8550_platform_init);