ebus.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* $Id: ebus.h,v 1.2 1999/09/11 23:05:55 zaitcev Exp $
  2. * ebus.h: PCI to Ebus pseudo driver software state.
  3. *
  4. * Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
  5. *
  6. * Adopted for sparc by V. Roganov and G. Raiko.
  7. */
  8. #ifndef __SPARC_EBUS_H
  9. #define __SPARC_EBUS_H
  10. #ifndef _LINUX_IOPORT_H
  11. #include <linux/ioport.h>
  12. #endif
  13. #include <asm/oplib.h>
  14. #include <asm/prom.h>
  15. struct linux_ebus_child {
  16. struct linux_ebus_child *next;
  17. struct linux_ebus_device *parent;
  18. struct linux_ebus *bus;
  19. struct device_node *prom_node;
  20. struct resource resource[PROMREG_MAX];
  21. int num_addrs;
  22. unsigned int irqs[PROMINTR_MAX];
  23. int num_irqs;
  24. };
  25. struct linux_ebus_device {
  26. struct linux_ebus_device *next;
  27. struct linux_ebus_child *children;
  28. struct linux_ebus *bus;
  29. struct device_node *prom_node;
  30. struct resource resource[PROMREG_MAX];
  31. int num_addrs;
  32. unsigned int irqs[PROMINTR_MAX];
  33. int num_irqs;
  34. };
  35. struct linux_ebus {
  36. struct linux_ebus *next;
  37. struct linux_ebus_device *devices;
  38. struct linux_pbm_info *parent;
  39. struct pci_dev *self;
  40. struct device_node *prom_node;
  41. };
  42. struct linux_ebus_dma {
  43. unsigned int dcsr;
  44. unsigned int dacr;
  45. unsigned int dbcr;
  46. };
  47. #define EBUS_DCSR_INT_PEND 0x00000001
  48. #define EBUS_DCSR_ERR_PEND 0x00000002
  49. #define EBUS_DCSR_DRAIN 0x00000004
  50. #define EBUS_DCSR_INT_EN 0x00000010
  51. #define EBUS_DCSR_RESET 0x00000080
  52. #define EBUS_DCSR_WRITE 0x00000100
  53. #define EBUS_DCSR_EN_DMA 0x00000200
  54. #define EBUS_DCSR_CYC_PEND 0x00000400
  55. #define EBUS_DCSR_DIAG_RD_DONE 0x00000800
  56. #define EBUS_DCSR_DIAG_WR_DONE 0x00001000
  57. #define EBUS_DCSR_EN_CNT 0x00002000
  58. #define EBUS_DCSR_TC 0x00004000
  59. #define EBUS_DCSR_DIS_CSR_DRN 0x00010000
  60. #define EBUS_DCSR_BURST_SZ_MASK 0x000c0000
  61. #define EBUS_DCSR_BURST_SZ_1 0x00080000
  62. #define EBUS_DCSR_BURST_SZ_4 0x00000000
  63. #define EBUS_DCSR_BURST_SZ_8 0x00040000
  64. #define EBUS_DCSR_BURST_SZ_16 0x000c0000
  65. #define EBUS_DCSR_DIAG_EN 0x00100000
  66. #define EBUS_DCSR_DIS_ERR_PEND 0x00400000
  67. #define EBUS_DCSR_TCI_DIS 0x00800000
  68. #define EBUS_DCSR_EN_NEXT 0x01000000
  69. #define EBUS_DCSR_DMA_ON 0x02000000
  70. #define EBUS_DCSR_A_LOADED 0x04000000
  71. #define EBUS_DCSR_NA_LOADED 0x08000000
  72. #define EBUS_DCSR_DEV_ID_MASK 0xf0000000
  73. extern struct linux_ebus *ebus_chain;
  74. extern void ebus_init(void);
  75. #define for_each_ebus(bus) \
  76. for((bus) = ebus_chain; (bus); (bus) = (bus)->next)
  77. #define for_each_ebusdev(dev, bus) \
  78. for((dev) = (bus)->devices; (dev); (dev) = (dev)->next)
  79. #define for_each_edevchild(dev, child) \
  80. for((child) = (dev)->children; (child); (child) = (child)->next)
  81. #endif /* !(__SPARC_EBUS_H) */