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/dma-mapping.h>
17 #include <linux/kernel.h>
18 #include <linux/init.h>
19 #include <linux/resource.h>
20 #include <linux/serial.h>
21 #include <linux/serial_pnx8xxx.h>
22 #include <linux/platform_device.h>
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 pnx8xxx_port pnx8xxx_ports
[] = {
70 .membase
= (void __iomem
*)PNX8550_UART_PORT0
,
71 .mapbase
= PNX8550_UART_PORT0
,
72 .irq
= PNX8550_UART_INT(0),
75 .flags
= UPF_BOOT_AUTOCONF
,
83 .membase
= (void __iomem
*)PNX8550_UART_PORT1
,
84 .mapbase
= PNX8550_UART_PORT1
,
85 .irq
= PNX8550_UART_INT(1),
88 .flags
= UPF_BOOT_AUTOCONF
,
94 /* The dmamask must be set for OHCI to work */
95 static u64 ohci_dmamask
= DMA_BIT_MASK(32);
97 static u64 uart_dmamask
= DMA_BIT_MASK(32);
99 static struct platform_device pnx8550_usb_ohci_device
= {
100 .name
= "pnx8550-ohci",
103 .dma_mask
= &ohci_dmamask
,
104 .coherent_dma_mask
= DMA_BIT_MASK(32),
106 .num_resources
= ARRAY_SIZE(pnx8550_usb_ohci_resources
),
107 .resource
= pnx8550_usb_ohci_resources
,
110 static struct platform_device pnx8550_uart_device
= {
111 .name
= "pnx8xxx-uart",
114 .dma_mask
= &uart_dmamask
,
115 .coherent_dma_mask
= DMA_BIT_MASK(32),
116 .platform_data
= pnx8xxx_ports
,
118 .num_resources
= ARRAY_SIZE(pnx8550_uart_resources
),
119 .resource
= pnx8550_uart_resources
,
122 static struct platform_device
*pnx8550_platform_devices
[] __initdata
= {
123 &pnx8550_usb_ohci_device
,
124 &pnx8550_uart_device
,
127 static int __init
pnx8550_platform_init(void)
129 return platform_add_devices(pnx8550_platform_devices
,
130 ARRAY_SIZE(pnx8550_platform_devices
));
133 arch_initcall(pnx8550_platform_init
);