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;
53 unsigned long __init of_get_flat_dt_root(void)
55 unsigned long p = ((unsigned long)initial_boot_params) +
56 initial_boot_params->off_dt_struct;
58 while (*((u32 *)p) == OF_DT_NOP)
60 BUG_ON(*((u32 *)p) != OF_DT_BEGIN_NODE);
62 return _ALIGN(p + strlen((char *)p) + 1, 4);
66 * This function can be used within scan_flattened_dt callback to get
67 * access to properties
69 void *__init of_get_flat_dt_prop(unsigned long node, const char *name,
72 unsigned long p = node;
75 u32 tag = *((u32 *)p);
82 if (tag != OF_DT_PROP)
86 noff = *((u32 *)(p + 4));
88 if (initial_boot_params->version < 0x10)
89 p = _ALIGN(p, sz >= 8 ? 8 : 4);
91 nstr = find_flat_dt_string(noff);
93 printk(KERN_WARNING "Can't find property index"
97 if (strcmp(name, nstr) == 0) {
107 int __init of_flat_dt_is_compatible(unsigned long node, const char *compat)
110 unsigned long cplen, l;
112 cp = of_get_flat_dt_prop(node, "compatible", &cplen);
116 if (strncasecmp(cp, compat, strlen(compat)) == 0)
126 static void *__init unflatten_dt_alloc(unsigned long *mem, unsigned long size,
131 *mem = _ALIGN(*mem, align);
138 static unsigned long __init unflatten_dt_node(unsigned long mem,
140 struct device_node *dad,
141 struct device_node ***allnextpp,
142 unsigned long fpsize)
144 struct device_node *np;
145 struct property *pp, **prev_pp = NULL;
148 unsigned int l, allocl;
152 tag = *((u32 *)(*p));
153 if (tag != OF_DT_BEGIN_NODE) {
154 printk("Weird tag at start of node: %x\n", tag);
159 l = allocl = strlen(pathp) + 1;
160 *p = _ALIGN(*p + l, 4);
162 /* version 0x10 has a more compact unit name here instead of the full
163 * path. we accumulate the full path size using "fpsize", we'll rebuild
164 * it later. We detect this because the first character of the name is
167 if ((*pathp) != '/') {
170 /* root node: special case. fpsize accounts for path
171 * plus terminating zero. root node only has '/', so
172 * fpsize should be 2, but we want to avoid the first
173 * level nodes to have two '/' so we use fpsize 1 here
178 /* account for '/' and path size minus terminal 0
186 np = unflatten_dt_alloc(&mem, sizeof(struct device_node) + allocl,
187 __alignof__(struct device_node));
189 memset(np, 0, sizeof(*np));
190 np->full_name = ((char *)np) + sizeof(struct device_node);
192 char *p2 = np->full_name;
193 /* rebuild full path for new format */
194 if (dad && dad->parent) {
195 strcpy(p2, dad->full_name);
197 if ((strlen(p2) + l + 1) != allocl) {
198 pr_debug("%s: p: %d, l: %d, a: %d\n",
199 pathp, (int)strlen(p2),
206 memcpy(p2, pathp, l);
208 memcpy(np->full_name, pathp, l);
209 prev_pp = &np->properties;
211 *allnextpp = &np->allnext;
214 /* we temporarily use the next field as `last_child'*/
215 if (dad->next == NULL)
218 dad->next->sibling = np;
221 kref_init(&np->kref);
227 tag = *((u32 *)(*p));
228 if (tag == OF_DT_NOP) {
232 if (tag != OF_DT_PROP)
236 noff = *((u32 *)((*p) + 4));
238 if (initial_boot_params->version < 0x10)
239 *p = _ALIGN(*p, sz >= 8 ? 8 : 4);
241 pname = find_flat_dt_string(noff);
244 "Can't find property name in list !\n");
247 if (strcmp(pname, "name") == 0)
249 l = strlen(pname) + 1;
250 pp = unflatten_dt_alloc(&mem, sizeof(struct property),
251 __alignof__(struct property));
253 if (strcmp(pname, "linux,phandle") == 0) {
254 np->node = *((u32 *)*p);
255 if (np->linux_phandle == 0)
256 np->linux_phandle = np->node;
258 if (strcmp(pname, "ibm,phandle") == 0)
259 np->linux_phandle = *((u32 *)*p);
262 pp->value = (void *)*p;
266 *p = _ALIGN((*p) + sz, 4);
268 /* with version 0x10 we may not have the name property, recreate
269 * it here from the unit name if absent
272 char *p1 = pathp, *ps = pathp, *pa = NULL;
285 pp = unflatten_dt_alloc(&mem, sizeof(struct property) + sz,
286 __alignof__(struct property));
293 memcpy(pp->value, ps, sz - 1);
294 ((char *)pp->value)[sz - 1] = 0;
295 pr_debug("fixed up name for %s -> %s\n", pathp,
301 np->name = of_get_property(np, "name", NULL);
302 np->type = of_get_property(np, "device_type", NULL);
309 while (tag == OF_DT_BEGIN_NODE) {
310 mem = unflatten_dt_node(mem, p, np, allnextpp, fpsize);
311 tag = *((u32 *)(*p));
313 if (tag != OF_DT_END_NODE) {
314 printk(KERN_INFO "Weird tag at end of node: %x\n", tag);
322 * unflattens the device-tree passed by the firmware, creating the
323 * tree of struct device_node. It also fills the "name" and "type"
324 * pointers of the nodes so the normal device-tree walking functions
325 * can be used (this used to be done by finish_device_tree)
327 void __init unflatten_device_tree(void)
329 unsigned long start, mem, size;
330 struct device_node **allnextp = &allnodes;
332 pr_debug(" -> unflatten_device_tree()\n");
334 /* First pass, scan for size */
335 start = ((unsigned long)initial_boot_params) +
336 initial_boot_params->off_dt_struct;
337 size = unflatten_dt_node(0, &start, NULL, NULL, 0);
338 size = (size | 3) + 1;
340 pr_debug(" size is %lx, allocating...\n", size);
342 /* Allocate memory for the expanded device tree */
343 mem = lmb_alloc(size + 4, __alignof__(struct device_node));
344 mem = (unsigned long) __va(mem);
346 ((u32 *)mem)[size / 4] = 0xdeadbeef;
348 pr_debug(" unflattening %lx...\n", mem);
350 /* Second pass, do actual unflattening */
351 start = ((unsigned long)initial_boot_params) +
352 initial_boot_params->off_dt_struct;
353 unflatten_dt_node(mem, &start, NULL, &allnextp, 0);
354 if (*((u32 *)start) != OF_DT_END)
355 printk(KERN_WARNING "Weird tag at end of tree: %08x\n",
357 if (((u32 *)mem)[size / 4] != 0xdeadbeef)
358 printk(KERN_WARNING "End of tree marker overwritten: %08x\n",
359 ((u32 *)mem)[size / 4]);
362 /* Get pointer to OF "/chosen" node for use everywhere */
363 of_chosen = of_find_node_by_path("/chosen");
364 if (of_chosen == NULL)
365 of_chosen = of_find_node_by_path("/chosen@0");
367 pr_debug(" <- unflatten_device_tree()\n");
370 #define early_init_dt_scan_drconf_memory(node) 0
372 static int __init early_init_dt_scan_cpus(unsigned long node,
373 const char *uname, int depth,
376 static int logical_cpuid;
377 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
382 /* We are scanning "cpu" nodes only */
383 if (type == NULL || strcmp(type, "cpu") != 0)
386 /* Get physical cpuid */
387 intserv = of_get_flat_dt_prop(node, "reg", NULL);
391 * Now see if any of these threads match our boot cpu.
392 * NOTE: This must match the parsing done in smp_setup_cpu_maps.
394 for (i = 0; i < nthreads; i++) {
396 * version 2 of the kexec param format adds the phys cpuid of
399 if (initial_boot_params && initial_boot_params->version >= 2) {
401 initial_boot_params->boot_cpuid_phys) {
407 * Check if it's the boot-cpu, set it's hw index now,
408 * unfortunately this format did not support booting
409 * off secondary threads.
411 if (of_get_flat_dt_prop(node,
412 "linux,boot-cpu", NULL) != NULL) {
419 /* logical cpu id is always 0 on UP kernels */
425 pr_debug("boot cpu: logical %d physical %d\n", logical_cpuid,
427 boot_cpuid = logical_cpuid;
433 #ifdef CONFIG_BLK_DEV_INITRD
434 static void __init early_init_dt_check_for_initrd(unsigned long node)
439 pr_debug("Looking for initrd properties... ");
441 prop = of_get_flat_dt_prop(node, "linux,initrd-start", &l);
443 initrd_start = (unsigned long)
444 __va((u32)of_read_ulong(prop, l/4));
446 prop = of_get_flat_dt_prop(node, "linux,initrd-end", &l);
448 initrd_end = (unsigned long)
449 __va((u32)of_read_ulong(prop, 1/4));
450 initrd_below_start_ok = 1;
456 pr_debug("initrd_start=0x%lx initrd_end=0x%lx\n",
457 initrd_start, initrd_end);
460 static inline void early_init_dt_check_for_initrd(unsigned long node)
463 #endif /* CONFIG_BLK_DEV_INITRD */
465 static int __init early_init_dt_scan_chosen(unsigned long node,
466 const char *uname, int depth, void *data)
471 pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
474 (strcmp(uname, "chosen") != 0 &&
475 strcmp(uname, "chosen@0") != 0))
479 lprop = (u64 *)of_get_flat_dt_prop(node,
480 "linux,crashkernel-base", NULL);
482 crashk_res.start = *lprop;
484 lprop = (u64 *)of_get_flat_dt_prop(node,
485 "linux,crashkernel-size", NULL);
487 crashk_res.end = crashk_res.start + *lprop - 1;
490 early_init_dt_check_for_initrd(node);
492 /* Retreive command line */
493 p = of_get_flat_dt_prop(node, "bootargs", &l);
494 if (p != NULL && l > 0)
495 strlcpy(cmd_line, p, min((int)l, COMMAND_LINE_SIZE));
497 #ifdef CONFIG_CMDLINE
498 #ifndef CONFIG_CMDLINE_FORCE
499 if (p == NULL || l == 0 || (l == 1 && (*p) == 0))
501 strlcpy(cmd_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
502 #endif /* CONFIG_CMDLINE */
504 pr_debug("Command line is: %s\n", cmd_line);
510 static int __init early_init_dt_scan_root(unsigned long node,
511 const char *uname, int depth, void *data)
518 prop = of_get_flat_dt_prop(node, "#size-cells", NULL);
519 dt_root_size_cells = (prop == NULL) ? 1 : *prop;
520 pr_debug("dt_root_size_cells = %x\n", dt_root_size_cells);
522 prop = of_get_flat_dt_prop(node, "#address-cells", NULL);
523 dt_root_addr_cells = (prop == NULL) ? 2 : *prop;
524 pr_debug("dt_root_addr_cells = %x\n", dt_root_addr_cells);
530 static u64 __init dt_mem_next_cell(int s, cell_t **cellp)
535 return of_read_number(p, s);
538 static int __init early_init_dt_scan_memory(unsigned long node,
539 const char *uname, int depth, void *data)
541 char *type = of_get_flat_dt_prop(node, "device_type", NULL);
545 /* Look for the ibm,dynamic-reconfiguration-memory node */
547 strcmp(uname, "ibm,dynamic-reconfiguration-memory") == 0)
548 return early_init_dt_scan_drconf_memory(node);
550 /* We are scanning "memory" nodes only */
553 * The longtrail doesn't have a device_type on the
554 * /memory node, so look for the node called /memory@0.
556 if (depth != 1 || strcmp(uname, "memory@0") != 0)
558 } else if (strcmp(type, "memory") != 0)
561 reg = (cell_t *)of_get_flat_dt_prop(node, "linux,usable-memory", &l);
563 reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l);
567 endp = reg + (l / sizeof(cell_t));
569 pr_debug("memory scan node %s, reg size %ld, data: %x %x %x %x,\n",
570 uname, l, reg[0], reg[1], reg[2], reg[3]);
572 while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) {
575 base = dt_mem_next_cell(dt_root_addr_cells, ®);
576 size = dt_mem_next_cell(dt_root_size_cells, ®);
580 pr_debug(" - %llx , %llx\n", (unsigned long long)base,
581 (unsigned long long)size);
588 #ifdef CONFIG_PHYP_DUMP
590 * phyp_dump_calculate_reserve_size() - reserve variable boot area 5% or arg
592 * Function to find the largest size we need to reserve
593 * during early boot process.
595 * It either looks for boot param and returns that OR
596 * returns larger of 256 or 5% rounded down to multiples of 256MB.
599 static inline unsigned long phyp_dump_calculate_reserve_size(void)
603 if (phyp_dump_info->reserve_bootvar)
604 return phyp_dump_info->reserve_bootvar;
606 /* divide by 20 to get 5% of value */
607 tmp = lmb_end_of_DRAM();
610 /* round it down in multiples of 256 */
611 tmp = tmp & ~0x0FFFFFFFUL;
613 return (tmp > PHYP_DUMP_RMR_END ? tmp : PHYP_DUMP_RMR_END);
617 * phyp_dump_reserve_mem() - reserve all not-yet-dumped mmemory
619 * This routine may reserve memory regions in the kernel only
620 * if the system is supported and a dump was taken in last
621 * boot instance or if the hardware is supported and the
622 * scratch area needs to be setup. In other instances it returns
623 * without reserving anything. The memory in case of dump being
624 * active is freed when the dump is collected (by userland tools).
626 static void __init phyp_dump_reserve_mem(void)
628 unsigned long base, size;
629 unsigned long variable_reserve_size;
631 if (!phyp_dump_info->phyp_dump_configured) {
632 printk(KERN_ERR "Phyp-dump not supported on this hardware\n");
636 if (!phyp_dump_info->phyp_dump_at_boot) {
637 printk(KERN_INFO "Phyp-dump disabled at boot time\n");
641 variable_reserve_size = phyp_dump_calculate_reserve_size();
643 if (phyp_dump_info->phyp_dump_is_active) {
644 /* Reserve *everything* above RMR.Area freed by userland tools*/
645 base = variable_reserve_size;
646 size = lmb_end_of_DRAM() - base;
648 /* XXX crashed_ram_end is wrong, since it may be beyond
649 * the memory_limit, it will need to be adjusted. */
650 lmb_reserve(base, size);
652 phyp_dump_info->init_reserve_start = base;
653 phyp_dump_info->init_reserve_size = size;
655 size = phyp_dump_info->cpu_state_size +
656 phyp_dump_info->hpte_region_size +
657 variable_reserve_size;
658 base = lmb_end_of_DRAM() - size;
659 lmb_reserve(base, size);
660 phyp_dump_info->init_reserve_start = base;
661 phyp_dump_info->init_reserve_size = size;
665 static inline void __init phyp_dump_reserve_mem(void) {}
666 #endif /* CONFIG_PHYP_DUMP && CONFIG_PPC_RTAS */
668 #ifdef CONFIG_EARLY_PRINTK
669 /* MS this is Microblaze specifig function */
670 static int __init early_init_dt_scan_serial(unsigned long node,
671 const char *uname, int depth, void *data)
677 pr_debug("search \"chosen\", depth: %d, uname: %s\n", depth, uname);
679 /* find all serial nodes */
680 if (strncmp(uname, "serial", 6) != 0)
683 early_init_dt_check_for_initrd(node);
685 /* find compatible node with uartlite */
686 p = of_get_flat_dt_prop(node, "compatible", &l);
687 if ((strncmp(p, "xlnx,xps-uartlite", 17) != 0) &&
688 (strncmp(p, "xlnx,opb-uartlite", 17) != 0))
691 addr = of_get_flat_dt_prop(node, "reg", &l);
692 return *addr; /* return address */
695 /* this function is looking for early uartlite console - Microblaze specific */
696 int __init early_uartlite_console(void)
698 return of_scan_flat_dt(early_init_dt_scan_serial, NULL);
702 void __init early_init_devtree(void *params)
704 pr_debug(" -> early_init_devtree(%p)\n", params);
706 /* Setup flat device-tree pointer */
707 initial_boot_params = params;
709 #ifdef CONFIG_PHYP_DUMP
710 /* scan tree to see if dump occured during last boot */
711 of_scan_flat_dt(early_init_dt_scan_phyp_dump, NULL);
714 /* Retrieve various informations from the /chosen node of the
715 * device-tree, including the platform type, initrd location and
716 * size, TCE reserve, and more ...
718 of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
720 /* Scan memory nodes and rebuild LMBs */
722 of_scan_flat_dt(early_init_dt_scan_root, NULL);
723 of_scan_flat_dt(early_init_dt_scan_memory, NULL);
725 /* Save command line for /proc/cmdline and then parse parameters */
726 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
731 pr_debug("Phys. mem: %lx\n", (unsigned long) lmb_phys_mem_size());
733 pr_debug("Scanning CPUs ...\n");
735 /* Retreive CPU related informations from the flat tree
736 * (altivec support, boot CPU ID, ...)
738 of_scan_flat_dt(early_init_dt_scan_cpus, NULL);
740 pr_debug(" <- early_init_devtree()\n");
744 * Indicates whether the root node has a given value in its
745 * compatible property.
747 int machine_is_compatible(const char *compat)
749 struct device_node *root;
752 root = of_find_node_by_path("/");
754 rc = of_device_is_compatible(root, compat);
759 EXPORT_SYMBOL(machine_is_compatible);
763 * New implementation of the OF "find" APIs, return a refcounted
764 * object, call of_node_put() when done. The device tree and list
765 * are protected by a rw_lock.
767 * Note that property management will need some locking as well,
768 * this isn't dealt with yet.
773 * of_find_node_by_phandle - Find a node given a phandle
774 * @handle: phandle of the node to find
776 * Returns a node pointer with refcount incremented, use
777 * of_node_put() on it when done.
779 struct device_node *of_find_node_by_phandle(phandle handle)
781 struct device_node *np;
783 read_lock(&devtree_lock);
784 for (np = allnodes; np != NULL; np = np->allnext)
785 if (np->linux_phandle == handle)
788 read_unlock(&devtree_lock);
791 EXPORT_SYMBOL(of_find_node_by_phandle);
794 * of_node_get - Increment refcount of a node
795 * @node: Node to inc refcount, NULL is supported to
796 * simplify writing of callers
800 struct device_node *of_node_get(struct device_node *node)
803 kref_get(&node->kref);
806 EXPORT_SYMBOL(of_node_get);
808 static inline struct device_node *kref_to_device_node(struct kref *kref)
810 return container_of(kref, struct device_node, kref);
814 * of_node_release - release a dynamically allocated node
815 * @kref: kref element of the node to be released
817 * In of_node_put() this function is passed to kref_put()
820 static void of_node_release(struct kref *kref)
822 struct device_node *node = kref_to_device_node(kref);
823 struct property *prop = node->properties;
825 /* We should never be releasing nodes that haven't been detached. */
826 if (!of_node_check_flag(node, OF_DETACHED)) {
827 printk(KERN_INFO "WARNING: Bad of_node_put() on %s\n",
830 kref_init(&node->kref);
834 if (!of_node_check_flag(node, OF_DYNAMIC))
838 struct property *next = prop->next;
845 prop = node->deadprops;
846 node->deadprops = NULL;
849 kfree(node->full_name);
855 * of_node_put - Decrement refcount of a node
856 * @node: Node to dec refcount, NULL is supported to
857 * simplify writing of callers
860 void of_node_put(struct device_node *node)
863 kref_put(&node->kref, of_node_release);
865 EXPORT_SYMBOL(of_node_put);
868 * Plug a device node into the tree and global list.
870 void of_attach_node(struct device_node *np)
874 write_lock_irqsave(&devtree_lock, flags);
875 np->sibling = np->parent->child;
876 np->allnext = allnodes;
877 np->parent->child = np;
879 write_unlock_irqrestore(&devtree_lock, flags);
883 * "Unplug" a node from the device tree. The caller must hold
884 * a reference to the node. The memory associated with the node
885 * is not freed until its refcount goes to zero.
887 void of_detach_node(struct device_node *np)
889 struct device_node *parent;
892 write_lock_irqsave(&devtree_lock, flags);
899 allnodes = np->allnext;
901 struct device_node *prev;
902 for (prev = allnodes;
904 prev = prev->allnext)
906 prev->allnext = np->allnext;
909 if (parent->child == np)
910 parent->child = np->sibling;
912 struct device_node *prevsib;
913 for (prevsib = np->parent->child;
914 prevsib->sibling != np;
915 prevsib = prevsib->sibling)
917 prevsib->sibling = np->sibling;
920 of_node_set_flag(np, OF_DETACHED);
923 write_unlock_irqrestore(&devtree_lock, flags);
927 * Add a property to a node
929 int prom_add_property(struct device_node *np, struct property *prop)
931 struct property **next;
935 write_lock_irqsave(&devtree_lock, flags);
936 next = &np->properties;
938 if (strcmp(prop->name, (*next)->name) == 0) {
939 /* duplicate ! don't insert it */
940 write_unlock_irqrestore(&devtree_lock, flags);
943 next = &(*next)->next;
946 write_unlock_irqrestore(&devtree_lock, flags);
948 #ifdef CONFIG_PROC_DEVICETREE
949 /* try to add to proc as well if it was initialized */
951 proc_device_tree_add_prop(np->pde, prop);
952 #endif /* CONFIG_PROC_DEVICETREE */
958 * Remove a property from a node. Note that we don't actually
959 * remove it, since we have given out who-knows-how-many pointers
960 * to the data using get-property. Instead we just move the property
961 * to the "dead properties" list, so it won't be found any more.
963 int prom_remove_property(struct device_node *np, struct property *prop)
965 struct property **next;
969 write_lock_irqsave(&devtree_lock, flags);
970 next = &np->properties;
975 prop->next = np->deadprops;
976 np->deadprops = prop;
980 next = &(*next)->next;
982 write_unlock_irqrestore(&devtree_lock, flags);
987 #ifdef CONFIG_PROC_DEVICETREE
988 /* try to remove the proc node as well */
990 proc_device_tree_remove_prop(np->pde, prop);
991 #endif /* CONFIG_PROC_DEVICETREE */
997 * Update a property in a node. Note that we don't actually
998 * remove it, since we have given out who-knows-how-many pointers
999 * to the data using get-property. Instead we just move the property
1000 * to the "dead properties" list, and add the new property to the
1003 int prom_update_property(struct device_node *np,
1004 struct property *newprop,
1005 struct property *oldprop)
1007 struct property **next;
1008 unsigned long flags;
1011 write_lock_irqsave(&devtree_lock, flags);
1012 next = &np->properties;
1014 if (*next == oldprop) {
1015 /* found the node */
1016 newprop->next = oldprop->next;
1018 oldprop->next = np->deadprops;
1019 np->deadprops = oldprop;
1023 next = &(*next)->next;
1025 write_unlock_irqrestore(&devtree_lock, flags);
1030 #ifdef CONFIG_PROC_DEVICETREE
1031 /* try to add to proc as well if it was initialized */
1033 proc_device_tree_update_prop(np->pde, newprop, oldprop);
1034 #endif /* CONFIG_PROC_DEVICETREE */
1039 #if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
1040 static struct debugfs_blob_wrapper flat_dt_blob;
1042 static int __init export_flat_device_tree(void)
1046 flat_dt_blob.data = initial_boot_params;
1047 flat_dt_blob.size = initial_boot_params->totalsize;
1049 d = debugfs_create_blob("flat-device-tree", S_IFREG | S_IRUSR,
1050 of_debugfs_root, &flat_dt_blob);
1056 device_initcall(export_flat_device_tree);