blob: b5059dc899f44d2616a4c72c873fe82819474c09 [file] [log] [blame]
Steven J. Hill30700332012-05-30 21:02:49 +00001/*
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
4 * for more details.
5 *
6 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved.
7 */
8#include <linux/init.h>
Steven J. Hill9b731002013-01-17 11:37:03 -06009#include <linux/of_platform.h>
10#include <linux/of_fdt.h>
11#include <linux/bootmem.h>
12
13#include <asm/mips-boards/generic.h>
Steven J. Hill30700332012-05-30 21:02:49 +000014
Steven J. Hill30700332012-05-30 21:02:49 +000015const char *get_system_type(void)
16{
17 return "MIPS SEAD3";
18}
19
20void __init plat_mem_setup(void)
21{
Steven J. Hill9b731002013-01-17 11:37:03 -060022 /*
23 * Load the builtin devicetree. This causes the chosen node to be
24 * parsed resulting in our memory appearing
25 */
26 __dt_setup_arch(&__dtb_start);
27}
28
29void __init device_tree_init(void)
30{
31 unsigned long base, size;
32
33 if (!initial_boot_params)
34 return;
35
36 base = virt_to_phys((void *)initial_boot_params);
37 size = be32_to_cpu(initial_boot_params->totalsize);
38
39 /* Before we do anything, lets reserve the dt blob */
40 reserve_bootmem(base, size, BOOTMEM_DEFAULT);
41
42 unflatten_device_tree();
Steven J. Hill30700332012-05-30 21:02:49 +000043}