Skip to content

Commit

Permalink
of/flattree: Add Kconfig for EARLY_FLATTREE
Browse files Browse the repository at this point in the history
The device tree code is now in two pieces: some which can be used generically
on any platform which selects CONFIG_OF_FLATTREE, and some early which is used
at boot time on only a few architectures.  This patch segregates the early
code so that only those architectures which care about it need compile it.
This also means that some of the requirements in the early code (such as
a cmd_line variable) that most architectures (e.g. X86) don't provide
can be ignored.

Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
[grant.likely@secretlab.ca: remove extra blank line addition]
[grant.likely@secretlab.ca: fixed incorrect #ifdef CONFIG_EARLY_FLATTREE check]
[grant.likely@secretlab.ca: Made OF_EARLY_FLATTREE select instead of depend
                            on OF_FLATTREE]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
  • Loading branch information
Stephen Neuendorffer authored and Grant Likely committed Dec 29, 2010
1 parent 5527102 commit e6ce132
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arch/microblaze/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ config MICROBLAZE
select HAVE_DMA_API_DEBUG
select TRACING_SUPPORT
select OF
select OF_FLATTREE
select OF_EARLY_FLATTREE

config SWAP
def_bool n
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2218,7 +2218,7 @@ config SECCOMP
config USE_OF
bool "Flattened Device Tree support"
select OF
select OF_FLATTREE
select OF_EARLY_FLATTREE
help
Include support for flattened device tree machine descriptions.

Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ config PPC
bool
default y
select OF
select OF_FLATTREE
select OF_EARLY_FLATTREE
select HAVE_FTRACE_MCOUNT_RECORD
select HAVE_DYNAMIC_FTRACE
select HAVE_FUNCTION_TRACER
Expand Down
4 changes: 4 additions & 0 deletions drivers/of/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ config OF_FLATTREE
bool
select DTC

config OF_EARLY_FLATTREE
bool
select OF_FLATTREE

config OF_PROMTREE
bool

Expand Down
4 changes: 4 additions & 0 deletions drivers/of/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ int __initdata dt_root_size_cells;

struct boot_param_header *initial_boot_params;

#ifdef CONFIG_OF_EARLY_FLATTREE

char *find_flat_dt_string(u32 offset)
{
return ((char *)initial_boot_params) +
Expand Down Expand Up @@ -604,3 +606,5 @@ void __init unflatten_device_tree(void)

pr_debug(" <- unflatten_device_tree()\n");
}

#endif /* CONFIG_OF_EARLY_FLATTREE */

0 comments on commit e6ce132

Please sign in to comment.