diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2011-01-06 14:35:28 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2011-01-06 14:35:28 +1100 |
commit | eb04b2b2a2743d0446d5b058bc86b5ac81c47f7d (patch) | |
tree | 48206e4324d87697cb74eeb418a7f095afeeb51a /include | |
parent | 03428b5e8b139aa30d098bb2c5a5bc66fd136cab (diff) | |
parent | 672d8eafe38e9324055b8c0d0ad6e95c43b6d52a (diff) |
Merge remote branch 'devicetree/next-devicetree'
Conflicts:
arch/sparc/prom/tree_32.c
drivers/mtd/Kconfig
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 13 | ||||
-rw-r--r-- | include/linux/of_fdt.h | 16 | ||||
-rw-r--r-- | include/linux/of_net.h | 15 |
3 files changed, 42 insertions, 2 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index bd69d79208de..05cbad03c5ab 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -67,7 +67,8 @@ * Align to a 32 byte boundary equal to the * alignment gcc 4.5 uses for a struct */ -#define STRUCT_ALIGN() . = ALIGN(32) +#define STRUCT_ALIGNMENT 32 +#define STRUCT_ALIGN() . = ALIGN(STRUCT_ALIGNMENT) /* The actual configuration determine if the init/exit sections * are handled as text/data or they can be discarded (which @@ -146,6 +147,13 @@ #define TRACE_SYSCALLS() #endif + +#define KERNEL_DTB() \ + STRUCT_ALIGN(); \ + VMLINUX_SYMBOL(__dtb_start) = .; \ + *(.dtb.init.rodata) \ + VMLINUX_SYMBOL(__dtb_end) = .; + /* .data section */ #define DATA_DATA \ *(.data) \ @@ -468,7 +476,8 @@ MCOUNT_REC() \ DEV_DISCARD(init.rodata) \ CPU_DISCARD(init.rodata) \ - MEM_DISCARD(init.rodata) + MEM_DISCARD(init.rodata) \ + KERNEL_DTB() #define INIT_TEXT \ *(.init.text) \ diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 7bbf5b328438..ee96091f7d25 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h @@ -58,6 +58,21 @@ struct boot_param_header { }; #if defined(CONFIG_OF_FLATTREE) + +/* For scanning an arbitrary device-tree at any time */ +extern char *of_fdt_get_string(struct boot_param_header *blob, u32 offset); +extern void *of_fdt_get_property(struct boot_param_header *blob, + unsigned long node, + const char *name, + unsigned long *size); +extern int of_fdt_is_compatible(struct boot_param_header *blob, + unsigned long node, + const char *compat); +extern int of_fdt_match(struct boot_param_header *blob, unsigned long node, + const char **compat); +extern void of_fdt_unflatten_tree(unsigned long *blob, + struct device_node **mynodes); + /* TBD: Temporary export of fdt globals - remove when code fully merged */ extern int __initdata dt_root_addr_cells; extern int __initdata dt_root_size_cells; @@ -71,6 +86,7 @@ extern int of_scan_flat_dt(int (*it)(unsigned long node, const char *uname, extern void *of_get_flat_dt_prop(unsigned long node, const char *name, unsigned long *size); extern int of_flat_dt_is_compatible(unsigned long node, const char *name); +extern int of_flat_dt_match(unsigned long node, const char **matches); extern unsigned long of_get_flat_dt_root(void); extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, diff --git a/include/linux/of_net.h b/include/linux/of_net.h new file mode 100644 index 000000000000..e913081fb52a --- /dev/null +++ b/include/linux/of_net.h @@ -0,0 +1,15 @@ +/* + * OF helpers for network devices. + * + * This file is released under the GPLv2 + */ + +#ifndef __LINUX_OF_NET_H +#define __LINUX_OF_NET_H + +#ifdef CONFIG_OF_NET +#include <linux/of.h> +extern const void *of_get_mac_address(struct device_node *np); +#endif + +#endif /* __LINUX_OF_NET_H */ |