2011-06-05 01:56:16 +07:00
|
|
|
/*
|
|
|
|
* OpenRISC prom.c
|
|
|
|
*
|
|
|
|
* Linux architectural port borrowing liberally from similar works of
|
|
|
|
* others. All original copyrights apply as per the original source
|
|
|
|
* declaration.
|
|
|
|
*
|
|
|
|
* Modifications for the OpenRISC architecture:
|
|
|
|
* Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version
|
|
|
|
* 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Architecture specific procedures for creating, accessing and
|
|
|
|
* interpreting the device tree.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/string.h>
|
|
|
|
#include <linux/init.h>
|
|
|
|
#include <linux/threads.h>
|
|
|
|
#include <linux/spinlock.h>
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/pci.h>
|
|
|
|
#include <linux/stringify.h>
|
|
|
|
#include <linux/delay.h>
|
|
|
|
#include <linux/initrd.h>
|
|
|
|
#include <linux/bitops.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/kexec.h>
|
|
|
|
#include <linux/debugfs.h>
|
|
|
|
#include <linux/irq.h>
|
|
|
|
#include <linux/memblock.h>
|
|
|
|
#include <linux/of_fdt.h>
|
|
|
|
|
|
|
|
#include <asm/prom.h>
|
|
|
|
#include <asm/page.h>
|
|
|
|
#include <asm/processor.h>
|
|
|
|
#include <asm/irq.h>
|
|
|
|
#include <linux/io.h>
|
|
|
|
#include <asm/mmu.h>
|
|
|
|
#include <asm/pgtable.h>
|
|
|
|
#include <asm/sections.h>
|
|
|
|
#include <asm/setup.h>
|
|
|
|
|
|
|
|
void __init early_init_dt_add_memory_arch(u64 base, u64 size)
|
|
|
|
{
|
|
|
|
size &= PAGE_MASK;
|
|
|
|
memblock_add(base, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
void __init early_init_devtree(void *params)
|
|
|
|
{
|
|
|
|
/* Setup flat device-tree pointer */
|
|
|
|
initial_boot_params = params;
|
|
|
|
|
|
|
|
|
|
|
|
/* Retrieve various informations from the /chosen node of the
|
|
|
|
* device-tree, including the platform type, initrd location and
|
|
|
|
* size, TCE reserve, and more ...
|
|
|
|
*/
|
2013-08-26 23:28:50 +07:00
|
|
|
of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line);
|
2011-06-05 01:56:16 +07:00
|
|
|
|
|
|
|
/* Scan memory nodes and rebuild MEMBLOCKs */
|
|
|
|
of_scan_flat_dt(early_init_dt_scan_root, NULL);
|
|
|
|
of_scan_flat_dt(early_init_dt_scan_memory, NULL);
|
|
|
|
|
2011-12-09 01:22:08 +07:00
|
|
|
memblock_allow_resize();
|
2011-06-05 01:56:16 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_BLK_DEV_INITRD
|
2013-07-02 01:20:35 +07:00
|
|
|
void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
|
2011-06-05 01:56:16 +07:00
|
|
|
{
|
|
|
|
initrd_start = (unsigned long)__va(start);
|
|
|
|
initrd_end = (unsigned long)__va(end);
|
|
|
|
initrd_below_start_ok = 1;
|
|
|
|
}
|
|
|
|
#endif
|