diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2011-02-24 03:52:42 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2011-02-24 07:01:59 -0500 |
commit | 4a66b1d95ad8baf6ab884a1c64461449b463eb78 (patch) | |
tree | 3ae4a1ceb22c69f787bc30f9fa1b9a45b8b29a56 /arch/x86/kernel/devicetree.c | |
parent | 3bcbaf6e08d8d82cde781997bd2c56dda87049b5 (diff) |
x86: dt: Fix OLPC=y/INTEL_CE=n build
Both OLPC and CE4100 activate CONFIG_OF. OLPC uses PROMTREE while CE
uses FLATTREE. Compiling for OLPC only breaks due to missing flat tree
functions and variables.
Use proper wrappers and provide an empty x86_flattree_get_config()
inline so OF=y FLATTREE=n builds and works.
[ tglx: Make it work with HPET_TIMER=n and make a function static ]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/devicetree.c')
-rw-r--r-- | arch/x86/kernel/devicetree.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index 2d65897a39d0..06e5e91939c5 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c | |||
@@ -26,7 +26,7 @@ static DEFINE_RAW_SPINLOCK(big_irq_lock); | |||
26 | 26 | ||
27 | int __initdata of_ioapic; | 27 | int __initdata of_ioapic; |
28 | 28 | ||
29 | void add_interrupt_host(struct irq_domain *ih) | 29 | static void add_interrupt_host(struct irq_domain *ih) |
30 | { | 30 | { |
31 | unsigned long flags; | 31 | unsigned long flags; |
32 | 32 | ||
@@ -115,7 +115,7 @@ static struct of_device_id __initdata ce4100_ids[] = { | |||
115 | 115 | ||
116 | static int __init add_bus_probe(void) | 116 | static int __init add_bus_probe(void) |
117 | { | 117 | { |
118 | if (!initial_boot_params) | 118 | if (!of_have_populated_dt()) |
119 | return 0; | 119 | return 0; |
120 | 120 | ||
121 | return of_platform_bus_probe(NULL, ce4100_ids, NULL); | 121 | return of_platform_bus_probe(NULL, ce4100_ids, NULL); |
@@ -203,6 +203,7 @@ void __cpuinit x86_of_pci_init(void) | |||
203 | 203 | ||
204 | static void __init dtb_setup_hpet(void) | 204 | static void __init dtb_setup_hpet(void) |
205 | { | 205 | { |
206 | #ifdef CONFIG_HPET_TIMER | ||
206 | struct device_node *dn; | 207 | struct device_node *dn; |
207 | struct resource r; | 208 | struct resource r; |
208 | int ret; | 209 | int ret; |
@@ -216,6 +217,7 @@ static void __init dtb_setup_hpet(void) | |||
216 | return; | 217 | return; |
217 | } | 218 | } |
218 | hpet_address = r.start; | 219 | hpet_address = r.start; |
220 | #endif | ||
219 | } | 221 | } |
220 | 222 | ||
221 | static void __init dtb_lapic_setup(void) | 223 | static void __init dtb_lapic_setup(void) |
@@ -288,7 +290,8 @@ void __init x86_dtb_find_config(void) | |||
288 | printk(KERN_ERR "Missing device tree!.\n"); | 290 | printk(KERN_ERR "Missing device tree!.\n"); |
289 | } | 291 | } |
290 | 292 | ||
291 | void __init x86_dtb_get_config(unsigned int unused) | 293 | #ifdef CONFIG_OF_FLATTREE |
294 | static void __init x86_flattree_get_config(void) | ||
292 | { | 295 | { |
293 | u32 size, map_len; | 296 | u32 size, map_len; |
294 | void *new_dtb; | 297 | void *new_dtb; |
@@ -317,6 +320,18 @@ void __init x86_dtb_get_config(unsigned int unused) | |||
317 | of_scan_flat_dt(early_init_dt_scan_root, NULL); | 320 | of_scan_flat_dt(early_init_dt_scan_root, NULL); |
318 | 321 | ||
319 | unflatten_device_tree(); | 322 | unflatten_device_tree(); |
323 | } | ||
324 | #else | ||
325 | static inline void x86_flattree_get_config(void) { } | ||
326 | #endif | ||
327 | |||
328 | void __init x86_dtb_get_config(unsigned int unused) | ||
329 | { | ||
330 | x86_flattree_get_config(); | ||
331 | |||
332 | if (!of_have_populated_dt()) | ||
333 | return; | ||
334 | |||
320 | dtb_setup_hpet(); | 335 | dtb_setup_hpet(); |
321 | dtb_apic_setup(); | 336 | dtb_apic_setup(); |
322 | } | 337 | } |
@@ -413,7 +428,7 @@ void __init x86_add_irq_domains(void) | |||
413 | { | 428 | { |
414 | struct device_node *dp; | 429 | struct device_node *dp; |
415 | 430 | ||
416 | if (!initial_boot_params) | 431 | if (!of_have_populated_dt()) |
417 | return; | 432 | return; |
418 | 433 | ||
419 | for_each_node_with_property(dp, "interrupt-controller") { | 434 | for_each_node_with_property(dp, "interrupt-controller") { |