prom.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * Definitions for talking to the Open Firmware PROM on
  3. * Power Macintosh computers.
  4. *
  5. * Copyright (C) 1996-2005 Paul Mackerras.
  6. *
  7. * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License
  11. * as published by the Free Software Foundation; either version
  12. * 2 of the License, or (at your option) any later version.
  13. */
  14. #include <linux/of.h> /* linux/of.h gets to determine #include ordering */
  15. #ifndef _ASM_MICROBLAZE_PROM_H
  16. #define _ASM_MICROBLAZE_PROM_H
  17. #ifdef __KERNEL__
  18. #ifndef __ASSEMBLY__
  19. #include <linux/types.h>
  20. #include <asm/irq.h>
  21. #include <asm/atomic.h>
  22. #define HAVE_ARCH_DEVTREE_FIXUPS
  23. /* Other Prototypes */
  24. extern int early_uartlite_console(void);
  25. extern int early_uart16550_console(void);
  26. #ifdef CONFIG_PCI
  27. /*
  28. * PCI <-> OF matching functions
  29. * (XXX should these be here?)
  30. */
  31. struct pci_bus;
  32. struct pci_dev;
  33. extern int pci_device_from_OF_node(struct device_node *node,
  34. u8 *bus, u8 *devfn);
  35. extern struct device_node *pci_busdev_to_OF_node(struct pci_bus *bus,
  36. int devfn);
  37. extern struct device_node *pci_device_to_OF_node(struct pci_dev *dev);
  38. extern void pci_create_OF_bus_map(void);
  39. #endif
  40. /*
  41. * OF address retreival & translation
  42. */
  43. #ifdef CONFIG_PCI
  44. extern unsigned long pci_address_to_pio(phys_addr_t address);
  45. #define pci_address_to_pio pci_address_to_pio
  46. #endif /* CONFIG_PCI */
  47. /* Parse the ibm,dma-window property of an OF node into the busno, phys and
  48. * size parameters.
  49. */
  50. void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
  51. unsigned long *busno, unsigned long *phys, unsigned long *size);
  52. extern void kdump_move_device_tree(void);
  53. /* CPU OF node matching */
  54. struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
  55. /**
  56. * of_irq_map_pci - Resolve the interrupt for a PCI device
  57. * @pdev: the device whose interrupt is to be resolved
  58. * @out_irq: structure of_irq filled by this function
  59. *
  60. * This function resolves the PCI interrupt for a given PCI device. If a
  61. * device-node exists for a given pci_dev, it will use normal OF tree
  62. * walking. If not, it will implement standard swizzling and walk up the
  63. * PCI tree until an device-node is found, at which point it will finish
  64. * resolving using the OF tree walking.
  65. */
  66. struct pci_dev;
  67. struct of_irq;
  68. extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
  69. #endif /* __ASSEMBLY__ */
  70. #endif /* __KERNEL__ */
  71. /* These includes are put at the bottom because they may contain things
  72. * that are overridden by this file. Ideally they shouldn't be included
  73. * by this file, but there are a bunch of .c files that currently depend
  74. * on it. Eventually they will be cleaned up. */
  75. #include <linux/of_fdt.h>
  76. #include <linux/of_irq.h>
  77. #include <linux/platform_device.h>
  78. #endif /* _ASM_MICROBLAZE_PROM_H */