2 * Procedures for creating, accessing and interpreting the device tree.
4 * Paul Mackerras August 1996.
5 * Copyright (C) 1996-2005 Paul Mackerras.
7 * Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
8 * {engebret|bergner}@us.ibm.com
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
17 #include <linux/kernel.h>
18 #include <linux/string.h>
19 #include <linux/init.h>
20 #include <linux/threads.h>
21 #include <linux/spinlock.h>
22 #include <linux/types.h>
23 #include <linux/pci.h>
24 #include <linux/stringify.h>
25 #include <linux/delay.h>
26 #include <linux/initrd.h>
27 #include <linux/bitops.h>
28 #include <linux/module.h>
29 #include <linux/kexec.h>
30 #include <linux/debugfs.h>
31 #include <linux/irq.h>
32 #include <linux/lmb.h>
36 #include <asm/processor.h>
39 #include <asm/system.h>
41 #include <asm/pgtable.h>
42 #include <asm/sections.h>
43 #include <asm/pci-bridge.h>
45 static int __initdata dt_root_addr_cells;
46 static int __initdata dt_root_size_cells;
50 /* export that to outside world */
51 struct device_node *of_chosen;
54 * This function can be used within scan_flattened_dt callback to get
55 * access to properties
57 void *__init of_get_flat_dt_prop(unsigned long node, const char *name,
60 unsigned long p = node;
63 u32 tag = *((u32 *)p);
70 if (tag != OF_DT_PROP)
74 noff = *((u32 *)(p + 4));
76 if (initial_boot_params->version < 0x10)
77 p = _ALIGN(p, sz >= 8 ? 8 : 4);
79 nstr = find_flat_dt_string(noff);
81 printk(KERN_WARNING "Can't find property index"
85 if (strcmp(name, nstr) == 0) {
95 int __init of_flat_dt_is_compatible(unsigned long node, const char *compat)
98 unsigned long cplen, l;
100 cp = of_get_flat_dt_prop(node, "compatible", &cplen);
104 if (strncasecmp(cp, compat, strlen(compat)) == 0)
114 static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size,
119 *mem = _ALIGN(*mem, align);
126 static unsigned long __init unflatten_dt_node(unsigned long mem,
128 struct device_node *dad,
129 struct device_node ***allnextpp,
130 unsigned long fpsize)
132 struct device_node *np;
133 struct property *pp, **prev_pp = NULL;
136 unsigned int l, allocl;
140 tag = *((u32 *)(*p));
141 if (tag != OF_DT_BEGIN_NODE) {
142 printk("Weird tag at start of node: %x\n", tag);
147 l = allocl = strlen(pathp) + 1;
148 *p = _ALIGN(*p + l, 4);
150 /* version 0x10 has a more compact unit name here instead of the full
151 * path. we accumulate the full path size using "fpsize", we'll rebuild
152 * it later. We detect this because the first character of the name is
155 if ((*pathp) != '/') {
158 /* root node: special case. fpsize accounts for path
159 * plus terminating zero. root node only has '/', so
160 * fpsize should be 2, but we want to avoid the first
161 * level nodes to have two '/' so we use fpsize 1 here
166 /* account for '/' and path size minus terminal 0
174 np = unflatten_dt_alloc(&mem, sizeof(struct device_node) + allocl,
175 __alignof__(struct device_node));
177 memset(np, 0, sizeof(*np));
178 np->full_name = ((char *)np) + sizeof(struct device_node);
180 char *p2 = np->full_name;
181 /* rebuild full path for new format */
182 if (dad && dad->parent) {
183 strcpy(p2, dad->full_name);
185 if ((strlen(p2) + l + 1) != allocl) {
186 pr_debug("%s: p: %d, l: %d, a: %d\n",
187 pathp, (int)strlen(p2),
194 memcpy(p2, pathp, l);
196 memcpy(np->full_name, pathp, l);
197 prev_pp = &np->properties;
199 *allnextpp = &np->allnext;
202 /* we temporarily use the next field as `last_child'*/
203 if (dad->next == NULL)
206 dad->next->sibling = np;
209 kref_init(&np->kref);
215 tag = *((u32 *)(*p));
216 if (tag == OF_DT_NOP) {
220 if (tag != OF_DT_PROP)
224 noff = *((u32 *)((*p) + 4));
226 if (initial_boot_params->version < 0x10)
227 *p = _ALIGN(*p, sz >= 8 ? 8 : 4);
229 pname = find_flat_dt_string(noff);
232 "Can't find property name in list !\n");
235 if (strcmp(pname, "name") == 0)
237 l = strlen(pname) + 1;
238 pp = unflatten_dt_alloc(&mem, sizeof(struct property),
239 __alignof__(struct property));
241 if (strcmp(pname, "linux,phandle") == 0) {
242 np->node = *((u32 *)*p);
243 if (np->linux_phandle == 0)
244 np->linux_phandle = np->node;
246 if (strcmp(pname, "ibm,phandle") == 0)
247 np->linux_phandle = *((u32 *)*p);
250 pp->value = (void *)*p;
254 *p = _ALIGN((*p) + sz, 4);
256 /* with version 0x10 we may not have the name property, recreate
257 * it here from the unit name if absent
260 char *p1 = pathp, *ps = pathp, *pa = NULL;
273 pp = unflatten_dt_alloc(&mem, sizeof(struct property) + sz,
274 __alignof__(struct property));
281 memcpy(pp->value, ps, sz - 1);
282 ((char *)pp->value)[sz - 1] = 0;
283 pr_debug("fixed up name for %s -> %s\n", pathp,
289 np->name = of_get_property(np, "name", NULL);
290 np->type = of_get_property(np, "device_type", NULL);
297 while (tag == OF_DT_BEGIN_NODE) {
298 mem = unflatten_dt_node(mem, p, np, allnextpp, fpsize);
299 tag = *((u32 *)(*p));
301 if (tag != OF_DT_END_NODE) {
302 printk(KERN_INFO "Weird tag at end of node: %x\n", tag);
310 * unflattens the device-tree passed by the firmware, creating the
311 * tree of struct device_node. It also fills the "name" and "type"
312 * pointers of the nodes so the normal device-tree walking functions
313 * can be used (this used to be done by finish_device_tree)
315 void __init unflatten_device_tree(void)
317 unsigned long start, mem, size;
318 struct device_node **allnextp = &allnodes;
320 pr_debug(" -> unflatten_device_tree()\n");
322 /* First pass, scan for size */
323 start = ((unsigned long)initial_boot_params) +
324 initial_boot_params->off_dt_struct;
325 size = unflatten_dt_node(0, &start, NULL, NULL, 0);
326 size = (size | 3) + 1;
328 pr_debug(" size is %lx, allocating...\n", size);
330 /* Allocate memory for the expanded device tree */
331 mem = lmb_alloc(size + 4, __alignof__(struct device_node));
332 mem = (unsigned long) __va(mem);
334 ((u32 *)mem)[size / 4] = 0xdeadbeef;
336 pr_debug(" unflattening %lx...\n", mem);
338 /* Second pass, do actual unflattening */
339 start = ((unsigned long)initial_boot_params) +
340 initial_boot_params->off_dt_struct;
341 unflatten_dt_node(mem, &start, NULL, &allnextp, 0);
342 if (*((u32 *)start) != OF_DT_END)
343 printk(KERN_WARNING "Weird tag at end of tree: %08x\n",
345 if (((u32 *)mem)[size / 4] != 0xdeadbeef)
346 printk(KERN_WARNING "End of tree marker overwritten: %08x\n",
347 ((u32 *)mem)[size / 4]);
350 /* Get pointer to OF "/chosen" node for use everywhere */
351 of_chosen = of_find_node_by_path("/chosen");
352 if (of_chosen == NULL)
353 of_chosen = of_find_node_by_path("/chosen@0");
355 pr_debug(" <- unflatten_device_tree()\n");
358 #define early_init_dt_scan_drconf_memory(node) 0
360 static int __init early_init_dt_scan_cpus(unsigned long node,
361 const char *uname, int depth,
364 static int logical_cpuid;
365 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
370 /* We are scanning "cpu" nodes only */
371 if (type == NULL || strcmp(type, "cpu") != 0)
374 /* Get physical cpuid */
375 intserv = of_get_flat_dt_prop(node, "reg", NULL);
379 * Now see if any of these threads match our boot cpu.
380 * NOTE: This must match the parsing done in smp_setup_cpu_maps.
382 for (i = 0; i < nthreads; i++) {
384 * version 2 of the kexec param format adds the phys cpuid of
387 if (initial_boot_params && initial_boot_params->version >= 2) {
389 initial_boot_params->boot_cpuid_phys) {
395 * Check if it's the boot-cpu, set it's hw index now,
396 * unfortunately this format did not support booting
397 * off secondary threads.
399 if (of_get_flat_dt_prop(node,
400 "linux,boot-cpu", NULL) != NULL) {
407 /* logical cpu id is always 0 on UP kernels */
413 pr_debug("boot cpu: logical %d physical %d\n", logical_cpuid,
415 boot_cpuid = logical_cpuid;
421 #ifdef CONFIG_BLK_DEV_INITRD
422 static void __init early_init_dt_check_for_initrd(unsigned long node)
427 pr_debug("Looking for initrd properties... ");
429 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &l);
431 initrd_start = (unsigned long)
432 __va((u32)of_read_ulong(prop, l/4));
434 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &l);
436 initrd_end = (unsigned long)
437 __va((u32)of_read_ulong(prop, 1/4));
438 initrd_below_start_ok = 1;
444 pr_debug("initrd_start=0x%lx initrd_end=0x%lx\n",
445 initrd_start, initrd_end);
448 static inline void early_init_dt_check_for_initrd(unsigned long node)
451 #endif /* CONFIG_BLK_DEV_INITRD */
453 static int __init early_init_dt_scan_chosen(unsigned long node,
454 const char *uname, int depth, void *data)
459 pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
462 (strcmp(uname, "chosen") != 0 &&
463 strcmp(uname, "chosen@0") != 0))
467 lprop = (u64 *)of_get_flat_dt_prop(node,
468 "linux,crashkernel-base", NULL);
470 crashk_res.start = *lprop;
472 lprop = (u64 *)of_get_flat_dt_prop(node,
473 "linux,crashkernel-size", NULL);
475 crashk_res.end = crashk_res.start + *lprop - 1;
478 early_init_dt_check_for_initrd(node);
480 /* Retreive command line */
481 p = of_get_flat_dt_prop(node, "bootargs", &l);
482 if (p != NULL && l > 0)
483 strlcpy(cmd_line, p, min((int)l, COMMAND_LINE_SIZE));
485 #ifdef CONFIG_CMDLINE
486 #ifndef CONFIG_CMDLINE_FORCE
487 if (p == NULL || l == 0 || (l == 1 && (*p) == 0))
489 strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
490 #endif /* CONFIG_CMDLINE */
492 pr_debug("Command line is: %s\n", cmd_line);
498 static int __init early_init_dt_scan_root(unsigned long node,
499 const char *uname, int depth, void *data)
506 prop = of_get_flat_dt_prop(node, "#size-cells", NULL);
507 dt_root_size_cells = (prop == NULL) ? 1 : *prop;
508 pr_debug("dt_root_size_cells = %x\n", dt_root_size_cells);
510 prop = of_get_flat_dt_prop(node, "#address-cells", NULL);
511 dt_root_addr_cells = (prop == NULL) ? 2 : *prop;
512 pr_debug("dt_root_addr_cells = %x\n", dt_root_addr_cells);
518 static u64 __init dt_mem_next_cell(int s, cell_t **cellp)
523 return of_read_number(p, s);
526 static int __init early_init_dt_scan_memory(unsigned long node,
527 const char *uname, int depth, void *data)
529 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
533 /* Look for the ibm,dynamic-reconfiguration-memory node */
535 strcmp(uname, "ibm,dynamic-reconfiguration-memory") == 0)
536 return early_init_dt_scan_drconf_memory(node);
538 /* We are scanning "memory" nodes only */
541 * The longtrail doesn't have a device_type on the
542 * /memory node, so look for the node called /memory@0.
544 if (depth != 1 || strcmp(uname, "memory@0") != 0)
546 } else if (strcmp(type, "memory") != 0)
549 reg = (cell_t *)of_get_flat_dt_prop(node, "linux,usable-memory", &l);
551 reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l);
555 endp = reg + (l / sizeof(cell_t));
557 pr_debug("memory scan node %s, reg size %ld, data: %x %x %x %x,\n",
558 uname, l, reg[0], reg[1], reg[2], reg[3]);
560 while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) {
563 base = dt_mem_next_cell(dt_root_addr_cells, ®);
564 size = dt_mem_next_cell(dt_root_size_cells, ®);
568 pr_debug(" - %llx , %llx\n", (unsigned long long)base,
569 (unsigned long long)size);
576 #ifdef CONFIG_PHYP_DUMP
578 * phyp_dump_calculate_reserve_size() - reserve variable boot area 5% or arg
580 * Function to find the largest size we need to reserve
581 * during early boot process.
583 * It either looks for boot param and returns that OR
584 * returns larger of 256 or 5% rounded down to multiples of 256MB.
587 static inline unsigned long phyp_dump_calculate_reserve_size(void)
591 if (phyp_dump_info->reserve_bootvar)
592 return phyp_dump_info->reserve_bootvar;
594 /* divide by 20 to get 5% of value */
595 tmp = lmb_end_of_DRAM();
598 /* round it down in multiples of 256 */
599 tmp = tmp & ~0x0FFFFFFFUL;
601 return (tmp > PHYP_DUMP_RMR_END ? tmp : PHYP_DUMP_RMR_END);
605 * phyp_dump_reserve_mem() - reserve all not-yet-dumped mmemory
607 * This routine may reserve memory regions in the kernel only
608 * if the system is supported and a dump was taken in last
609 * boot instance or if the hardware is supported and the
610 * scratch area needs to be setup. In other instances it returns
611 * without reserving anything. The memory in case of dump being
612 * active is freed when the dump is collected (by userland tools).
614 static void __init phyp_dump_reserve_mem(void)
616 unsigned long base, size;
617 unsigned long variable_reserve_size;
619 if (!phyp_dump_info->phyp_dump_configured) {
620 printk(KERN_ERR "Phyp-dump not supported on this hardware\n");
624 if (!phyp_dump_info->phyp_dump_at_boot) {
625 printk(KERN_INFO "Phyp-dump disabled at boot time\n");
629 variable_reserve_size = phyp_dump_calculate_reserve_size();
631 if (phyp_dump_info->phyp_dump_is_active) {
632 /* Reserve *everything* above RMR.Area freed by userland tools*/
633 base = variable_reserve_size;
634 size = lmb_end_of_DRAM() - base;
636 /* XXX crashed_ram_end is wrong, since it may be beyond
637 * the memory_limit, it will need to be adjusted. */
638 lmb_reserve(base, size);
640 phyp_dump_info->init_reserve_start = base;
641 phyp_dump_info->init_reserve_size = size;
643 size = phyp_dump_info->cpu_state_size +
644 phyp_dump_info->hpte_region_size +
645 variable_reserve_size;
646 base = lmb_end_of_DRAM() - size;
647 lmb_reserve(base, size);
648 phyp_dump_info->init_reserve_start = base;
649 phyp_dump_info->init_reserve_size = size;
653 static inline void __init phyp_dump_reserve_mem(void) {}
654 #endif /* CONFIG_PHYP_DUMP && CONFIG_PPC_RTAS */
656 #ifdef CONFIG_EARLY_PRINTK
657 /* MS this is Microblaze specifig function */
658 static int __init early_init_dt_scan_serial(unsigned long node,
659 const char *uname, int depth, void *data)
665 pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
667 /* find all serial nodes */
668 if (strncmp(uname, "serial", 6) != 0)
671 early_init_dt_check_for_initrd(node);
673 /* find compatible node with uartlite */
674 p = of_get_flat_dt_prop(node, "compatible", &l);
675 if ((strncmp(p, "xlnx,xps-uartlite", 17) != 0) &&
676 (strncmp(p, "xlnx,opb-uartlite", 17) != 0))
679 addr = of_get_flat_dt_prop(node, "reg", &l);
680 return *addr; /* return address */
683 /* this function is looking for early uartlite console - Microblaze specific */
684 int __init early_uartlite_console(void)
686 return of_scan_flat_dt(early_init_dt_scan_serial, NULL);
690 void __init early_init_devtree(void *params)
692 pr_debug(" -> early_init_devtree(%p)\n", params);
694 /* Setup flat device-tree pointer */
695 initial_boot_params = params;
697 #ifdef CONFIG_PHYP_DUMP
698 /* scan tree to see if dump occured during last boot */
699 of_scan_flat_dt(early_init_dt_scan_phyp_dump, NULL);
702 /* Retrieve various informations from the /chosen node of the
703 * device-tree, including the platform type, initrd location and
704 * size, TCE reserve, and more ...
706 of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
708 /* Scan memory nodes and rebuild LMBs */
710 of_scan_flat_dt(early_init_dt_scan_root, NULL);
711 of_scan_flat_dt(early_init_dt_scan_memory, NULL);
713 /* Save command line for /proc/cmdline and then parse parameters */
714 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
719 pr_debug("Phys. mem: %lx\n", (unsigned long) lmb_phys_mem_size());
721 pr_debug("Scanning CPUs ...\n");
723 /* Retreive CPU related informations from the flat tree
724 * (altivec support, boot CPU ID, ...)
726 of_scan_flat_dt(early_init_dt_scan_cpus, NULL);
728 pr_debug(" <- early_init_devtree()\n");
732 * Indicates whether the root node has a given value in its
733 * compatible property.
735 int machine_is_compatible(const char *compat)
737 struct device_node *root;
740 root = of_find_node_by_path("/");
742 rc = of_device_is_compatible(root, compat);
747 EXPORT_SYMBOL(machine_is_compatible);
751 * New implementation of the OF "find" APIs, return a refcounted
752 * object, call of_node_put() when done. The device tree and list
753 * are protected by a rw_lock.
755 * Note that property management will need some locking as well,
756 * this isn't dealt with yet.
761 * of_find_node_by_phandle - Find a node given a phandle
762 * @handle: phandle of the node to find
764 * Returns a node pointer with refcount incremented, use
765 * of_node_put() on it when done.
767 struct device_node *of_find_node_by_phandle(phandle handle)
769 struct device_node *np;
771 read_lock(&devtree_lock);
772 for (np = allnodes; np != NULL; np = np->allnext)
773 if (np->linux_phandle == handle)
776 read_unlock(&devtree_lock);
779 EXPORT_SYMBOL(of_find_node_by_phandle);
782 * of_node_get - Increment refcount of a node
783 * @node: Node to inc refcount, NULL is supported to
784 * simplify writing of callers
788 struct device_node *of_node_get(struct device_node *node)
791 kref_get(&node->kref);
794 EXPORT_SYMBOL(of_node_get);
796 static inline struct device_node *kref_to_device_node(struct kref *kref)
798 return container_of(kref, struct device_node, kref);
802 * of_node_release - release a dynamically allocated node
803 * @kref: kref element of the node to be released
805 * In of_node_put() this function is passed to kref_put()
808 static void of_node_release(struct kref *kref)
810 struct device_node *node = kref_to_device_node(kref);
811 struct property *prop = node->properties;
813 /* We should never be releasing nodes that haven't been detached. */
814 if (!of_node_check_flag(node, OF_DETACHED)) {
815 printk(KERN_INFO "WARNING: Bad of_node_put() on %s\n",
818 kref_init(&node->kref);
822 if (!of_node_check_flag(node, OF_DYNAMIC))
826 struct property *next = prop->next;
833 prop = node->deadprops;
834 node->deadprops = NULL;
837 kfree(node->full_name);
843 * of_node_put - Decrement refcount of a node
844 * @node: Node to dec refcount, NULL is supported to
845 * simplify writing of callers
848 void of_node_put(struct device_node *node)
851 kref_put(&node->kref, of_node_release);
853 EXPORT_SYMBOL(of_node_put);
856 * Plug a device node into the tree and global list.
858 void of_attach_node(struct device_node *np)
862 write_lock_irqsave(&devtree_lock, flags);
863 np->sibling = np->parent->child;
864 np->allnext = allnodes;
865 np->parent->child = np;
867 write_unlock_irqrestore(&devtree_lock, flags);
871 * "Unplug" a node from the device tree. The caller must hold
872 * a reference to the node. The memory associated with the node
873 * is not freed until its refcount goes to zero.
875 void of_detach_node(struct device_node *np)
877 struct device_node *parent;
880 write_lock_irqsave(&devtree_lock, flags);
887 allnodes = np->allnext;
889 struct device_node *prev;
890 for (prev = allnodes;
892 prev = prev->allnext)
894 prev->allnext = np->allnext;
897 if (parent->child == np)
898 parent->child = np->sibling;
900 struct device_node *prevsib;
901 for (prevsib = np->parent->child;
902 prevsib->sibling != np;
903 prevsib = prevsib->sibling)
905 prevsib->sibling = np->sibling;
908 of_node_set_flag(np, OF_DETACHED);
911 write_unlock_irqrestore(&devtree_lock, flags);
915 * Add a property to a node
917 int prom_add_property(struct device_node *np, struct property *prop)
919 struct property **next;
923 write_lock_irqsave(&devtree_lock, flags);
924 next = &np->properties;
926 if (strcmp(prop->name, (*next)->name) == 0) {
927 /* duplicate ! don't insert it */
928 write_unlock_irqrestore(&devtree_lock, flags);
931 next = &(*next)->next;
934 write_unlock_irqrestore(&devtree_lock, flags);
936 #ifdef CONFIG_PROC_DEVICETREE
937 /* try to add to proc as well if it was initialized */
939 proc_device_tree_add_prop(np->pde, prop);
940 #endif /* CONFIG_PROC_DEVICETREE */
946 * Remove a property from a node. Note that we don't actually
947 * remove it, since we have given out who-knows-how-many pointers
948 * to the data using get-property. Instead we just move the property
949 * to the "dead properties" list, so it won't be found any more.
951 int prom_remove_property(struct device_node *np, struct property *prop)
953 struct property **next;
957 write_lock_irqsave(&devtree_lock, flags);
958 next = &np->properties;
963 prop->next = np->deadprops;
964 np->deadprops = prop;
968 next = &(*next)->next;
970 write_unlock_irqrestore(&devtree_lock, flags);
975 #ifdef CONFIG_PROC_DEVICETREE
976 /* try to remove the proc node as well */
978 proc_device_tree_remove_prop(np->pde, prop);
979 #endif /* CONFIG_PROC_DEVICETREE */
985 * Update a property in a node. Note that we don't actually
986 * remove it, since we have given out who-knows-how-many pointers
987 * to the data using get-property. Instead we just move the property
988 * to the "dead properties" list, and add the new property to the
991 int prom_update_property(struct device_node *np,
992 struct property *newprop,
993 struct property *oldprop)
995 struct property **next;
999 write_lock_irqsave(&devtree_lock, flags);
1000 next = &np->properties;
1002 if (*next == oldprop) {
1003 /* found the node */
1004 newprop->next = oldprop->next;
1006 oldprop->next = np->deadprops;
1007 np->deadprops = oldprop;
1011 next = &(*next)->next;
1013 write_unlock_irqrestore(&devtree_lock, flags);
1018 #ifdef CONFIG_PROC_DEVICETREE
1019 /* try to add to proc as well if it was initialized */
1021 proc_device_tree_update_prop(np->pde, newprop, oldprop);
1022 #endif /* CONFIG_PROC_DEVICETREE */
1027 #if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
1028 static struct debugfs_blob_wrapper flat_dt_blob;
1030 static int __init export_flat_device_tree(void)
1034 flat_dt_blob.data = initial_boot_params;
1035 flat_dt_blob.size = initial_boot_params->totalsize;
1037 d = debugfs_create_blob("flat-device-tree", S_IFREG | S_IRUSR,
1038 of_debugfs_root, &flat_dt_blob);
1044 device_initcall(export_flat_device_tree);