bast.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. /*
  2. * Copyright (c) 2003-2004 Simtec Electronics
  3. * Ben Dooks <ben@simtec.co.uk>
  4. *
  5. * BAST - CPLD control constants
  6. * BAST - IRQ Number definitions
  7. * BAST - Memory map definitions
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License version 2 as
  11. * published by the Free Software Foundation.
  12. */
  13. #ifndef __MACH_S3C24XX_BAST_H
  14. #define __MACH_S3C24XX_BAST_H __FILE__
  15. /* CTRL1 - Audio LR routing */
  16. #define BAST_CPLD_CTRL1_LRCOFF (0x00)
  17. #define BAST_CPLD_CTRL1_LRCADC (0x01)
  18. #define BAST_CPLD_CTRL1_LRCDAC (0x02)
  19. #define BAST_CPLD_CTRL1_LRCARM (0x03)
  20. #define BAST_CPLD_CTRL1_LRMASK (0x03)
  21. /* CTRL2 - NAND WP control, IDE Reset assert/check */
  22. #define BAST_CPLD_CTRL2_WNAND (0x04)
  23. #define BAST_CPLD_CTLR2_IDERST (0x08)
  24. /* CTRL3 - rom write control, CPLD identity */
  25. #define BAST_CPLD_CTRL3_IDMASK (0x0e)
  26. #define BAST_CPLD_CTRL3_ROMWEN (0x01)
  27. /* CTRL4 - 8bit LCD interface control/status */
  28. #define BAST_CPLD_CTRL4_LLAT (0x01)
  29. #define BAST_CPLD_CTRL4_LCDRW (0x02)
  30. #define BAST_CPLD_CTRL4_LCDCMD (0x04)
  31. #define BAST_CPLD_CTRL4_LCDE2 (0x01)
  32. /* CTRL5 - DMA routing */
  33. #define BAST_CPLD_DMA0_PRIIDE (0)
  34. #define BAST_CPLD_DMA0_SECIDE (1)
  35. #define BAST_CPLD_DMA0_ISA15 (2)
  36. #define BAST_CPLD_DMA0_ISA36 (3)
  37. #define BAST_CPLD_DMA1_PRIIDE (0 << 2)
  38. #define BAST_CPLD_DMA1_SECIDE (1 << 2)
  39. #define BAST_CPLD_DMA1_ISA15 (2 << 2)
  40. #define BAST_CPLD_DMA1_ISA36 (3 << 2)
  41. /* irq numbers to onboard peripherals */
  42. #define BAST_IRQ_USBOC IRQ_EINT18
  43. #define BAST_IRQ_IDE0 IRQ_EINT16
  44. #define BAST_IRQ_IDE1 IRQ_EINT17
  45. #define BAST_IRQ_PCSERIAL1 IRQ_EINT15
  46. #define BAST_IRQ_PCSERIAL2 IRQ_EINT14
  47. #define BAST_IRQ_PCPARALLEL IRQ_EINT13
  48. #define BAST_IRQ_ASIX IRQ_EINT11
  49. #define BAST_IRQ_DM9000 IRQ_EINT10
  50. #define BAST_IRQ_ISA IRQ_EINT9
  51. #define BAST_IRQ_SMALERT IRQ_EINT8
  52. /* map */
  53. /*
  54. * ok, we've used up to 0x13000000, now we need to find space for the
  55. * peripherals that live in the nGCS[x] areas, which are quite numerous
  56. * in their space. We also have the board's CPLD to find register space
  57. * for.
  58. */
  59. #define BAST_IOADDR(x) (S3C2410_ADDR((x) + 0x01300000))
  60. /* we put the CPLD registers next, to get them out of the way */
  61. #define BAST_VA_CTRL1 BAST_IOADDR(0x00000000)
  62. #define BAST_PA_CTRL1 (S3C2410_CS5 | 0x7800000)
  63. #define BAST_VA_CTRL2 BAST_IOADDR(0x00100000)
  64. #define BAST_PA_CTRL2 (S3C2410_CS1 | 0x6000000)
  65. #define BAST_VA_CTRL3 BAST_IOADDR(0x00200000)
  66. #define BAST_PA_CTRL3 (S3C2410_CS1 | 0x6800000)
  67. #define BAST_VA_CTRL4 BAST_IOADDR(0x00300000)
  68. #define BAST_PA_CTRL4 (S3C2410_CS1 | 0x7000000)
  69. /* next, we have the PC104 ISA interrupt registers */
  70. #define BAST_PA_PC104_IRQREQ (S3C2410_CS5 | 0x6000000)
  71. #define BAST_VA_PC104_IRQREQ BAST_IOADDR(0x00400000)
  72. #define BAST_PA_PC104_IRQRAW (S3C2410_CS5 | 0x6800000)
  73. #define BAST_VA_PC104_IRQRAW BAST_IOADDR(0x00500000)
  74. #define BAST_PA_PC104_IRQMASK (S3C2410_CS5 | 0x7000000)
  75. #define BAST_VA_PC104_IRQMASK BAST_IOADDR(0x00600000)
  76. #define BAST_PA_LCD_RCMD1 (0x8800000)
  77. #define BAST_VA_LCD_RCMD1 BAST_IOADDR(0x00700000)
  78. #define BAST_PA_LCD_WCMD1 (0x8000000)
  79. #define BAST_VA_LCD_WCMD1 BAST_IOADDR(0x00800000)
  80. #define BAST_PA_LCD_RDATA1 (0x9800000)
  81. #define BAST_VA_LCD_RDATA1 BAST_IOADDR(0x00900000)
  82. #define BAST_PA_LCD_WDATA1 (0x9000000)
  83. #define BAST_VA_LCD_WDATA1 BAST_IOADDR(0x00A00000)
  84. #define BAST_PA_LCD_RCMD2 (0xA800000)
  85. #define BAST_VA_LCD_RCMD2 BAST_IOADDR(0x00B00000)
  86. #define BAST_PA_LCD_WCMD2 (0xA000000)
  87. #define BAST_VA_LCD_WCMD2 BAST_IOADDR(0x00C00000)
  88. #define BAST_PA_LCD_RDATA2 (0xB800000)
  89. #define BAST_VA_LCD_RDATA2 BAST_IOADDR(0x00D00000)
  90. #define BAST_PA_LCD_WDATA2 (0xB000000)
  91. #define BAST_VA_LCD_WDATA2 BAST_IOADDR(0x00E00000)
  92. /*
  93. * 0xE0000000 contains the IO space that is split by speed and
  94. * whether the access is for 8 or 16bit IO... this ensures that
  95. * the correct access is made
  96. *
  97. * 0x10000000 of space, partitioned as so:
  98. *
  99. * 0x00000000 to 0x04000000 8bit, slow
  100. * 0x04000000 to 0x08000000 16bit, slow
  101. * 0x08000000 to 0x0C000000 16bit, net
  102. * 0x0C000000 to 0x10000000 16bit, fast
  103. *
  104. * each of these spaces has the following in:
  105. *
  106. * 0x00000000 to 0x01000000 16MB ISA IO space
  107. * 0x01000000 to 0x02000000 16MB ISA memory space
  108. * 0x02000000 to 0x02100000 1MB IDE primary channel
  109. * 0x02100000 to 0x02200000 1MB IDE primary channel aux
  110. * 0x02200000 to 0x02400000 1MB IDE secondary channel
  111. * 0x02300000 to 0x02400000 1MB IDE secondary channel aux
  112. * 0x02400000 to 0x02500000 1MB ASIX ethernet controller
  113. * 0x02500000 to 0x02600000 1MB Davicom DM9000 ethernet controller
  114. * 0x02600000 to 0x02700000 1MB PC SuperIO controller
  115. *
  116. * the phyiscal layout of the zones are:
  117. * nGCS2 - 8bit, slow
  118. * nGCS3 - 16bit, slow
  119. * nGCS4 - 16bit, net
  120. * nGCS5 - 16bit, fast
  121. */
  122. #define BAST_VA_MULTISPACE (0xE0000000)
  123. #define BAST_VA_ISAIO (BAST_VA_MULTISPACE + 0x00000000)
  124. #define BAST_VA_ISAMEM (BAST_VA_MULTISPACE + 0x01000000)
  125. #define BAST_VA_IDEPRI (BAST_VA_MULTISPACE + 0x02000000)
  126. #define BAST_VA_IDEPRIAUX (BAST_VA_MULTISPACE + 0x02100000)
  127. #define BAST_VA_IDESEC (BAST_VA_MULTISPACE + 0x02200000)
  128. #define BAST_VA_IDESECAUX (BAST_VA_MULTISPACE + 0x02300000)
  129. #define BAST_VA_ASIXNET (BAST_VA_MULTISPACE + 0x02400000)
  130. #define BAST_VA_DM9000 (BAST_VA_MULTISPACE + 0x02500000)
  131. #define BAST_VA_SUPERIO (BAST_VA_MULTISPACE + 0x02600000)
  132. #define BAST_VAM_CS2 (0x00000000)
  133. #define BAST_VAM_CS3 (0x04000000)
  134. #define BAST_VAM_CS4 (0x08000000)
  135. #define BAST_VAM_CS5 (0x0C000000)
  136. /* physical offset addresses for the peripherals */
  137. #define BAST_PA_ISAIO (0x00000000)
  138. #define BAST_PA_ASIXNET (0x01000000)
  139. #define BAST_PA_SUPERIO (0x01800000)
  140. #define BAST_PA_IDEPRI (0x02000000)
  141. #define BAST_PA_IDEPRIAUX (0x02800000)
  142. #define BAST_PA_IDESEC (0x03000000)
  143. #define BAST_PA_IDESECAUX (0x03800000)
  144. #define BAST_PA_ISAMEM (0x04000000)
  145. #define BAST_PA_DM9000 (0x05000000)
  146. /* some configurations for the peripherals */
  147. #define BAST_PCSIO (BAST_VA_SUPERIO + BAST_VAM_CS2)
  148. #define BAST_ASIXNET_CS BAST_VAM_CS5
  149. #define BAST_DM9000_CS BAST_VAM_CS4
  150. #define BAST_IDE_CS S3C2410_CS5
  151. #endif /* __MACH_S3C24XX_BAST_H */