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,
145 .pci_nr_irqs = ARRAY_SIZE(rb1xx_pci_irqs),
146 .pci_irq_map = rb1xx_pci_irqs,
149 static struct adm5120_board rb133c_board __initdata = {
150 .mach_type = MACH_ADM5120_RB_133C,
151 .name = "Mikrotik RouterBOARD 133C",
152 .board_setup = rb1xx_setup,
154 .eth_vlans = rb133c_vlans,
155 .num_devices = ARRAY_SIZE(rb1xx_devices),
156 .devices = rb1xx_devices,
157 .pci_nr_irqs = ARRAY_SIZE(rb1xx_pci_irqs),
158 .pci_irq_map = rb1xx_pci_irqs,
161 static struct adm5120_board rb150_board __initdata = {
162 .mach_type = MACH_ADM5120_RB_150,
163 .name = "Mikrotik RouterBOARD 150",
164 .board_setup = rb1xx_setup,
166 .eth_vlans = rb15x_vlans,
167 .num_devices = ARRAY_SIZE(rb150_devices),
168 .devices = rb150_devices,
171 static struct adm5120_board rb153_board __initdata = {
172 .mach_type = MACH_ADM5120_RB_153,
173 .name = "Mikrotik RouterBOARD 153",
174 .board_setup = rb1xx_setup,
176 .eth_vlans = rb15x_vlans,
177 .num_devices = ARRAY_SIZE(rb1xx_devices),
178 .devices = rb1xx_devices,
179 .pci_nr_irqs = ARRAY_SIZE(rb1xx_pci_irqs),
180 .pci_irq_map = rb1xx_pci_irqs,
183 static struct adm5120_board rb192_board __initdata = {
184 .mach_type = MACH_ADM5120_RB_192,
185 .name = "Mikrotik RouterBOARD 192",
186 .board_setup = rb1xx_setup,
188 .eth_vlans = rb192_vlans,
189 .num_devices = ARRAY_SIZE(rb1xx_devices),
190 .devices = rb1xx_devices,
191 .pci_nr_irqs = ARRAY_SIZE(rb1xx_pci_irqs),
192 .pci_irq_map = rb1xx_pci_irqs,
195 static int __init register_boards(void)
197 adm5120_board_register(&rb111_board);
198 adm5120_board_register(&rb112_board);
199 adm5120_board_register(&rb133_board);
200 adm5120_board_register(&rb133c_board);
201 adm5120_board_register(&rb150_board);
202 adm5120_board_register(&rb153_board);
203 adm5120_board_register(&rb192_board);
207 pure_initcall(register_boards);