anchor.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /****************************************************************************/
  2. /*
  3. * anchor.h -- Anchor CO-MEM Lite PCI host bridge part.
  4. *
  5. * (C) Copyright 2000, Moreton Bay (www.moreton.com.au)
  6. */
  7. /****************************************************************************/
  8. #ifndef anchor_h
  9. #define anchor_h
  10. /****************************************************************************/
  11. /*
  12. * Define basic addressing info.
  13. */
  14. #if defined(CONFIG_M5407C3)
  15. #define COMEM_BASE 0xFFFF0000 /* Base of CO-MEM address space */
  16. #define COMEM_IRQ 25 /* IRQ of anchor part */
  17. #else
  18. #define COMEM_BASE 0x80000000 /* Base of CO-MEM address space */
  19. #define COMEM_IRQ 25 /* IRQ of anchor part */
  20. #endif
  21. /****************************************************************************/
  22. /*
  23. * 4-byte registers of CO-MEM, so adjust register addresses for
  24. * easy access. Handy macro for word access too.
  25. */
  26. #define LREG(a) ((a) >> 2)
  27. #define WREG(a) ((a) >> 1)
  28. /*
  29. * Define base addresses within CO-MEM Lite register address space.
  30. */
  31. #define COMEM_I2O 0x0000 /* I2O registers */
  32. #define COMEM_OPREGS 0x0400 /* Operation registers */
  33. #define COMEM_PCIBUS 0x2000 /* Direct access to PCI bus */
  34. #define COMEM_SHMEM 0x4000 /* Shared memory region */
  35. #define COMEM_SHMEMSIZE 0x4000 /* Size of shared memory */
  36. /*
  37. * Define CO-MEM Registers.
  38. */
  39. #define COMEM_I2OHISR 0x0030 /* I2O host interrupt status */
  40. #define COMEM_I2OHIMR 0x0034 /* I2O host interrupt mask */
  41. #define COMEM_I2OLISR 0x0038 /* I2O local interrupt status */
  42. #define COMEM_I2OLIMR 0x003c /* I2O local interrupt mask */
  43. #define COMEM_IBFPFIFO 0x0040 /* I2O inbound free/post FIFO */
  44. #define COMEM_OBPFFIFO 0x0044 /* I2O outbound post/free FIFO */
  45. #define COMEM_IBPFFIFO 0x0048 /* I2O inbound post/free FIFO */
  46. #define COMEM_OBFPFIFO 0x004c /* I2O outbound free/post FIFO */
  47. #define COMEM_DAHBASE 0x0460 /* Direct access base address */
  48. #define COMEM_NVCMD 0x04a0 /* I2C serial command */
  49. #define COMEM_NVREAD 0x04a4 /* I2C serial read */
  50. #define COMEM_NVSTAT 0x04a8 /* I2C status */
  51. #define COMEM_DMALBASE 0x04b0 /* DMA local base address */
  52. #define COMEM_DMAHBASE 0x04b4 /* DMA host base address */
  53. #define COMEM_DMASIZE 0x04b8 /* DMA size */
  54. #define COMEM_DMACTL 0x04bc /* DMA control */
  55. #define COMEM_HCTL 0x04e0 /* Host control */
  56. #define COMEM_HINT 0x04e4 /* Host interrupt control/status */
  57. #define COMEM_HLDATA 0x04e8 /* Host to local data mailbox */
  58. #define COMEM_LINT 0x04f4 /* Local interrupt contole status */
  59. #define COMEM_LHDATA 0x04f8 /* Local to host data mailbox */
  60. #define COMEM_LBUSCFG 0x04fc /* Local bus configuration */
  61. /*
  62. * Commands and flags for use with Direct Access Register.
  63. */
  64. #define COMEM_DA_IACK 0x00000000 /* Interrupt acknowledge (read) */
  65. #define COMEM_DA_SPCL 0x00000010 /* Special cycle (write) */
  66. #define COMEM_DA_MEMRD 0x00000004 /* Memory read cycle */
  67. #define COMEM_DA_MEMWR 0x00000004 /* Memory write cycle */
  68. #define COMEM_DA_IORD 0x00000002 /* I/O read cycle */
  69. #define COMEM_DA_IOWR 0x00000002 /* I/O write cycle */
  70. #define COMEM_DA_CFGRD 0x00000006 /* Configuration read cycle */
  71. #define COMEM_DA_CFGWR 0x00000006 /* Configuration write cycle */
  72. #define COMEM_DA_ADDR(a) ((a) & 0xffffe000)
  73. #define COMEM_DA_OFFSET(a) ((a) & 0x00001fff)
  74. /*
  75. * The PCI bus will be limited in what slots will actually be used.
  76. * Define valid device numbers for different boards.
  77. */
  78. #if defined(CONFIG_M5407C3)
  79. #define COMEM_MINDEV 14 /* Minimum valid DEVICE */
  80. #define COMEM_MAXDEV 14 /* Maximum valid DEVICE */
  81. #define COMEM_BRIDGEDEV 15 /* Slot bridge is in */
  82. #else
  83. #define COMEM_MINDEV 0 /* Minimum valid DEVICE */
  84. #define COMEM_MAXDEV 3 /* Maximum valid DEVICE */
  85. #endif
  86. #define COMEM_MAXPCI (COMEM_MAXDEV+1) /* Maximum PCI devices */
  87. /****************************************************************************/
  88. #endif /* anchor_h */