2 +++ b/arch/powerpc/boot/rb333.c
5 + * The RouterBOARD platform -- for booting RB333 RouterBOARDs.
7 + * Author: Alexandros C. Couloumbis <alex@ozo.com>
8 + * Author: Michael Guntsche <mike@it-loops.com>
10 + * Copyright (c) 2010 Alexandros C. Couloumbis
11 + * Copyright (c) 2009 Michael Guntsche
13 + * This program is free software; you can redistribute it and/or modify it
14 + * under the terms of the GNU General Public License version 2 as published
15 + * by the Free Software Foundation.
29 +static void rb333_fixups(void)
31 + const u32 *reg, *timebase, *clock;
34 + const char* bootargs;
36 + dt_fixup_memory(0, memsize64);
38 + /* Find the CPU timebase and clock frequencies. */
39 + node = fdt_node_offset_by_prop_value(fw_dtb, -1, "device_type", "cpu", sizeof("cpu"));
40 + timebase = fdt_getprop(fw_dtb, node, "timebase-frequency", &size);
41 + clock = fdt_getprop(fw_dtb, node, "clock-frequency", &size);
42 + dt_fixup_cpu_clocks(*clock, *timebase, 0);
45 + * The bootloader reads the kernelparm segment and adds the content to
46 + * bootargs. This is needed to specify root and other boot flags.
48 + chosen = finddevice("/chosen");
49 + node = fdt_path_offset(fw_dtb, "/chosen");
50 + bootargs = fdt_getprop(fw_dtb, node, "bootargs", &size);
51 + setprop_str(chosen, "bootargs", bootargs);
54 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
55 + unsigned long r6, unsigned long r7)
60 + fw_dtb = (const void *)r3;
62 + /* Find the memory range. */
63 + node = fdt_node_offset_by_prop_value(fw_dtb, -1, "device_type", "memory", sizeof("memory"));
64 + reg = fdt_getprop(fw_dtb, node, "reg", &size);
67 + /* Now we have the memory size; initialize the heap. */
68 + simple_alloc_init(_end, memsize64 - (unsigned long)_end, 32, 64);
70 + /* Prepare the device tree and find the console. */
71 + fdt_init(_dtb_start);
72 + serial_console_init();
74 + /* Remaining fixups... */
75 + platform_ops.fixups = rb333_fixups;