1 --- a/arch/powerpc/platforms/83xx/rbppc.c
2 +++ b/arch/powerpc/platforms/83xx/rbppc.c
5 + * Copyright (C) 2010 Alexandros C. Couloumbis <alex@ozo.com>
6 * Copyright (C) 2008-2009 Noah Fontes <nfontes@transtruct.org>
7 * Copyright (C) 2009 Michael Guntsche <mike@it-loops.com>
8 * Copyright (C) Mikrotik 2007
13 + if (strcmp(model, "RB333") == 0)
16 if (strcmp(model, "RB600") == 0)
20 #define SBIT(x) (0x80000000 >> (x))
21 #define DBIT(x, y) ((y) << (32 - (((x % 16) + 1) * 2)))
23 +#define GPIO_DIR_RB333(x) ((x) + (0x1408 >> 2))
24 +#define GPIO_DATA_RB333(x) ((x) + (0x1404 >> 2))
26 #define SICRL_RB600(x) ((x) + (0x114 >> 2))
27 #define GPIO_DIR_RB600(x) ((x) + (0xc00 >> 2))
28 #define GPIO_DATA_RB600(x) ((x) + (0xc08 >> 2))
30 static void rbppc_restart(char *cmd)
34 - reg = ioremap(get_immrbase(), 0x1000);
35 - local_irq_disable();
36 - out_be32(SICRL_RB600(reg), in_be32(SICRL_RB600(reg)) & ~0x00800000);
37 - out_be32(GPIO_DIR_RB600(reg), in_be32(GPIO_DIR_RB600(reg)) | SBIT(2));
38 - out_be32(GPIO_DATA_RB600(reg), in_be32(GPIO_DATA_RB600(reg)) & ~SBIT(2));
42 + struct device_node *root;
45 + root = of_find_node_by_path("/");
47 + const char *prop = (char *) of_get_property(root, "model", &size);
48 + rb_model = prop[sizeof("RB") - 1] - '0';
52 + reg = ioremap(get_immrbase(), 0x2000);
53 + local_irq_disable();
54 + out_be32(GPIO_DIR_RB333(reg),
55 + (in_be32(GPIO_DIR_RB333(reg)) & ~DBIT(4, 3)) | DBIT(4, 1));
56 + out_be32(GPIO_DATA_RB333(reg), in_be32(GPIO_DATA_RB333(reg)) & ~SBIT(4));
59 + reg = ioremap(get_immrbase(), 0x1000);
60 + local_irq_disable();
61 + out_be32(SICRL_RB600(reg), in_be32(SICRL_RB600(reg)) & ~0x00800000);
62 + out_be32(GPIO_DIR_RB600(reg), in_be32(GPIO_DIR_RB600(reg)) | SBIT(2));
63 + out_be32(GPIO_DATA_RB600(reg), in_be32(GPIO_DATA_RB600(reg)) & ~SBIT(2));
66 + mpc83xx_restart(cmd);
70 + else mpc83xx_restart(cmd);
75 static void rbppc_halt(void)
80 -device_initcall(rbppc_declare_of_platform_devices);
81 +machine_device_initcall(rb600, rbppc_declare_of_platform_devices);
83 define_machine(rb600) {
84 - .name = "MikroTik RouterBOARD 600 series",
85 + .name = "MikroTik RouterBOARD 333/600 series",
87 .setup_arch = rbppc_setup_arch,
88 .init_IRQ = rbppc_init_IRQ,
90 .time_init = mpc83xx_time_init,
91 .calibrate_decr = generic_calibrate_decr,
94 +static void fixup_pcibridge(struct pci_dev *dev)
96 + if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
97 + /* let the kernel itself set right memory windows */
98 + pci_write_config_word(dev, PCI_MEMORY_BASE, 0);
99 + pci_write_config_word(dev, PCI_MEMORY_LIMIT, 0);
100 + pci_write_config_word(dev, PCI_PREF_MEMORY_BASE, 0);
101 + pci_write_config_word(dev, PCI_PREF_MEMORY_LIMIT, 0);
102 + pci_write_config_byte(dev, PCI_IO_BASE, 0);
103 + pci_write_config_byte(dev, PCI_IO_LIMIT, 4 << 4);
105 + pci_write_config_byte(
107 + PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY | PCI_COMMAND_IO);
108 + pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 8);
113 +static void fixup_rb604(struct pci_dev *dev)
115 + pci_write_config_byte(dev, 0xC0, 0x01);
118 +DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, fixup_pcibridge)
119 +DECLARE_PCI_FIXUP_HEADER(0x3388, 0x0021, fixup_rb604)
121 --- a/drivers/mtd/nand/Kconfig 2010-03-19 12:30:12.000000000 +0200
122 +++ b/drivers/mtd/nand/Kconfig 2010-03-19 12:30:28.000000000 +0200
123 @@ -387,11 +387,11 @@
126 config MTD_NAND_RB_PPC
127 - tristate "MikroTik RB600 NAND support"
128 + tristate "MikroTik RB 333/600 NAND support"
129 depends on MTD_NAND && MTD_PARTITIONS && RB_PPC
131 This option enables support for the NAND device on MikroTik
132 - RouterBOARD 600 series boards.
133 + RouterBOARD 333/600 series boards.
136 tristate "MTD driver for Olympus MAUSB-10 and Fujifilm DPC-R1"
137 --- a/drivers/mtd/nand/rbppc_nand.c 2010-03-19 12:43:48.000000000 +0200
138 +++ b/drivers/mtd/nand/rbppc_nand.c 2010-03-19 12:44:17.000000000 +0200
141 const unsigned *rdy, *nce, *cle, *ale;
143 - printk(KERN_INFO "rbppc_nand_probe: MikroTik RouterBOARD 600 series NAND driver, version " DRV_VERSION "\n");
144 + printk(KERN_INFO "rbppc_nand_probe: MikroTik RouterBOARD 333/600 series NAND driver, version " DRV_VERSION "\n");
146 info = kmalloc(sizeof(*info), GFP_KERNEL);
149 MODULE_AUTHOR("Mikrotikls SIA");
150 MODULE_AUTHOR("Noah Fontes");
151 MODULE_AUTHOR("Michael Guntsche");
152 -MODULE_DESCRIPTION("MikroTik RouterBOARD 600 series NAND driver");
153 +MODULE_DESCRIPTION("MikroTik RouterBOARD 333/600 series NAND driver");
154 MODULE_LICENSE("GPL");
155 MODULE_VERSION(DRV_VERSION);
157 --- a/arch/powerpc/platforms/83xx/Kconfig 2010-03-19 12:47:36.000000000 +0200
158 +++ b/arch/powerpc/platforms/83xx/Kconfig 2010-03-19 12:50:07.000000000 +0200
160 This option enables support for the MPC8323 RDB board.
163 - bool "MikroTik RouterBOARD 600 series"
164 + bool "MikroTik RouterBOARD 333/600 series"
165 select DEFAULT_UIMAGE
175 - This option enables support for MikroTik RouterBOARD 600 series boards.
176 + This option enables support for MikroTik RouterBOARD 333/600 series boards.
179 bool "Freescale MPC834x MDS"
180 --- a/arch/powerpc/boot/Makefile 2010-03-18 21:32:32.000000000 +0200
181 +++ b/arch/powerpc/boot/Makefile 2010-03-18 21:32:53.000000000 +0200
183 cuboot-pq2.c cuboot-sequoia.c treeboot-walnut.c \
184 cuboot-bamboo.c cuboot-mpc7448hpc2.c cuboot-taishan.c \
185 fixed-head.S ep88xc.c ep405.c cuboot-c2k.c \
186 - cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c rb600.c \
187 + cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c rb600.c rb333.c \
188 cuboot-warp.c cuboot-85xx-cpm2.c cuboot-yosemite.c simpleboot.c \
189 virtex405-head.S virtex.c redboot-83xx.c cuboot-sam440ep.c \
190 cuboot-acadia.c cuboot-amigaone.c
192 image-$(CONFIG_MPC834x_MDS) += cuImage.mpc834x_mds
193 image-$(CONFIG_MPC836x_MDS) += cuImage.mpc836x_mds
194 image-$(CONFIG_ASP834x) += dtbImage.asp834x-redboot
195 -image-$(CONFIG_RB_PPC) += dtbImage.rb600
196 +image-$(CONFIG_RB_PPC) += dtbImage.rb600 \
199 # Board ports in arch/powerpc/platform/85xx/Kconfig
200 image-$(CONFIG_MPC8540_ADS) += cuImage.mpc8540ads
201 --- a/arch/powerpc/boot/wrapper 2010-03-18 21:34:24.000000000 +0200
202 +++ b/arch/powerpc/boot/wrapper 2010-03-18 21:34:45.000000000 +0200
204 isection=.kernel:initrd
207 -ep88xc|ep405|ep8248e|rb600)
208 +ep88xc|ep405|ep8248e|rb600|rb333)
209 platformo="$object/fixed-head.o $object/$platform.o"