Commit e6ce1324e4f08b0d984340201a125806dae0e9a6

Authored by Stephen Neuendorffer
Committed by Grant Likely
1 parent 55271024a7

of/flattree: Add Kconfig for EARLY_FLATTREE

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>

Showing 5 changed files with 11 additions and 3 deletions Side-by-side Diff

arch/microblaze/Kconfig
... ... @@ -14,7 +14,7 @@
14 14 select HAVE_DMA_API_DEBUG
15 15 select TRACING_SUPPORT
16 16 select OF
17   - select OF_FLATTREE
  17 + select OF_EARLY_FLATTREE
18 18  
19 19 config SWAP
20 20 def_bool n
... ... @@ -2218,7 +2218,7 @@
2218 2218 config USE_OF
2219 2219 bool "Flattened Device Tree support"
2220 2220 select OF
2221   - select OF_FLATTREE
  2221 + select OF_EARLY_FLATTREE
2222 2222 help
2223 2223 Include support for flattened device tree machine descriptions.
2224 2224  
arch/powerpc/Kconfig
... ... @@ -116,7 +116,7 @@
116 116 bool
117 117 default y
118 118 select OF
119   - select OF_FLATTREE
  119 + select OF_EARLY_FLATTREE
120 120 select HAVE_FTRACE_MCOUNT_RECORD
121 121 select HAVE_DYNAMIC_FTRACE
122 122 select HAVE_FUNCTION_TRACER
... ... @@ -19,6 +19,10 @@
19 19 bool
20 20 select DTC
21 21  
  22 +config OF_EARLY_FLATTREE
  23 + bool
  24 + select OF_FLATTREE
  25 +
22 26 config OF_PROMTREE
23 27 bool
24 28  
... ... @@ -27,6 +27,8 @@
27 27  
28 28 struct boot_param_header *initial_boot_params;
29 29  
  30 +#ifdef CONFIG_OF_EARLY_FLATTREE
  31 +
30 32 char *find_flat_dt_string(u32 offset)
31 33 {
32 34 return ((char *)initial_boot_params) +
... ... @@ -604,4 +606,6 @@
604 606  
605 607 pr_debug(" <- unflatten_device_tree()\n");
606 608 }
  609 +
  610 +#endif /* CONFIG_OF_EARLY_FLATTREE */