2 * arch/ppc/platforms/4xx/ibm440gx.c
4 * PPC440GX I/O descriptions
6 * Matt Porter <mporter@mvista.com>
7 * Copyright 2002-2004 MontaVista Software Inc.
9 * Eugene Surovegin <eugene.surovegin@zultys.com> or <ebs@ebshome.net>
10 * Copyright (c) 2003, 2004 Zultys Technologies
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
18 #include <linux/init.h>
19 #include <linux/module.h>
20 #include <platforms/4xx/ibm440gx.h>
22 #include <asm/ppc4xx_pic.h>
24 static struct ocp_func_emac_data ibm440gx_emac0_def
= {
25 .rgmii_idx
= -1, /* No RGMII */
26 .rgmii_mux
= -1, /* No RGMII */
27 .zmii_idx
= 0, /* ZMII device index */
28 .zmii_mux
= 0, /* ZMII input of this EMAC */
29 .mal_idx
= 0, /* MAL device index */
30 .mal_rx_chan
= 0, /* MAL rx channel number */
31 .mal_tx_chan
= 0, /* MAL tx channel number */
32 .wol_irq
= 61, /* WOL interrupt number */
33 .mdio_idx
= -1, /* No shared MDIO */
34 .tah_idx
= -1, /* No TAH */
37 static struct ocp_func_emac_data ibm440gx_emac1_def
= {
38 .rgmii_idx
= -1, /* No RGMII */
39 .rgmii_mux
= -1, /* No RGMII */
40 .zmii_idx
= 0, /* ZMII device index */
41 .zmii_mux
= 1, /* ZMII input of this EMAC */
42 .mal_idx
= 0, /* MAL device index */
43 .mal_rx_chan
= 1, /* MAL rx channel number */
44 .mal_tx_chan
= 1, /* MAL tx channel number */
45 .wol_irq
= 63, /* WOL interrupt number */
46 .mdio_idx
= -1, /* No shared MDIO */
47 .tah_idx
= -1, /* No TAH */
50 static struct ocp_func_emac_data ibm440gx_emac2_def
= {
51 .rgmii_idx
= 0, /* RGMII device index */
52 .rgmii_mux
= 0, /* RGMII input of this EMAC */
53 .zmii_idx
= 0, /* ZMII device index */
54 .zmii_mux
= 2, /* ZMII input of this EMAC */
55 .mal_idx
= 0, /* MAL device index */
56 .mal_rx_chan
= 2, /* MAL rx channel number */
57 .mal_tx_chan
= 2, /* MAL tx channel number */
58 .wol_irq
= 65, /* WOL interrupt number */
59 .mdio_idx
= -1, /* No shared MDIO */
60 .tah_idx
= 0, /* TAH device index */
61 .jumbo
= 1, /* Jumbo frames supported */
64 static struct ocp_func_emac_data ibm440gx_emac3_def
= {
65 .rgmii_idx
= 0, /* RGMII device index */
66 .rgmii_mux
= 1, /* RGMII input of this EMAC */
67 .zmii_idx
= 0, /* ZMII device index */
68 .zmii_mux
= 3, /* ZMII input of this EMAC */
69 .mal_idx
= 0, /* MAL device index */
70 .mal_rx_chan
= 3, /* MAL rx channel number */
71 .mal_tx_chan
= 3, /* MAL tx channel number */
72 .wol_irq
= 67, /* WOL interrupt number */
73 .mdio_idx
= -1, /* No shared MDIO */
74 .tah_idx
= 1, /* TAH device index */
75 .jumbo
= 1, /* Jumbo frames supported */
79 static struct ocp_func_mal_data ibm440gx_mal0_def
= {
80 .num_tx_chans
= 4, /* Number of TX channels */
81 .num_rx_chans
= 4, /* Number of RX channels */
82 .txeob_irq
= 10, /* TX End Of Buffer IRQ */
83 .rxeob_irq
= 11, /* RX End Of Buffer IRQ */
84 .txde_irq
= 33, /* TX Descriptor Error IRQ */
85 .rxde_irq
= 34, /* RX Descriptor Error IRQ */
86 .serr_irq
= 32, /* MAL System Error IRQ */
90 static struct ocp_func_iic_data ibm440gx_iic0_def
= {
91 .fast_mode
= 0, /* Use standad mode (100Khz) */
94 static struct ocp_func_iic_data ibm440gx_iic1_def
= {
95 .fast_mode
= 0, /* Use standad mode (100Khz) */
99 struct ocp_def core_ocp
[] = {
100 { .vendor
= OCP_VENDOR_IBM
,
101 .function
= OCP_FUNC_OPB
,
103 .paddr
= 0x0000000140000000ULL
,
107 { .vendor
= OCP_VENDOR_IBM
,
108 .function
= OCP_FUNC_16550
,
110 .paddr
= PPC440GX_UART0_ADDR
,
114 { .vendor
= OCP_VENDOR_IBM
,
115 .function
= OCP_FUNC_16550
,
117 .paddr
= PPC440GX_UART1_ADDR
,
121 { .vendor
= OCP_VENDOR_IBM
,
122 .function
= OCP_FUNC_IIC
,
124 .paddr
= 0x0000000140000400ULL
,
127 .additions
= &ibm440gx_iic0_def
,
128 .show
= &ocp_show_iic_data
130 { .vendor
= OCP_VENDOR_IBM
,
131 .function
= OCP_FUNC_IIC
,
133 .paddr
= 0x0000000140000500ULL
,
136 .additions
= &ibm440gx_iic1_def
,
137 .show
= &ocp_show_iic_data
139 { .vendor
= OCP_VENDOR_IBM
,
140 .function
= OCP_FUNC_GPIO
,
142 .paddr
= 0x0000000140000700ULL
,
146 { .vendor
= OCP_VENDOR_IBM
,
147 .function
= OCP_FUNC_MAL
,
148 .paddr
= OCP_PADDR_NA
,
151 .additions
= &ibm440gx_mal0_def
,
152 .show
= &ocp_show_mal_data
,
154 { .vendor
= OCP_VENDOR_IBM
,
155 .function
= OCP_FUNC_EMAC
,
157 .paddr
= 0x0000000140000800ULL
,
160 .additions
= &ibm440gx_emac0_def
,
161 .show
= &ocp_show_emac_data
,
163 { .vendor
= OCP_VENDOR_IBM
,
164 .function
= OCP_FUNC_EMAC
,
166 .paddr
= 0x0000000140000900ULL
,
169 .additions
= &ibm440gx_emac1_def
,
170 .show
= &ocp_show_emac_data
,
172 { .vendor
= OCP_VENDOR_IBM
,
173 .function
= OCP_FUNC_EMAC
,
175 .paddr
= 0x0000000140000C00ULL
,
178 .additions
= &ibm440gx_emac2_def
,
179 .show
= &ocp_show_emac_data
,
181 { .vendor
= OCP_VENDOR_IBM
,
182 .function
= OCP_FUNC_EMAC
,
184 .paddr
= 0x0000000140000E00ULL
,
187 .additions
= &ibm440gx_emac3_def
,
188 .show
= &ocp_show_emac_data
,
190 { .vendor
= OCP_VENDOR_IBM
,
191 .function
= OCP_FUNC_RGMII
,
192 .paddr
= 0x0000000140000790ULL
,
196 { .vendor
= OCP_VENDOR_IBM
,
197 .function
= OCP_FUNC_ZMII
,
198 .paddr
= 0x0000000140000780ULL
,
202 { .vendor
= OCP_VENDOR_IBM
,
203 .function
= OCP_FUNC_TAH
,
205 .paddr
= 0x0000000140000b50ULL
,
209 { .vendor
= OCP_VENDOR_IBM
,
210 .function
= OCP_FUNC_TAH
,
212 .paddr
= 0x0000000140000d50ULL
,
216 { .vendor
= OCP_VENDOR_INVALID
220 /* Polarity and triggering settings for internal interrupt sources */
221 struct ppc4xx_uic_settings ppc4xx_core_uic_cfg
[] __initdata
= {
222 { .polarity
= 0xfffffe03,
223 .triggering
= 0x01c00000,
224 .ext_irq_mask
= 0x000001fc, /* IRQ0 - IRQ6 */
226 { .polarity
= 0xffffc0ff,
227 .triggering
= 0x00ff8000,
228 .ext_irq_mask
= 0x00003f00, /* IRQ7 - IRQ12 */
230 { .polarity
= 0xffff83ff,
231 .triggering
= 0x000f83c0,
232 .ext_irq_mask
= 0x00007c00, /* IRQ13 - IRQ17 */