ppc440ep_gr.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. /*
  2. * (C) Copyright 2010
  3. * Stefan Roese, DENX Software Engineering, sr@denx.de.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of
  8. * the License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  18. * MA 02111-1307 USA
  19. */
  20. #ifndef _PPC440EP_GR_H_
  21. #define _PPC440EP_GR_H_
  22. #define CONFIG_SDRAM_PPC4xx_IBM_DDR /* IBM DDR controller */
  23. #define CONFIG_NAND_NDFC
  24. /*
  25. * Some SoC specific registers (not common for all 440 SoC's)
  26. */
  27. /* Memory mapped registers */
  28. #define CONFIG_SYS_PERIPHERAL_BASE 0xef600000 /* Internal Peripherals */
  29. #define CONFIG_SYS_NS16550_COM1 (CONFIG_SYS_PERIPHERAL_BASE + 0x0300)
  30. #define CONFIG_SYS_NS16550_COM2 (CONFIG_SYS_PERIPHERAL_BASE + 0x0400)
  31. #define CONFIG_SYS_NS16550_COM3 (CONFIG_SYS_PERIPHERAL_BASE + 0x0500)
  32. #define CONFIG_SYS_NS16550_COM4 (CONFIG_SYS_PERIPHERAL_BASE + 0x0600)
  33. #define GPIO0_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0b00)
  34. #define GPIO1_BASE (CONFIG_SYS_PERIPHERAL_BASE + 0x0c00)
  35. /* SDR's */
  36. #define SDR0_PCI0 0x0300
  37. #define SDR0_SDSTP2 0x4001
  38. #define SDR0_SDSTP3 0x4003
  39. #define SDR0_SDSTP1_PAE_MASK (0x80000000 >> 21)
  40. #define SDR0_SDSTP1_PAME_MASK (0x80000000 >> 27)
  41. /* Pin Function Control Register 1 */
  42. #define SDR0_PFC1_U1ME_MASK 0x02000000 /* UART1 Mode Enable */
  43. #define SDR0_PFC1_U1ME_DSR_DTR 0x00000000 /* UART1 in DSR/DTR Mode */
  44. #define SDR0_PFC1_U1ME_CTS_RTS 0x02000000 /* UART1 in CTS/RTS Mode */
  45. #define SDR0_PFC1_U0ME_MASK 0x00080000 /* UART0 Mode Enable */
  46. #define SDR0_PFC1_U0ME_DSR_DTR 0x00000000 /* UART0 in DSR/DTR Mode */
  47. #define SDR0_PFC1_U0ME_CTS_RTS 0x00080000 /* UART0 in CTS/RTS Mode */
  48. #define SDR0_PFC1_U0IM_MASK 0x00040000 /* UART0 Interface Mode */
  49. #define SDR0_PFC1_U0IM_8PINS 0x00000000 /* UART0 Interface Mode 8 pins */
  50. #define SDR0_PFC1_U0IM_4PINS 0x00040000 /* UART0 Interface Mode 4 pins */
  51. #define SDR0_PFC1_SIS_MASK 0x00020000 /* SCP or IIC1 Selection */
  52. #define SDR0_PFC1_SIS_SCP_SEL 0x00000000 /* SCP Selected */
  53. #define SDR0_PFC1_SIS_IIC1_SEL 0x00020000 /* IIC1 Selected */
  54. #define SDR0_PFC1_UES_MASK 0x00010000 /* USB2D_RX_Active / EBC_Hold
  55. Req Selection */
  56. #define SDR0_PFC1_UES_USB2D_SEL 0x00000000 /* USB2D_RX_Active Selected */
  57. #define SDR0_PFC1_UES_EBCHR_SEL 0x00010000 /* EBC_Hold Req Selected */
  58. #define SDR0_PFC1_DIS_MASK 0x00008000 /* DMA_Req(1) / UIC_IRQ(5)
  59. Selection */
  60. #define SDR0_PFC1_DIS_DMAR_SEL 0x00000000 /* DMA_Req(1) Selected */
  61. #define SDR0_PFC1_DIS_UICIRQ5_SEL 0x00008000 /* UIC_IRQ(5) Selected */
  62. #define SDR0_PFC1_ERE_MASK 0x00004000 /* EBC Mast.Ext.Req.En./GPIO0(27)
  63. Selection */
  64. #define SDR0_PFC1_ERE_EXTR_SEL 0x00000000 /* EBC Mast.Ext.Req.En.
  65. Selected */
  66. #define SDR0_PFC1_ERE_GPIO0_27_SEL 0x00004000 /* GPIO0(27) Selected */
  67. #define SDR0_PFC1_UPR_MASK 0x00002000 /* USB2 Device Packet Reject
  68. Selection */
  69. #define SDR0_PFC1_UPR_DISABLE 0x00000000 /* USB2 Device Packet Reject
  70. Disable */
  71. #define SDR0_PFC1_UPR_ENABLE 0x00002000 /* USB2 Device Packet Reject
  72. Enable */
  73. #define SDR0_PFC1_PLB_PME_MASK 0x00001000 /* PLB3/PLB4 Perf. Monitor Enable
  74. Selection */
  75. #define SDR0_PFC1_PLB_PME_PLB3_SEL 0x00000000 /* PLB3 Performance Monitor
  76. Enable */
  77. #define SDR0_PFC1_PLB_PME_PLB4_SEL 0x00001000 /* PLB3 Performance Monitor
  78. Enable */
  79. #define SDR0_PFC1_GFGGI_MASK 0x0000000F /* GPT Frequency Generation
  80. Gated In */
  81. /* USB Control Register */
  82. #define SDR0_USB0_USB_DEVSEL_MASK 0x00000002 /* USB Device Selection */
  83. #define SDR0_USB0_USB20D_DEVSEL 0x00000000 /* USB2.0 Device Selected */
  84. #define SDR0_USB0_USB11D_DEVSEL 0x00000002 /* USB1.1 Device Selected */
  85. #define SDR0_USB0_LEEN_MASK 0x00000001 /* Little Endian selection */
  86. #define SDR0_USB0_LEEN_DISABLE 0x00000000 /* Little Endian Disable */
  87. #define SDR0_USB0_LEEN_ENABLE 0x00000001 /* Little Endian Enable */
  88. /* Miscealleneaous Function Reg. */
  89. #define SDR0_MFR_ETH0_CLK_SEL_MASK 0x08000000 /* Ethernet0 Clock Select */
  90. #define SDR0_MFR_ETH0_CLK_SEL_EXT 0x00000000
  91. #define SDR0_MFR_ETH1_CLK_SEL_MASK 0x04000000 /* Ethernet1 Clock Select */
  92. #define SDR0_MFR_ETH1_CLK_SEL_EXT 0x00000000
  93. #define SDR0_MFR_ZMII_MODE_MASK 0x03000000 /* ZMII Mode Mask */
  94. #define SDR0_MFR_ZMII_MODE_MII 0x00000000 /* ZMII Mode MII */
  95. #define SDR0_MFR_ZMII_MODE_SMII 0x01000000 /* ZMII Mode SMII */
  96. #define SDR0_MFR_ZMII_MODE_RMII_10M 0x02000000 /* ZMII Mode RMII - 10 Mbs */
  97. #define SDR0_MFR_ZMII_MODE_RMII_100M 0x03000000 /* ZMII Mode RMII - 100 Mbs */
  98. #define SDR0_MFR_ZMII_MODE_BIT0 0x02000000 /* ZMII Mode Bit0 */
  99. #define SDR0_MFR_ZMII_MODE_BIT1 0x01000000 /* ZMII Mode Bit1 */
  100. #define SDR0_MFR_ZM_ENCODE(n) ((((u32)(n)) & 0x3) << 24)
  101. #define SDR0_MFR_ZM_DECODE(n) ((((u32)(n)) << 24) & 0x3)
  102. #define SDR0_MFR_ERRATA3_EN0 0x00800000
  103. #define SDR0_MFR_ERRATA3_EN1 0x00400000
  104. #define SDR0_MFR_PKT_REJ_MASK 0x00180000 /* Pkt Rej. Enable Mask */
  105. #define SDR0_MFR_PKT_REJ_EN 0x00180000 /* Pkt Rej. Ena. on both EMAC3 0-1 */
  106. #define SDR0_MFR_PKT_REJ_EN0 0x00100000 /* Pkt Rej. Enable on EMAC3(0) */
  107. #define SDR0_MFR_PKT_REJ_EN1 0x00080000 /* Pkt Rej. Enable on EMAC3(1) */
  108. #define SDR0_MFR_PKT_REJ_POL 0x00200000 /* Packet Reject Polarity */
  109. /* CUST0 Customer Configuration Register0 */
  110. #define SDR0_CUST0_MUX_E_N_G_MASK 0xC0000000 /* Mux_Emac_NDFC_GPIO */
  111. #define SDR0_CUST0_MUX_EMAC_SEL 0x40000000 /* Emac Selection */
  112. #define SDR0_CUST0_MUX_NDFC_SEL 0x80000000 /* NDFC Selection */
  113. #define SDR0_CUST0_MUX_GPIO_SEL 0xC0000000 /* GPIO Selection */
  114. #define SDR0_CUST0_NDFC_EN_MASK 0x20000000 /* NDFC Enable Mask */
  115. #define SDR0_CUST0_NDFC_ENABLE 0x20000000 /* NDFC Enable */
  116. #define SDR0_CUST0_NDFC_DISABLE 0x00000000 /* NDFC Disable */
  117. #define SDR0_CUST0_NDFC_BW_MASK 0x10000000 /* NDFC Boot Width */
  118. #define SDR0_CUST0_NDFC_BW_16_BIT 0x10000000 /* NDFC Boot Width = 16 Bit */
  119. #define SDR0_CUST0_NDFC_BW_8_BIT 0x00000000 /* NDFC Boot Width = 8 Bit */
  120. #define SDR0_CUST0_NDFC_BP_MASK 0x0F000000 /* NDFC Boot Page */
  121. #define SDR0_CUST0_NDFC_BP_ENCODE(n) ((((u32)(n)) & 0xF) << 24)
  122. #define SDR0_CUST0_NDFC_BP_DECODE(n) ((((u32)(n)) >> 24) & 0xF)
  123. #define SDR0_CUST0_NDFC_BAC_MASK 0x00C00000 /* NDFC Boot Address Cycle */
  124. #define SDR0_CUST0_NDFC_BAC_ENCODE(n) ((((u32)(n)) & 0x3) << 22)
  125. #define SDR0_CUST0_NDFC_BAC_DECODE(n) ((((u32)(n)) >> 22) & 0x3)
  126. #define SDR0_CUST0_NDFC_ARE_MASK 0x00200000 /* NDFC Auto Read Enable */
  127. #define SDR0_CUST0_NDFC_ARE_ENABLE 0x00200000 /* NDFC Auto Read Enable */
  128. #define SDR0_CUST0_NDFC_ARE_DISABLE 0x00000000 /* NDFC Auto Read Disable */
  129. #define SDR0_CUST0_NRB_MASK 0x00100000 /* NDFC Ready / Busy */
  130. #define SDR0_CUST0_NRB_BUSY 0x00100000 /* Busy */
  131. #define SDR0_CUST0_NRB_READY 0x00000000 /* Ready */
  132. #define SDR0_CUST0_NDRSC_MASK 0x0000FFF0 /* NDFC Device Reset Count Mask */
  133. #define SDR0_CUST0_NDRSC_ENCODE(n) ((((u32)(n)) & 0xFFF) << 4)
  134. #define SDR0_CUST0_NDRSC_DECODE(n) ((((u32)(n)) >> 4) & 0xFFF)
  135. #define SDR0_CUST0_CHIPSELGAT_MASK 0x0000000F /* Chip Select Gating Mask */
  136. #define SDR0_CUST0_CHIPSELGAT_DIS 0x00000000 /* Chip Select Gating Disable */
  137. #define SDR0_CUST0_CHIPSELGAT_ENALL 0x0000000F /*All Chip Select Gating Enable*/
  138. #define SDR0_CUST0_CHIPSELGAT_EN0 0x00000008 /* Chip Select0 Gating Enable */
  139. #define SDR0_CUST0_CHIPSELGAT_EN1 0x00000004 /* Chip Select1 Gating Enable */
  140. #define SDR0_CUST0_CHIPSELGAT_EN2 0x00000002 /* Chip Select2 Gating Enable */
  141. #define SDR0_CUST0_CHIPSELGAT_EN3 0x00000001 /* Chip Select3 Gating Enable */
  142. #define SDR0_SRST_DMC 0x00200000
  143. #define PLLSYS0_ENG_MASK 0x80000000 /* 0 = SysClk, 1 = PLL VCO */
  144. #define PLLSYS0_SRC_MASK 0x40000000 /* 0 = PLL A, 1 = PLL B */
  145. #define PLLSYS0_SEL_MASK 0x38000000 /* 0 = PLL, 1 = CPU, 5 = PerClk */
  146. #define PLLSYS0_TUNE_MASK 0x07fe0000 /* PLL Tune bits */
  147. #define PLLSYS0_FB_DIV_MASK 0x0001f000 /* Feedback divisor */
  148. #define PLLSYS0_FWD_DIV_A_MASK 0x00000f00 /* Fwd Div A */
  149. #define PLLSYS0_FWD_DIV_B_MASK 0x000000e0 /* Fwd Div B */
  150. #define PLLSYS0_PRI_DIV_B_MASK 0x0000001c /* PLL Primary Divisor B */
  151. #define PLLSYS0_OPB_DIV_MASK 0x00000003 /* OPB Divisor */
  152. #define PLLC_ENG_MASK 0x20000000 /* PLL primary forward divisor source */
  153. #define PLLC_SRC_MASK 0x20000000 /* PLL feedback source */
  154. #define PLLD_FBDV_MASK 0x1f000000 /* PLL Feedback Divisor */
  155. #define PLLD_FWDVA_MASK 0x000f0000 /* PLL Forward Divisor A */
  156. #define PLLD_FWDVB_MASK 0x00000700 /* PLL Forward Divisor B */
  157. #define PLLD_LFBDV_MASK 0x0000003f /* PLL Local Feedback Divisor */
  158. #define OPBDDV_MASK 0x03000000 /* OPB Clock Divisor Register */
  159. #define PERDV_MASK 0x07000000 /* Peripheral Clock Divisor */
  160. #define PRADV_MASK 0x07000000 /* Primary Divisor A */
  161. #define PRBDV_MASK 0x07000000 /* Primary Divisor B */
  162. #define SPCID_MASK 0x03000000 /* Sync PCI Divisor */
  163. /* Strap 1 Register */
  164. #define PLLSYS1_LF_DIV_MASK 0xfc000000 /* PLL Local Feedback Divisor */
  165. #define PLLSYS1_PERCLK_DIV_MASK 0x03000000 /* Peripheral Clk Divisor */
  166. #define PLLSYS1_MAL_DIV_MASK 0x00c00000 /* MAL Clk Divisor */
  167. #define PLLSYS1_RW_MASK 0x00300000 /* ROM width */
  168. #define PLLSYS1_EAR_MASK 0x00080000 /* ERAP Address reset vector */
  169. #define PLLSYS1_PAE_MASK 0x00040000 /* PCI arbitor enable */
  170. #define PLLSYS1_PCHE_MASK 0x00020000 /* PCI host config enable */
  171. #define PLLSYS1_PISE_MASK 0x00010000 /* PCI init seq. enable */
  172. #define PLLSYS1_PCWE_MASK 0x00008000 /* PCI local cpu wait enable */
  173. #define PLLSYS1_PPIM_MASK 0x00007800 /* PCI inbound map */
  174. #define PLLSYS1_PR64E_MASK 0x00000400 /* PCI init Req64 enable */
  175. #define PLLSYS1_PXFS_MASK 0x00000300 /* PCI-X Freq Sel */
  176. #define PLLSYS1_RSVD_MASK 0x00000080 /* RSVD */
  177. #define PLLSYS1_PDM_MASK 0x00000040 /* PCI-X Driver Mode */
  178. #define PLLSYS1_EPS_MASK 0x00000038 /* Ethernet Pin Select */
  179. #define PLLSYS1_RMII_MASK 0x00000004 /* RMII Mode */
  180. #define PLLSYS1_TRE_MASK 0x00000002 /* GPIO Trace Enable */
  181. #define PLLSYS1_NTO1_MASK 0x00000001 /* CPU:PLB N-to-1 ratio */
  182. #define CPR0_ICFG_RLI_MASK 0x80000000
  183. #define CPR0_ICFG_ICS_MASK 0x00000007
  184. #define CPR0_SPCID_SPCIDV0_MASK 0x03000000
  185. #define CPR0_SPCID_SPCIDV0_DIV1 0x01000000
  186. #define CPR0_SPCID_SPCIDV0_DIV2 0x02000000
  187. #define CPR0_SPCID_SPCIDV0_DIV3 0x03000000
  188. #define CPR0_SPCID_SPCIDV0_DIV4 0x00000000
  189. #define CPR0_PERD_PERDV0_MASK 0x07000000
  190. #define PCI_MMIO_LCR_BASE (CONFIG_SYS_PCI_BASE + 0x0f400000) /* Real =>
  191. 0x0EF400000 */
  192. /* PCI Master Local Configuration Registers */
  193. #define PCIL0_PMM0LA (PCI_MMIO_LCR_BASE + 0x00) /* PMM0 Local Address */
  194. #define PCIL0_PMM0MA (PCI_MMIO_LCR_BASE + 0x04) /* PMM0 Mask/Attribute */
  195. #define PCIL0_PMM0PCILA (PCI_MMIO_LCR_BASE + 0x08) /* PMM0 PCI Low Address */
  196. #define PCIL0_PMM0PCIHA (PCI_MMIO_LCR_BASE + 0x0C) /* PMM0 PCI High Address */
  197. #define PCIL0_PMM1LA (PCI_MMIO_LCR_BASE + 0x10) /* PMM1 Local Address */
  198. #define PCIL0_PMM1MA (PCI_MMIO_LCR_BASE + 0x14) /* PMM1 Mask/Attribute */
  199. #define PCIL0_PMM1PCILA (PCI_MMIO_LCR_BASE + 0x18) /* PMM1 PCI Low Address */
  200. #define PCIL0_PMM1PCIHA (PCI_MMIO_LCR_BASE + 0x1C) /* PMM1 PCI High Address */
  201. #define PCIL0_PMM2LA (PCI_MMIO_LCR_BASE + 0x20) /* PMM2 Local Address */
  202. #define PCIL0_PMM2MA (PCI_MMIO_LCR_BASE + 0x24) /* PMM2 Mask/Attribute */
  203. #define PCIL0_PMM2PCILA (PCI_MMIO_LCR_BASE + 0x28) /* PMM2 PCI Low Address */
  204. #define PCIL0_PMM2PCIHA (PCI_MMIO_LCR_BASE + 0x2C) /* PMM2 PCI High Address */
  205. /* PCI Target Local Configuration Registers */
  206. #define PCIL0_PTM1MS (PCI_MMIO_LCR_BASE + 0x30) /* PTM1 Memory Size/
  207. Attribute */
  208. #define PCIL0_PTM1LA (PCI_MMIO_LCR_BASE + 0x34) /* PTM1 Local Addr. Reg */
  209. #define PCIL0_PTM2MS (PCI_MMIO_LCR_BASE + 0x38) /* PTM2 Memory Size/
  210. Attribute */
  211. #define PCIL0_PTM2LA (PCI_MMIO_LCR_BASE + 0x3C) /* PTM2 Local Addr. Reg */
  212. #endif /* _PPC440EP_GR_H_ */