4 * Mikrotik RouterBOARDs 111/112/133/133C/150/153
6 * Copyright (C) 2007 OpenWrt.org
7 * Copyright (C) 2007 Gabor Juhos <juhosg@freemail.hu>
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 <asm/mach-adm5120/adm5120_board.h>
33 #include <asm/mach-adm5120/adm5120_platform.h>
35 static struct mtd_partition rb1xx_partitions[] = {
40 .mask_flags = MTD_WRITEABLE,
43 .offset = MTDPART_OFS_APPEND,
44 .size = MTDPART_SIZ_FULL,
48 static struct platform_device *rb1xx_devices[] __initdata = {
49 &adm5120_flash0_device,
53 static struct platform_device *rb150_devices[] __initdata = {
54 &adm5120_flash0_device,
55 /* TODO: nand device is not yet supported */
58 static void __init rb1xx_setup(void)
60 /* setup data for flash0 device */
61 adm5120_flash0_data.nr_parts = ARRAY_SIZE(rb1xx_partitions);
62 adm5120_flash0_data.parts = rb1xx_partitions;
64 /* TODO: setup mac address */
69 * RB1xx boards have bad network performance with the default VLAN matrixes.
70 * Disable it while the ethernet driver gets fixed.
72 static unsigned char rb11x_vlans[6] __initdata = {
74 0x41, 0x00, 0x00, 0x00, 0x00, 0x00
77 static unsigned char rb133_vlans[6] __initdata = {
79 0x44, 0x42, 0x41, 0x00, 0x00, 0x00
82 static unsigned char rb133c_vlans[6] __initdata = {
84 0x44, 0x00, 0x00, 0x00, 0x00, 0x00
87 static unsigned char rb15x_vlans[6] __initdata = {
89 0x41, 0x42, 0x44, 0x48, 0x50, 0x00
92 static unsigned char rb_vlans[6] __initdata = {
93 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00
95 #define rb11x_vlans rb_vlans
96 #define rb133_vlans rb_vlans
97 #define rb133c_vlans rb_vlans
98 #define rb15x_vlans rb_vlans
101 static struct adm5120_board rb111_board __initdata = {
102 .mach_type = MACH_ADM5120_RB_111,
103 .name = "Mikrotik RouterBOARD 111",
104 .board_setup = rb1xx_setup,
106 .eth_vlans = rb11x_vlans,
107 .num_devices = ARRAY_SIZE(rb1xx_devices),
108 .devices = rb1xx_devices,
111 static struct adm5120_board rb112_board __initdata = {
112 .mach_type = MACH_ADM5120_RB_112,
113 .name = "Mikrotik RouterBOARD 112",
114 .board_setup = rb1xx_setup,
116 .eth_vlans = rb11x_vlans,
117 .num_devices = ARRAY_SIZE(rb1xx_devices),
118 .devices = rb1xx_devices,
121 static struct adm5120_board rb133_board __initdata = {
122 .mach_type = MACH_ADM5120_RB_133,
123 .name = "Mikrotik RouterBOARD 133",
124 .board_setup = rb1xx_setup,
126 .eth_vlans = rb133_vlans,
127 .num_devices = ARRAY_SIZE(rb1xx_devices),
128 .devices = rb1xx_devices,
131 static struct adm5120_board rb133c_board __initdata = {
132 .mach_type = MACH_ADM5120_RB_133C,
133 .name = "Mikrotik RouterBOARD 133C",
134 .board_setup = rb1xx_setup,
136 .eth_vlans = rb133c_vlans,
137 .num_devices = ARRAY_SIZE(rb1xx_devices),
138 .devices = rb1xx_devices,
141 static struct adm5120_board rb150_board __initdata = {
142 .mach_type = MACH_ADM5120_RB_150,
143 .name = "Mikrotik RouterBOARD 150",
144 .board_setup = rb1xx_setup,
146 .eth_vlans = rb15x_vlans,
147 .num_devices = ARRAY_SIZE(rb150_devices),
148 .devices = rb150_devices,
151 static struct adm5120_board rb153_board __initdata = {
152 .mach_type = MACH_ADM5120_RB_153,
153 .name = "Mikrotik RouterBOARD 153",
154 .board_setup = rb1xx_setup,
156 .eth_vlans = rb15x_vlans,
157 .num_devices = ARRAY_SIZE(rb1xx_devices),
158 .devices = rb1xx_devices,
161 static int __init register_boards(void)
163 adm5120_board_register(&rb111_board);
164 adm5120_board_register(&rb112_board);
165 adm5120_board_register(&rb133_board);
166 adm5120_board_register(&rb133c_board);
167 adm5120_board_register(&rb150_board);
168 adm5120_board_register(&rb153_board);
172 pure_initcall(register_boards);