2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
7 * Copyright (C) 2014 Kevin Cernekee <cernekee@gmail.com>
10 #include <linux/init.h>
11 #include <linux/bootmem.h>
12 #include <linux/clk-provider.h>
13 #include <linux/ioport.h>
15 #include <linux/of_fdt.h>
16 #include <linux/of_platform.h>
17 #include <linux/smp.h>
18 #include <asm/addrspace.h>
19 #include <asm/bmips.h>
20 #include <asm/bootinfo.h>
22 #include <asm/smp-ops.h>
25 void __init prom_init(void)
27 register_bmips_smp_ops();
30 void __init prom_free_prom_memory(void)
34 const char *get_system_type(void)
39 void __init plat_time_init(void)
41 struct device_node *np;
44 np = of_find_node_by_name(NULL, "cpus");
46 panic("missing 'cpus' DT node");
47 if (of_property_read_u32(np, "mips-hpt-frequency", &freq) < 0)
48 panic("missing 'mips-hpt-frequency' property");
51 mips_hpt_frequency = freq;
54 void __init plat_mem_setup(void)
56 void *dtb = __dtb_start;
59 ioport_resource.start = 0;
60 ioport_resource.end = ~0;
62 /* intended to somewhat resemble ARM; see Documentation/arm/Booting */
63 if (fw_arg0 == 0 && fw_arg1 == 0xffffffff)
64 dtb = phys_to_virt(fw_arg2);
68 strlcpy(arcs_cmdline, boot_command_line, COMMAND_LINE_SIZE);
71 void __init device_tree_init(void)
73 struct device_node *np;
75 unflatten_and_copy_device_tree();
77 /* Disable SMP boot unless both CPUs are listed in DT and !disabled */
78 np = of_find_node_by_name(NULL, "cpus");
79 if (np && of_get_available_child_count(np) <= 1)
80 bmips_smp_enabled = 0;
84 int __init plat_of_setup(void)
86 return __dt_register_buses("brcm,bcm3384", "simple-bus");
89 arch_initcall(plat_of_setup);
91 static int __init plat_dev_init(void)
97 device_initcall(plat_dev_init);