ddb5476.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * header file specific for ddb5476
  3. *
  4. * Copyright (C) 2001 MontaVista Software Inc.
  5. * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License as published by the
  9. * Free Software Foundation; either version 2 of the License, or (at your
  10. * option) any later version.
  11. *
  12. */
  13. /*
  14. * Memory map (physical address)
  15. *
  16. * Note most of the following address must be properly aligned by the
  17. * corresponding size. For example, if PCI_IO_SIZE is 16MB, then
  18. * PCI_IO_BASE must be aligned along 16MB boundary.
  19. */
  20. #define DDB_SDRAM_BASE 0x00000000
  21. #define DDB_SDRAM_SIZE 0x04000000 /* 64MB */
  22. #define DDB_DCS3_BASE 0x04000000 /* flash 1 */
  23. #define DDB_DCS3_SIZE 0x01000000 /* 16MB */
  24. #define DDB_DCS2_BASE 0x05000000 /* flash 2 */
  25. #define DDB_DCS2_SIZE 0x01000000 /* 16MB */
  26. #define DDB_PCI_IO_BASE 0x06000000
  27. #define DDB_PCI_IO_SIZE 0x02000000 /* 32 MB */
  28. #define DDB_PCI_MEM_BASE 0x08000000
  29. #define DDB_PCI_MEM_SIZE 0x08000000 /* 128 MB */
  30. #define DDB_DCS5_BASE 0x13000000 /* DDB status regs */
  31. #define DDB_DCS5_SIZE 0x00200000 /* 2MB, 8-bit */
  32. #define DDB_DCS4_BASE 0x14000000 /* DDB control regs */
  33. #define DDB_DCS4_SIZE 0x00200000 /* 2MB, 8-bit */
  34. #define DDB_INTCS_BASE 0x1fa00000 /* VRC5476 control regs */
  35. #define DDB_INTCS_SIZE 0x00200000 /* 2MB */
  36. #define DDB_BOOTCS_BASE 0x1fc00000 /* Boot ROM / EPROM /Flash */
  37. #define DDB_BOOTCS_SIZE 0x00200000 /* 2 MB - doc says 4MB */
  38. /* aliases */
  39. #define DDB_PCI_CONFIG_BASE DDB_PCI_MEM_BASE
  40. #define DDB_PCI_CONFIG_SIZE DDB_PCI_MEM_SIZE
  41. /* PCI intr ack share PCIW0 with PCI IO */
  42. #define DDB_PCI_IACK_BASE DDB_PCI_IO_BASE
  43. /*
  44. * Interrupt mapping
  45. *
  46. * We have three interrupt controllers:
  47. *
  48. * . CPU itself - 8 sources
  49. * . i8259 - 16 sources
  50. * . vrc5476 - 16 sources
  51. *
  52. * They connected as follows:
  53. * all vrc5476 interrupts are routed to cpu IP2 (by software setting)
  54. * all i2869 are routed to INTC in vrc5476 (by hardware connection)
  55. *
  56. * All VRC5476 PCI interrupts are level-triggered (no ack needed).
  57. * All PCI irq but INTC are active low.
  58. */
  59. /*
  60. * irq number block assignment
  61. */
  62. #define NUM_CPU_IRQ 8
  63. #define NUM_I8259_IRQ 16
  64. #define NUM_VRC5476_IRQ 16
  65. #define DDB_IRQ_BASE 0
  66. #define I8259_IRQ_BASE DDB_IRQ_BASE
  67. #define VRC5476_IRQ_BASE (I8259_IRQ_BASE + NUM_I8259_IRQ)
  68. #define CPU_IRQ_BASE (VRC5476_IRQ_BASE + NUM_VRC5476_IRQ)
  69. /*
  70. * vrc5476 irq defs, see page 52-64 of Vrc5074 system controller manual
  71. */
  72. #define VRC5476_IRQ_CPCE 0 /* cpu parity error */
  73. #define VRC5476_IRQ_CNTD 1 /* cpu no target */
  74. #define VRC5476_IRQ_MCE 2 /* memory check error */
  75. #define VRC5476_IRQ_DMA 3 /* DMA */
  76. #define VRC5476_IRQ_UART 4 /* vrc5476 builtin UART, not used */
  77. #define VRC5476_IRQ_WDOG 5 /* watchdog timer */
  78. #define VRC5476_IRQ_GPT 6 /* general purpose timer */
  79. #define VRC5476_IRQ_LBRT 7 /* local bus read timeout */
  80. #define VRC5476_IRQ_INTA 8 /* PCI INT #A */
  81. #define VRC5476_IRQ_INTB 9 /* PCI INT #B */
  82. #define VRC5476_IRQ_INTC 10 /* PCI INT #C */
  83. #define VRC5476_IRQ_INTD 11 /* PCI INT #D */
  84. #define VRC5476_IRQ_INTE 12 /* PCI INT #E */
  85. #define VRC5476_IRQ_RESERVED_13 13 /* reserved */
  86. #define VRC5476_IRQ_PCIS 14 /* PCI SERR # */
  87. #define VRC5476_IRQ_PCI 15 /* PCI internal error */
  88. /*
  89. * i2859 irq assignment
  90. */
  91. #define I8259_IRQ_RESERVED_0 0
  92. #define I8259_IRQ_KEYBOARD 1 /* M1543 default */
  93. #define I8259_IRQ_CASCADE 2
  94. #define I8259_IRQ_UART_B 3 /* M1543 default, may conflict with RTC according to schematic diagram */
  95. #define I8259_IRQ_UART_A 4 /* M1543 default */
  96. #define I8259_IRQ_PARALLEL 5 /* M1543 default */
  97. #define I8259_IRQ_RESERVED_6 6
  98. #define I8259_IRQ_RESERVED_7 7
  99. #define I8259_IRQ_RTC 8 /* who set this? */
  100. #define I8259_IRQ_USB 9 /* ddb_setup */
  101. #define I8259_IRQ_PMU 10 /* ddb_setup */
  102. #define I8259_IRQ_RESERVED_11 11
  103. #define I8259_IRQ_RESERVED_12 12 /* m1543_irq_setup */
  104. #define I8259_IRQ_RESERVED_13 13
  105. #define I8259_IRQ_HDC1 14 /* default and ddb_setup */
  106. #define I8259_IRQ_HDC2 15 /* default */
  107. /*
  108. * misc
  109. */
  110. #define VRC5476_I8259_CASCADE VRC5476_IRQ_INTC
  111. #define CPU_VRC5476_CASCADE 2
  112. #define is_i8259_irq(irq) ((irq) < NUM_I8259_IRQ)
  113. #define nile4_to_irq(n) ((n)+NUM_I8259_IRQ)
  114. #define irq_to_nile4(n) ((n)-NUM_I8259_IRQ)
  115. /*
  116. * low-level irq functions
  117. */
  118. #ifndef __ASSEMBLY__
  119. extern void nile4_map_irq(int nile4_irq, int cpu_irq);
  120. extern void nile4_map_irq_all(int cpu_irq);
  121. extern void nile4_enable_irq(int nile4_irq);
  122. extern void nile4_disable_irq(int nile4_irq);
  123. extern void nile4_disable_irq_all(void);
  124. extern u16 nile4_get_irq_stat(int cpu_irq);
  125. extern void nile4_enable_irq_output(int cpu_irq);
  126. extern void nile4_disable_irq_output(int cpu_irq);
  127. extern void nile4_set_pci_irq_polarity(int pci_irq, int high);
  128. extern void nile4_set_pci_irq_level_or_edge(int pci_irq, int level);
  129. extern void nile4_clear_irq(int nile4_irq);
  130. extern void nile4_clear_irq_mask(u32 mask);
  131. extern u8 nile4_i8259_iack(void);
  132. extern void nile4_dump_irq_status(void); /* Debug */
  133. #endif /* !__ASSEMBLY__ */