From 9b73100911ac6886e1bbf54a4626d545f9ba6ddf Mon Sep 17 00:00:00 2001 From: "Steven J. Hill" Date: Thu, 17 Jan 2013 11:37:03 -0600 Subject: MIPS: SEAD3: Implement OF support. Activate USE_OF for SEAD-3 platform. Add basic DTS file and convert memory detection and reservations to use OF. [ralf@linux-mips.org: Remove unnecessary #ifdef wrapper in generic.h. Make inclusion work even without prior inclusion.] Signed-off-by: Steven J. Hill Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/4809/ Signed-off-by: Ralf Baechle --- arch/mips/mti-sead3/sead3-setup.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'arch/mips/mti-sead3/sead3-setup.c') diff --git a/arch/mips/mti-sead3/sead3-setup.c b/arch/mips/mti-sead3/sead3-setup.c index 8ad46ad31b4..f012fd164ce 100644 --- a/arch/mips/mti-sead3/sead3-setup.c +++ b/arch/mips/mti-sead3/sead3-setup.c @@ -6,6 +6,12 @@ * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. */ #include +#include +#include +#include + +#include +#include int coherentio; /* 0 => no DMA cache coherency (may be set by user) */ int hw_coherentio; /* 0 => no HW DMA cache coherency (reflects real HW) */ @@ -17,4 +23,25 @@ const char *get_system_type(void) void __init plat_mem_setup(void) { + /* + * Load the builtin devicetree. This causes the chosen node to be + * parsed resulting in our memory appearing + */ + __dt_setup_arch(&__dtb_start); +} + +void __init device_tree_init(void) +{ + unsigned long base, size; + + if (!initial_boot_params) + return; + + base = virt_to_phys((void *)initial_boot_params); + size = be32_to_cpu(initial_boot_params->totalsize); + + /* Before we do anything, lets reserve the dt blob */ + reserve_bootmem(base, size, BOOTMEM_DEFAULT); + + unflatten_device_tree(); } -- cgit v1.2.3-70-g09d2