prom.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. #ifndef _ASM_X86_PROM_H
  13. #define _ASM_X86_PROM_H
  14. #ifndef __ASSEMBLY__
  15. #include <linux/of.h>
  16. #include <linux/types.h>
  17. #include <linux/pci.h>
  18. #include <asm/irq.h>
  19. #include <asm/atomic.h>
  20. #include <asm/setup.h>
  21. #include <asm/irq_controller.h>
  22. #ifdef CONFIG_OF
  23. extern int of_ioapic;
  24. extern u64 initial_dtb;
  25. extern void add_dtb(u64 data);
  26. extern void x86_add_irq_domains(void);
  27. void __cpuinit x86_of_pci_init(void);
  28. void x86_dtb_init(void);
  29. static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
  30. {
  31. return pdev ? pdev->dev.of_node : NULL;
  32. }
  33. static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
  34. {
  35. return pci_device_to_OF_node(bus->self);
  36. }
  37. #else
  38. static inline void add_dtb(u64 data) { }
  39. static inline void x86_add_irq_domains(void) { }
  40. static inline void x86_of_pci_init(void) { }
  41. static inline void x86_dtb_init(void) { }
  42. #define of_ioapic 0
  43. #endif
  44. extern char cmd_line[COMMAND_LINE_SIZE];
  45. #define pci_address_to_pio pci_address_to_pio
  46. unsigned long pci_address_to_pio(phys_addr_t addr);
  47. /**
  48. * irq_dispose_mapping - Unmap an interrupt
  49. * @virq: linux virq number of the interrupt to unmap
  50. *
  51. * FIXME: We really should implement proper virq handling like power,
  52. * but that's going to be major surgery.
  53. */
  54. static inline void irq_dispose_mapping(unsigned int virq) { }
  55. #define HAVE_ARCH_DEVTREE_FIXUPS
  56. #endif /* __ASSEMBLY__ */
  57. #endif