From 6ea5dc3cca616142fa452ba04a5f1eeaeef92acf Mon Sep 17 00:00:00 2001 From: acoul Date: Mon, 25 Oct 2010 17:59:14 +0000 Subject: linux/mpc83xx: add preliminary 2.6.36 kernel support git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23633 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../mpc83xx/patches-2.6.36/022-boot_rb333.patch | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 target/linux/mpc83xx/patches-2.6.36/022-boot_rb333.patch (limited to 'target/linux/mpc83xx/patches-2.6.36/022-boot_rb333.patch') diff --git a/target/linux/mpc83xx/patches-2.6.36/022-boot_rb333.patch b/target/linux/mpc83xx/patches-2.6.36/022-boot_rb333.patch new file mode 100644 index 000000000..8c70a0b56 --- /dev/null +++ b/target/linux/mpc83xx/patches-2.6.36/022-boot_rb333.patch @@ -0,0 +1,76 @@ +--- /dev/null ++++ b/arch/powerpc/boot/rb333.c +@@ -0,0 +1,73 @@ ++/* ++ * The RouterBOARD platform -- for booting RB333 RouterBOARDs. ++ * ++ * Author: Alexandros C. Couloumbis ++ * Author: Michael Guntsche ++ * ++ * Copyright (c) 2010 Alexandros C. Couloumbis ++ * Copyright (c) 2009 Michael Guntsche ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 as published ++ * by the Free Software Foundation. ++ */ ++ ++#include "ops.h" ++#include "types.h" ++#include "io.h" ++#include "stdio.h" ++#include ++ ++BSS_STACK(4*1024); ++ ++u64 memsize64; ++const void *fw_dtb; ++ ++static void rb333_fixups(void) ++{ ++ const u32 *reg, *timebase, *clock; ++ int node, size; ++ void *chosen; ++ const char* bootargs; ++ ++ dt_fixup_memory(0, memsize64); ++ ++ /* Find the CPU timebase and clock frequencies. */ ++ node = fdt_node_offset_by_prop_value(fw_dtb, -1, "device_type", "cpu", sizeof("cpu")); ++ timebase = fdt_getprop(fw_dtb, node, "timebase-frequency", &size); ++ clock = fdt_getprop(fw_dtb, node, "clock-frequency", &size); ++ dt_fixup_cpu_clocks(*clock, *timebase, 0); ++ ++ /* Fixup chosen ++ * The bootloader reads the kernelparm segment and adds the content to ++ * bootargs. This is needed to specify root and other boot flags. ++ */ ++ chosen = finddevice("/chosen"); ++ node = fdt_path_offset(fw_dtb, "/chosen"); ++ bootargs = fdt_getprop(fw_dtb, node, "bootargs", &size); ++ setprop_str(chosen, "bootargs", bootargs); ++} ++ ++void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, ++ unsigned long r6, unsigned long r7) ++{ ++ const u32 *reg; ++ int node, size; ++ ++ fw_dtb = (const void *)r3; ++ ++ /* Find the memory range. */ ++ node = fdt_node_offset_by_prop_value(fw_dtb, -1, "device_type", "memory", sizeof("memory")); ++ reg = fdt_getprop(fw_dtb, node, "reg", &size); ++ memsize64 = reg[1]; ++ ++ /* Now we have the memory size; initialize the heap. */ ++ simple_alloc_init(_end, memsize64 - (unsigned long)_end, 32, 64); ++ ++ /* Prepare the device tree and find the console. */ ++ fdt_init(_dtb_start); ++ serial_console_init(); ++ ++ /* Remaining fixups... */ ++ platform_ops.fixups = rb333_fixups; ++} -- cgit v1.2.3