]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blob - arch/ppc/platforms/4xx/ibmstb4.c
Create platform_device.h to contain all the platform device details.
[mirror_ubuntu-artful-kernel.git] / arch / ppc / platforms / 4xx / ibmstb4.c
1 /*
2 * arch/ppc/platforms/4xx/ibmstb4.c
3 *
4 * Author: Armin Kuster <akuster@mvista.com>
5 *
6 * 2000-2001 (c) MontaVista, Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <asm/ocp.h>
15 #include <asm/ppc4xx_pic.h>
16 #include <platforms/4xx/ibmstb4.h>
17
18 static struct ocp_func_iic_data ibmstb4_iic0_def = {
19 .fast_mode = 0, /* Use standad mode (100Khz) */
20 };
21
22 static struct ocp_func_iic_data ibmstb4_iic1_def = {
23 .fast_mode = 0, /* Use standad mode (100Khz) */
24 };
25 OCP_SYSFS_IIC_DATA()
26
27 struct ocp_def core_ocp[] __initdata = {
28 { .vendor = OCP_VENDOR_IBM,
29 .function = OCP_FUNC_16550,
30 .index = 0,
31 .paddr = UART0_IO_BASE,
32 .irq = UART0_INT,
33 .pm = IBM_CPM_UART0,
34 },
35 { .vendor = OCP_VENDOR_IBM,
36 .function = OCP_FUNC_16550,
37 .index = 1,
38 .paddr = UART1_IO_BASE,
39 .irq = UART1_INT,
40 .pm = IBM_CPM_UART1,
41 },
42 { .vendor = OCP_VENDOR_IBM,
43 .function = OCP_FUNC_16550,
44 .index = 2,
45 .paddr = UART2_IO_BASE,
46 .irq = UART2_INT,
47 .pm = IBM_CPM_UART2,
48 },
49 { .vendor = OCP_VENDOR_IBM,
50 .function = OCP_FUNC_IIC,
51 .paddr = IIC0_BASE,
52 .irq = IIC0_IRQ,
53 .pm = IBM_CPM_IIC0,
54 .additions = &ibmstb4_iic0_def,
55 .show = &ocp_show_iic_data
56 },
57 { .vendor = OCP_VENDOR_IBM,
58 .function = OCP_FUNC_IIC,
59 .paddr = IIC1_BASE,
60 .irq = IIC1_IRQ,
61 .pm = IBM_CPM_IIC1,
62 .additions = &ibmstb4_iic1_def,
63 .show = &ocp_show_iic_data
64 },
65 { .vendor = OCP_VENDOR_IBM,
66 .function = OCP_FUNC_GPIO,
67 .paddr = GPIO0_BASE,
68 .irq = OCP_IRQ_NA,
69 .pm = IBM_CPM_GPIO0,
70 },
71 { .vendor = OCP_VENDOR_IBM,
72 .function = OCP_FUNC_IDE,
73 .paddr = IDE0_BASE,
74 .irq = IDE0_IRQ,
75 .pm = OCP_CPM_NA,
76 },
77 { .vendor = OCP_VENDOR_INVALID,
78 }
79 };
80
81 /* Polarity and triggering settings for internal interrupt sources */
82 struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
83 { .polarity = 0x7fffff01,
84 .triggering = 0x00000000,
85 .ext_irq_mask = 0x0000007e, /* IRQ0 - IRQ5 */
86 }
87 };
88
89 static struct resource ohci_usb_resources[] = {
90 [0] = {
91 .start = USB0_BASE,
92 .end = USB0_BASE + USB0_SIZE - 1,
93 .flags = IORESOURCE_MEM,
94 },
95 [1] = {
96 .start = USB0_IRQ,
97 .end = USB0_IRQ,
98 .flags = IORESOURCE_IRQ,
99 },
100 };
101
102 static u64 dma_mask = 0xffffffffULL;
103
104 static struct platform_device ohci_usb_device = {
105 .name = "ppc-soc-ohci",
106 .id = 0,
107 .num_resources = ARRAY_SIZE(ohci_usb_resources),
108 .resource = ohci_usb_resources,
109 .dev = {
110 .dma_mask = &dma_mask,
111 .coherent_dma_mask = 0xffffffffULL,
112 }
113 };
114
115 static struct platform_device *ibmstb4_devs[] __initdata = {
116 &ohci_usb_device,
117 };
118
119 static int __init
120 ibmstb4_platform_add_devices(void)
121 {
122 return platform_add_devices(ibmstb4_devs, ARRAY_SIZE(ibmstb4_devs));
123 }
124 arch_initcall(ibmstb4_platform_add_devices);