This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / arch / mips / vr41xx / nec-cmbvr4133 / setup.c
1 /*
2  * arch/mips/vr41xx/nec-cmbvr4133/setup.c
3  *
4  * Setup for the NEC CMB-VR4133.
5  *
6  * Author: Yoichi Yuasa <yyuasa@mvista.com, or source@mvista.com> and
7  *         Alex Sapkov <asapkov@ru.mvista.com>
8  *
9  * 2001-2004 (c) MontaVista, Software, Inc. This file is licensed under
10  * the terms of the GNU General Public License version 2. This program
11  * is licensed "as is" without any warranty of any kind, whether express
12  * or implied.
13  *
14  * Support for CMBVR4133 board in 2.6
15  * Author: Manish Lachwani (mlachwani@mvista.com)
16  */
17 #include <linux/config.h>
18 #include <linux/init.h>
19 #include <linux/console.h>
20 #include <linux/ide.h>
21 #include <linux/ioport.h>
22
23 #include <asm/reboot.h>
24 #include <asm/time.h>
25 #include <asm/vr41xx/cmbvr4133.h>
26 #include <asm/bootinfo.h>
27
28 #ifdef CONFIG_MTD
29 #include <linux/mtd/physmap.h>
30 #include <linux/mtd/partitions.h>
31 #include <linux/mtd/mtd.h>
32 #include <linux/mtd/map.h>
33
34 static struct mtd_partition cmbvr4133_mtd_parts[] = {
35         {
36                 .name =         "User FS",
37                 .size =         0x1be0000,
38                 .offset =       0,
39                 .mask_flags =   0,
40         },
41         {
42                 .name =         "PMON",
43                 .size =         0x140000,
44                 .offset =       MTDPART_OFS_APPEND,
45                 .mask_flags =   MTD_WRITEABLE,  /* force read-only */
46         },
47         {
48                 .name =         "User FS2",
49                 .size =         MTDPART_SIZ_FULL,
50                 .offset =       MTDPART_OFS_APPEND,
51                 .mask_flags =   0,
52         }
53 };
54
55 #define number_partitions (sizeof(cmbvr4133_mtd_parts)/sizeof(struct mtd_partition))
56 #endif
57
58 extern void (*late_time_init)(void);
59
60 static void __init vr4133_serial_init(void)
61 {
62         vr41xx_select_siu_interface(SIU_RS232C, IRDA_NONE);
63         vr41xx_siu_init();
64         vr41xx_dsiu_init();
65 }
66
67 extern void i8259_init(void);
68
69 static int __init nec_cmbvr4133_setup(void)
70 {
71 #ifdef CONFIG_ROCKHOPPER
72         extern void disable_pcnet(void);
73
74         disable_pcnet();
75 #endif
76         set_io_port_base(KSEG1ADDR(0x16000000));
77
78         mips_machgroup = MACH_GROUP_NEC_VR41XX;
79         mips_machtype = MACH_NEC_CMBVR4133;
80
81         late_time_init = vr4133_serial_init;
82
83 #ifdef CONFIG_PCI
84 #ifdef CONFIG_ROCKHOPPER
85         ali_m5229_preinit();
86 #endif
87 #endif
88
89 #ifdef CONFIG_ROCKHOPPER
90         rockhopper_init_irq();
91 #endif
92
93 #ifdef CONFIG_MTD
94         /* we use generic physmap mapping driver and we use partitions */
95         physmap_configure(0x1C000000, 0x02000000, 4, NULL);
96         physmap_set_partitions(cmbvr4133_mtd_parts, number_partitions);
97 #endif
98
99         /* 128 MB memory support */
100         add_memory_region(0, 0x08000000, BOOT_MEM_RAM);
101
102 #ifdef CONFIG_ROCKHOPPER
103         i8259_init();
104 #endif
105         return 0;
106 }
107
108 early_initcall(nec_cmbvr4133_setup);