patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / arch / ppc / platforms / 4xx / ibm405gp.c
1 /*
2  *
3  *    Copyright 2000-2001 MontaVista Software Inc.
4  *      Original author: Armin Kuster akuster@mvista.com
5  *
6  *    Module name: ibm405gp.c
7  *
8  *
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.
13  *
14  */
15
16 #include <linux/config.h>
17 #include <linux/init.h>
18 #include <linux/smp.h>
19 #include <linux/threads.h>
20 #include <linux/param.h>
21 #include <linux/string.h>
22 #include <platforms/4xx/ibm405gp.h>
23 #include <asm/ibm4xx.h>
24 #include <asm/ocp.h>
25
26 static struct ocp_func_emac_data ibm405gp_emac0_def = {
27         .rgmii_idx      = -1,           /* No RGMII */
28         .rgmii_mux      = -1,           /* No RGMII */
29         .zmii_idx       = -1,           /* ZMII device index */
30         .zmii_mux       = 0,            /* ZMII input of this EMAC */
31         .mal_idx        = 0,            /* MAL device index */
32         .mal_rx_chan    = 0,            /* MAL rx channel number */
33         .mal_tx_chan    = 0,            /* MAL tx channel number */
34         .wol_irq        = 9,            /* WOL interrupt number */
35         .mdio_idx       = -1,           /* No shared MDIO */
36         .tah_idx        = -1,           /* No TAH */
37 };
38 OCP_SYSFS_EMAC_DATA()
39
40 static struct ocp_func_mal_data ibm405gp_mal0_def = {
41         .num_tx_chans   = 1,            /* Number of TX channels */
42         .num_rx_chans   = 1,            /* Number of RX channels */
43         .txeob_irq      = 11,           /* TX End Of Buffer IRQ  */
44         .rxeob_irq      = 12,           /* RX End Of Buffer IRQ  */
45         .txde_irq       = 13,           /* TX Descriptor Error IRQ */
46         .rxde_irq       = 14,           /* RX Descriptor Error IRQ */
47         .serr_irq       = 10,           /* MAL System Error IRQ    */
48 };
49 OCP_SYSFS_MAL_DATA()
50
51 static struct ocp_func_iic_data ibm405gp_iic0_def = {
52         .fast_mode      = 0,            /* Use standad mode (100Khz) */
53 };
54 OCP_SYSFS_IIC_DATA()
55
56 struct ocp_def core_ocp[] = {
57         { .vendor       = OCP_VENDOR_IBM,
58           .function     = OCP_FUNC_OPB,
59           .index        = 0,
60           .paddr        = 0xEF600000,
61           .irq          = OCP_IRQ_NA,
62           .pm           = OCP_CPM_NA,
63         },
64         { .vendor       = OCP_VENDOR_IBM,
65           .function     = OCP_FUNC_16550,
66           .index        = 0,
67           .paddr        = UART0_IO_BASE,
68           .irq          = UART0_INT,
69           .pm           = IBM_CPM_UART0
70         },
71         { .vendor       = OCP_VENDOR_IBM,
72           .function     = OCP_FUNC_16550,
73           .index        = 1,
74           .paddr        = UART1_IO_BASE,
75           .irq          = UART1_INT,
76           .pm           = IBM_CPM_UART1
77         },
78         { .vendor       = OCP_VENDOR_IBM,
79           .function     = OCP_FUNC_IIC,
80           .paddr        = 0xEF600500,
81           .irq          = 2,
82           .pm           = IBM_CPM_IIC0,
83           .additions    = &ibm405gp_iic0_def,
84           .show         = &ocp_show_iic_data,
85         },
86         { .vendor       = OCP_VENDOR_IBM,
87           .function     = OCP_FUNC_GPIO,
88           .paddr        = 0xEF600700,
89           .irq          = OCP_IRQ_NA,
90           .pm           = IBM_CPM_GPIO0
91         },
92         { .vendor       = OCP_VENDOR_IBM,
93           .function     = OCP_FUNC_MAL,
94           .paddr        = OCP_PADDR_NA,
95           .irq          = OCP_IRQ_NA,
96           .pm           = OCP_CPM_NA,
97           .additions    = &ibm405gp_mal0_def,
98           .show         = &ocp_show_mal_data,
99         },
100         { .vendor       = OCP_VENDOR_IBM,
101           .function     = OCP_FUNC_EMAC,
102           .index        = 0,
103           .paddr        = EMAC0_BASE,
104           .irq          = 15,
105           .pm           = IBM_CPM_EMAC0,
106           .additions    = &ibm405gp_emac0_def,
107           .show         = &ocp_show_emac_data,
108         },
109         { .vendor       = OCP_VENDOR_INVALID
110         }
111 };