prom.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * OpenRISC Linux
  3. *
  4. * Linux architectural port borrowing liberally from similar works of
  5. * others. All original copyrights apply as per the original source
  6. * declaration.
  7. *
  8. * OpenRISC implementation:
  9. * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
  10. * et al.
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation; either version 2 of the License, or
  15. * (at your option) any later version.
  16. */
  17. #include <linux/of.h> /* linux/of.h gets to determine #include ordering */
  18. #ifndef _ASM_OPENRISC_PROM_H
  19. #define _ASM_OPENRISC_PROM_H
  20. #ifdef __KERNEL__
  21. #ifndef __ASSEMBLY__
  22. #include <linux/types.h>
  23. #include <asm/irq.h>
  24. #include <linux/irqdomain.h>
  25. #include <linux/atomic.h>
  26. #include <linux/of_irq.h>
  27. #include <linux/of_fdt.h>
  28. #include <linux/of_address.h>
  29. #include <linux/proc_fs.h>
  30. #include <linux/platform_device.h>
  31. #define HAVE_ARCH_DEVTREE_FIXUPS
  32. /* Other Prototypes */
  33. extern int early_uartlite_console(void);
  34. /* Parse the ibm,dma-window property of an OF node into the busno, phys and
  35. * size parameters.
  36. */
  37. void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
  38. unsigned long *busno, unsigned long *phys, unsigned long *size);
  39. extern void kdump_move_device_tree(void);
  40. /* CPU OF node matching */
  41. struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
  42. /* Get the MAC address */
  43. extern const void *of_get_mac_address(struct device_node *np);
  44. /**
  45. * of_irq_map_pci - Resolve the interrupt for a PCI device
  46. * @pdev: the device whose interrupt is to be resolved
  47. * @out_irq: structure of_irq filled by this function
  48. *
  49. * This function resolves the PCI interrupt for a given PCI device. If a
  50. * device-node exists for a given pci_dev, it will use normal OF tree
  51. * walking. If not, it will implement standard swizzling and walk up the
  52. * PCI tree until an device-node is found, at which point it will finish
  53. * resolving using the OF tree walking.
  54. */
  55. struct pci_dev;
  56. extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
  57. #endif /* __ASSEMBLY__ */
  58. #endif /* __KERNEL__ */
  59. #endif /* _ASM_OPENRISC_PROM_H */