prom.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 <linux/atomic.h>
  21. #define HAVE_ARCH_DEVTREE_FIXUPS
  22. /*
  23. * OF address retreival & translation
  24. */
  25. /* Translate a DMA address from device space to CPU space */
  26. extern u64 of_translate_dma_address(struct device_node *dev,
  27. const __be32 *in_addr);
  28. #ifdef CONFIG_PCI
  29. extern unsigned long pci_address_to_pio(phys_addr_t address);
  30. #define pci_address_to_pio pci_address_to_pio
  31. #endif /* CONFIG_PCI */
  32. /* Parse the ibm,dma-window property of an OF node into the busno, phys and
  33. * size parameters.
  34. */
  35. void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
  36. unsigned long *busno, unsigned long *phys, unsigned long *size);
  37. extern void kdump_move_device_tree(void);
  38. /* CPU OF node matching */
  39. struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
  40. /* cache lookup */
  41. struct device_node *of_find_next_cache_node(struct device_node *np);
  42. #ifdef CONFIG_NUMA
  43. extern int of_node_to_nid(struct device_node *device);
  44. #else
  45. static inline int of_node_to_nid(struct device_node *device) { return 0; }
  46. #endif
  47. #define of_node_to_nid of_node_to_nid
  48. extern void of_instantiate_rtc(void);
  49. /* These includes are put at the bottom because they may contain things
  50. * that are overridden by this file. Ideally they shouldn't be included
  51. * by this file, but there are a bunch of .c files that currently depend
  52. * on it. Eventually they will be cleaned up. */
  53. #include <linux/of_fdt.h>
  54. #include <linux/of_address.h>
  55. #include <linux/of_irq.h>
  56. #include <linux/platform_device.h>
  57. #endif /* __KERNEL__ */
  58. #endif /* _POWERPC_PROM_H */