trizeps4.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /************************************************************************
  3. * Include file for TRIZEPS4 SoM and ConXS eval-board
  4. * Copyright (c) Jürgen Schindele
  5. * 2006
  6. ************************************************************************/
  7. /*
  8. * Includes/Defines
  9. */
  10. #ifndef _TRIPEPS4_H_
  11. #define _TRIPEPS4_H_
  12. #include "irqs.h" /* PXA_GPIO_TO_IRQ */
  13. /* physical memory regions */
  14. #define TRIZEPS4_FLASH_PHYS (PXA_CS0_PHYS) /* Flash region */
  15. #define TRIZEPS4_DISK_PHYS (PXA_CS1_PHYS) /* Disk On Chip region */
  16. #define TRIZEPS4_ETH_PHYS (PXA_CS2_PHYS) /* Ethernet DM9000 region */
  17. #define TRIZEPS4_PIC_PHYS (PXA_CS3_PHYS) /* Logic chip on ConXS-Board */
  18. #define TRIZEPS4_SDRAM_BASE 0xa0000000 /* SDRAM region */
  19. /* Logic on ConXS-board CSFR register*/
  20. #define TRIZEPS4_CFSR_PHYS (PXA_CS3_PHYS)
  21. /* Logic on ConXS-board BOCR register*/
  22. #define TRIZEPS4_BOCR_PHYS (PXA_CS3_PHYS+0x02000000)
  23. /* Logic on ConXS-board IRCR register*/
  24. #define TRIZEPS4_IRCR_PHYS (PXA_CS3_PHYS+0x02400000)
  25. /* Logic on ConXS-board UPSR register*/
  26. #define TRIZEPS4_UPSR_PHYS (PXA_CS3_PHYS+0x02800000)
  27. /* Logic on ConXS-board DICR register*/
  28. #define TRIZEPS4_DICR_PHYS (PXA_CS3_PHYS+0x03800000)
  29. /* virtual memory regions */
  30. #define TRIZEPS4_DISK_VIRT 0xF0000000 /* Disk On Chip region */
  31. #define TRIZEPS4_PIC_VIRT 0xF0100000 /* not used */
  32. #define TRIZEPS4_CFSR_VIRT 0xF0100000
  33. #define TRIZEPS4_BOCR_VIRT 0xF0200000
  34. #define TRIZEPS4_DICR_VIRT 0xF0300000
  35. #define TRIZEPS4_IRCR_VIRT 0xF0400000
  36. #define TRIZEPS4_UPSR_VIRT 0xF0500000
  37. /* size of flash */
  38. #define TRIZEPS4_FLASH_SIZE 0x02000000 /* Flash size 32 MB */
  39. /* Ethernet Controller Davicom DM9000 */
  40. #define GPIO_DM9000 101
  41. #define TRIZEPS4_ETH_IRQ PXA_GPIO_TO_IRQ(GPIO_DM9000)
  42. /* UCB1400 audio / TS-controller */
  43. #define GPIO_UCB1400 1
  44. #define TRIZEPS4_UCB1400_IRQ PXA_GPIO_TO_IRQ(GPIO_UCB1400)
  45. /* PCMCIA socket Compact Flash */
  46. #define GPIO_PCD 11 /* PCMCIA Card Detect */
  47. #define TRIZEPS4_CD_IRQ PXA_GPIO_TO_IRQ(GPIO_PCD)
  48. #define GPIO_PRDY 13 /* READY / nINT */
  49. #define TRIZEPS4_READY_NINT PXA_GPIO_TO_IRQ(GPIO_PRDY)
  50. /* MMC socket */
  51. #define GPIO_MMC_DET 12
  52. #define TRIZEPS4_MMC_IRQ PXA_GPIO_TO_IRQ(GPIO_MMC_DET)
  53. /* DOC NAND chip */
  54. #define GPIO_DOC_LOCK 94
  55. #define GPIO_DOC_IRQ 93
  56. #define TRIZEPS4_DOC_IRQ PXA_GPIO_TO_IRQ(GPIO_DOC_IRQ)
  57. /* SPI interface */
  58. #define GPIO_SPI 53
  59. #define TRIZEPS4_SPI_IRQ PXA_GPIO_TO_IRQ(GPIO_SPI)
  60. /* LEDS using tx2 / rx2 */
  61. #define GPIO_SYS_BUSY_LED 46
  62. #define GPIO_HEARTBEAT_LED 47
  63. /* Off-module PIC on ConXS board */
  64. #define GPIO_PIC 0
  65. #define TRIZEPS4_PIC_IRQ PXA_GPIO_TO_IRQ(GPIO_PIC)
  66. #ifdef CONFIG_MACH_TRIZEPS_CONXS
  67. /* for CONXS base board define these registers */
  68. #define CFSR_P2V(x) ((x) - TRIZEPS4_CFSR_PHYS + TRIZEPS4_CFSR_VIRT)
  69. #define CFSR_V2P(x) ((x) - TRIZEPS4_CFSR_VIRT + TRIZEPS4_CFSR_PHYS)
  70. #define BCR_P2V(x) ((x) - TRIZEPS4_BOCR_PHYS + TRIZEPS4_BOCR_VIRT)
  71. #define BCR_V2P(x) ((x) - TRIZEPS4_BOCR_VIRT + TRIZEPS4_BOCR_PHYS)
  72. #define DCR_P2V(x) ((x) - TRIZEPS4_DICR_PHYS + TRIZEPS4_DICR_VIRT)
  73. #define DCR_V2P(x) ((x) - TRIZEPS4_DICR_VIRT + TRIZEPS4_DICR_PHYS)
  74. #define IRCR_P2V(x) ((x) - TRIZEPS4_IRCR_PHYS + TRIZEPS4_IRCR_VIRT)
  75. #define IRCR_V2P(x) ((x) - TRIZEPS4_IRCR_VIRT + TRIZEPS4_IRCR_PHYS)
  76. #ifndef __ASSEMBLY__
  77. static inline unsigned short CFSR_readw(void)
  78. {
  79. /* [Compact Flash Status Register] is read only */
  80. return *((unsigned short *)CFSR_P2V(0x0C000000));
  81. }
  82. static inline void BCR_writew(unsigned short value)
  83. {
  84. /* [Board Control Regsiter] is write only */
  85. *((unsigned short *)BCR_P2V(0x0E000000)) = value;
  86. }
  87. static inline void DCR_writew(unsigned short value)
  88. {
  89. /* [Display Control Register] is write only */
  90. *((unsigned short *)DCR_P2V(0x0E000000)) = value;
  91. }
  92. static inline void IRCR_writew(unsigned short value)
  93. {
  94. /* [InfraRed data Control Register] is write only */
  95. *((unsigned short *)IRCR_P2V(0x0E000000)) = value;
  96. }
  97. #else
  98. #define ConXS_CFSR CFSR_P2V(0x0C000000)
  99. #define ConXS_BCR BCR_P2V(0x0E000000)
  100. #define ConXS_DCR DCR_P2V(0x0F800000)
  101. #define ConXS_IRCR IRCR_P2V(0x0F800000)
  102. #endif
  103. #else
  104. /* for whatever baseboard define function registers */
  105. static inline unsigned short CFSR_readw(void)
  106. {
  107. return 0;
  108. }
  109. static inline void BCR_writew(unsigned short value)
  110. {
  111. ;
  112. }
  113. static inline void DCR_writew(unsigned short value)
  114. {
  115. ;
  116. }
  117. static inline void IRCR_writew(unsigned short value)
  118. {
  119. ;
  120. }
  121. #endif /* CONFIG_MACH_TRIZEPS_CONXS */
  122. #define ConXS_CFSR_BVD_MASK 0x0003
  123. #define ConXS_CFSR_BVD1 (1 << 0)
  124. #define ConXS_CFSR_BVD2 (1 << 1)
  125. #define ConXS_CFSR_VS_MASK 0x000C
  126. #define ConXS_CFSR_VS1 (1 << 2)
  127. #define ConXS_CFSR_VS2 (1 << 3)
  128. #define ConXS_CFSR_VS_5V (0x3 << 2)
  129. #define ConXS_CFSR_VS_3V3 0x0
  130. #define ConXS_BCR_S0_POW_EN0 (1 << 0)
  131. #define ConXS_BCR_S0_POW_EN1 (1 << 1)
  132. #define ConXS_BCR_L_DISP (1 << 4)
  133. #define ConXS_BCR_CF_BUF_EN (1 << 5)
  134. #define ConXS_BCR_CF_RESET (1 << 7)
  135. #define ConXS_BCR_S0_VCC_3V3 0x1
  136. #define ConXS_BCR_S0_VCC_5V0 0x2
  137. #define ConXS_BCR_S0_VPP_12V 0x4
  138. #define ConXS_BCR_S0_VPP_3V3 0x8
  139. #define ConXS_IRCR_MODE (1 << 0)
  140. #define ConXS_IRCR_SD (1 << 1)
  141. #endif /* _TRIPEPS4_H_ */