Random OF cleanups and merges
Subsystems (5)
cover Random OF cleanups and merges
Here's another batch of cleanup patches from my test-devicetree branch. A number of cleanups, corrections and minor merges of common code. Also a patch from Jeremy to make the flat tree work on architectures without LMB (arm).
Once I've collected acks on these, I'll move them over to my next-devicetree branch on git://git.secretlab.ca/git/linux-2.6
Cheers,
g.
---
Grant Likely (6):
of: remove undefined request_OF_resource & release_OF_resource of/sparc: Remove sparc-local declaration of allnodes and devtree_lock
of: move definition of of_chosen into common code.
of: remove unused extern reference to devtree_lock
of: put default string compare and #a/s-cell values into common header
of: Remove old and misplaced function declarations
Jeremy Kerr (3):
of/flattree: Don't assume HAVE_LMB
of: protect linux/of.h with CONFIG_OF
proc_devtree: fix THIS_MODULE without module.h
arch/microblaze/include/asm/prom.h | 15 --------------- arch/microblaze/kernel/prom.c | 8 +++++--- arch/powerpc/include/asm/prom.h | 14 -------------- arch/powerpc/kernel/prom.c | 10 +++++----- arch/sparc/kernel/prom.h | 3 --- drivers/of/base.c | 1 + drivers/of/fdt.c | 9 ++++++--- fs/proc/proc_devtree.c | 1 + include/linux/of.h | 27 +++++++++++++++++++++++++++ include/linux/of_fdt.h | 11 +---------- 10 files changed, 46 insertions(+), 53 deletions(-)
PATCH 1/9 of: Remove old and misplaced function declarations
The following functions don't exist:
finish_device_tree()
print_properties()
prom_n_intr_cells()
prom_get_irq_senses()
The following functions are in drivers/of/base.c, so the declaration belongs in of.h instead of of_fdt.h
of_machine_is_compatible()
prom_add_property()
prom_remove_property()
prom_update_property()
---
include/linux/of.h | 8 ++++++++ include/linux/of_fdt.h | 10 ---------- 2 files changed, 8 insertions(+), 10 deletions(-)
include/linux/of.h +8 -0
@@ -180,6 +180,14 @@ extern int of_parse_phandles_with_args(struct device_node *np, const char *list_name, const char *cells_name, int index, struct device_node **out_node, const void **out_args); +extern int of_machine_is_compatible (const char *compat); + +extern int prom_add_property (struct device_node * np,struct property * prop); +extern int prom_remove_property (struct device_node *np,struct property *prop); +extern int prom_update_property (struct device_node *np, +struct property *newprop, +struct property *oldprop); +#if defined(CONFIG_OF_DYNAMIC )/* For updating the device tree at runtime */ extern void of_attach_node (struct device_node *);
include/linux/of_fdt.h +0 -10
@@ -95,18 +95,8 @@ extern int early_init_dt_scan_root(unsigned long node, const char *uname, int depth, void *data);/* Other Prototypes */ -extern void finish_device_tree (void );extern void unflatten_device_tree (void );extern void early_init_devtree (void *); -extern int of_machine_is_compatible (const char *compat); -extern void print_properties (struct device_node *node); -extern int prom_n_intr_cells (struct device_node * np); -extern void prom_get_irq_senses (unsigned char *senses,int off,int max); -extern int prom_add_property (struct device_node * np,struct property * prop); -extern int prom_remove_property (struct device_node *np,struct property *prop); -extern int prom_update_property (struct device_node *np, -struct property *newprop, -struct property *oldprop);#endif /* __ASSEMBLY__ */ #endif /* _LINUX_OF_FDT_H */
Re: [PATCH 1/9] of: Remove old and misplaced function declarations
Quoted 6 lines · Grant Likely
The following functions don't exist:
finish_device_tree()
print_properties()
prom_n_intr_cells()
prom_get_irq_senses()
Quoted 8 lines
The following functions are in
drivers/of/base.c, so the declaration belongs inof.hinstead ofof_fdt.h
of_machine_is_compatible()
prom_add_property()
prom_remove_property()
prom_update_property()Signed-off-by Grant Likely <grant.likely-s3s/[email protected]>
Quoted 48 lines
---
include/linux/of.h | 8 ++++++++ include/linux/of_fdt.h | 10 ---------- 2 files changed, 8 insertions(+), 10 deletions(-)include/linux/of.h +8
-0@@ -180,6 +180,14 @@ extern int of_parse_phandles_with_args(struct device_node *np, const char *list_name, const char *cells_name, int index, struct device_node **out_node, const void **out_args); +extern int of_machine_is_compatible (const char *compat); + +extern int prom_add_property (struct device_node * np,struct property * prop); +extern int prom_remove_property (struct device_node *np,struct property *prop); +extern int prom_update_property (struct device_node *np, +struct property *newprop, +struct property *oldprop); +#if defined(CONFIG_OF_DYNAMIC )/* For updating the device tree at runtime */ extern void of_attach_node (struct device_node *);include/linux/of_fdt.h +0
-10@@ -95,18 +95,8 @@ extern int early_init_dt_scan_root(unsigned long node, const char *uname, int depth, void *data);/* Other Prototypes */ -extern void finish_device_tree (void );extern void unflatten_device_tree (void );extern void early_init_devtree (void *); -extern int of_machine_is_compatible (const char *compat); -extern void print_properties (struct device_node *node); -extern int prom_n_intr_cells (struct device_node * np); -extern void prom_get_irq_senses (unsigned char *senses,int off,int max); -extern int prom_add_property (struct device_node * np,struct property * prop); -extern int prom_remove_property (struct device_node *np,struct property *prop); -extern int prom_update_property (struct device_node *np, -struct property *newprop, -struct property *oldprop);#endif /* __ASSEMBLY__ */ #endif /* _LINUX_OF_FDT_H */
PATCH 2/9 proc_devtree: fix THIS_MODULE without module.h
In reply to Grant LikelyFrom: Jeremy Kerr <[email protected]>
Commit e22f628395432b967f2f505858c64450f7835365 introduced a build breakage for ARM devtree work: the THIS_MODULE macro was added, but we don't have module.h
This change adds the necessary #include to get THIS_MODULE defined. While we could just replace it with NULL (PROC_FS is a bool, not a tristate), using THIS_MODULE will prevent unexpected breakage if we ever do compile this as a module.
---
fs/proc/proc_devtree.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
fs/proc/proc_devtree.c +1 -0
@@ -11,6 +11,7 @@#include <linux/stat.h> #include <linux/string.h> #include <linux/of.h> +#include <linux/module.h> #include <asm/prom.h> #include <asm/uaccess.h> #include "internal.h"
Re: [PATCH 2/9] proc_devtree: fix THIS_MODULE without module.h
Quoted 6 lines · Grant Likely
From: Jeremy Kerr <[email protected]>
Commit
e22f628395432b967f2f505858c64450f7835365introduced a build breakage for ARM devtree work: theTHIS_MODULEmacro was added, but we don't havemodule.h
Quoted 7 lines
This change adds the necessary #include to get
THIS_MODULEdefined. While we could just replace it with NULL (PROC_FSis a bool, not a tristate), usingTHIS_MODULEwill prevent unexpected breakage if we ever do compile this as a module.Signed-off-by Jeremy Kerr <[email protected]>Signed-off-by Grant Likely <[email protected]>
Quoted 17 lines
---
fs/proc/proc_devtree.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)fs/proc/proc_devtree.c +1
-0@@ -11,6 +11,7 @@#include <linux/stat.h> #include <linux/string.h> #include <linux/of.h> +#include <linux/module.h> #include <asm/prom.h> #include <asm/uaccess.h> #include "internal.h"
PATCH 2/9 proc_devtree: fix THIS_MODULE without module.h
In reply to Grant LikelyFrom: Jeremy Kerr <[email protected]>
Commit e22f628395432b967f2f505858c64450f7835365 introduced a build breakage for ARM devtree work: the THIS_MODULE macro was added, but we don't have module.h
This change adds the necessary #include to get THIS_MODULE defined. While we could just replace it with NULL (PROC_FS is a bool, not a tristate), using THIS_MODULE will prevent unexpected breakage if we ever do compile this as a module.
---
fs/proc/proc_devtree.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
fs/proc/proc_devtree.c +1 -0
@@ -11,6 +11,7 @@#include <linux/stat.h> #include <linux/string.h> #include <linux/of.h> +#include <linux/module.h> #include <asm/prom.h> #include <asm/uaccess.h> #include "internal.h"
PATCH 3/9 of: protect linux/of.h with CONFIG_OF
In reply to Grant LikelyFrom: Jeremy Kerr <[email protected]>
For platforms that have CONFIG_OF optional, we need to make the contents of linux/of.h conditional on CONFIG_OF.
---
include/linux/of.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
include/linux/of.h +3 -0
@@ -22,6 +22,8 @@#include <asm/byteorder.h> +#ifdef CONFIG_OF +typedef u32 phandle ;typedef u32 ihandle ;
@@ -194,4 +196,5 @@ extern void of_attach_node(struct device_node *);extern void of_detach_node (struct device_node *);#endif +#endif /* CONFIG_OF */ #endif /* _LINUX_OF_H */
Re: [PATCH 3/9] of: protect linux/of.h with CONFIG_OF
Quoted 7 lines · Grant Likely
From: Jeremy Kerr <[email protected]>
For platforms that have
CONFIG_OFoptional, we need to make the contents oflinux/of.hconditional onCONFIG_OF.Signed-off-by Jeremy Kerr <[email protected]>Signed-off-by Grant Likely <[email protected]>
For now...
In the long run, maybe we want some of the iterators to be empty inlines returning NULL ?
Cheers,
Ben.
Quoted 24 lines
---
include/linux/of.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)include/linux/of.h +3
-0@@ -22,6 +22,8 @@#include <asm/byteorder.h> +#ifdef CONFIG_OF +typedef u32 phandle ;typedef u32 ihandle ;@@ -194,4 +196,5 @@ extern void of_attach_node(struct device_node *);extern void of_detach_node (struct device_node *);#endif +#endif /* CONFIG_OF */ #endif /* _LINUX_OF_H */
WALID
Acked-by Benjamin HerrenschmidtRE: Re: [PATCH 3/9] of: protect linux/of.h with CONFIG_OF
Please remove my email from your mailing list!!!!!!!
-----Original Message-----
From: owner-microblaze-uclinux-FR6EJeJVuqfA6Z3fQjNZrN9u6TNh0Fb7@public.gmane.org [mailto:owner-microblaze-uclinux-FR6EJeJVuqfA6Z3fQjNZrN9u6TNh0Fb7@public.gmane.org] On Behalf Of Benjamin Herrenschmidt
Sent: Sunday, February 14, 2010 8:11 AM
To: Grant Likely
Cc: [email protected]; [email protected]; [email protected]; davem-fT/PcQaiUtIeIZ0/[email protected]; microblaze-uclinux-rVRm/[email protected]; [email protected]; [email protected]; devicetree-discuss-uLR06cmDAlY/[email protected]; [email protected]
Subject: [microblaze-uclinux] Re: [PATCH 3/9] of: protect linux/of.h with CONFIG_OF
Quoted 7 lines · Grant Likely
From: Jeremy Kerr <[email protected]>
For platforms that have
CONFIG_OFoptional, we need to make the contents oflinux/of.hconditional onCONFIG_OF.Signed-off-by Jeremy Kerr <[email protected]>Signed-off-by Grant Likely <grant.likely-s3s/[email protected]>
For now...
In the long run, maybe we want some of the iterators to be empty inlines returning NULL ?
Cheers,
Ben.
Quoted 19 lines
---
include/linux/of.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)include/linux/of.h +2
-0@@ -22,6 +22,8 @@#include <asm/byteorder.h> +#ifdef CONFIG_OF +typedef u32 phandle ;typedef u32 ihandle ;
include/linux/of.h extern void of_attach_node(struct device_node *); · line 200
Quoted 5 lines
include/linux/of.h +1
-0@@ -194,4 +196,5 @@ extern void of_attach_node(struct device_node *);extern void of_detach_node (struct device_node *);#endif +#endif /* CONFIG_OF */ #endif /* _LINUX_OF_H */
___________________________
microblaze-uclinux mailing list microblaze-uclinux-rVRm/[email protected] Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/
Re: [PATCH 3/9] of: protect linux/of.h with CONFIG_OF
In reply to Benjamin HerrenschmidtQuoted 9 lines · Benjamin Herrenschmidt
Quoted 7 lines · Grant Likely
From: Jeremy Kerr <[email protected]>
For platforms that have
CONFIG_OFoptional, we need to make the contents oflinux/of.hconditional onCONFIG_OF.Signed-off-by Jeremy Kerr <[email protected]>Signed-off-by Grant Likely <[email protected]>
Quoted 6 lines
For now...
In the long run, maybe we want some of the iterators to be empty inlines returning NULL ?
Yes. I'll add them as they are needed.
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
PATCH 3/9 of: protect linux/of.h with CONFIG_OF
In reply to Grant LikelyFrom: Jeremy Kerr <[email protected]>
For platforms that have CONFIG_OF optional, we need to make the contents of linux/of.h conditional on CONFIG_OF.
---
include/linux/of.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
include/linux/of.h +3 -0
@@ -22,6 +22,8 @@#include <asm/byteorder.h> +#ifdef CONFIG_OF +typedef u32 phandle ;typedef u32 ihandle ;
@@ -194,4 +196,5 @@ extern void of_attach_node(struct device_node *);extern void of_detach_node (struct device_node *);#endif +#endif /* CONFIG_OF */ #endif /* _LINUX_OF_H */
PATCH 4/9 of/flattree: Don't assume HAVE_LMB
In reply to Grant LikelyFrom: Jeremy Kerr <[email protected]>
We don't always have lmb available, so make arches provide an early_init_dt_alloc_memory_arch() to handle the allocation of memory in the fdt code.
When we don't have lmb.h included, we need asm/page.h for __va.
---
arch/microblaze/kernel/prom.c | 5 +++++ arch/powerpc/kernel/prom.c | 5 +++++ drivers/of/fdt.c | 9 ++++++--- include/linux/of_fdt.h | 1 + 4 files changed, 17 insertions(+), 3 deletions(-)
arch/microblaze/kernel/prom.c +5 -0
@@ -55,6 +55,11 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)lmb_add (base, size); } +u64 __init early_init_dt_alloc_memory_arch (u64 size,u64 align) +{ +return lmb_alloc (size, align); +} +#ifdef CONFIG_EARLY_PRINTK /* MS this is Microblaze specifig function */ static int __init early_init_dt_scan_serial(unsigned long node,
arch/powerpc/kernel/prom.c +5 -0
@@ -510,6 +510,11 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) memstart_addr =min ((u64 )memstart_addr, base); } +u64 __init early_init_dt_alloc_memory_arch (u64 size,u64 align) +{ +return lmb_alloc (size, align); +} +#ifdef CONFIG_BLK_DEV_INITRD void __init early_init_dt_setup_initrd_arch (unsigned long start,unsigned long end)
drivers/of/fdt.c +6 -3
@@ -10,16 +10,18 @@*/ #include <linux/kernel.h> -#include <linux/lmb.h> #include <linux/initrd.h> #include <linux/of.h> #include <linux/of_fdt.h> - +#include <linux/string.h> +#include <linux/errno.h> #ifdef CONFIG_PPC #include <asm/machdep.h> #endif /* CONFIG_PPC */ +#include <asm/page.h> +int __initdata dt_root_addr_cells;int __initdata dt_root_size_cells;
@@ -560,7 +562,8 @@ void __init unflatten_device_tree(void)pr_debug (" size is %lx, allocating...\n" , size);/* Allocate memory for the expanded device tree */ - mem =lmb_alloc (size +4 , __alignof__(struct device_node )); + mem =early_init_dt_alloc_memory_arch (size +4 , + __alignof__(struct device_node )); mem = (unsigned long )__va (mem); ((__be32 *)mem)[size /4 ] =cpu_to_be32 (0xdeadbeef );
include/linux/of_fdt.h +1 -0
@@ -78,6 +78,7 @@ extern void early_init_dt_check_for_initrd(unsigned long node);extern int early_init_dt_scan_memory (unsigned long node,const char *uname,int depth,void *data);extern void early_init_dt_add_memory_arch (u64 base,u64 size); +extern u64 early_init_dt_alloc_memory_arch (u64 size,u64 align);extern u64 dt_mem_next_cell (int s,__be32 **cellp);/*
Re: [PATCH 4/9] of/flattree: Don't assume HAVE_LMB
Quoted 10 lines · Grant Likely
From: Jeremy Kerr <[email protected]>
We don't always have lmb available, so make arches provide an
early_init_dt_alloc_memory_arch()to handle the allocation of memory in the fdt code.When we don't have
lmb.hincluded, we needasm/page.hfor__va.Signed-off-by Jeremy Kerr <[email protected]>Signed-off-by Grant Likely <grant.likely-s3s/[email protected]>
Quoted 87 lines
---
arch/microblaze/kernel/prom.c | 5 +++++ arch/powerpc/kernel/prom.c | 5 +++++ drivers/of/fdt.c | 9 ++++++--- include/linux/of_fdt.h | 1 + 4 files changed, 17 insertions(+), 3 deletions(-)arch/microblaze/kernel/prom.c +5
-0@@ -55,6 +55,11 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)lmb_add (base, size); } +u64 __init early_init_dt_alloc_memory_arch (u64 size,u64 align) +{ +return lmb_alloc (size, align); +} +#ifdef CONFIG_EARLY_PRINTK /* MS this is Microblaze specifig function */ static int __init early_init_dt_scan_serial(unsigned long node,arch/powerpc/kernel/prom.c +5
-0@@ -510,6 +510,11 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) memstart_addr =min ((u64 )memstart_addr, base); } +u64 __init early_init_dt_alloc_memory_arch (u64 size,u64 align) +{ +return lmb_alloc (size, align); +} +#ifdef CONFIG_BLK_DEV_INITRD void __init early_init_dt_setup_initrd_arch (unsigned long start,unsigned long end)drivers/of/fdt.c +6
-3@@ -10,16 +10,18 @@*/ #include <linux/kernel.h> -#include <linux/lmb.h> #include <linux/initrd.h> #include <linux/of.h> #include <linux/of_fdt.h> - +#include <linux/string.h> +#include <linux/errno.h> #ifdef CONFIG_PPC #include <asm/machdep.h> #endif /* CONFIG_PPC */ +#include <asm/page.h> +int __initdata dt_root_addr_cells;int __initdata dt_root_size_cells;@@ -560,7 +562,8 @@ void __init unflatten_device_tree(void)pr_debug (" size is %lx, allocating...\n" , size);/* Allocate memory for the expanded device tree */ - mem =lmb_alloc (size +4 , __alignof__(struct device_node )); + mem =early_init_dt_alloc_memory_arch (size +4 , + __alignof__(struct device_node )); mem = (unsigned long )__va (mem); ((__be32 *)mem)[size /4 ] =cpu_to_be32 (0xdeadbeef );include/linux/of_fdt.h +1
-0@@ -78,6 +78,7 @@ extern void early_init_dt_check_for_initrd(unsigned long node);extern int early_init_dt_scan_memory (unsigned long node,const char *uname,int depth,void *data);extern void early_init_dt_add_memory_arch (u64 base,u64 size); +extern u64 early_init_dt_alloc_memory_arch (u64 size,u64 align);extern u64 dt_mem_next_cell (int s,__be32 **cellp);/*
Re: [PATCH 4/9] of/flattree: Don't assume HAVE_LMB
In reply to Grant LikelyQuoted 59 lines · Grant Likely
From: Jeremy Kerr <[email protected]>
We don't always have lmb available, so make arches provide an
early_init_dt_alloc_memory_arch()to handle the allocation of memory in the fdt code.When we don't have
lmb.hincluded, we needasm/page.hfor__va.Signed-off-by Jeremy Kerr <[email protected]>Signed-off-by Grant Likely <[email protected]>---
arch/microblaze/kernel/prom.c | 5 +++++ arch/powerpc/kernel/prom.c | 5 +++++ drivers/of/fdt.c | 9 ++++++--- include/linux/of_fdt.h | 1 + 4 files changed, 17 insertions(+), 3 deletions(-)arch/microblaze/kernel/prom.c +5
-0@@ -55,6 +55,11 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)lmb_add (base, size); } +u64 __init early_init_dt_alloc_memory_arch (u64 size,u64 align) +{ +return lmb_alloc (size, align); +} +#ifdef CONFIG_EARLY_PRINTK /* MS this is Microblaze specifig function */ static int __init early_init_dt_scan_serial(unsigned long node,arch/powerpc/kernel/prom.c +5
-0@@ -510,6 +510,11 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) memstart_addr =min ((u64 )memstart_addr, base); } +u64 __init early_init_dt_alloc_memory_arch (u64 size,u64 align) +{ +return lmb_alloc (size, align); +} +#ifdef CONFIG_BLK_DEV_INITRD void __init early_init_dt_setup_initrd_arch (unsigned long start,unsigned long end)drivers/of/fdt.c +0
-1@@ -10,16 +10,18 @@*/ #include <linux/kernel.h> -#include <linux/lmb.h>
drivers/of/fdt.c line 21
Quoted 10 lines
drivers/of/fdt.c +2
-1#include <linux/initrd.h> #include <linux/of.h> #include <linux/of_fdt.h> - +#include <linux/string.h> +#include <linux/errno.h> #ifdef CONFIG_PPC #include <asm/machdep.h> #endif /* CONFIG_PPC */
It is not part of your patch but I think that will be great completely remove this CONFIG_PPC part from generic OF file. Would it be possible to include your asm/machdep.h through asm/page.h or any other file?
Michal
Quoted 34 lines
drivers/of/fdt.c +4
-1+#include <asm/page.h> +int __initdata dt_root_addr_cells;int __initdata dt_root_size_cells;@@ -560,7 +562,8 @@ void __init unflatten_device_tree(void)pr_debug (" size is %lx, allocating...\n" , size);/* Allocate memory for the expanded device tree */ - mem =lmb_alloc (size +4 , __alignof__(struct device_node )); + mem =early_init_dt_alloc_memory_arch (size +4 , + __alignof__(struct device_node )); mem = (unsigned long )__va (mem); ((__be32 *)mem)[size /4 ] =cpu_to_be32 (0xdeadbeef );include/linux/of_fdt.h +1
-1@@ -78,6 +78,7 @@ extern void early_init_dt_check_for_initrd(unsigned long node);extern int early_init_dt_scan_memory (unsigned long node,const char *uname,int depth,void *data);extern void early_init_dt_add_memory_arch (u64 base,u64 size); +extern u64 early_init_dt_alloc_memory_arch (u64 size,u64 align);extern u64 dt_mem_next_cell (int s,__be32 **cellp);/* -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 3 lines
Michal Simek, Ing. (M.Eng) PetaLogix - Linux Solutions for a Reconfigurable World w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663
Re: [PATCH 4/9] of/flattree: Don't assume HAVE_LMB
Quoted 66 lines · Michal Simek
Quoted 65 lines · Grant Likely
From: Jeremy Kerr <[email protected]>
We don't always have lmb available, so make arches provide an
early_init_dt_alloc_memory_arch()to handle the allocation of memory in the fdt code.When we don't have
lmb.hincluded, we needasm/page.hfor__va.Signed-off-by Jeremy Kerr <[email protected]>Signed-off-by Grant Likely <[email protected]>---
arch/microblaze/kernel/prom.c | 5 +++++
arch/powerpc/kernel/prom.c | 5 +++++
drivers/of/fdt.c | 9 ++++++---
include/linux/of_fdt.h | 1 +4 files changed, 17 insertions(+), 3 deletions(-)arch/microblaze/kernel/prom.c +4
-0@@ -55,6 +55,11 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) lmb_add(base, size); } +u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align) +{ + return lmb_alloc(size, align); +} + #ifdef CONFIG_EARLY_PRINTK /* MS this is Microblaze specifig function */static int
__initearly_init_dt_scan_serial(unsigned long node,arch/powerpc/kernel/prom.c +4
-0@@ -510,6 +510,11 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) memstart_addr = min((u64)memstart_addr, base); } +u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align) +{ + return lmb_alloc(size, align); +} + #ifdef CONFIG_BLK_DEV_INITRD void __init early_init_dt_setup_initrd_arch(unsigned long start,unsigned long end)
drivers/of/fdt.c +2
-2@@ -10,16 +10,18 @@*/ #include <linux/kernel.h> -#include <linux/lmb.h> #include <linux/initrd.h> #include <linux/of.h> #include <linux/of_fdt.h> - +#include <linux/string.h> +#include <linux/errno.h>
Quoted 8 lines
drivers/of/fdt.c line 21
Quoted 3 lines
drivers/of/fdt.c +0
-0#ifdef CONFIG_PPC #include <asm/machdep.h> #endif /* CONFIG_PPC */It is not part of your patch but I think that will be great completely remove this
CONFIG_PPCpart from generic OF file.
Would it be possible to include yourasm/machdep.hthroughasm/page.hor any other file?
Yup. I'll get there unless someone else beats me to it. :-)
Quoted 41 lines
Michal
Quoted 26 lines
+#include <
asm/page.h>
+
int__initdatadt_root_addr_cells;
int__initdatadt_root_size_cells;
@@ -560,7 +562,8 @@ void__initunflatten_device_tree(void)pr_debug(" size is %lx, allocating...\n", size); /* Allocate memory for the expanded device tree */
- mem =lmb_alloc(size + 4, __alignof__(struct device_node));
+ mem = early_init_dt_alloc_memory_arch(size + 4,
+__alignof__(struct device_node)); mem = (unsigned long)__va(mem);
((__be32 *)mem)[size / 4] =cpu_to_be32(0xdeadbeef);include/linux/of_fdt.h +0
-0@@ -78,6 +78,7 @@ extern void early_init_dt_check_for_initrd(unsigned long node);extern int early_init_dt_scan_memory(unsigned long node, const char *uname,
int depth, void *data); extern voidearly_init_dt_add_memory_arch(u64 base, u64 size); +extern u64early_init_dt_alloc_memory_arch(u64 size, u64 align); extern u64dt_mem_next_cell(int s, __be32 **cellp);
/*Quoted 5 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/--
Michal Simek, Ing. (M.Eng)
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com p: +61-7-30090663,+42-0-721842854 f: +61-7-30090663
Signature · 6 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 4/9 of/flattree: Don't assume HAVE_LMB
In reply to Grant LikelyFrom: Jeremy Kerr <[email protected]>
We don't always have lmb available, so make arches provide an early_init_dt_alloc_memory_arch() to handle the allocation of memory in the fdt code.
When we don't have lmb.h included, we need asm/page.h for __va.
---
arch/microblaze/kernel/prom.c | 5 +++++ arch/powerpc/kernel/prom.c | 5 +++++ drivers/of/fdt.c | 9 ++++++--- include/linux/of_fdt.h | 1 + 4 files changed, 17 insertions(+), 3 deletions(-)
arch/microblaze/kernel/prom.c +5 -0
@@ -55,6 +55,11 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size)lmb_add (base, size); } +u64 __init early_init_dt_alloc_memory_arch (u64 size,u64 align) +{ +return lmb_alloc (size, align); +} +#ifdef CONFIG_EARLY_PRINTK /* MS this is Microblaze specifig function */ static int __init early_init_dt_scan_serial(unsigned long node,
arch/powerpc/kernel/prom.c +5 -0
@@ -510,6 +510,11 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) memstart_addr =min ((u64 )memstart_addr, base); } +u64 __init early_init_dt_alloc_memory_arch (u64 size,u64 align) +{ +return lmb_alloc (size, align); +} +#ifdef CONFIG_BLK_DEV_INITRD void __init early_init_dt_setup_initrd_arch (unsigned long start,unsigned long end)
drivers/of/fdt.c +6 -3
@@ -10,16 +10,18 @@*/ #include <linux/kernel.h> -#include <linux/lmb.h> #include <linux/initrd.h> #include <linux/of.h> #include <linux/of_fdt.h> - +#include <linux/string.h> +#include <linux/errno.h> #ifdef CONFIG_PPC #include <asm/machdep.h> #endif /* CONFIG_PPC */ +#include <asm/page.h> +int __initdata dt_root_addr_cells;int __initdata dt_root_size_cells;
@@ -560,7 +562,8 @@ void __init unflatten_device_tree(void)pr_debug (" size is %lx, allocating...\n" , size);/* Allocate memory for the expanded device tree */ - mem =lmb_alloc (size +4 , __alignof__(struct device_node )); + mem =early_init_dt_alloc_memory_arch (size +4 , + __alignof__(struct device_node )); mem = (unsigned long )__va (mem); ((__be32 *)mem)[size /4 ] =cpu_to_be32 (0xdeadbeef );
include/linux/of_fdt.h +1 -0
@@ -78,6 +78,7 @@ extern void early_init_dt_check_for_initrd(unsigned long node);extern int early_init_dt_scan_memory (unsigned long node,const char *uname,int depth,void *data);extern void early_init_dt_add_memory_arch (u64 base,u64 size); +extern u64 early_init_dt_alloc_memory_arch (u64 size,u64 align);extern u64 dt_mem_next_cell (int s,__be32 **cellp);/*
PATCH 5/9 of: put default string compare and #a/s-cell values into common header
In reply to Grant LikelyMost architectures don't need to change these. Put them into common code to eliminate some duplication
---
arch/microblaze/include/asm/prom.h | 7 ------- arch/powerpc/include/asm/prom.h | 7 ------- include/linux/of.h | 13 +++++++++++++ 3 files changed, 13 insertions(+), 14 deletions(-)
arch/microblaze/include/asm/prom.h +0 -7
@@ -26,13 +26,6 @@#include <asm/irq.h> #include <asm/atomic.h> -#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 -#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 - -#define of_compat_cmp (s1, s2, l) strncasecmp((s1), (s2), (l)) -#define of_prop_cmp (s1, s2) strcmp((s1), (s2)) -#define of_node_cmp (s1, s2) strcasecmp((s1), (s2)) -extern struct device_node *of_chosen;#define HAVE_ARCH_DEVTREE_FIXUPS
arch/powerpc/include/asm/prom.h +0 -7
@@ -23,13 +23,6 @@#include <asm/irq.h> #include <asm/atomic.h> -#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 -#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 - -#define of_compat_cmp (s1, s2, l) strcasecmp((s1), (s2)) -#define of_prop_cmp (s1, s2) strcmp((s1), (s2)) -#define of_node_cmp (s1, s2) strcasecmp((s1), (s2)) -extern struct device_node *of_chosen;#define HAVE_ARCH_DEVTREE_FIXUPS
include/linux/of.h +13 -0
@@ -116,6 +116,19 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)#include <asm/prom.h> +/* Default #address and #size cells. Allow arch asm/prom.h to override */ +#if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT ) +#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 +#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 +#endif + +/* Default string compare functions, Allow arch asm/prom.h to override */ +#if !defined(of_compat_cmp) +#define of_compat_cmp (s1, s2, l) strncasecmp((s1), (s2), (l)) +#define of_prop_cmp (s1, s2) strcmp((s1), (s2)) +#define of_node_cmp (s1, s2) strcasecmp((s1), (s2)) +#endif +/* flag descriptions */ #define OF_DYNAMIC 1/* node and properties were allocated via kmalloc */ #define OF_DETACHED 2/* node has been detached from the device tree */
Re: [PATCH 5/9] of: put default string compare and #a/s-cell values into common header
Quoted 5 lines · Grant Likely
Most architectures don't need to change these. Put them into common code to eliminate some duplication
Signed-off-by Grant Likely <[email protected]>---
Quoted 72 lines
arch/microblaze/include/asm/prom.h | 7 ------- arch/powerpc/include/asm/prom.h | 7 ------- include/linux/of.h | 13 +++++++++++++ 3 files changed, 13 insertions(+), 14 deletions(-)arch/microblaze/include/asm/prom.h +0
-7@@ -26,13 +26,6 @@#include <asm/irq.h> #include <asm/atomic.h> -#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 -#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 - -#define of_compat_cmp (s1, s2, l) strncasecmp((s1), (s2), (l)) -#define of_prop_cmp (s1, s2) strcmp((s1), (s2)) -#define of_node_cmp (s1, s2) strcasecmp((s1), (s2)) -extern struct device_node *of_chosen;#define HAVE_ARCH_DEVTREE_FIXUPS arch/powerpc/include/asm/prom.h +0
-7@@ -23,13 +23,6 @@#include <asm/irq.h> #include <asm/atomic.h> -#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 -#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 - -#define of_compat_cmp (s1, s2, l) strcasecmp((s1), (s2)) -#define of_prop_cmp (s1, s2) strcmp((s1), (s2)) -#define of_node_cmp (s1, s2) strcasecmp((s1), (s2)) -extern struct device_node *of_chosen;#define HAVE_ARCH_DEVTREE_FIXUPS include/linux/of.h +13
-1@@ -116,6 +116,19 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)#include <asm/prom.h> +/* Default #address and #size cells. Allow arch asm/prom.h to override */ +#if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT ) +#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 +#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 +#endif + +/* Default string compare functions, Allow arch asm/prom.h to override */ +#if !defined(of_compat_cmp) +#define of_compat_cmp (s1, s2, l) strncasecmp((s1), (s2), (l)) +#define of_prop_cmp (s1, s2) strcmp((s1), (s2)) +#define of_node_cmp (s1, s2) strcasecmp((s1), (s2)) +#endif +/* flag descriptions */ #define OF_DYNAMIC 1/* node and properties were allocated via kmalloc */ #define OF_DETACHED 2/* node has been detached from the device tree */ --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
PATCH 5/9 of: put default string compare and #a/s-cell values into common header
In reply to Grant LikelyMost architectures don't need to change these. Put them into common code to eliminate some duplication
---
arch/microblaze/include/asm/prom.h | 7 ------- arch/powerpc/include/asm/prom.h | 7 ------- include/linux/of.h | 13 +++++++++++++ 3 files changed, 13 insertions(+), 14 deletions(-)
arch/microblaze/include/asm/prom.h +0 -7
@@ -26,13 +26,6 @@#include <asm/irq.h> #include <asm/atomic.h> -#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 -#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 - -#define of_compat_cmp (s1, s2, l) strncasecmp((s1), (s2), (l)) -#define of_prop_cmp (s1, s2) strcmp((s1), (s2)) -#define of_node_cmp (s1, s2) strcasecmp((s1), (s2)) -extern struct device_node *of_chosen;#define HAVE_ARCH_DEVTREE_FIXUPS
arch/powerpc/include/asm/prom.h +0 -7
@@ -23,13 +23,6 @@#include <asm/irq.h> #include <asm/atomic.h> -#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 -#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 - -#define of_compat_cmp (s1, s2, l) strcasecmp((s1), (s2)) -#define of_prop_cmp (s1, s2) strcmp((s1), (s2)) -#define of_node_cmp (s1, s2) strcasecmp((s1), (s2)) -extern struct device_node *of_chosen;#define HAVE_ARCH_DEVTREE_FIXUPS
include/linux/of.h +13 -0
@@ -116,6 +116,19 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)#include <asm/prom.h> +/* Default #address and #size cells. Allow arch asm/prom.h to override */ +#if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT ) +#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 +#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 +#endif + +/* Default string compare functions, Allow arch asm/prom.h to override */ +#if !defined(of_compat_cmp) +#define of_compat_cmp (s1, s2, l) strncasecmp((s1), (s2), (l)) +#define of_prop_cmp (s1, s2) strcmp((s1), (s2)) +#define of_node_cmp (s1, s2) strcasecmp((s1), (s2)) +#endif +/* flag descriptions */ #define OF_DYNAMIC 1/* node and properties were allocated via kmalloc */ #define OF_DETACHED 2/* node has been detached from the device tree */
PATCH 6/9 of: remove unused extern reference to devtree_lock
In reply to Grant LikelyNeither the powerpc nor the microblaze code use devtree_lock anymore. Remove the extern reference.
---
arch/microblaze/include/asm/prom.h | 2 -- arch/powerpc/kernel/prom.c | 2 -- 2 files changed, 0 insertions(+), 4 deletions(-)
arch/microblaze/include/asm/prom.h +0 -2
@@ -30,8 +30,6 @@ extern struct device_node *of_chosen;#define HAVE_ARCH_DEVTREE_FIXUPS -extern rwlock_t devtree_lock;/* temporary while merging */ -/* Other Prototypes */ extern int early_uartlite_console (void );
arch/powerpc/kernel/prom.c +0 -2
@@ -67,8 +67,6 @@ int __initdata iommu_force_on;unsigned long tce_alloc_start, tce_alloc_end;#endif -extern rwlock_t devtree_lock;/* temporary while merging */ -/* export that to outside world */ struct device_node *of_chosen;
Re: [PATCH 6/9] of: remove unused extern reference to devtree_lock
Quoted 5 lines · Grant Likely
Neither the powerpc nor the microblaze code use
devtree_lockanymore. Remove the extern reference.Signed-off-by Grant Likely <[email protected]>---
Quoted 36 lines
arch/microblaze/include/asm/prom.h | 2 -- arch/powerpc/kernel/prom.c | 2 -- 2 files changed, 0 insertions(+), 4 deletions(-)arch/microblaze/include/asm/prom.h +0
-2@@ -30,8 +30,6 @@ extern struct device_node *of_chosen;#define HAVE_ARCH_DEVTREE_FIXUPS -extern rwlock_t devtree_lock;/* temporary while merging */ -/* Other Prototypes */ extern int early_uartlite_console (void );arch/powerpc/kernel/prom.c +0
-3@@ -67,8 +67,6 @@ int __initdata iommu_force_on;unsigned long tce_alloc_start, tce_alloc_end;#endif -extern rwlock_t devtree_lock;/* temporary while merging */ -/* export that to outside world */ struct device_node *of_chosen; --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
PATCH 6/9 of: remove unused extern reference to devtree_lock
In reply to Grant LikelyNeither the powerpc nor the microblaze code use devtree_lock anymore. Remove the extern reference.
---
arch/microblaze/include/asm/prom.h | 2 -- arch/powerpc/kernel/prom.c | 2 -- 2 files changed, 0 insertions(+), 4 deletions(-)
arch/microblaze/include/asm/prom.h +0 -2
@@ -30,8 +30,6 @@ extern struct device_node *of_chosen;#define HAVE_ARCH_DEVTREE_FIXUPS -extern rwlock_t devtree_lock;/* temporary while merging */ -/* Other Prototypes */ extern int early_uartlite_console (void );
arch/powerpc/kernel/prom.c +0 -2
@@ -67,8 +67,6 @@ int __initdata iommu_force_on;unsigned long tce_alloc_start, tce_alloc_end;#endif -extern rwlock_t devtree_lock;/* temporary while merging */ -/* export that to outside world */ struct device_node *of_chosen;
PATCH 7/9 of: move definition of of_chosen into common code.
In reply to Grant LikelyRather than defining of_chosen in each arch, it can be defined for all in driver/of/base.c
---
arch/microblaze/include/asm/prom.h | 2 -- arch/microblaze/kernel/prom.c | 3 --- arch/powerpc/include/asm/prom.h | 2 -- arch/powerpc/kernel/prom.c | 3 --- drivers/of/base.c | 1 + include/linux/of.h | 1 + 6 files changed, 2 insertions(+), 10 deletions(-)
arch/microblaze/include/asm/prom.h +0 -2
@@ -26,8 +26,6 @@#include <asm/irq.h> #include <asm/atomic.h> -extern struct device_node *of_chosen; -#define HAVE_ARCH_DEVTREE_FIXUPS /* Other Prototypes */
arch/microblaze/kernel/prom.c +0 -3
@@ -42,9 +42,6 @@#include <asm/sections.h> #include <asm/pci-bridge.h> -/* export that to outside world */ -struct device_node *of_chosen; -void __init early_init_dt_scan_chosen_arch (unsigned long node) {/* No Microblaze specific code here */
arch/powerpc/include/asm/prom.h +0 -2
@@ -23,8 +23,6 @@#include <asm/irq.h> #include <asm/atomic.h> -extern struct device_node *of_chosen; -#define HAVE_ARCH_DEVTREE_FIXUPS #ifdef CONFIG_PPC32
arch/powerpc/kernel/prom.c +0 -3
@@ -67,9 +67,6 @@ int __initdata iommu_force_on;unsigned long tce_alloc_start, tce_alloc_end;#endif -/* export that to outside world */ -struct device_node *of_chosen; -static int __init early_parse_mem (char *p) {if (!p)
drivers/of/base.c +1 -0
@@ -23,6 +23,7 @@#include <linux/proc_fs.h> struct device_node *allnodes; +struct device_node *of_chosen;/* use when traversing tree through the allnext, child, sibling, * or parent members of struct device_node.
include/linux/of.h +1 -0
@@ -66,6 +66,7 @@ struct device_node {/* Pointer for first entry in chain of all nodes. */ extern struct device_node *allnodes; +extern struct device_node *of_chosen;static inline int of_node_check_flag (struct device_node *n,unsigned long flag) {
Re: [PATCH 7/9] of: move definition of of_chosen into common code.
Quoted 4 lines · Grant Likely
Rather than defining
of_chosenin each arch, it can be defined for all indriver/of/base.cSigned-off-by Grant Likely <grant.likely-s3s/[email protected]>
Quoted 94 lines
---
arch/microblaze/include/asm/prom.h | 2 -- arch/microblaze/kernel/prom.c | 3 --- arch/powerpc/include/asm/prom.h | 2 -- arch/powerpc/kernel/prom.c | 3 --- drivers/of/base.c | 1 + include/linux/of.h | 1 + 6 files changed, 2 insertions(+), 10 deletions(-)arch/microblaze/include/asm/prom.h +0
-2@@ -26,8 +26,6 @@#include <asm/irq.h> #include <asm/atomic.h> -extern struct device_node *of_chosen; -#define HAVE_ARCH_DEVTREE_FIXUPS /* Other Prototypes */ arch/microblaze/kernel/prom.c +0
-3@@ -42,9 +42,6 @@#include <asm/sections.h> #include <asm/pci-bridge.h> -/* export that to outside world */ -struct device_node *of_chosen; -void __init early_init_dt_scan_chosen_arch (unsigned long node) {/* No Microblaze specific code here */ arch/powerpc/include/asm/prom.h +0
-2@@ -23,8 +23,6 @@#include <asm/irq.h> #include <asm/atomic.h> -extern struct device_node *of_chosen; -#define HAVE_ARCH_DEVTREE_FIXUPS #ifdef CONFIG_PPC32 arch/powerpc/kernel/prom.c +0
-3@@ -67,9 +67,6 @@ int __initdata iommu_force_on;unsigned long tce_alloc_start, tce_alloc_end;#endif -/* export that to outside world */ -struct device_node *of_chosen; -static int __init early_parse_mem (char *p) {if (!p)drivers/of/base.c +1
-0@@ -23,6 +23,7 @@#include <linux/proc_fs.h> struct device_node *allnodes; +struct device_node *of_chosen;/* use when traversing tree through the allnext, child, sibling, * or parent members of struct device_node. include/linux/of.h +1
-1@@ -66,6 +66,7 @@ struct device_node {/* Pointer for first entry in chain of all nodes. */ extern struct device_node *allnodes; +extern struct device_node *of_chosen;static inline int of_node_check_flag (struct device_node *n,unsigned long flag) { --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
PATCH 7/9 of: move definition of of_chosen into common code.
In reply to Grant LikelyRather than defining of_chosen in each arch, it can be defined for all in driver/of/base.c
---
arch/microblaze/include/asm/prom.h | 2 -- arch/microblaze/kernel/prom.c | 3 --- arch/powerpc/include/asm/prom.h | 2 -- arch/powerpc/kernel/prom.c | 3 --- drivers/of/base.c | 1 + include/linux/of.h | 1 + 6 files changed, 2 insertions(+), 10 deletions(-)
arch/microblaze/include/asm/prom.h +0 -2
@@ -26,8 +26,6 @@#include <asm/irq.h> #include <asm/atomic.h> -extern struct device_node *of_chosen; -#define HAVE_ARCH_DEVTREE_FIXUPS /* Other Prototypes */
arch/microblaze/kernel/prom.c +0 -3
@@ -42,9 +42,6 @@#include <asm/sections.h> #include <asm/pci-bridge.h> -/* export that to outside world */ -struct device_node *of_chosen; -void __init early_init_dt_scan_chosen_arch (unsigned long node) {/* No Microblaze specific code here */
arch/powerpc/include/asm/prom.h +0 -2
@@ -23,8 +23,6 @@#include <asm/irq.h> #include <asm/atomic.h> -extern struct device_node *of_chosen; -#define HAVE_ARCH_DEVTREE_FIXUPS #ifdef CONFIG_PPC32
arch/powerpc/kernel/prom.c +0 -3
@@ -67,9 +67,6 @@ int __initdata iommu_force_on;unsigned long tce_alloc_start, tce_alloc_end;#endif -/* export that to outside world */ -struct device_node *of_chosen; -static int __init early_parse_mem (char *p) {if (!p)
drivers/of/base.c +1 -0
@@ -23,6 +23,7 @@#include <linux/proc_fs.h> struct device_node *allnodes; +struct device_node *of_chosen;/* use when traversing tree through the allnext, child, sibling, * or parent members of struct device_node.
include/linux/of.h +1 -0
@@ -66,6 +66,7 @@ struct device_node {/* Pointer for first entry in chain of all nodes. */ extern struct device_node *allnodes; +extern struct device_node *of_chosen;static inline int of_node_check_flag (struct device_node *n,unsigned long flag) {
PATCH 8/9 of/sparc: Remove sparc-local declaration of allnodes and devtree_lock
In reply to Grant LikelyBoth allnodes and devtree_lock are defined in common code. The extern declaration should be in the common header too so that the compiler can type check. allnodes is already in of.h, but devtree_lock should be declared there too.
This patch removes the SPARC declarations and uses decls in of.h instead.
---
arch/sparc/kernel/prom.h | 3 --- include/linux/of.h | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-)
arch/sparc/kernel/prom.h +0 -3
@@ -4,9 +4,6 @@#include <linux/spinlock.h> #include <asm/prom.h> -extern struct device_node *allnodes;/* temporary while merging */ -extern rwlock_t devtree_lock;/* temporary while merging */ -extern void *prom_early_alloc (unsigned long size);extern void irq_trans_init (struct device_node *dp);
include/linux/of.h +2 -0
@@ -19,6 +19,7 @@#include <linux/bitops.h> #include <linux/kref.h> #include <linux/mod_devicetable.h> +#include <linux/spinlock.h> #include <asm/byteorder.h>
@@ -67,6 +68,7 @@ struct device_node {/* Pointer for first entry in chain of all nodes. */ extern struct device_node *allnodes;extern struct device_node *of_chosen; +extern rwlock_t devtree_lock;static inline int of_node_check_flag (struct device_node *n,unsigned long flag) {
Re: [PATCH 8/9] of/sparc: Remove sparc-local declaration of allnodes and devtree_lock
Quoted 8 lines · Grant Likely
Both allnodes and
devtree_lockare defined in common code. The extern declaration should be in the common header too so that the compiler can type check. allnodes is already inof.h, butdevtree_lockshould be declared there too.This patch removes the SPARC declarations and uses decls in
of.hinstead.Signed-off-by Grant Likely <[email protected]>
Quoted 46 lines
---
arch/sparc/kernel/prom.h | 3 --- include/linux/of.h | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-)arch/sparc/kernel/prom.h +0
-3@@ -4,9 +4,6 @@#include <linux/spinlock.h> #include <asm/prom.h> -extern struct device_node *allnodes;/* temporary while merging */ -extern rwlock_t devtree_lock;/* temporary while merging */ -extern void *prom_early_alloc (unsigned long size);extern void irq_trans_init (struct device_node *dp);include/linux/of.h +2
-1@@ -19,6 +19,7 @@#include <linux/bitops.h> #include <linux/kref.h> #include <linux/mod_devicetable.h> +#include <linux/spinlock.h> #include <asm/byteorder.h> @@ -67,6 +68,7 @@ struct device_node {/* Pointer for first entry in chain of all nodes. */ extern struct device_node *allnodes;extern struct device_node *of_chosen; +extern rwlock_t devtree_lock;static inline int of_node_check_flag (struct device_node *n,unsigned long flag) { --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 8/9] of/sparc: Remove sparc-local declaration of allnodes and devtree_lock
In reply to Grant LikelyFrom: Grant Likely <[email protected]>
Date: Sat, 13 Feb 2010 09:03:09 -0700
Quoted 8 lines
Both allnodes and
devtree_lockare defined in common code. The extern declaration should be in the common header too so that the compiler can type check. allnodes is already inof.h, butdevtree_lockshould be declared there too.This patch removes the SPARC declarations and uses decls in
of.hinstead.Signed-off-by Grant Likely <[email protected]>
PATCH 8/9 of/sparc: Remove sparc-local declaration of allnodes and devtree_lock
In reply to Grant LikelyBoth allnodes and devtree_lock are defined in common code. The extern declaration should be in the common header too so that the compiler can type check. allnodes is already in of.h, but devtree_lock should be declared there too.
This patch removes the SPARC declarations and uses decls in of.h instead.
---
arch/sparc/kernel/prom.h | 3 --- include/linux/of.h | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-)
arch/sparc/kernel/prom.h +0 -3
@@ -4,9 +4,6 @@#include <linux/spinlock.h> #include <asm/prom.h> -extern struct device_node *allnodes;/* temporary while merging */ -extern rwlock_t devtree_lock;/* temporary while merging */ -extern void *prom_early_alloc (unsigned long size);extern void irq_trans_init (struct device_node *dp);
include/linux/of.h +2 -0
@@ -19,6 +19,7 @@#include <linux/bitops.h> #include <linux/kref.h> #include <linux/mod_devicetable.h> +#include <linux/spinlock.h> #include <asm/byteorder.h>
@@ -67,6 +68,7 @@ struct device_node {/* Pointer for first entry in chain of all nodes. */ extern struct device_node *allnodes;extern struct device_node *of_chosen; +extern rwlock_t devtree_lock;static inline int of_node_check_flag (struct device_node *n,unsigned long flag) {
PATCH 9/9 of: remove undefined request_OF_resource & release_OF_resource
In reply to Grant LikelyNeither request_OF_resource or release_OF_resource are defined anywhere. Remove the declarations.
---
arch/microblaze/include/asm/prom.h | 4 ---- arch/powerpc/include/asm/prom.h | 5 ----- 2 files changed, 0 insertions(+), 9 deletions(-)
arch/microblaze/include/asm/prom.h +0 -4
@@ -31,10 +31,6 @@/* Other Prototypes */ extern int early_uartlite_console (void ); -extern struct resource *request_OF_resource (struct device_node *node, -int index,const char *name_postfix); -extern int release_OF_resource (struct device_node *node,int index); -/* * OF address retreival & translation */
arch/powerpc/include/asm/prom.h +0 -5
@@ -39,11 +39,6 @@ extern struct device_node* pci_device_to_OF_node(struct pci_dev *);extern void pci_create_OF_bus_map (void );#endif -extern struct resource *request_OF_resource (struct device_node * node, -int index,const char * name_postfix); -extern int release_OF_resource (struct device_node * node,int index); - -/* * OF address retreival & translation */
Re: [PATCH 9/9] of: remove undefined request_OF_resource & release_OF_resource
Quoted 5 lines · Grant Likely
Neither
request_OF_resourceorrelease_OF_resourceare defined anywhere. Remove the declarations.Signed-off-by Grant Likely <grant.likely-s3s/[email protected]>---
Quoted 41 lines
arch/microblaze/include/asm/prom.h | 4 ---- arch/powerpc/include/asm/prom.h | 5 ----- 2 files changed, 0 insertions(+), 9 deletions(-)arch/microblaze/include/asm/prom.h +0
-4@@ -31,10 +31,6 @@/* Other Prototypes */ extern int early_uartlite_console (void ); -extern struct resource *request_OF_resource (struct device_node *node, -int index,const char *name_postfix); -extern int release_OF_resource (struct device_node *node,int index); -/* * OF address retreival & translation */ arch/powerpc/include/asm/prom.h +0
-6@@ -39,11 +39,6 @@ extern struct device_node* pci_device_to_OF_node(struct pci_dev *);extern void pci_create_OF_bus_map (void );#endif -extern struct resource *request_OF_resource (struct device_node * node, -int index,const char * name_postfix); -extern int release_OF_resource (struct device_node * node,int index); - -/* * OF address retreival & translation */ --To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
PATCH 9/9 of: remove undefined request_OF_resource & release_OF_resource
In reply to Grant LikelyNeither request_OF_resource or release_OF_resource are defined anywhere. Remove the declarations.
---
arch/microblaze/include/asm/prom.h | 4 ---- arch/powerpc/include/asm/prom.h | 5 ----- 2 files changed, 0 insertions(+), 9 deletions(-)
arch/microblaze/include/asm/prom.h +0 -4
@@ -31,10 +31,6 @@/* Other Prototypes */ extern int early_uartlite_console (void ); -extern struct resource *request_OF_resource (struct device_node *node, -int index,const char *name_postfix); -extern int release_OF_resource (struct device_node *node,int index); -/* * OF address retreival & translation */
arch/powerpc/include/asm/prom.h +0 -5
@@ -39,11 +39,6 @@ extern struct device_node* pci_device_to_OF_node(struct pci_dev *);extern void pci_create_OF_bus_map (void );#endif -extern struct resource *request_OF_resource (struct device_node * node, -int index,const char * name_postfix); -extern int release_OF_resource (struct device_node * node,int index); - -/* * OF address retreival & translation */
Quoted 7 lines · Grant Likely
Here's another batch of cleanup patches from my test-devicetree branch. A number of cleanups, corrections and minor merges of common code. Also a patch from Jeremy to make the flat tree work on architectures without LMB (arm).
Once I've collected acks on these, I'll move them over to my next-devicetree branch on
git://git.secretlab.ca/git/linux-2.6
All changes look ok. Please add them to linux-next which I am testing. I don't expect any problem with it but anywya if any problems arise, I will let you know.
I don't want to reply every email as Ben that's why one my big ACK for that 9 patches.
Quoted 36 lines
Cheers,
g.---
Grant Likely (6):
of: remove undefinedrequest_OF_resource&release_OF_resourceof/sparc: Remove sparc-local declaration of allnodes anddevtree_lock
of: move definition ofof_choseninto common code.
of: remove unused extern reference todevtree_lock
of: put default string compare and #a/s-cell values into common header
of: Remove old and misplaced function declarationsJeremy Kerr (3):
of/flattree: Don't assumeHAVE_LMB
of: protectlinux/of.hwithCONFIG_OF
proc_devtree: fixTHIS_MODULEwithoutmodule.harch/microblaze/include/asm/prom.h | 15 --------------- arch/microblaze/kernel/prom.c | 8 +++++--- arch/powerpc/include/asm/prom.h | 14 -------------- arch/powerpc/kernel/prom.c | 10 +++++----- arch/sparc/kernel/prom.h | 3 --- drivers/of/base.c | 1 + drivers/of/fdt.c | 9 ++++++--- fs/proc/proc_devtree.c | 1 + include/linux/of.h | 27 +++++++++++++++++++++++++++ include/linux/of_fdt.h | 11 +---------- 10 files changed, 46 insertions(+), 53 deletions(-)--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 4 lines
Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian