balloon3.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * linux/include/asm-arm/arch-pxa/balloon3.h
  4. *
  5. * Authors: Nick Bane and Wookey
  6. * Created: Oct, 2005
  7. * Copyright: Toby Churchill Ltd
  8. * Cribbed from mainstone.c, by Nicholas Pitre
  9. */
  10. #ifndef ASM_ARCH_BALLOON3_H
  11. #define ASM_ARCH_BALLOON3_H
  12. #include "irqs.h" /* PXA_NR_BUILTIN_GPIO */
  13. enum balloon3_features {
  14. BALLOON3_FEATURE_OHCI,
  15. BALLOON3_FEATURE_MMC,
  16. BALLOON3_FEATURE_CF,
  17. BALLOON3_FEATURE_AUDIO,
  18. BALLOON3_FEATURE_TOPPOLY,
  19. };
  20. #define BALLOON3_FPGA_PHYS PXA_CS4_PHYS
  21. #define BALLOON3_FPGA_VIRT IOMEM(0xf1000000) /* as per balloon2 */
  22. #define BALLOON3_FPGA_LENGTH 0x01000000
  23. #define BALLOON3_FPGA_SETnCLR (0x1000)
  24. /* FPGA / CPLD registers for CF socket */
  25. #define BALLOON3_CF_STATUS_REG (BALLOON3_FPGA_VIRT + 0x00e00008)
  26. #define BALLOON3_CF_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00008)
  27. /* FPGA / CPLD version register */
  28. #define BALLOON3_FPGA_VER (BALLOON3_FPGA_VIRT + 0x00e0001c)
  29. /* FPGA / CPLD registers for NAND flash */
  30. #define BALLOON3_NAND_BASE (PXA_CS4_PHYS + 0x00e00000)
  31. #define BALLOON3_NAND_IO_REG (BALLOON3_FPGA_VIRT + 0x00e00000)
  32. #define BALLOON3_NAND_CONTROL2_REG (BALLOON3_FPGA_VIRT + 0x00e00010)
  33. #define BALLOON3_NAND_STAT_REG (BALLOON3_FPGA_VIRT + 0x00e00014)
  34. #define BALLOON3_NAND_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00014)
  35. /* fpga/cpld interrupt control register */
  36. #define BALLOON3_INT_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e0000C)
  37. #define BALLOON3_VERSION_REG (BALLOON3_FPGA_VIRT + 0x00e0001c)
  38. #define BALLOON3_SAMOSA_ADDR_REG (BALLOON3_FPGA_VIRT + 0x00c00000)
  39. #define BALLOON3_SAMOSA_DATA_REG (BALLOON3_FPGA_VIRT + 0x00c00004)
  40. #define BALLOON3_SAMOSA_STATUS_REG (BALLOON3_FPGA_VIRT + 0x00c0001c)
  41. /* CF Status Register bits (read-only) bits */
  42. #define BALLOON3_CF_nIRQ (1 << 0)
  43. #define BALLOON3_CF_nSTSCHG_BVD1 (1 << 1)
  44. /* CF Control Set Register bits / CF Control Clear Register bits (write-only) */
  45. #define BALLOON3_CF_RESET (1 << 0)
  46. #define BALLOON3_CF_ENABLE (1 << 1)
  47. #define BALLOON3_CF_ADD_ENABLE (1 << 2)
  48. /* CF Interrupt sources */
  49. #define BALLOON3_BP_CF_NRDY_IRQ BALLOON3_IRQ(0)
  50. #define BALLOON3_BP_NSTSCHG_IRQ BALLOON3_IRQ(1)
  51. /* NAND Control register */
  52. #define BALLOON3_NAND_CONTROL_FLWP (1 << 7)
  53. #define BALLOON3_NAND_CONTROL_FLSE (1 << 6)
  54. #define BALLOON3_NAND_CONTROL_FLCE3 (1 << 5)
  55. #define BALLOON3_NAND_CONTROL_FLCE2 (1 << 4)
  56. #define BALLOON3_NAND_CONTROL_FLCE1 (1 << 3)
  57. #define BALLOON3_NAND_CONTROL_FLCE0 (1 << 2)
  58. #define BALLOON3_NAND_CONTROL_FLALE (1 << 1)
  59. #define BALLOON3_NAND_CONTROL_FLCLE (1 << 0)
  60. /* NAND Status register */
  61. #define BALLOON3_NAND_STAT_RNB (1 << 0)
  62. /* NAND Control2 register */
  63. #define BALLOON3_NAND_CONTROL2_16BIT (1 << 0)
  64. /* GPIOs for irqs */
  65. #define BALLOON3_GPIO_AUX_NIRQ (94)
  66. #define BALLOON3_GPIO_CODEC_IRQ (95)
  67. /* Timer and Idle LED locations */
  68. #define BALLOON3_GPIO_LED_NAND (9)
  69. #define BALLOON3_GPIO_LED_IDLE (10)
  70. /* backlight control */
  71. #define BALLOON3_GPIO_RUN_BACKLIGHT (99)
  72. #define BALLOON3_GPIO_S0_CD (105)
  73. /* NAND */
  74. #define BALLOON3_GPIO_RUN_NAND (102)
  75. /* PCF8574A Leds */
  76. #define BALLOON3_PCF_GPIO_BASE 160
  77. #define BALLOON3_PCF_GPIO_LED0 (BALLOON3_PCF_GPIO_BASE + 0)
  78. #define BALLOON3_PCF_GPIO_LED1 (BALLOON3_PCF_GPIO_BASE + 1)
  79. #define BALLOON3_PCF_GPIO_LED2 (BALLOON3_PCF_GPIO_BASE + 2)
  80. #define BALLOON3_PCF_GPIO_LED3 (BALLOON3_PCF_GPIO_BASE + 3)
  81. #define BALLOON3_PCF_GPIO_LED4 (BALLOON3_PCF_GPIO_BASE + 4)
  82. #define BALLOON3_PCF_GPIO_LED5 (BALLOON3_PCF_GPIO_BASE + 5)
  83. #define BALLOON3_PCF_GPIO_LED6 (BALLOON3_PCF_GPIO_BASE + 6)
  84. #define BALLOON3_PCF_GPIO_LED7 (BALLOON3_PCF_GPIO_BASE + 7)
  85. /* FPGA Interrupt Mask/Acknowledge Register */
  86. #define BALLOON3_INT_S0_IRQ (1 << 0) /* PCMCIA 0 IRQ */
  87. #define BALLOON3_INT_S0_STSCHG (1 << 1) /* PCMCIA 0 status changed */
  88. /* CPLD (and FPGA) interface definitions */
  89. #define CPLD_LCD0_DATA_SET 0x00
  90. #define CPLD_LCD0_DATA_CLR 0x10
  91. #define CPLD_LCD0_COMMAND_SET 0x01
  92. #define CPLD_LCD0_COMMAND_CLR 0x11
  93. #define CPLD_LCD1_DATA_SET 0x02
  94. #define CPLD_LCD1_DATA_CLR 0x12
  95. #define CPLD_LCD1_COMMAND_SET 0x03
  96. #define CPLD_LCD1_COMMAND_CLR 0x13
  97. #define CPLD_MISC_SET 0x07
  98. #define CPLD_MISC_CLR 0x17
  99. #define CPLD_MISC_LOON_NRESET_BIT 0
  100. #define CPLD_MISC_LOON_UNSUSP_BIT 1
  101. #define CPLD_MISC_RUN_5V_BIT 2
  102. #define CPLD_MISC_CHG_D0_BIT 3
  103. #define CPLD_MISC_CHG_D1_BIT 4
  104. #define CPLD_MISC_DAC_NCS_BIT 5
  105. #define CPLD_LCD_SET 0x08
  106. #define CPLD_LCD_CLR 0x18
  107. #define CPLD_LCD_BACKLIGHT_EN_0_BIT 0
  108. #define CPLD_LCD_BACKLIGHT_EN_1_BIT 1
  109. #define CPLD_LCD_LED_RED_BIT 4
  110. #define CPLD_LCD_LED_GREEN_BIT 5
  111. #define CPLD_LCD_NRESET_BIT 7
  112. #define CPLD_LCD_RO_SET 0x09
  113. #define CPLD_LCD_RO_CLR 0x19
  114. #define CPLD_LCD_RO_LCD0_nWAIT_BIT 0
  115. #define CPLD_LCD_RO_LCD1_nWAIT_BIT 1
  116. #define CPLD_SERIAL_SET 0x0a
  117. #define CPLD_SERIAL_CLR 0x1a
  118. #define CPLD_SERIAL_GSM_RI_BIT 0
  119. #define CPLD_SERIAL_GSM_CTS_BIT 1
  120. #define CPLD_SERIAL_GSM_DTR_BIT 2
  121. #define CPLD_SERIAL_LPR_CTS_BIT 3
  122. #define CPLD_SERIAL_TC232_CTS_BIT 4
  123. #define CPLD_SERIAL_TC232_DSR_BIT 5
  124. #define CPLD_SROUTING_SET 0x0b
  125. #define CPLD_SROUTING_CLR 0x1b
  126. #define CPLD_SROUTING_MSP430_LPR 0
  127. #define CPLD_SROUTING_MSP430_TC232 1
  128. #define CPLD_SROUTING_MSP430_GSM 2
  129. #define CPLD_SROUTING_LOON_LPR (0 << 4)
  130. #define CPLD_SROUTING_LOON_TC232 (1 << 4)
  131. #define CPLD_SROUTING_LOON_GSM (2 << 4)
  132. #define CPLD_AROUTING_SET 0x0c
  133. #define CPLD_AROUTING_CLR 0x1c
  134. #define CPLD_AROUTING_MIC2PHONE_BIT 0
  135. #define CPLD_AROUTING_PHONE2INT_BIT 1
  136. #define CPLD_AROUTING_PHONE2EXT_BIT 2
  137. #define CPLD_AROUTING_LOONL2INT_BIT 3
  138. #define CPLD_AROUTING_LOONL2EXT_BIT 4
  139. #define CPLD_AROUTING_LOONR2PHONE_BIT 5
  140. #define CPLD_AROUTING_LOONR2INT_BIT 6
  141. #define CPLD_AROUTING_LOONR2EXT_BIT 7
  142. /* Balloon3 Interrupts */
  143. #define BALLOON3_IRQ(x) (IRQ_BOARD_START + (x))
  144. #define BALLOON3_AUX_NIRQ PXA_GPIO_TO_IRQ(BALLOON3_GPIO_AUX_NIRQ)
  145. #define BALLOON3_CODEC_IRQ PXA_GPIO_TO_IRQ(BALLOON3_GPIO_CODEC_IRQ)
  146. #define BALLOON3_NR_IRQS (IRQ_BOARD_START + 16)
  147. extern int balloon3_has(enum balloon3_features feature);
  148. #endif