Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
devicetree.c
Go to the documentation of this file.
1 /*
2  * Architecture specific OF callbacks.
3  *
4  * Copyright (C) 2011 Texas Instruments Incorporated
5  * Author: Mark Salter <[email protected]>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  */
12 #include <linux/init.h>
13 #include <linux/of.h>
14 #include <linux/of_fdt.h>
15 #include <linux/initrd.h>
16 #include <linux/memblock.h>
17 
19 {
20  /* Setup flat device-tree pointer */
22 
23  /* Retrieve various informations from the /chosen node of the
24  * device-tree, including the platform type, initrd location and
25  * size and more ...
26  */
27  of_scan_flat_dt(early_init_dt_scan_chosen, c6x_command_line);
28 
29  /* Scan memory nodes and rebuild MEMBLOCKs */
30  of_scan_flat_dt(early_init_dt_scan_root, NULL);
31  of_scan_flat_dt(early_init_dt_scan_memory, NULL);
32 }
33 
34 
35 #ifdef CONFIG_BLK_DEV_INITRD
37  unsigned long end)
38 {
39  initrd_start = (unsigned long)__va(start);
40  initrd_end = (unsigned long)__va(end);
42 }
43 #endif
44 
46 {
47  c6x_add_memory(base, size);
48 }
49 
51 {
52  return __va(memblock_alloc(size, align));
53 }