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 <linux/platform_device.h>
18 #include <platforms/4xx/ibm440ep.h>
20 #include <asm/ppc4xx_pic.h>
22 static struct ocp_func_emac_data ibm440ep_emac0_def
= {
23 .rgmii_idx
= -1, /* No RGMII */
24 .rgmii_mux
= -1, /* No RGMII */
25 .zmii_idx
= 0, /* ZMII device index */
26 .zmii_mux
= 0, /* ZMII input of this EMAC */
27 .mal_idx
= 0, /* MAL device index */
28 .mal_rx_chan
= 0, /* MAL rx channel number */
29 .mal_tx_chan
= 0, /* MAL tx channel number */
30 .wol_irq
= 61, /* WOL interrupt number */
31 .mdio_idx
= -1, /* No shared MDIO */
32 .tah_idx
= -1, /* No TAH */
35 static struct ocp_func_emac_data ibm440ep_emac1_def
= {
36 .rgmii_idx
= -1, /* No RGMII */
37 .rgmii_mux
= -1, /* No RGMII */
38 .zmii_idx
= 0, /* ZMII device index */
39 .zmii_mux
= 1, /* ZMII input of this EMAC */
40 .mal_idx
= 0, /* MAL device index */
41 .mal_rx_chan
= 1, /* MAL rx channel number */
42 .mal_tx_chan
= 2, /* MAL tx channel number */
43 .wol_irq
= 63, /* WOL interrupt number */
44 .mdio_idx
= -1, /* No shared MDIO */
45 .tah_idx
= -1, /* No TAH */
49 static struct ocp_func_mal_data ibm440ep_mal0_def
= {
50 .num_tx_chans
= 4, /* Number of TX channels */
51 .num_rx_chans
= 2, /* Number of RX channels */
52 .txeob_irq
= 10, /* TX End Of Buffer IRQ */
53 .rxeob_irq
= 11, /* RX End Of Buffer IRQ */
54 .txde_irq
= 33, /* TX Descriptor Error IRQ */
55 .rxde_irq
= 34, /* RX Descriptor Error IRQ */
56 .serr_irq
= 32, /* MAL System Error IRQ */
57 .dcr_base
= DCRN_MAL_BASE
/* MAL0_CFG DCR number */
61 static struct ocp_func_iic_data ibm440ep_iic0_def
= {
62 .fast_mode
= 0, /* Use standad mode (100Khz) */
65 static struct ocp_func_iic_data ibm440ep_iic1_def
= {
66 .fast_mode
= 0, /* Use standad mode (100Khz) */
70 struct ocp_def core_ocp
[] = {
71 { .vendor
= OCP_VENDOR_IBM
,
72 .function
= OCP_FUNC_OPB
,
74 .paddr
= 0x0EF600000ULL
,
78 { .vendor
= OCP_VENDOR_IBM
,
79 .function
= OCP_FUNC_16550
,
81 .paddr
= PPC440EP_UART0_ADDR
,
85 { .vendor
= OCP_VENDOR_IBM
,
86 .function
= OCP_FUNC_16550
,
88 .paddr
= PPC440EP_UART1_ADDR
,
92 { .vendor
= OCP_VENDOR_IBM
,
93 .function
= OCP_FUNC_16550
,
95 .paddr
= PPC440EP_UART2_ADDR
,
99 { .vendor
= OCP_VENDOR_IBM
,
100 .function
= OCP_FUNC_16550
,
102 .paddr
= PPC440EP_UART3_ADDR
,
106 { .vendor
= OCP_VENDOR_IBM
,
107 .function
= OCP_FUNC_IIC
,
109 .paddr
= 0x0EF600700ULL
,
112 .additions
= &ibm440ep_iic0_def
,
113 .show
= &ocp_show_iic_data
115 { .vendor
= OCP_VENDOR_IBM
,
116 .function
= OCP_FUNC_IIC
,
118 .paddr
= 0x0EF600800ULL
,
121 .additions
= &ibm440ep_iic1_def
,
122 .show
= &ocp_show_iic_data
124 { .vendor
= OCP_VENDOR_IBM
,
125 .function
= OCP_FUNC_GPIO
,
127 .paddr
= 0x0EF600B00ULL
,
131 { .vendor
= OCP_VENDOR_IBM
,
132 .function
= OCP_FUNC_GPIO
,
134 .paddr
= 0x0EF600C00ULL
,
138 { .vendor
= OCP_VENDOR_IBM
,
139 .function
= OCP_FUNC_MAL
,
140 .paddr
= OCP_PADDR_NA
,
143 .additions
= &ibm440ep_mal0_def
,
144 .show
= &ocp_show_mal_data
,
146 { .vendor
= OCP_VENDOR_IBM
,
147 .function
= OCP_FUNC_EMAC
,
149 .paddr
= 0x0EF600E00ULL
,
152 .additions
= &ibm440ep_emac0_def
,
153 .show
= &ocp_show_emac_data
,
155 { .vendor
= OCP_VENDOR_IBM
,
156 .function
= OCP_FUNC_EMAC
,
158 .paddr
= 0x0EF600F00ULL
,
161 .additions
= &ibm440ep_emac1_def
,
162 .show
= &ocp_show_emac_data
,
164 { .vendor
= OCP_VENDOR_IBM
,
165 .function
= OCP_FUNC_ZMII
,
166 .paddr
= 0x0EF600D00ULL
,
170 { .vendor
= OCP_VENDOR_INVALID
174 /* Polarity and triggering settings for internal interrupt sources */
175 struct ppc4xx_uic_settings ppc4xx_core_uic_cfg
[] __initdata
= {
176 { .polarity
= 0xffbffe03,
177 .triggering
= 0xfffffe00,
178 .ext_irq_mask
= 0x000001fc, /* IRQ0 - IRQ6 */
180 { .polarity
= 0xffffc6ef,
181 .triggering
= 0xffffc7ff,
182 .ext_irq_mask
= 0x00003800, /* IRQ7 - IRQ9 */
186 static struct resource usb_gadget_resources
[] = {
188 .start
= 0x050000100ULL
,
189 .end
= 0x05000017FULL
,
190 .flags
= IORESOURCE_MEM
,
195 .flags
= IORESOURCE_IRQ
,
199 static u64 dma_mask
= 0xffffffffULL
;
201 static struct platform_device usb_gadget_device
= {
204 .num_resources
= ARRAY_SIZE(usb_gadget_resources
),
205 .resource
= usb_gadget_resources
,
207 .dma_mask
= &dma_mask
,
208 .coherent_dma_mask
= 0xffffffffULL
,
212 static struct platform_device
*ibm440ep_devs
[] __initdata
= {
217 ibm440ep_platform_add_devices(void)
219 return platform_add_devices(ibm440ep_devs
, ARRAY_SIZE(ibm440ep_devs
));
221 arch_initcall(ibm440ep_platform_add_devices
);