prom.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. /* The of_drconf_cell struct defines the layout of the LMB array
  50. * specified in the device tree property
  51. * ibm,dynamic-reconfiguration-memory/ibm,dynamic-memory
  52. */
  53. struct of_drconf_cell {
  54. u64 base_addr;
  55. u32 drc_index;
  56. u32 reserved;
  57. u32 aa_index;
  58. u32 flags;
  59. };
  60. #define DRCONF_MEM_ASSIGNED 0x00000008
  61. #define DRCONF_MEM_AI_INVALID 0x00000040
  62. #define DRCONF_MEM_RESERVED 0x00000080
  63. /* These includes are put at the bottom because they may contain things
  64. * that are overridden by this file. Ideally they shouldn't be included
  65. * by this file, but there are a bunch of .c files that currently depend
  66. * on it. Eventually they will be cleaned up. */
  67. #include <linux/of_fdt.h>
  68. #include <linux/of_address.h>
  69. #include <linux/of_irq.h>
  70. #include <linux/platform_device.h>
  71. #endif /* __KERNEL__ */
  72. #endif /* _POWERPC_PROM_H */