ebus.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. struct linux_ebus_child {
  15. struct linux_ebus_child *next;
  16. struct linux_ebus_device *parent;
  17. struct linux_ebus *bus;
  18. int prom_node;
  19. char prom_name[64];
  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. int prom_node;
  30. char prom_name[64];
  31. struct resource resource[PROMREG_MAX];
  32. int num_addrs;
  33. unsigned int irqs[PROMINTR_MAX];
  34. int num_irqs;
  35. };
  36. struct linux_ebus {
  37. struct linux_ebus *next;
  38. struct linux_ebus_device *devices;
  39. struct linux_pbm_info *parent;
  40. struct pci_dev *self;
  41. int prom_node;
  42. char prom_name[64];
  43. struct linux_prom_ebus_ranges ebus_ranges[PROMREG_MAX];
  44. int num_ebus_ranges;
  45. };
  46. struct linux_ebus_dma {
  47. unsigned int dcsr;
  48. unsigned int dacr;
  49. unsigned int dbcr;
  50. };
  51. #define EBUS_DCSR_INT_PEND 0x00000001
  52. #define EBUS_DCSR_ERR_PEND 0x00000002
  53. #define EBUS_DCSR_DRAIN 0x00000004
  54. #define EBUS_DCSR_INT_EN 0x00000010
  55. #define EBUS_DCSR_RESET 0x00000080
  56. #define EBUS_DCSR_WRITE 0x00000100
  57. #define EBUS_DCSR_EN_DMA 0x00000200
  58. #define EBUS_DCSR_CYC_PEND 0x00000400
  59. #define EBUS_DCSR_DIAG_RD_DONE 0x00000800
  60. #define EBUS_DCSR_DIAG_WR_DONE 0x00001000
  61. #define EBUS_DCSR_EN_CNT 0x00002000
  62. #define EBUS_DCSR_TC 0x00004000
  63. #define EBUS_DCSR_DIS_CSR_DRN 0x00010000
  64. #define EBUS_DCSR_BURST_SZ_MASK 0x000c0000
  65. #define EBUS_DCSR_BURST_SZ_1 0x00080000
  66. #define EBUS_DCSR_BURST_SZ_4 0x00000000
  67. #define EBUS_DCSR_BURST_SZ_8 0x00040000
  68. #define EBUS_DCSR_BURST_SZ_16 0x000c0000
  69. #define EBUS_DCSR_DIAG_EN 0x00100000
  70. #define EBUS_DCSR_DIS_ERR_PEND 0x00400000
  71. #define EBUS_DCSR_TCI_DIS 0x00800000
  72. #define EBUS_DCSR_EN_NEXT 0x01000000
  73. #define EBUS_DCSR_DMA_ON 0x02000000
  74. #define EBUS_DCSR_A_LOADED 0x04000000
  75. #define EBUS_DCSR_NA_LOADED 0x08000000
  76. #define EBUS_DCSR_DEV_ID_MASK 0xf0000000
  77. extern struct linux_ebus *ebus_chain;
  78. extern void ebus_init(void);
  79. #define for_each_ebus(bus) \
  80. for((bus) = ebus_chain; (bus); (bus) = (bus)->next)
  81. #define for_each_ebusdev(dev, bus) \
  82. for((dev) = (bus)->devices; (dev); (dev) = (dev)->next)
  83. #define for_each_edevchild(dev, child) \
  84. for((child) = (dev)->children; (child); (child) = (child)->next)
  85. #endif /* !(__SPARC_EBUS_H) */