]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - arch/ppc/platforms/4xx/ibmstb4.c
Merge iSeries include file move
[karo-tx-linux.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 <asm/ocp.h>
14 #include <asm/ppc4xx_pic.h>
15 #include <platforms/4xx/ibmstb4.h>
16
17 static struct ocp_func_iic_data ibmstb4_iic0_def = {
18         .fast_mode      = 0,            /* Use standad mode (100Khz) */
19 };
20
21 static struct ocp_func_iic_data ibmstb4_iic1_def = {
22         .fast_mode      = 0,            /* Use standad mode (100Khz) */
23 };
24 OCP_SYSFS_IIC_DATA()
25
26 struct ocp_def core_ocp[] __initdata = {
27         { .vendor       = OCP_VENDOR_IBM,
28           .function     = OCP_FUNC_16550,
29           .index        = 0,
30           .paddr        = UART0_IO_BASE,
31           .irq          = UART0_INT,
32           .pm           = IBM_CPM_UART0,
33         },
34         { .vendor       = OCP_VENDOR_IBM,
35           .function     = OCP_FUNC_16550,
36           .index        = 1,
37           .paddr        = UART1_IO_BASE,
38           .irq          = UART1_INT,
39           .pm           = IBM_CPM_UART1,
40         },
41         { .vendor       = OCP_VENDOR_IBM,
42           .function     = OCP_FUNC_16550,
43           .index        = 2,
44           .paddr        = UART2_IO_BASE,
45           .irq          = UART2_INT,
46           .pm           = IBM_CPM_UART2,
47         },
48         { .vendor       = OCP_VENDOR_IBM,
49           .function     = OCP_FUNC_IIC,
50           .paddr        = IIC0_BASE,
51           .irq          = IIC0_IRQ,
52           .pm           = IBM_CPM_IIC0,
53           .additions    = &ibmstb4_iic0_def,
54           .show         = &ocp_show_iic_data
55         },
56         { .vendor       = OCP_VENDOR_IBM,
57           .function     = OCP_FUNC_IIC,
58           .paddr        = IIC1_BASE,
59           .irq          = IIC1_IRQ,
60           .pm           = IBM_CPM_IIC1,
61           .additions    = &ibmstb4_iic1_def,
62           .show         = &ocp_show_iic_data
63         },
64         { .vendor       = OCP_VENDOR_IBM,
65           .function     = OCP_FUNC_GPIO,
66           .paddr        = GPIO0_BASE,
67           .irq          = OCP_IRQ_NA,
68           .pm           = IBM_CPM_GPIO0,
69         },
70         { .vendor       = OCP_VENDOR_IBM,
71           .function     = OCP_FUNC_IDE,
72           .paddr        = IDE0_BASE,
73           .irq          = IDE0_IRQ,
74           .pm           = OCP_CPM_NA,
75         },
76         { .vendor       = OCP_VENDOR_INVALID,
77         }
78 };
79
80 /* Polarity and triggering settings for internal interrupt sources */
81 struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
82         { .polarity     = 0x7fffff01,
83           .triggering   = 0x00000000,
84           .ext_irq_mask = 0x0000007e,   /* IRQ0 - IRQ5 */
85         }
86 };
87
88 static struct resource ohci_usb_resources[] = {
89         [0] = {
90                 .start  = USB0_BASE,
91                 .end    = USB0_BASE + USB0_SIZE - 1,
92                 .flags  = IORESOURCE_MEM,
93         },
94         [1] = {
95                 .start  = USB0_IRQ,
96                 .end    = USB0_IRQ,
97                 .flags  = IORESOURCE_IRQ,
98         },
99 };
100
101 static u64 dma_mask = 0xffffffffULL;
102
103 static struct platform_device ohci_usb_device = {
104         .name           = "ppc-soc-ohci",
105         .id             = 0,
106         .num_resources  = ARRAY_SIZE(ohci_usb_resources),
107         .resource       = ohci_usb_resources,
108         .dev            = {
109                 .dma_mask = &dma_mask,
110                 .coherent_dma_mask = 0xffffffffULL,
111         }
112 };
113
114 static struct platform_device *ibmstb4_devs[] __initdata = {
115         &ohci_usb_device,
116 };
117
118 static int __init
119 ibmstb4_platform_add_devices(void)
120 {
121         return platform_add_devices(ibmstb4_devs, ARRAY_SIZE(ibmstb4_devs));
122 }
123 arch_initcall(ibmstb4_platform_add_devices);