port enough sendpoint support for DSM-G600 from D-Link 2.4.21-pre4
[linux-2.4.git] / arch / ppc / platforms / 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  *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR   IMPLIED
15  *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
16  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
17  *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT,  INDIRECT,
18  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19  *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
20  *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21  *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
22  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23  *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  *  You should have received a copy of the  GNU General Public License along
26  *  with this program; if not, write  to the Free Software Foundation, Inc.,
27  *  675 Mass Ave, Cambridge, MA 02139, USA.
28  */
29
30 #include <linux/config.h>
31 #include <linux/init.h>
32 #include <linux/smp.h>
33 #include <linux/threads.h>
34 #include <linux/param.h>
35 #include <linux/string.h>
36 #include <platforms/ibm405gp.h>
37 #include <asm/ibm4xx.h>
38 #include <asm/ocp.h>
39
40 static struct ocp_func_emac_data ibm405gp_emac0_def = {
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_tx1_chan   = 0,            /* MAL tx channel 1 number */
46         .mal_tx2_chan   = 1,            /* MAL tx channel 2 number */
47         .wol_irq        = BL_MAC_WOL,   /* WOL interrupt number */
48         .mdio_idx       = -1,           /* No shared MDIO */
49 };
50
51 static struct ocp_func_mal_data ibm405gp_mal0_def = {
52         .num_tx_chans   = 2*EMAC_NUMS,  /* Number of TX channels */
53         .num_rx_chans   = EMAC_NUMS,    /* Number of RX channels */
54 };
55
56 struct ocp_def core_ocp[]  __initdata = {
57         { .vendor       = OCP_VENDOR_IBM,
58           .function     = OCP_FUNC_OPB,
59           .index        = 0,
60           .paddr        = OPB_BASE_START,
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        = IIC0_BASE,
81           .irq          = IIC0_IRQ,
82           .pm           = IBM_CPM_IIC0
83         },
84         { .vendor       = OCP_VENDOR_IBM,
85           .function     = OCP_FUNC_GPIO,
86           .paddr        = GPIO0_BASE,
87           .irq          = OCP_IRQ_NA,
88           .pm           = IBM_CPM_GPIO0
89         },
90         { .vendor       = OCP_VENDOR_IBM,
91           .function     = OCP_FUNC_MAL,
92           .paddr        = OCP_PADDR_NA,
93           .irq          = OCP_IRQ_NA,
94           .pm           = OCP_CPM_NA,
95           .additions    = &ibm405gp_mal0_def,
96         },
97         { .vendor       = OCP_VENDOR_IBM,
98           .function     = OCP_FUNC_EMAC,
99           .index        = 0,
100           .paddr        = EMAC0_BASE,
101           .irq          = BL_MAC_ETH0,
102           .pm           = IBM_CPM_EMAC0,
103           .additions    = &ibm405gp_emac0_def,
104         },
105         { .vendor       = OCP_VENDOR_INVALID
106         }
107 };