blob: 55af769a6e70854e5000017973a75b4f35924a53 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * Support for IBM PPC 405EP processors.
3 *
4 * Author: SAW (IBM), derived from ibmnp405l.c.
5 * Maintained by MontaVista Software <source@mvista.com>
6 *
7 * 2003 (c) MontaVista Softare Inc. This file is licensed under the
8 * terms of the GNU General Public License version 2. This program is
9 * licensed "as is" without any warranty of any kind, whether express
10 * or implied.
11 */
12
13#include <linux/config.h>
14#include <linux/init.h>
15#include <linux/smp.h>
16#include <linux/threads.h>
17#include <linux/param.h>
18#include <linux/string.h>
19
20#include <asm/ibm4xx.h>
21#include <asm/ocp.h>
22#include <asm/ppc4xx_pic.h>
23
24#include <platforms/4xx/ibm405ep.h>
25
26static struct ocp_func_mal_data ibm405ep_mal0_def = {
27 .num_tx_chans = 4, /* Number of TX channels */
28 .num_rx_chans = 2, /* Number of RX channels */
29 .txeob_irq = 11, /* TX End Of Buffer IRQ */
30 .rxeob_irq = 12, /* RX End Of Buffer IRQ */
31 .txde_irq = 13, /* TX Descriptor Error IRQ */
32 .rxde_irq = 14, /* RX Descriptor Error IRQ */
33 .serr_irq = 10, /* MAL System Error IRQ */
Eugene Surovegin3a0a4012005-09-03 15:55:53 -070034 .dcr_base = DCRN_MAL_BASE /* MAL0_CFG DCR number */
Linus Torvalds1da177e2005-04-16 15:20:36 -070035};
36OCP_SYSFS_MAL_DATA()
37
38static struct ocp_func_emac_data ibm405ep_emac0_def = {
39 .rgmii_idx = -1, /* No RGMII */
40 .rgmii_mux = -1, /* No RGMII */
41 .zmii_idx = -1, /* ZMII device index */
42 .zmii_mux = 0, /* ZMII input of this EMAC */
43 .mal_idx = 0, /* MAL device index */
44 .mal_rx_chan = 0, /* MAL rx channel number */
45 .mal_tx_chan = 0, /* MAL tx channel number */
46 .wol_irq = 9, /* WOL interrupt number */
47 .mdio_idx = 0, /* MDIO via EMAC0 */
48 .tah_idx = -1, /* No TAH */
49};
50
51static struct ocp_func_emac_data ibm405ep_emac1_def = {
52 .rgmii_idx = -1, /* No RGMII */
53 .rgmii_mux = -1, /* No RGMII */
54 .zmii_idx = -1, /* ZMII device index */
55 .zmii_mux = 0, /* ZMII input of this EMAC */
56 .mal_idx = 0, /* MAL device index */
57 .mal_rx_chan = 1, /* MAL rx channel number */
58 .mal_tx_chan = 2, /* MAL tx channel number */
59 .wol_irq = 9, /* WOL interrupt number */
60 .mdio_idx = 0, /* MDIO via EMAC0 */
61 .tah_idx = -1, /* No TAH */
62};
63OCP_SYSFS_EMAC_DATA()
64
65static struct ocp_func_iic_data ibm405ep_iic0_def = {
66 .fast_mode = 0, /* Use standad mode (100Khz) */
67};
68OCP_SYSFS_IIC_DATA()
69
70struct ocp_def core_ocp[] = {
71 { .vendor = OCP_VENDOR_IBM,
72 .function = OCP_FUNC_OPB,
73 .index = 0,
74 .paddr = 0xEF600000,
75 .irq = OCP_IRQ_NA,
76 .pm = OCP_CPM_NA,
77 },
78 { .vendor = OCP_VENDOR_IBM,
79 .function = OCP_FUNC_16550,
80 .index = 0,
81 .paddr = UART0_IO_BASE,
82 .irq = UART0_INT,
83 .pm = IBM_CPM_UART0
84 },
85 { .vendor = OCP_VENDOR_IBM,
86 .function = OCP_FUNC_16550,
87 .index = 1,
88 .paddr = UART1_IO_BASE,
89 .irq = UART1_INT,
90 .pm = IBM_CPM_UART1
91 },
92 { .vendor = OCP_VENDOR_IBM,
93 .function = OCP_FUNC_IIC,
94 .paddr = 0xEF600500,
95 .irq = 2,
96 .pm = IBM_CPM_IIC0,
97 .additions = &ibm405ep_iic0_def,
98 .show = &ocp_show_iic_data
99 },
100 { .vendor = OCP_VENDOR_IBM,
101 .function = OCP_FUNC_GPIO,
102 .paddr = 0xEF600700,
103 .irq = OCP_IRQ_NA,
104 .pm = IBM_CPM_GPIO0
105 },
106 { .vendor = OCP_VENDOR_IBM,
107 .function = OCP_FUNC_MAL,
108 .paddr = OCP_PADDR_NA,
109 .irq = OCP_IRQ_NA,
110 .pm = OCP_CPM_NA,
111 .additions = &ibm405ep_mal0_def,
112 .show = &ocp_show_mal_data
113 },
114 { .vendor = OCP_VENDOR_IBM,
115 .function = OCP_FUNC_EMAC,
116 .index = 0,
117 .paddr = EMAC0_BASE,
118 .irq = 15,
119 .pm = OCP_CPM_NA,
120 .additions = &ibm405ep_emac0_def,
121 .show = &ocp_show_emac_data
122 },
123 { .vendor = OCP_VENDOR_IBM,
124 .function = OCP_FUNC_EMAC,
125 .index = 1,
126 .paddr = 0xEF600900,
127 .irq = 17,
128 .pm = OCP_CPM_NA,
129 .additions = &ibm405ep_emac1_def,
130 .show = &ocp_show_emac_data
131 },
132 { .vendor = OCP_VENDOR_INVALID
133 }
134};
135
136/* Polarity and triggering settings for internal interrupt sources */
137struct ppc4xx_uic_settings ppc4xx_core_uic_cfg[] __initdata = {
138 { .polarity = 0xffff7f80,
139 .triggering = 0x00000000,
140 .ext_irq_mask = 0x0000007f, /* IRQ0 - IRQ6 */
141 }
142};