blob: f012fd164ceedc9e2aed9a94ebb30cc2bdc602c2 [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>
14#include <asm/prom.h>
Steven J. Hill30700332012-05-30 21:02:49 +000015
16int coherentio; /* 0 => no DMA cache coherency (may be set by user) */
17int hw_coherentio; /* 0 => no HW DMA cache coherency (reflects real HW) */
18
19const char *get_system_type(void)
20{
21 return "MIPS SEAD3";
22}
23
24void __init plat_mem_setup(void)
25{
Steven J. Hill9b731002013-01-17 11:37:03 -060026 /*
27 * Load the builtin devicetree. This causes the chosen node to be
28 * parsed resulting in our memory appearing
29 */
30 __dt_setup_arch(&__dtb_start);
31}
32
33void __init device_tree_init(void)
34{
35 unsigned long base, size;
36
37 if (!initial_boot_params)
38 return;
39
40 base = virt_to_phys((void *)initial_boot_params);
41 size = be32_to_cpu(initial_boot_params->totalsize);
42
43 /* Before we do anything, lets reserve the dt blob */
44 reserve_bootmem(base, size, BOOTMEM_DEFAULT);
45
46 unflatten_device_tree();
Steven J. Hill30700332012-05-30 21:02:49 +000047}