4 * Mikrotik RouterBOARDs 1xx series
6 * Copyright (C) 2007 OpenWrt.org
7 * Copyright (C) 2007 Gabor Juhos <juhosg at openwrt.org>
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the
21 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301, USA.
26 #include <linux/kernel.h>
27 #include <linux/init.h>
29 #include <asm/bootinfo.h>
32 #include <adm5120_board.h>
33 #include <adm5120_platform.h>
34 #include <adm5120_irq.h>
36 static struct adm5120_pci_irq rb1xx_pci_irqs
[] __initdata
= {
37 PCIIRQ(1, 0, 1, ADM5120_IRQ_PCI0
),
38 PCIIRQ(2, 0, 1, ADM5120_IRQ_PCI1
),
39 PCIIRQ(3, 0, 1, ADM5120_IRQ_PCI2
)
42 static struct mtd_partition rb1xx_partitions
[] = {
47 .mask_flags
= MTD_WRITEABLE
,
50 .offset
= MTDPART_OFS_APPEND
,
51 .size
= MTDPART_SIZ_FULL
,
55 static struct platform_device
*rb1xx_devices
[] __initdata
= {
56 &adm5120_flash0_device
,
60 static struct platform_device
*rb150_devices
[] __initdata
= {
61 &adm5120_flash0_device
,
62 /* TODO: nand device is not yet supported */
65 static void __init
rb1xx_setup(void)
67 /* setup data for flash0 device */
68 adm5120_flash0_data
.nr_parts
= ARRAY_SIZE(rb1xx_partitions
);
69 adm5120_flash0_data
.parts
= rb1xx_partitions
;
71 /* TODO: setup mac address */
76 * RB1xx boards have bad network performance with the default VLAN matrixes.
77 * Disable it while the ethernet driver gets fixed.
79 static unsigned char rb11x_vlans
[6] __initdata
= {
81 0x41, 0x00, 0x00, 0x00, 0x00, 0x00
84 static unsigned char rb133_vlans
[6] __initdata
= {
86 0x44, 0x42, 0x41, 0x00, 0x00, 0x00
89 static unsigned char rb133c_vlans
[6] __initdata
= {
91 0x44, 0x00, 0x00, 0x00, 0x00, 0x00
94 static unsigned char rb15x_vlans
[6] __initdata
= {
96 0x41, 0x42, 0x44, 0x48, 0x50, 0x00
98 static unsigned char rb192_vlans
[6] __initdata
= {
100 0x41, 0x50, 0x48, 0x44, 0x42, 0x00
103 static unsigned char rb_vlans
[6] __initdata
= {
104 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00
106 #define rb11x_vlans rb_vlans
107 #define rb133_vlans rb_vlans
108 #define rb133c_vlans rb_vlans
109 #define rb15x_vlans rb_vlans
110 #define rb192_vlans rb_vlans
113 static struct adm5120_board rb111_board __initdata
= {
114 .mach_type
= MACH_ADM5120_RB_111
,
115 .name
= "Mikrotik RouterBOARD 111",
116 .board_setup
= rb1xx_setup
,
118 .eth_vlans
= rb11x_vlans
,
119 .num_devices
= ARRAY_SIZE(rb1xx_devices
),
120 .devices
= rb1xx_devices
,
121 .pci_nr_irqs
= ARRAY_SIZE(rb1xx_pci_irqs
),
122 .pci_irq_map
= rb1xx_pci_irqs
,
125 static struct adm5120_board rb112_board __initdata
= {
126 .mach_type
= MACH_ADM5120_RB_112
,
127 .name
= "Mikrotik RouterBOARD 112",
128 .board_setup
= rb1xx_setup
,
130 .eth_vlans
= rb11x_vlans
,
131 .num_devices
= ARRAY_SIZE(rb1xx_devices
),
132 .devices
= rb1xx_devices
,
133 .pci_nr_irqs
= ARRAY_SIZE(rb1xx_pci_irqs
),
134 .pci_irq_map
= rb1xx_pci_irqs
,
137 static struct adm5120_board rb133_board __initdata
= {
138 .mach_type
= MACH_ADM5120_RB_133
,
139 .name
= "Mikrotik RouterBOARD 133",
140 .board_setup
= rb1xx_setup
,
142 .eth_vlans
= rb133_vlans
,
143 .num_devices
= ARRAY_SIZE(rb1xx_devices
),
144 .devices
= rb1xx_devices
,
147 static struct adm5120_board rb133c_board __initdata
= {
148 .mach_type
= MACH_ADM5120_RB_133C
,
149 .name
= "Mikrotik RouterBOARD 133C",
150 .board_setup
= rb1xx_setup
,
152 .eth_vlans
= rb133c_vlans
,
153 .num_devices
= ARRAY_SIZE(rb1xx_devices
),
154 .devices
= rb1xx_devices
,
155 .pci_nr_irqs
= ARRAY_SIZE(rb1xx_pci_irqs
),
156 .pci_irq_map
= rb1xx_pci_irqs
,
159 static struct adm5120_board rb150_board __initdata
= {
160 .mach_type
= MACH_ADM5120_RB_150
,
161 .name
= "Mikrotik RouterBOARD 150",
162 .board_setup
= rb1xx_setup
,
164 .eth_vlans
= rb15x_vlans
,
165 .num_devices
= ARRAY_SIZE(rb150_devices
),
166 .devices
= rb150_devices
,
169 static struct adm5120_board rb153_board __initdata
= {
170 .mach_type
= MACH_ADM5120_RB_153
,
171 .name
= "Mikrotik RouterBOARD 153",
172 .board_setup
= rb1xx_setup
,
174 .eth_vlans
= rb15x_vlans
,
175 .num_devices
= ARRAY_SIZE(rb1xx_devices
),
176 .devices
= rb1xx_devices
,
177 .pci_nr_irqs
= ARRAY_SIZE(rb1xx_pci_irqs
),
178 .pci_irq_map
= rb1xx_pci_irqs
,
181 static struct adm5120_board rb192_board __initdata
= {
182 .mach_type
= MACH_ADM5120_RB_192
,
183 .name
= "Mikrotik RouterBOARD 192",
184 .board_setup
= rb1xx_setup
,
186 .eth_vlans
= rb192_vlans
,
187 .num_devices
= ARRAY_SIZE(rb1xx_devices
),
188 .devices
= rb1xx_devices
,
189 .pci_nr_irqs
= ARRAY_SIZE(rb1xx_pci_irqs
),
190 .pci_irq_map
= rb1xx_pci_irqs
,
193 static int __init
register_boards(void)
195 adm5120_board_register(&rb111_board
);
196 adm5120_board_register(&rb112_board
);
197 adm5120_board_register(&rb133_board
);
198 adm5120_board_register(&rb133c_board
);
199 adm5120_board_register(&rb150_board
);
200 adm5120_board_register(&rb153_board
);
201 adm5120_board_register(&rb192_board
);
205 pure_initcall(register_boards
);