keylargo.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. #ifndef _ASM_POWERPC_KEYLARGO_H
  2. #define _ASM_POWERPC_KEYLARGO_H
  3. #ifdef __KERNEL__
  4. /*
  5. * keylargo.h: definitions for using the "KeyLargo" I/O controller chip.
  6. *
  7. */
  8. /* "Pangea" chipset has keylargo device-id 0x25 while core99
  9. * has device-id 0x22. The rev. of the pangea one is 0, so we
  10. * fake an artificial rev. in keylargo_rev by oring 0x100
  11. */
  12. #define KL_PANGEA_REV 0x100
  13. /* offset from base for feature control registers */
  14. #define KEYLARGO_MBCR 0x34 /* KL Only, Media bay control/status */
  15. #define KEYLARGO_FCR0 0x38
  16. #define KEYLARGO_FCR1 0x3c
  17. #define KEYLARGO_FCR2 0x40
  18. #define KEYLARGO_FCR3 0x44
  19. #define KEYLARGO_FCR4 0x48
  20. #define KEYLARGO_FCR5 0x4c /* Pangea only */
  21. /* K2 additional FCRs */
  22. #define K2_FCR6 0x34
  23. #define K2_FCR7 0x30
  24. #define K2_FCR8 0x2c
  25. #define K2_FCR9 0x28
  26. #define K2_FCR10 0x24
  27. /* GPIO registers */
  28. #define KEYLARGO_GPIO_LEVELS0 0x50
  29. #define KEYLARGO_GPIO_LEVELS1 0x54
  30. #define KEYLARGO_GPIO_EXTINT_0 0x58
  31. #define KEYLARGO_GPIO_EXTINT_CNT 18
  32. #define KEYLARGO_GPIO_0 0x6A
  33. #define KEYLARGO_GPIO_CNT 17
  34. #define KEYLARGO_GPIO_EXTINT_DUAL_EDGE 0x80
  35. #define KEYLARGO_GPIO_OUTPUT_ENABLE 0x04
  36. #define KEYLARGO_GPIO_OUTOUT_DATA 0x01
  37. #define KEYLARGO_GPIO_INPUT_DATA 0x02
  38. /* K2 does only extint GPIOs and does 51 of them */
  39. #define K2_GPIO_EXTINT_0 0x58
  40. #define K2_GPIO_EXTINT_CNT 51
  41. /* Specific GPIO regs */
  42. #define KL_GPIO_MODEM_RESET (KEYLARGO_GPIO_0+0x03)
  43. #define KL_GPIO_MODEM_POWER (KEYLARGO_GPIO_0+0x02) /* Pangea */
  44. #define KL_GPIO_SOUND_POWER (KEYLARGO_GPIO_0+0x05)
  45. /* Hrm... this one is only to be used on Pismo. It seems to also
  46. * control the timebase enable on other machines. Still to be
  47. * experimented... --BenH.
  48. */
  49. #define KL_GPIO_FW_CABLE_POWER (KEYLARGO_GPIO_0+0x09)
  50. #define KL_GPIO_TB_ENABLE (KEYLARGO_GPIO_0+0x09)
  51. #define KL_GPIO_ETH_PHY_RESET (KEYLARGO_GPIO_0+0x10)
  52. #define KL_GPIO_EXTINT_CPU1 (KEYLARGO_GPIO_0+0x0a)
  53. #define KL_GPIO_EXTINT_CPU1_ASSERT 0x04
  54. #define KL_GPIO_EXTINT_CPU1_RELEASE 0x38
  55. #define KL_GPIO_RESET_CPU0 (KEYLARGO_GPIO_EXTINT_0+0x03)
  56. #define KL_GPIO_RESET_CPU1 (KEYLARGO_GPIO_EXTINT_0+0x04)
  57. #define KL_GPIO_RESET_CPU2 (KEYLARGO_GPIO_EXTINT_0+0x0f)
  58. #define KL_GPIO_RESET_CPU3 (KEYLARGO_GPIO_EXTINT_0+0x10)
  59. #define KL_GPIO_PMU_MESSAGE_IRQ (KEYLARGO_GPIO_EXTINT_0+0x09)
  60. #define KL_GPIO_PMU_MESSAGE_BIT KEYLARGO_GPIO_INPUT_DATA
  61. #define KL_GPIO_MEDIABAY_IRQ (KEYLARGO_GPIO_EXTINT_0+0x0e)
  62. #define KL_GPIO_AIRPORT_0 (KEYLARGO_GPIO_EXTINT_0+0x0a)
  63. #define KL_GPIO_AIRPORT_1 (KEYLARGO_GPIO_EXTINT_0+0x0d)
  64. #define KL_GPIO_AIRPORT_2 (KEYLARGO_GPIO_0+0x0d)
  65. #define KL_GPIO_AIRPORT_3 (KEYLARGO_GPIO_0+0x0e)
  66. #define KL_GPIO_AIRPORT_4 (KEYLARGO_GPIO_0+0x0f)
  67. /*
  68. * Bits in feature control register. Those bits different for K2 are
  69. * listed separately
  70. */
  71. #define KL_MBCR_MB0_PCI_ENABLE 0x00000800 /* exist ? */
  72. #define KL_MBCR_MB0_IDE_ENABLE 0x00001000
  73. #define KL_MBCR_MB0_FLOPPY_ENABLE 0x00002000 /* exist ? */
  74. #define KL_MBCR_MB0_SOUND_ENABLE 0x00004000 /* hrm... */
  75. #define KL_MBCR_MB0_DEV_MASK 0x00007800
  76. #define KL_MBCR_MB0_DEV_POWER 0x00000400
  77. #define KL_MBCR_MB0_DEV_RESET 0x00000200
  78. #define KL_MBCR_MB0_ENABLE 0x00000100
  79. #define KL_MBCR_MB1_PCI_ENABLE 0x08000000 /* exist ? */
  80. #define KL_MBCR_MB1_IDE_ENABLE 0x10000000
  81. #define KL_MBCR_MB1_FLOPPY_ENABLE 0x20000000 /* exist ? */
  82. #define KL_MBCR_MB1_SOUND_ENABLE 0x40000000 /* hrm... */
  83. #define KL_MBCR_MB1_DEV_MASK 0x78000000
  84. #define KL_MBCR_MB1_DEV_POWER 0x04000000
  85. #define KL_MBCR_MB1_DEV_RESET 0x02000000
  86. #define KL_MBCR_MB1_ENABLE 0x01000000
  87. #define KL0_SCC_B_INTF_ENABLE 0x00000001 /* (KL Only) */
  88. #define KL0_SCC_A_INTF_ENABLE 0x00000002
  89. #define KL0_SCC_SLOWPCLK 0x00000004
  90. #define KL0_SCC_RESET 0x00000008
  91. #define KL0_SCCA_ENABLE 0x00000010
  92. #define KL0_SCCB_ENABLE 0x00000020
  93. #define KL0_SCC_CELL_ENABLE 0x00000040
  94. #define KL0_IRDA_HIGH_BAND 0x00000100 /* (KL Only) */
  95. #define KL0_IRDA_SOURCE2_SEL 0x00000200 /* (KL Only) */
  96. #define KL0_IRDA_SOURCE1_SEL 0x00000400 /* (KL Only) */
  97. #define KL0_PG_USB0_PMI_ENABLE 0x00000400 /* (Pangea/Intrepid Only) */
  98. #define KL0_IRDA_RESET 0x00000800 /* (KL Only) */
  99. #define KL0_PG_USB0_REF_SUSPEND_SEL 0x00000800 /* (Pangea/Intrepid Only) */
  100. #define KL0_IRDA_DEFAULT1 0x00001000 /* (KL Only) */
  101. #define KL0_PG_USB0_REF_SUSPEND 0x00001000 /* (Pangea/Intrepid Only) */
  102. #define KL0_IRDA_DEFAULT0 0x00002000 /* (KL Only) */
  103. #define KL0_PG_USB0_PAD_SUSPEND 0x00002000 /* (Pangea/Intrepid Only) */
  104. #define KL0_IRDA_FAST_CONNECT 0x00004000 /* (KL Only) */
  105. #define KL0_PG_USB1_PMI_ENABLE 0x00004000 /* (Pangea/Intrepid Only) */
  106. #define KL0_IRDA_ENABLE 0x00008000 /* (KL Only) */
  107. #define KL0_PG_USB1_REF_SUSPEND_SEL 0x00008000 /* (Pangea/Intrepid Only) */
  108. #define KL0_IRDA_CLK32_ENABLE 0x00010000 /* (KL Only) */
  109. #define KL0_PG_USB1_REF_SUSPEND 0x00010000 /* (Pangea/Intrepid Only) */
  110. #define KL0_IRDA_CLK19_ENABLE 0x00020000 /* (KL Only) */
  111. #define KL0_PG_USB1_PAD_SUSPEND 0x00020000 /* (Pangea/Intrepid Only) */
  112. #define KL0_USB0_PAD_SUSPEND0 0x00040000
  113. #define KL0_USB0_PAD_SUSPEND1 0x00080000
  114. #define KL0_USB0_CELL_ENABLE 0x00100000
  115. #define KL0_USB1_PAD_SUSPEND0 0x00400000
  116. #define KL0_USB1_PAD_SUSPEND1 0x00800000
  117. #define KL0_USB1_CELL_ENABLE 0x01000000
  118. #define KL0_USB_REF_SUSPEND 0x10000000 /* (KL Only) */
  119. #define KL0_SERIAL_ENABLE (KL0_SCC_B_INTF_ENABLE | \
  120. KL0_SCC_SLOWPCLK | \
  121. KL0_SCC_CELL_ENABLE | KL0_SCCA_ENABLE)
  122. #define KL1_USB2_PMI_ENABLE 0x00000001 /* Intrepid only */
  123. #define KL1_AUDIO_SEL_22MCLK 0x00000002 /* KL/Pangea only */
  124. #define KL1_USB2_REF_SUSPEND_SEL 0x00000002 /* Intrepid only */
  125. #define KL1_USB2_REF_SUSPEND 0x00000004 /* Intrepid only */
  126. #define KL1_AUDIO_CLK_ENABLE_BIT 0x00000008 /* KL/Pangea only */
  127. #define KL1_USB2_PAD_SUSPEND_SEL 0x00000008 /* Intrepid only */
  128. #define KL1_USB2_PAD_SUSPEND0 0x00000010 /* Intrepid only */
  129. #define KL1_AUDIO_CLK_OUT_ENABLE 0x00000020 /* KL/Pangea only */
  130. #define KL1_USB2_PAD_SUSPEND1 0x00000020 /* Intrepid only */
  131. #define KL1_AUDIO_CELL_ENABLE 0x00000040 /* KL/Pangea only */
  132. #define KL1_USB2_CELL_ENABLE 0x00000040 /* Intrepid only */
  133. #define KL1_AUDIO_CHOOSE 0x00000080 /* KL/Pangea only */
  134. #define KL1_I2S0_CHOOSE 0x00000200 /* KL Only */
  135. #define KL1_I2S0_CELL_ENABLE 0x00000400
  136. #define KL1_I2S0_CLK_ENABLE_BIT 0x00001000
  137. #define KL1_I2S0_ENABLE 0x00002000
  138. #define KL1_I2S1_CELL_ENABLE 0x00020000
  139. #define KL1_I2S1_CLK_ENABLE_BIT 0x00080000
  140. #define KL1_I2S1_ENABLE 0x00100000
  141. #define KL1_EIDE0_ENABLE 0x00800000 /* KL/Intrepid Only */
  142. #define KL1_EIDE0_RESET_N 0x01000000 /* KL/Intrepid Only */
  143. #define KL1_EIDE1_ENABLE 0x04000000 /* KL Only */
  144. #define KL1_EIDE1_RESET_N 0x08000000 /* KL Only */
  145. #define KL1_UIDE_ENABLE 0x20000000 /* KL/Pangea Only */
  146. #define KL1_UIDE_RESET_N 0x40000000 /* KL/Pangea Only */
  147. #define KL2_IOBUS_ENABLE 0x00000002
  148. #define KL2_SLEEP_STATE_BIT 0x00000100 /* KL Only */
  149. #define KL2_PG_STOP_ALL_CLOCKS 0x00000100 /* Pangea Only */
  150. #define KL2_MPIC_ENABLE 0x00020000
  151. #define KL2_CARDSLOT_RESET 0x00040000 /* Pangea/Intrepid Only */
  152. #define KL2_ALT_DATA_OUT 0x02000000 /* KL Only ??? */
  153. #define KL2_MEM_IS_BIG 0x04000000
  154. #define KL2_CARDSEL_16 0x08000000
  155. #define KL3_SHUTDOWN_PLL_TOTAL 0x00000001 /* KL/Pangea only */
  156. #define KL3_SHUTDOWN_PLLKW6 0x00000002 /* KL/Pangea only */
  157. #define KL3_IT_SHUTDOWN_PLL3 0x00000002 /* Intrepid only */
  158. #define KL3_SHUTDOWN_PLLKW4 0x00000004 /* KL/Pangea only */
  159. #define KL3_IT_SHUTDOWN_PLL2 0x00000004 /* Intrepid only */
  160. #define KL3_SHUTDOWN_PLLKW35 0x00000008 /* KL/Pangea only */
  161. #define KL3_IT_SHUTDOWN_PLL1 0x00000008 /* Intrepid only */
  162. #define KL3_SHUTDOWN_PLLKW12 0x00000010 /* KL Only */
  163. #define KL3_IT_ENABLE_PLL3_SHUTDOWN 0x00000010 /* Intrepid only */
  164. #define KL3_PLL_RESET 0x00000020 /* KL/Pangea only */
  165. #define KL3_IT_ENABLE_PLL2_SHUTDOWN 0x00000020 /* Intrepid only */
  166. #define KL3_IT_ENABLE_PLL1_SHUTDOWN 0x00000010 /* Intrepid only */
  167. #define KL3_SHUTDOWN_PLL2X 0x00000080 /* KL Only */
  168. #define KL3_CLK66_ENABLE 0x00000100 /* KL Only */
  169. #define KL3_CLK49_ENABLE 0x00000200
  170. #define KL3_CLK45_ENABLE 0x00000400
  171. #define KL3_CLK31_ENABLE 0x00000800 /* KL/Pangea only */
  172. #define KL3_TIMER_CLK18_ENABLE 0x00001000
  173. #define KL3_I2S1_CLK18_ENABLE 0x00002000
  174. #define KL3_I2S0_CLK18_ENABLE 0x00004000
  175. #define KL3_VIA_CLK16_ENABLE 0x00008000 /* KL/Pangea only */
  176. #define KL3_IT_VIA_CLK32_ENABLE 0x00008000 /* Intrepid only */
  177. #define KL3_STOPPING33_ENABLED 0x00080000 /* KL Only */
  178. #define KL3_PG_PLL_ENABLE_TEST 0x00080000 /* Pangea Only */
  179. /* Intrepid USB bus 2, port 0,1 */
  180. #define KL3_IT_PORT_WAKEUP_ENABLE(p) (0x00080000 << ((p)<<3))
  181. #define KL3_IT_PORT_RESUME_WAKE_EN(p) (0x00040000 << ((p)<<3))
  182. #define KL3_IT_PORT_CONNECT_WAKE_EN(p) (0x00020000 << ((p)<<3))
  183. #define KL3_IT_PORT_DISCONNECT_WAKE_EN(p) (0x00010000 << ((p)<<3))
  184. #define KL3_IT_PORT_RESUME_STAT(p) (0x00300000 << ((p)<<3))
  185. #define KL3_IT_PORT_CONNECT_STAT(p) (0x00200000 << ((p)<<3))
  186. #define KL3_IT_PORT_DISCONNECT_STAT(p) (0x00100000 << ((p)<<3))
  187. /* Port 0,1 : bus 0, port 2,3 : bus 1 */
  188. #define KL4_PORT_WAKEUP_ENABLE(p) (0x00000008 << ((p)<<3))
  189. #define KL4_PORT_RESUME_WAKE_EN(p) (0x00000004 << ((p)<<3))
  190. #define KL4_PORT_CONNECT_WAKE_EN(p) (0x00000002 << ((p)<<3))
  191. #define KL4_PORT_DISCONNECT_WAKE_EN(p) (0x00000001 << ((p)<<3))
  192. #define KL4_PORT_RESUME_STAT(p) (0x00000040 << ((p)<<3))
  193. #define KL4_PORT_CONNECT_STAT(p) (0x00000020 << ((p)<<3))
  194. #define KL4_PORT_DISCONNECT_STAT(p) (0x00000010 << ((p)<<3))
  195. /* Pangea and Intrepid only */
  196. #define KL5_VIA_USE_CLK31 0000000001 /* Pangea Only */
  197. #define KL5_SCC_USE_CLK31 0x00000002 /* Pangea Only */
  198. #define KL5_PWM_CLK32_EN 0x00000004
  199. #define KL5_CLK3_68_EN 0x00000010
  200. #define KL5_CLK32_EN 0x00000020
  201. /* K2 definitions */
  202. #define K2_FCR0_USB0_SWRESET 0x00200000
  203. #define K2_FCR0_USB1_SWRESET 0x02000000
  204. #define K2_FCR0_RING_PME_DISABLE 0x08000000
  205. #define K2_FCR1_PCI1_BUS_RESET_N 0x00000010
  206. #define K2_FCR1_PCI1_SLEEP_RESET_EN 0x00000020
  207. #define K2_FCR1_I2S0_CELL_ENABLE 0x00000400
  208. #define K2_FCR1_I2S0_RESET 0x00000800
  209. #define K2_FCR1_I2S0_CLK_ENABLE_BIT 0x00001000
  210. #define K2_FCR1_I2S0_ENABLE 0x00002000
  211. #define K2_FCR1_PCI1_CLK_ENABLE 0x00004000
  212. #define K2_FCR1_FW_CLK_ENABLE 0x00008000
  213. #define K2_FCR1_FW_RESET_N 0x00010000
  214. #define K2_FCR1_I2S1_CELL_ENABLE 0x00020000
  215. #define K2_FCR1_I2S1_CLK_ENABLE_BIT 0x00080000
  216. #define K2_FCR1_I2S1_ENABLE 0x00100000
  217. #define K2_FCR1_GMAC_CLK_ENABLE 0x00400000
  218. #define K2_FCR1_GMAC_POWER_DOWN 0x00800000
  219. #define K2_FCR1_GMAC_RESET_N 0x01000000
  220. #define K2_FCR1_SATA_CLK_ENABLE 0x02000000
  221. #define K2_FCR1_SATA_POWER_DOWN 0x04000000
  222. #define K2_FCR1_SATA_RESET_N 0x08000000
  223. #define K2_FCR1_UATA_CLK_ENABLE 0x10000000
  224. #define K2_FCR1_UATA_RESET_N 0x40000000
  225. #define K2_FCR1_UATA_CHOOSE_CLK66 0x80000000
  226. /* Shasta definitions */
  227. #define SH_FCR1_I2S2_CELL_ENABLE 0x00000010
  228. #define SH_FCR1_I2S2_CLK_ENABLE_BIT 0x00000040
  229. #define SH_FCR1_I2S2_ENABLE 0x00000080
  230. #define SH_FCR3_I2S2_CLK18_ENABLE 0x00008000
  231. #endif /* __KERNEL__ */
  232. #endif /* _ASM_POWERPC_KEYLARGO_H */