prom.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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/atomic.h>
  25. #include <linux/of_irq.h>
  26. #include <linux/of_fdt.h>
  27. #include <linux/of_address.h>
  28. #include <linux/proc_fs.h>
  29. #include <linux/platform_device.h>
  30. #define HAVE_ARCH_DEVTREE_FIXUPS
  31. /* Other Prototypes */
  32. extern int early_uartlite_console(void);
  33. /* Parse the ibm,dma-window property of an OF node into the busno, phys and
  34. * size parameters.
  35. */
  36. void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
  37. unsigned long *busno, unsigned long *phys, unsigned long *size);
  38. extern void kdump_move_device_tree(void);
  39. /* CPU OF node matching */
  40. struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
  41. /* Get the MAC address */
  42. extern const void *of_get_mac_address(struct device_node *np);
  43. /**
  44. * of_irq_map_pci - Resolve the interrupt for a PCI device
  45. * @pdev: the device whose interrupt is to be resolved
  46. * @out_irq: structure of_irq filled by this function
  47. *
  48. * This function resolves the PCI interrupt for a given PCI device. If a
  49. * device-node exists for a given pci_dev, it will use normal OF tree
  50. * walking. If not, it will implement standard swizzling and walk up the
  51. * PCI tree until an device-node is found, at which point it will finish
  52. * resolving using the OF tree walking.
  53. */
  54. struct pci_dev;
  55. extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
  56. /* This routine is here to provide compatibility with how powerpc
  57. * handles IRQ mapping for OF device nodes. We precompute and permanently
  58. * register them in the platform_device objects, whereas powerpc computes them
  59. * on request.
  60. */
  61. static inline void irq_dispose_mapping(unsigned int virq)
  62. {
  63. }
  64. #endif /* __ASSEMBLY__ */
  65. #endif /* __KERNEL__ */
  66. #endif /* _ASM_OPENRISC_PROM_H */