2 * arch/ppc/platforms/4xx/ibm440ep.c
4 * PPC440EP I/O descriptions
6 * Wade Farnsworth <wfarnsworth@mvista.com>
7 * Copyright 2004 MontaVista Software Inc.
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
15 #include <linux/init.h>
16 #include <linux/module.h>
17 #include <platforms/4xx/ibm440ep.h>
19 #include <asm/ppc4xx_pic.h>
21 static struct ocp_func_emac_data ibm440ep_emac0_def = {
22 .rgmii_idx = -1, /* No RGMII */
23 .rgmii_mux = -1, /* No RGMII */
24 .zmii_idx = 0, /* ZMII device index */
25 .zmii_mux = 0, /* ZMII input of this EMAC */
26 .mal_idx = 0, /* MAL device index */
27 .mal_rx_chan = 0, /* MAL rx channel number */
28 .mal_tx_chan = 0, /* MAL tx channel number */
29 .wol_irq = 61, /* WOL interrupt number */
30 .mdio_idx = -1, /* No shared MDIO */
31 .tah_idx = -1, /* No TAH */
34 static struct ocp_func_emac_data ibm440ep_emac1_def = {
35 .rgmii_idx = -1, /* No RGMII */
36 .rgmii_mux = -1, /* No RGMII */
37 .zmii_idx = 0, /* ZMII device index */
38 .zmii_mux = 1, /* ZMII input of this EMAC */
39 .mal_idx = 0, /* MAL device index */
40 .mal_rx_chan = 1, /* MAL rx channel number */
41 .mal_tx_chan = 2, /* MAL tx channel number */
42 .wol_irq = 63, /* WOL interrupt number */
43 .mdio_idx = -1, /* No shared MDIO */
44 .tah_idx = -1, /* No TAH */
48 static struct ocp_func_mal_data ibm440ep_mal0_def = {
49 .num_tx_chans = 4, /* Number of TX channels */
50 .num_rx_chans = 2, /* Number of RX channels */
51 .txeob_irq = 10, /* TX End Of Buffer IRQ */
52 .rxeob_irq = 11, /* RX End Of Buffer IRQ */
53 .txde_irq = 33, /* TX Descriptor Error IRQ */
54 .rxde_irq = 34, /* RX Descriptor Error IRQ */
55 .serr_irq = 32, /* MAL System Error IRQ */
59 static struct ocp_func_iic_data ibm440ep_iic0_def = {
60 .fast_mode = 0, /* Use standad mode (100Khz) */
63 static struct ocp_func_iic_data ibm440ep_iic1_def = {
64 .fast_mode = 0, /* Use standad mode (100Khz) */
68 struct ocp_def core_ocp[] = {
69 { .vendor = OCP_VENDOR_IBM,
70 .function = OCP_FUNC_OPB,
72 .paddr = 0x0EF600000ULL,
76 { .vendor = OCP_VENDOR_IBM,
77 .function = OCP_FUNC_16550,
79 .paddr = PPC440EP_UART0_ADDR,
83 { .vendor = OCP_VENDOR_IBM,
84 .function = OCP_FUNC_16550,
86 .paddr = PPC440EP_UART1_ADDR,
90 { .vendor = OCP_VENDOR_IBM,
91 .function = OCP_FUNC_16550,
93 .paddr = PPC440EP_UART2_ADDR,
97 { .vendor = OCP_VENDOR_IBM,
98 .function = OCP_FUNC_16550,
100 .paddr = PPC440EP_UART3_ADDR,
104 { .vendor = OCP_VENDOR_IBM,
105 .function = OCP_FUNC_IIC,
107 .paddr = 0x0EF600700ULL,
110 .additions = &ibm440ep_iic0_def,
111 .show = &ocp_show_iic_data
113 { .vendor = OCP_VENDOR_IBM,
114 .function = OCP_FUNC_IIC,
116 .paddr = 0x0EF600800ULL,
119 .additions = &ibm440ep_iic1_def,
120 .show = &ocp_show_iic_data
122 { .vendor = OCP_VENDOR_IBM,
123 .function = OCP_FUNC_GPIO,
125 .paddr = 0x0EF600B00ULL,
129 { .vendor = OCP_VENDOR_IBM,
130 .function = OCP_FUNC_GPIO,
132 .paddr = 0x0EF600C00ULL,
136 { .vendor = OCP_VENDOR_IBM,
137 .function = OCP_FUNC_MAL,
138 .paddr = OCP_PADDR_NA,
141 .additions = &ibm440ep_mal0_def,
142 .show = &ocp_show_mal_data,
144 { .vendor = OCP_VENDOR_IBM,
145 .function = OCP_FUNC_EMAC,
147 .paddr = 0x0EF600E00ULL,
150 .additions = &ibm440ep_emac0_def,
151 .show = &ocp_show_emac_data,
153 { .vendor = OCP_VENDOR_IBM,
154 .function = OCP_FUNC_EMAC,
156 .paddr = 0x0EF600F00ULL,
159 .additions = &ibm440ep_emac1_def,
160 .show = &ocp_show_emac_data,
162 { .vendor = OCP_VENDOR_IBM,
163 .function = OCP_FUNC_ZMII,
164 .paddr = 0x0EF600D00ULL,
168 { .vendor = OCP_VENDOR_INVALID
172 /* Polarity and triggering settings for internal interrupt sources */
173 struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
174 { .polarity = 0xffbffe03,
175 .triggering = 0xfffffe00,
176 .ext_irq_mask = 0x000001fc, /* IRQ0 - IRQ6 */
178 { .polarity = 0xffffc6ef,
179 .triggering = 0xffffc7ff,
180 .ext_irq_mask = 0x00003800, /* IRQ7 - IRQ9 */
184 static struct resource usb_gadget_resources[] = {
186 .start = 0x050000100ULL,
187 .end = 0x05000017FULL,
188 .flags = IORESOURCE_MEM,
193 .flags = IORESOURCE_IRQ,
197 static u64 dma_mask = 0xffffffffULL;
199 static struct platform_device usb_gadget_device = {
202 .num_resources = ARRAY_SIZE(usb_gadget_resources),
203 .resource = usb_gadget_resources,
205 .dma_mask = &dma_mask,
206 .coherent_dma_mask = 0xffffffffULL,
210 static struct platform_device *ibm440ep_devs[] __initdata = {
215 ibm440ep_platform_add_devices(void)
217 return platform_add_devices(ibm440ep_devs, ARRAY_SIZE(ibm440ep_devs));
219 arch_initcall(ibm440ep_platform_add_devices);