prom.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #include <linux/of.h> /* linux/of.h gets to determine #include ordering */
  2. #ifndef _POWERPC_PROM_H
  3. #define _POWERPC_PROM_H
  4. #ifdef __KERNEL__
  5. /*
  6. * Definitions for talking to the Open Firmware PROM on
  7. * Power Macintosh computers.
  8. *
  9. * Copyright (C) 1996-2005 Paul Mackerras.
  10. *
  11. * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
  12. *
  13. * This program is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU General Public License
  15. * as published by the Free Software Foundation; either version
  16. * 2 of the License, or (at your option) any later version.
  17. */
  18. #include <linux/types.h>
  19. #include <asm/irq.h>
  20. #include <asm/atomic.h>
  21. #define HAVE_ARCH_DEVTREE_FIXUPS
  22. #ifdef CONFIG_PPC32
  23. /*
  24. * PCI <-> OF matching functions
  25. * (XXX should these be here?)
  26. */
  27. struct pci_bus;
  28. struct pci_dev;
  29. extern int pci_device_from_OF_node(struct device_node *node,
  30. u8* bus, u8* devfn);
  31. extern struct device_node* pci_busdev_to_OF_node(struct pci_bus *, int);
  32. extern struct device_node* pci_device_to_OF_node(struct pci_dev *);
  33. extern void pci_create_OF_bus_map(void);
  34. #endif
  35. /*
  36. * OF address retreival & translation
  37. */
  38. /* Translate a DMA address from device space to CPU space */
  39. extern u64 of_translate_dma_address(struct device_node *dev,
  40. const __be32 *in_addr);
  41. #ifdef CONFIG_PCI
  42. extern unsigned long pci_address_to_pio(phys_addr_t address);
  43. #define pci_address_to_pio pci_address_to_pio
  44. #endif /* CONFIG_PCI */
  45. /* Parse the ibm,dma-window property of an OF node into the busno, phys and
  46. * size parameters.
  47. */
  48. void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
  49. unsigned long *busno, unsigned long *phys, unsigned long *size);
  50. extern void kdump_move_device_tree(void);
  51. /* CPU OF node matching */
  52. struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
  53. /* cache lookup */
  54. struct device_node *of_find_next_cache_node(struct device_node *np);
  55. #ifdef CONFIG_NUMA
  56. extern int of_node_to_nid(struct device_node *device);
  57. #else
  58. static inline int of_node_to_nid(struct device_node *device) { return 0; }
  59. #endif
  60. #define of_node_to_nid of_node_to_nid
  61. extern void of_instantiate_rtc(void);
  62. /* These includes are put at the bottom because they may contain things
  63. * that are overridden by this file. Ideally they shouldn't be included
  64. * by this file, but there are a bunch of .c files that currently depend
  65. * on it. Eventually they will be cleaned up. */
  66. #include <linux/of_fdt.h>
  67. #include <linux/of_address.h>
  68. #include <linux/of_irq.h>
  69. #include <linux/platform_device.h>
  70. #endif /* __KERNEL__ */
  71. #endif /* _POWERPC_PROM_H */