2 +++ b/arch/powerpc/boot/rb600.c
5 + * The RouterBOARD platform -- for booting RB600(A) RouterBOARDs.
7 + * Author: Michael Guntsche <mike@it-loops.com>
9 + * Copyright (c) 2009 Michael Guntsche
11 + * This program is free software; you can redistribute it and/or modify it
12 + * under the terms of the GNU General Public License version 2 as published
13 + * by the Free Software Foundation.
27 +static void rb600_fixups(void)
29 + const u32 *reg, *timebase, *clock;
32 + const char* bootargs;
34 + dt_fixup_memory(0, memsize64);
36 + /* Set the MAC addresses. */
37 + node = fdt_path_offset(fw_dtb, "/soc8343@e0000000/ethernet@24000");
38 + reg = fdt_getprop(fw_dtb, node, "mac-address", &size);
39 + dt_fixup_mac_address_by_alias("ethernet1", (const u8 *)reg);
41 + node = fdt_path_offset(fw_dtb, "/soc8343@e0000000/ethernet@25000");
42 + reg = fdt_getprop(fw_dtb, node, "mac-address", &size);
43 + dt_fixup_mac_address_by_alias("ethernet0", (const u8 *)reg);
45 + /* Find the CPU timebase and clock frequencies. */
46 + node = fdt_node_offset_by_prop_value(fw_dtb, -1, "device_type", "cpu", sizeof("cpu"));
47 + timebase = fdt_getprop(fw_dtb, node, "timebase-frequency", &size);
48 + clock = fdt_getprop(fw_dtb, node, "clock-frequency", &size);
49 + dt_fixup_cpu_clocks(*clock, *timebase, 0);
52 + * The bootloader reads the kernelparm segment and adds the content to
53 + * bootargs. This is needed to specify root and other boot flags.
55 + chosen = finddevice("/chosen");
56 + node = fdt_path_offset(fw_dtb, "/chosen");
57 + bootargs = fdt_getprop(fw_dtb, node, "bootargs", &size);
58 + setprop_str(chosen, "bootargs", bootargs);
61 +void platform_init(unsigned long r3, unsigned long r4, unsigned long r5,
62 + unsigned long r6, unsigned long r7)
67 + fw_dtb = (const void *)r3;
69 + /* Find the memory range. */
70 + node = fdt_node_offset_by_prop_value(fw_dtb, -1, "device_type", "memory", sizeof("memory"));
71 + reg = fdt_getprop(fw_dtb, node, "reg", &size);
74 + /* Now we have the memory size; initialize the heap. */
75 + simple_alloc_init(_end, memsize64 - (unsigned long)_end, 32, 64);
77 + /* Prepare the device tree and find the console. */
78 + fdt_init(_dtb_start);
79 + serial_console_init();
81 + /* Remaining fixups... */
82 + platform_ops.fixups = rb600_fixups;