x86: Add device tree support
[zen-stable.git] / arch / x86 / kernel / devicetree.c
blob0b8f0daef9333d1db13448ab425c15bf260f1e52
1 /*
2 * Architecture specific OF callbacks.
3 */
4 #include <linux/bootmem.h>
5 #include <linux/io.h>
6 #include <linux/list.h>
7 #include <linux/of.h>
8 #include <linux/of_fdt.h>
9 #include <linux/of_platform.h>
10 #include <linux/slab.h>
12 char __initdata cmd_line[COMMAND_LINE_SIZE];
14 unsigned int irq_create_of_mapping(struct device_node *controller,
15 const u32 *intspec, unsigned int intsize)
17 return intspec[0];
20 EXPORT_SYMBOL_GPL(irq_create_of_mapping);
22 unsigned long pci_address_to_pio(phys_addr_t address)
25 * The ioport address can be directly used by inX / outX
27 BUG_ON(address >= (1 << 16));
28 return (unsigned long)address;
30 EXPORT_SYMBOL_GPL(pci_address_to_pio);
32 void __init early_init_dt_scan_chosen_arch(unsigned long node)
34 BUG();
37 void __init early_init_dt_add_memory_arch(u64 base, u64 size)
39 BUG();
42 void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
44 return __alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS));
47 void __init add_dtb(u64 data)
49 initial_boot_params = phys_to_virt((u64) (u32) data +
50 offsetof(struct setup_data, data));