Sebastian Andrzej Siewior | da6b737 | 2011-02-22 21:07:37 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Definitions for Device tree / OpenFirmware handling on X86 |
| 3 | * |
| 4 | * based on arch/powerpc/include/asm/prom.h which is |
| 5 | * Copyright (C) 1996-2005 Paul Mackerras. |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License |
| 9 | * as published by the Free Software Foundation; either version |
| 10 | * 2 of the License, or (at your option) any later version. |
| 11 | */ |
| 12 | |
| 13 | #ifndef _ASM_X86_PROM_H |
| 14 | #define _ASM_X86_PROM_H |
| 15 | #ifndef __ASSEMBLY__ |
| 16 | |
| 17 | #include <linux/of.h> |
| 18 | #include <linux/types.h> |
Sebastian Andrzej Siewior | 96e0a07 | 2011-02-22 21:07:42 +0100 | [diff] [blame] | 19 | #include <linux/pci.h> |
Sebastian Andrzej Siewior | da6b737 | 2011-02-22 21:07:37 +0100 | [diff] [blame] | 20 | |
| 21 | #include <asm/irq.h> |
| 22 | #include <asm/atomic.h> |
| 23 | #include <asm/setup.h> |
Sebastian Andrzej Siewior | 19c4f5f | 2011-02-22 21:07:39 +0100 | [diff] [blame] | 24 | #include <asm/irq_controller.h> |
Sebastian Andrzej Siewior | da6b737 | 2011-02-22 21:07:37 +0100 | [diff] [blame] | 25 | |
| 26 | #ifdef CONFIG_OF |
Sebastian Andrzej Siewior | 3879a6f | 2011-02-22 21:07:40 +0100 | [diff] [blame] | 27 | extern int of_ioapic; |
| 28 | extern u64 initial_dtb; |
Sebastian Andrzej Siewior | da6b737 | 2011-02-22 21:07:37 +0100 | [diff] [blame] | 29 | extern void add_dtb(u64 data); |
Sebastian Andrzej Siewior | bcc7c12 | 2011-02-22 21:07:44 +0100 | [diff] [blame] | 30 | extern void x86_add_irq_domains(void); |
Sebastian Andrzej Siewior | 96e0a07 | 2011-02-22 21:07:42 +0100 | [diff] [blame] | 31 | void __cpuinit x86_of_pci_init(void); |
Thomas Gleixner | a906fda | 2011-02-25 16:09:31 +0100 | [diff] [blame^] | 32 | void x86_dtb_init(void); |
Sebastian Andrzej Siewior | 96e0a07 | 2011-02-22 21:07:42 +0100 | [diff] [blame] | 33 | |
| 34 | static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev) |
| 35 | { |
| 36 | return pdev ? pdev->dev.of_node : NULL; |
| 37 | } |
| 38 | |
| 39 | static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus) |
| 40 | { |
| 41 | return pci_device_to_OF_node(bus->self); |
| 42 | } |
| 43 | |
Sebastian Andrzej Siewior | da6b737 | 2011-02-22 21:07:37 +0100 | [diff] [blame] | 44 | #else |
| 45 | static inline void add_dtb(u64 data) { } |
Sebastian Andrzej Siewior | bcc7c12 | 2011-02-22 21:07:44 +0100 | [diff] [blame] | 46 | static inline void x86_add_irq_domains(void) { } |
Sebastian Andrzej Siewior | 96e0a07 | 2011-02-22 21:07:42 +0100 | [diff] [blame] | 47 | static inline void x86_of_pci_init(void) { } |
Thomas Gleixner | a906fda | 2011-02-25 16:09:31 +0100 | [diff] [blame^] | 48 | static inline void x86_dtb_init(void) { } |
Sebastian Andrzej Siewior | 3879a6f | 2011-02-22 21:07:40 +0100 | [diff] [blame] | 49 | #define of_ioapic 0 |
Sebastian Andrzej Siewior | da6b737 | 2011-02-22 21:07:37 +0100 | [diff] [blame] | 50 | #endif |
| 51 | |
| 52 | extern char cmd_line[COMMAND_LINE_SIZE]; |
| 53 | |
| 54 | #define pci_address_to_pio pci_address_to_pio |
| 55 | unsigned long pci_address_to_pio(phys_addr_t addr); |
| 56 | |
| 57 | /** |
| 58 | * irq_dispose_mapping - Unmap an interrupt |
| 59 | * @virq: linux virq number of the interrupt to unmap |
| 60 | * |
| 61 | * FIXME: We really should implement proper virq handling like power, |
| 62 | * but that's going to be major surgery. |
| 63 | */ |
| 64 | static inline void irq_dispose_mapping(unsigned int virq) { } |
| 65 | |
| 66 | #define HAVE_ARCH_DEVTREE_FIXUPS |
| 67 | |
| 68 | #endif /* __ASSEMBLY__ */ |
| 69 | #endif |