Commit 4a66b1d9 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Thomas Gleixner

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: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 3bcbaf6e
...@@ -30,7 +30,6 @@ extern void add_dtb(u64 data); ...@@ -30,7 +30,6 @@ extern void add_dtb(u64 data);
extern void x86_add_irq_domains(void); extern void x86_add_irq_domains(void);
void x86_dtb_find_config(void); void x86_dtb_find_config(void);
void x86_dtb_get_config(unsigned int unused); void x86_dtb_get_config(unsigned int unused);
void add_interrupt_host(struct irq_domain *ih);
void __cpuinit x86_of_pci_init(void); void __cpuinit x86_of_pci_init(void);
static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
......
...@@ -26,7 +26,7 @@ static DEFINE_RAW_SPINLOCK(big_irq_lock); ...@@ -26,7 +26,7 @@ static DEFINE_RAW_SPINLOCK(big_irq_lock);
int __initdata of_ioapic; int __initdata of_ioapic;
void add_interrupt_host(struct irq_domain *ih) static void add_interrupt_host(struct irq_domain *ih)
{ {
unsigned long flags; unsigned long flags;
...@@ -115,7 +115,7 @@ static struct of_device_id __initdata ce4100_ids[] = { ...@@ -115,7 +115,7 @@ static struct of_device_id __initdata ce4100_ids[] = {
static int __init add_bus_probe(void) static int __init add_bus_probe(void)
{ {
if (!initial_boot_params) if (!of_have_populated_dt())
return 0; return 0;
return of_platform_bus_probe(NULL, ce4100_ids, NULL); return of_platform_bus_probe(NULL, ce4100_ids, NULL);
...@@ -203,6 +203,7 @@ void __cpuinit x86_of_pci_init(void) ...@@ -203,6 +203,7 @@ void __cpuinit x86_of_pci_init(void)
static void __init dtb_setup_hpet(void) static void __init dtb_setup_hpet(void)
{ {
#ifdef CONFIG_HPET_TIMER
struct device_node *dn; struct device_node *dn;
struct resource r; struct resource r;
int ret; int ret;
...@@ -216,6 +217,7 @@ static void __init dtb_setup_hpet(void) ...@@ -216,6 +217,7 @@ static void __init dtb_setup_hpet(void)
return; return;
} }
hpet_address = r.start; hpet_address = r.start;
#endif
} }
static void __init dtb_lapic_setup(void) static void __init dtb_lapic_setup(void)
...@@ -288,7 +290,8 @@ void __init x86_dtb_find_config(void) ...@@ -288,7 +290,8 @@ void __init x86_dtb_find_config(void)
printk(KERN_ERR "Missing device tree!.\n"); printk(KERN_ERR "Missing device tree!.\n");
} }
void __init x86_dtb_get_config(unsigned int unused) #ifdef CONFIG_OF_FLATTREE
static void __init x86_flattree_get_config(void)
{ {
u32 size, map_len; u32 size, map_len;
void *new_dtb; void *new_dtb;
...@@ -317,6 +320,18 @@ void __init x86_dtb_get_config(unsigned int unused) ...@@ -317,6 +320,18 @@ void __init x86_dtb_get_config(unsigned int unused)
of_scan_flat_dt(early_init_dt_scan_root, NULL); of_scan_flat_dt(early_init_dt_scan_root, NULL);
unflatten_device_tree(); unflatten_device_tree();
}
#else
static inline void x86_flattree_get_config(void) { }
#endif
void __init x86_dtb_get_config(unsigned int unused)
{
x86_flattree_get_config();
if (!of_have_populated_dt())
return;
dtb_setup_hpet(); dtb_setup_hpet();
dtb_apic_setup(); dtb_apic_setup();
} }
...@@ -413,7 +428,7 @@ void __init x86_add_irq_domains(void) ...@@ -413,7 +428,7 @@ void __init x86_add_irq_domains(void)
{ {
struct device_node *dp; struct device_node *dp;
if (!initial_boot_params) if (!of_have_populated_dt())
return; return;
for_each_node_with_property(dp, "interrupt-controller") { for_each_node_with_property(dp, "interrupt-controller") {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment