1 /* 2 * File : x1000_cpm.h 3 * This file is part of RT-Thread RTOS 4 * COPYRIGHT (C) 2008 - 2012, RT-Thread Development Team 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License along 17 * with this program; if not, write to the Free Software Foundation, Inc., 18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 * 20 * Change Logs: 21 * Date Author Notes 22 * 2017-02-03 Urey the first version 23 */ 24 25 #ifndef _X1000_CPM_H_ 26 #define _X1000_CPM_H_ 27 28 #define CPM_CPCCR (0x00) 29 #define CPM_CPCSR (0xd4) 30 31 #define CPM_DDRCDR (0x2c) 32 #define CPM_I2SCDR (0x60) 33 #define CPM_I2SCDR1 (0x70) 34 #define CPM_LPCDR (0x64) 35 #define CPM_MSC0CDR (0x68) 36 #define CPM_MSC1CDR (0xa4) 37 #define CPM_USBCDR (0x50) 38 #define CPM_MACCDR (0x54) 39 #define CPM_UHCCDR (0x6c) 40 #define CPM_SFCCDR (0x74) 41 #define CPM_CIMCDR (0x7c) 42 #define CPM_PCMCDR (0x84) 43 #define CPM_PCMCDR1 (0xe0) 44 #define CPM_MPHYC (0xe8) 45 46 #define CPM_INTR (0xb0) 47 #define CPM_INTRE (0xb4) 48 #define CPM_DRCG (0xd0) 49 #define CPM_CPSPPR (0x38) 50 #define CPM_CPPSR (0x34) 51 52 #define CPM_USBPCR (0x3c) 53 #define CPM_USBRDT (0x40) 54 #define CPM_USBVBFIL (0x44) 55 #define CPM_USBPCR1 (0x48) 56 57 #define CPM_CPAPCR (0x10) 58 #define CPM_CPMPCR (0x14) 59 60 #define CPM_LCR (0x04) 61 #define CPM_PSWC0ST (0x90) 62 #define CPM_PSWC1ST (0x94) 63 #define CPM_PSWC2ST (0x98) 64 #define CPM_PSWC3ST (0x9c) 65 #define CPM_CLKGR (0x20) 66 #define CPM_CLKGR0 (0x20) 67 #define CPM_MESTSEL (0xec) 68 #define CPM_SRBC (0xc4) 69 #define CPM_ERNG (0xd8) 70 #define CPM_RNG (0xdc) 71 #define CPM_SLBC (0xc8) 72 #define CPM_SLPC (0xcc) 73 #define CPM_OPCR (0x24) 74 #define CPM_RSR (0x08) 75 76 77 78 79 /* 80 * CPM registers common define 81 */ 82 83 /* Clock control register(CPCCR) */ 84 #define CPCCR_SEL_SRC_LSB 30 85 #define CPCCR_SEL_SRC_MASK BITS_H2L(31, CPCCR_SEL_SRC_LSB) 86 87 #define CPCCR_SEL_CPLL_LSB 28 88 #define CPCCR_SEL_CPLL_MASK BITS_H2L(29, CPCCR_SEL_CPLL_LSB) 89 90 #define CPCCR_SEL_H0PLL_LSB 26 91 #define CPCCR_SEL_H0PLL_MASK BITS_H2L(27, CPCCR_SEL_H0PLL_LSB) 92 93 #define CPCCR_SEL_H2PLL_LSB 24 94 #define CPCCR_SEL_H2PLL_MASK BITS_H2L(25, CPCCR_SEL_H2PLL_LSB) 95 96 #define CPCCR_CE_CPU BIT22 97 #define CPCCR_CE_AHB0 BIT21 98 #define CPCCR_CE_AHB2 BIT20 99 #define CPCCR_CE (CPCCR_CE_CPU | CPCCR_CE_AHB0 | CPCCR_CE_AHB2) 100 101 #define CPCCR_PDIV_LSB 16 102 #define CPCCR_PDIV_MASK BITS_H2L(19, CPCCR_PDIV_LSB) 103 104 #define CPCCR_H2DIV_LSB 12 105 #define CPCCR_H2DIV_MASK BITS_H2L(15, CPCCR_H2DIV_LSB) 106 107 #define CPCCR_H0DIV_LSB 8 108 #define CPCCR_H0DIV_MASK BITS_H2L(11, CPCCR_H0DIV_LSB) 109 110 #define CPCCR_L2DIV_LSB 4 111 #define CPCCR_L2DIV_MASK BITS_H2L(7, CPCCR_L2DIV_LSB) 112 113 #define CPCCR_CDIV_LSB 0 114 #define CPCCR_CDIV_MASK BITS_H2L(3, CPCCR_CDIV_LSB) 115 116 #define CPM_SRC_SEL_APLL 1 117 #define CPM_PLL_SEL_SRC 1 118 #define CPM_PLL_SEL_MPLL 2 119 120 /* Clock Status register(CPCSR) */ 121 #define CPCSR_SRC_MUX BIT31 122 #define CPCSR_CPU_MUX BIT30 123 #define CPCSR_AHB0_MUX BIT29 124 #define CPCSR_AHB2_MUX BIT28 125 #define CPCSR_DDR_MUX BIT27 126 #define CPCSR_H2DIV_BUSY BIT2 127 #define CPCSR_H0DIV_BUSY BIT1 128 #define CPCSR_CDIV_BUSY BIT0 129 #define CPCSR_DIV_BUSY (CPCSR_H2DIV_BUSY | CPCSR_H0DIV_BUSY | CPCSR_CDIV_BUSY) 130 131 /* DDR clock divider register(DDCDR) */ 132 #define DDCDR_DCS_LSB 30 133 #define DDCDR_DCS_MASK BITS_H2L(31, DDCDR_DCS_LSB) 134 #define DDCDR_DCS_STOP (0 << DDCDR_DCS_LSB) 135 #define DDCDR_DCS_APLL (1 << DDCDR_DCS_LSB) 136 #define DDCDR_DCS_MPLL (2 << DDCDR_DCS_LSB) 137 #define DDCDR_CE_DDR BIT29 138 #define DDCDR_DDR_BUSY BIT28 139 #define DDCDR_DDR_STOP BIT27 140 #define DDCDR_GATE_EN BIT26 141 #define DDCDR_DDR_CHANGE_EN BIT25 142 #define DDCDR_DDR BIT24 143 #define DDCDR_DDRDIV_LSB 0 144 #define DDCDR_DDRDIV_MASK BITS_H2L(3, DDCDR_DDRDIV_LSB) 145 146 /*MACPHY clock divider Register (MACCDR)*/ 147 #define MACCDR_MACPCS BIT31 148 #define MACCDR_CE_MAC BIT29 149 #define MACCDR_MAC_BUSY BIT28 150 #define MACCDR_MAC_STOP BIT27 151 #define MACCDR_MACCDR_LSB BIT0 152 #define MACCDR_MACCDR_MASK BITS_H2L(7,MACCDR_MACCDR_LSB) 153 154 /* I2S device clock divider register(I2SCDR) */ 155 #define I2SCDR_I2PCS BIT31 156 #define I2SCDR_I2CS BIT30 157 158 #define I2SCDR_I2SDIV_M_LSB 13 159 #define I2SCDR_I2SDIV_M_MASK BITS_H2L(21,I2SCDR_I2SDIV_M_LSB) 160 #define I2SCDR_I2SDIV_N_LSB 0 /* I2SCDR bit */ 161 #define I2SCDR_I2SDIV_N_MASK BITS_H2L(7, I2SCDR_I2SDIV_N_LSB) 162 163 164 /* I2S device clock divider register(I2SCDR1) */ 165 #define I2SCDR1_NEN BIT31 166 #define I2SCDR1_DEN BIT30 167 #define I2SCDR1_I2SDIV_D_LSB 0 168 #define I2SCDR1_I2SDIV_D_MASK BITS_H2L(12,I2SCDR1_I2SDIV_D_LSB) 169 170 /* LCD pix clock divider register(LPCDR) */ 171 #define LPCDR_LPCS_LSB 31 172 #define LPCDR_LPCS_APLL (0 << LPCDR_LPCS_LSB) 173 #define LPCDR_LPCS_MPLL (1 << LPCDR_LPCS_LSB) 174 #define LPCDR_CE_LCD BIT28 175 #define LPCDR_LCD_BUSY BIT27 176 #define LPCDR_LCD_STOP BIT26 177 178 #define LPCDR_PIXDIV_LSB 0 /* LPCDR bit */ 179 #define LPCDR_PIXDIV_MASK BITS_H2L(7, LPCDR_PIXDIV_LSB) 180 181 /* MSC clock divider register(MSCCDR) */ 182 #define MSCCDR_MPCS_LSB 31 /* MPCS bit */ 183 #define MSCCDR_MPCS_APLL (0 << MSCCDR_MPCS_LSB) 184 #define MSCCDR_MPCS_MPLL (1 << MSCCDR_MPCS_LSB) 185 186 #define MSCCDR_CE_MSC BIT29 187 #define MSCCDR_MSC_BUSY BIT28 188 #define MSCCDR_MSC_STOP BIT27 189 #define MSCCDR_S_CLK0_SEL BIT15 190 191 #define MSCCDR_MSCDIV_LSB 0 /* MSCCDR bit */ 192 #define MSCCDR_MSCDIV_MASK BITS_H2L(7, MSCCDR_MSCDIV_LSB) 193 194 195 /* OTG PHY clock divider register(USBCDR) */ 196 #define USBCDR_UCS BIT31 197 #define USBCDR_UPCS BIT30 198 #define USBCDR_CE_USB BIT29 199 #define USBCDR_USB_BUSY BIT28 200 #define USBCDR_USB_STOP BIT27 201 202 #define USBCDR_OTGDIV_LSB 0 /* USBCDR bit */ 203 #define USBCDR_OTGDIV_MASK BITS_H2L(7, USBCDR_OTGDIV_LSB) 204 205 /* SSI clock divider register(SSICDR) */ 206 #define SSICDR_SPCS BIT31 207 #define SSICDR_SCS BIT30 208 #define SSICDR_CE_SSI BIT29 209 #define SSICDR_SSI_BUSY BIT28 210 #define SSICDR_SSI_STOP BIT27 211 #define SSICDR_SSIDIV_LSB 0 /* SSICDR bit */ 212 #define SSICDR_SSIDIV_MASK BITS_H2L(7, SSICDR_SSIDIV_LSB) 213 214 /* CIM mclk clock divider register(CIMCDR) */ 215 #define CIMCDR_CIMPCS_APLL (0 << 31) 216 #define CIMCDR_CIMPCS_MPLL BIT31 217 #define CIMCDR_CE_CIM BIT29 218 #define CIMCDR_CIM_BUSY BIT28 219 #define CIMCDR_CIM_STOP BIT27 220 221 #define CIMCDR_CIMDIV_LSB 0 /* CIMCDR bit */ 222 #define CIMCDR_CIMDIV_MASK BITS_H2L(7, CIMCDR_CIMDIV_LSB) 223 224 225 /* PCM device clock divider register(PCMCDR) */ 226 #define PCMCDR_PCMPCS_LSB 30 227 #define PCMCDR_PCMPCS_MASK BITS_H2L(31,PCMCDR_PCMPCS_LSB) 228 #define PCMCDR_PCMPCS_SCLK_A 0 << PCMCDR_PCMPCS_LSB 229 #define PCMCDR_PCMPCS_EXTCLK 1 << PCMCDR_PCMPCS_LSB 230 #define PCMCDR_PCMPCS_MPLL 2 << PCMCDR_PCMPCS_LSB 231 #define PCMCDR_CE_PCM BIT29 232 #define PCMCDR_PCMDIV_M_LSB 13 233 #define PCMCDR_PCMDIV_M_MASK BITS_H2L(21,PCMCDR_PCMDIV_M_LSB) 234 #define PCMCDR_PCMDIV_N_LSB 0 235 #define PCMCDR_PCMDIV_N_MASK BITS_H2L(12,PCMCDR_PCMDIV_N_LSB) 236 237 /* PCM device clock divider register(PCMCDR1) */ 238 239 #define PCMCDR1_PCM_NEN BIT31 240 #define PCMCDR1_PCM_DEN BIT30 241 #define PCMCDR1_PCMDIV_D_LSB 0 242 #define PCMCDR1_PCMDIV_D_MASK BITS_H2L(12,PCMCDR1_PCMDIV_D_LSB) 243 244 /* MAC PHY Control Register (MPHYC) */ 245 #define MPHYC_MODE_SEL BIT31 //useless now 246 #define MPHYC_MAC_SPEED_LSB 29 247 #define MPHYC_MAC_SPEED_MASK BITS_H2L(30,MPHYC_MAC_SPEED_LSB) 248 #define MPHYC_SOFT_RST BIT3 249 #define MPHYC_PHY_INTF_LSB 0 250 #define MPHYC_PHY_INTF_MASK BITS_H2L(2,MPHYC_PHY_INTF_MASK) //useless now 251 252 /* CPM Interrupt Register (CPM_INTR)*/ 253 #define CPM_INTR_VBUS_INTR BIT1 254 #define CPM_INTR_ADEV_INTR BIT0 255 256 /* CPM Interrupt Enable Register (CPM_INTRE)*/ 257 #define CPM_INTRE_VBUS_INTRE BIT1 258 #define CPM_INTRE_ADEV_INTRE BIT0 259 260 /* CPM scratch pad protected register(CPSPPR) */ 261 #define CPSPPR_CPSPR_WRITABLE (0x00005a5a) 262 263 /* OTG parameter control register(USBPCR) */ 264 #define USBPCR_USB_MODE BIT31 265 #define USBPCR_AVLD_REG BIT30 266 #define USBPCR_INCRM BIT27 /* INCR_MASK bit */ 267 #define USBPCR_TXRISE_TUNE BIT26 268 #define USBPCR_COMMONONN BIT25 269 #define USBPCR_VBUSVLDEXT BIT24 270 #define USBPCR_VBUSVLDEXTSEL BIT23 271 #define USBPCR_POR BIT22 272 #define USBPCR_SIDDQ BIT21 273 #define USBPCR_OTG_DISABLE BIT20 274 #define USBPCR_TXPREEMPHTUNE BIT6 275 276 #define USBPCR_IDPULLUP_LSB 28 /* IDPULLUP_MASK bit */ 277 #define USBPCR_IDPULLUP_MASK BITS_H2L(29, USBPCR_IDPULLUP_LSB) 278 279 #define USBPCR_COMPDISTUNE_LSB 17 280 #define USBPCR_COMPDISTUNE_MASK BITS_H2L(19, USBPCR_COMPDISTUNE_LSB) 281 282 #define USBPCR_OTGTUNE_LSB 14 283 #define USBPCR_OTGTUNE_MASK BITS_H2L(16, USBPCR_OTGTUNE_LSB) 284 285 #define USBPCR_SQRXTUNE_LSB 11 286 #define USBPCR_SQRXTUNE_MASK BITS_H2L(13, USBPCR_SQRXTUNE_LSB) 287 288 #define USBPCR_TXFSLSTUNE_LSB 7 289 #define USBPCR_TXFSLSTUNE_MASK BITS_H2L(10, USBPCR_TXFSLSTUNE_LSB) 290 291 #define USBPCR_TXRISETUNE_LSB 4 292 #define USBPCR_TXRISETUNE_MASK BITS_H2L(5, USBPCR_TXRISETUNE_LSB) 293 294 #define USBPCR_TXVREFTUNE_LSB 0 295 #define USBPCR_TXVREFTUNE_MASK BITS_H2L(3, USBPCR_TXVREFTUNE_LSB) 296 297 /* OTG reset detect timer register(USBRDT) */ 298 #define USBRDT_HB_MASK BIT26 299 #define USBRDT_VBFIL_LD_EN BIT25 300 #define USBRDT_IDDIG_EN BIT24 301 #define USBRDT_IDDIG_REG BIT23 302 303 #define USBRDT_USBRDT_LSB 0 304 #define USBRDT_USBRDT_MASK BITS_H2L(22, USBRDT_USBRDT_LSB) 305 306 /* OTG parameter control register(USBPCR1) */ 307 #define USBPCR1_REG BIT31 308 #define USBPCR1_USB_SEL BIT28 309 #define USBPCR1_REFCLKSEL_LSB 26 310 #define USBPCR1_REFCLKSEL_MASK BITS_H2L(27, USBPCR1_REFCLKSEL_LSB) 311 312 #define USBPCR1_REFCLKDIV_LSB 24 313 #define USBPCR1_REFCLKDIV_MASK BITS_H2L(25, USBPCR1_REFCLKDIV_LSB) 314 315 #define USBPCR1_PORT_RST BIT21 316 317 #define USBPCR1_WORD_IF0 BIT19 318 #define USBPCR1_WORD_IF1 BIT18 319 320 321 /* APLL control register (CPXPCR) */ 322 #define CPAPCR_BS BIT31 323 #define CPAPCR_M_LSB 24 324 #define CPAPCR_M_MASK BITS_H2L(30, CPAPCR_M_LSB) 325 326 #define CPAPCR_N_LSB 18 327 #define CPAPCR_N_MASK BITS_H2L(22, CPAPCR_N_LSB) 328 329 #define CPAPCR_OD_LSB 16 330 #define CPAPCR_OD_MASK BITS_H2L(17, CPAPCR_OD_LSB) 331 332 #define CPAPCR_LOCK BIT15 /* LOCK bit */ 333 #define CPAPCR_ON BIT10 334 #define CPAPCR_BP BIT9 335 #define CPAPCR_EN BIT8 336 #define CPAPCR_PLLST_LSB 0 337 #define CPAPCR_PLLST_MASK BITS_H2L(7,CPAPCR_PLLST_LSB) 338 339 #define CPM_CPAPCR_EN CPAPCR_EN 340 #define CPM_CPAPCR_ON CPAPCR_ON 341 342 /* MPLL control register (CPXPCR) */ 343 #define CPMPCR_BS BIT31 344 #define CPMPCR_M_LSB 24 345 #define CPMPCR_M_MASK BITS_H2L(30, CPAPCR_M_LSB) 346 347 #define CPMPCR_N_LSB 18 348 #define CPMPCR_N_MASK BITS_H2L(22, CPAPCR_N_LSB) 349 350 #define CPMPCR_OD_LSB 16 351 #define CPMPCR_OD_MASK BITS_H2L(17, CPAPCR_OD_LSB) 352 353 #define CPMPCR_EN BIT7 354 #define CPMPCR_BP BIT6 355 #define CPMPCR_LOCK BIT1 /* LOCK bit */ 356 #define CPMPCR_ON BIT0 357 358 #define CPM_CPMPCR_EN CPMPCR_EN 359 #define CPM_CPMPCR_ON CPMPCR_ON 360 361 362 363 /* Low power control register(LCR) */ 364 #define LCR_PST_LSB 8 365 #define LCD_PST_MASK BITS_H2L(19,LCR_PST_LSB) 366 #define LCR_LPM_LSB 0 367 #define LCR_LPM_MASK BITS_H2L(1,LCR_LPM_LSB) 368 369 /* Clock gate register 0(CGR0) */ 370 #define CLKGR0_DDR BIT31 371 #define CLKGR0_CPU BIT30 372 #define CLKGR0_AHB0 BIT29 373 #define CLKGR0_APB0 BIT28 374 #define CLKGR0_RTC BIT27 375 #define CLKGR0_PCM BIT26 376 #define CLKGR0_MAC BIT25 377 #define CLKGR0_AES BIT24 378 #define CLKGR0_LCD BIT23 379 #define CLKGR0_CIM BIT22 380 #define CLKGR0_PDMA BIT21 381 #define CLKGR0_OST BIT20 382 #define CLKGR0_SSI BIT19 383 #define CLKGR0_TCU BIT18 384 #define CLKGR0_DMIC BIT17 385 #define CLKGR0_UART2 BIT16 386 #define CLKGR0_UART1 BIT15 387 #define CLKGR0_UART0 BIT14 388 #define CLKGR0_SADC BIT13 389 #define CLKGR0_JPEG BIT12 390 #define CLKGR0_AIC BIT11 391 #define CLKGR0_I2C3 BIT10 392 #define CLKGR0_I2C2 BIT9 393 #define CLKGR0_I2C1 BIT8 394 #define CLKGR0_I2C0 BIT7 395 #define CLKGR0_SCC BIT6 396 #define CLKGR0_MSC1 BIT5 397 #define CLKGR0_MSC0 BIT4 398 #define CLKGR0_OTG BIT3 399 #define CLKGR0_SFC BIT2 400 #define CLKGR0_EFUSE BIT1 401 #define CLKGR0_NEMC BIT0 402 403 /* CPM MEST SEL Register */ 404 405 #define MEST_SEL_TST8 BIT8 406 #define MEST_SEL_TST7 BIT7 407 #define MEST_SEL_TST4 BIT4 408 #define MEST_SEL_TST3 BIT3 409 #define MEST_SEL_TST1 BIT1 410 #define MEST_SEL_TST0 BIT0 411 412 /*Soft Reset and Bus Control Register (SRBC)*/ 413 414 #define SRBC_JPEG_SR BIT31 415 #define SRBC_JPEG_STP BIT30 416 #define SRBC_JPEG_ACK BIT29 417 #define SRBC_LCD_SR BIT25 418 #define SRBC_LCD_STP BIT24 419 #define SRBC_LCD_ACK BIT23 420 #define SRBC_CIM_STP BIT21 421 #define SRBC_CIM_ACK BIT20 422 #define SRBC_CPU_STP BIT15 423 #define SRBC_CPU_ACK BIT14 424 #define SRBC_OTG_SR BIT12 425 #define SRBC_AHB2_STP BIT8 426 #define SRBC_AHB2_ACK BIT7 427 #define SRBC_DDR_STP BIT6 428 #define SRBC_DDR_ACK BIT5 429 430 431 /* Oscillator and power control register(OPCR) */ 432 #define OPCR_IDLE_DIS BIT31 433 #define OPCR_MASK_INT BIT30 434 #define OPCR_MASK_VPU BIT29 //ONLY FOR DEBUG 435 #define OPCR_GATE_SCLK_ABUS BIT28 436 #define OPCR_L2C_PD BIT25 437 #define OPCR_REQ_MODE BIT24 438 #define OPCR_GATE_USBPHY_CLK BIT23 439 #define OPCR_DIS_STOP_MUX BIT22 440 #define OPCR_O1ST_LSB 8 441 #define OPCR_O1ST_MASK BITS_H2L(19, OPCR_O1ST_LSB) 442 #define OPCR_OTGPHY0_ENABLE BIT7 /* otg */ 443 #define OPCR_OTGPHY1_ENABLE BIT6 /* uhc */ 444 #define OPCR_USBPHY_ENABLE (OPCR_OTGPHY0_ENABLE | OPCR_OTGPHY1_ENABLE) 445 #define OPCR_O1SE BIT4 446 #define OPCR_PD BIT3 447 #define OPCR_ERCS BIT2 448 #define OPCR_BUSMODE BIT1 449 450 451 452 /* Reset status register(RSR) */ 453 #define RSR_HR BIT3 454 #define RSR_P0R BIT2 455 #define RSR_WR BIT1 456 #define RSR_PR BIT0 457 458 459 #ifndef __ASSEMBLY__ 460 461 #define REG_CPM_CPCCR REG32(CPM_BASE + CPM_CPCCR) 462 #define REG_CPM_CPCSR REG32(CPM_BASE + CPM_CPCSR) 463 #define REG_CPM_DDCDR REG32(CPM_BASE + CPM_DDCDR) 464 #define REG_CPM_MACCDR REG32(CPM_BASE + CPM_MACCDR) 465 #define REG_CPM_I2SCDR REG32(CPM_BASE + CPM_I2SCDR) 466 #define REG_CPM_I2SCDR1 REG32(CPM_BASE + CPM_I2SCDR1) 467 #define REG_CPM_LPCDR REG32(CPM_BASE + CPM_LPCDR) 468 #define REG_CPM_MSC0CDR REG32(CPM_BASE + CPM_MSC0CDR) 469 #define REG_CPM_MSC1CDR REG32(CPM_BASE + CPM_MSC1CDR) 470 #define REG_CPM_USBCDR REG32(CPM_BASE + CPM_USBCDR) 471 #define REG_CPM_SSICDR REG32(CPM_BASE + CPM_SSICDR) 472 #define REG_CPM_CIMCDR REG32(CPM_BASE + CPM_CIMCDR) 473 #define REG_CPM_PCMCDR REG32(CPM_BASE + CPM_PCMCDR) 474 #define REG_CPM_PCMCDR1 REG32(CPM_BASE + CPM_PCMCDR1) 475 #define REG_CPM_MPHYC REG32(CPM_BASE + CPM_MPHYC) 476 #define REG_CPM_INTRCDR REG32(CPM_BASE + CPM_INTRCDR) 477 #define REG_CPM_INTRECDR REG32(CPM_BASE + CPM_INTRECDR) 478 #define REG_CPM_CPSPR REG32(CPM_BASE + CPM_CPSPR) 479 #define REG_CPM_CPSPPR REG32(CPM_BASE + CPM_CPSPPR) 480 #define REG_CPM_USBPCR REG32(CPM_BASE + CPM_USBPCR) 481 #define REG_CPM_USBRDT REG32(CPM_BASE + CPM_USBRDT) 482 #define REG_CPM_USBVBFIL REG32(CPM_BASE + CPM_USBVBFIL) 483 #define REG_CPM_USBPCR1 REG32(CPM_BASE + CPM_USBPCR1) 484 #define REG_CPM_CPAPCR REG32(CPM_BASE + CPM_CPAPCR) 485 #define REG_CPM_CPMPCR REG32(CPM_BASE + CPM_CPMPCR) 486 487 #define REG_CPM_LCR REG32(CPM_BASE + CPM_LCR) 488 #define REG_CPM_PSWC0ST REG32(CPM_BASE + CPM_PSWC0ST) 489 #define REG_CPM_PSWC1ST REG32(CPM_BASE + CPM_PSWC1ST) 490 #define REG_CPM_PSWC2ST REG32(CPM_BASE + CPM_PSWC2ST) 491 #define REG_CPM_PSWC3ST REG32(CPM_BASE + CPM_PSWC3ST) 492 #define REG_CPM_CLKGR0 REG32(CPM_BASE + CPM_CLKGR0) 493 #define REG_CPM_SRBC REG32(CPM_BASE + CPM_SRBC) 494 #define REG_CPM_SLBC REG32(CPM_BASE + CPM_SLBC) 495 #define REG_CPM_SLPC REG32(CPM_BASE + CPM_SLPC) 496 #define REG_CPM_OPCR REG32(CPM_BASE + CPM_OPCR) 497 #define REG_CPM_RSR REG32(CPM_BASE + CPM_RSR) 498 499 #define _REG_CPM_MSCCDR(n) REG_CPM_MSC##n##CDR 500 #define REG_CPM_MSCCDR(n) _REG_CPM_MSCCDR(n) 501 502 /* CPM read write */ 503 #define cpm_inl(off) readl(CPM_BASE + off) 504 #define cpm_outl(val,off) writel(val, CPM_BASE + off) 505 #define cpm_test_bit(bit,off) (cpm_inl(off) & 0x1<<(bit)) 506 #define cpm_set_bit(bit,off) (cpm_outl((cpm_inl(off) | 0x1<<(bit)),off)) 507 #define cpm_clear_bit(bit,off) (cpm_outl(cpm_inl(off) & ~(0x1 << bit), off)) 508 509 #endif /* __ASSEMBLY__ */ 510 511 #endif /* _X1000_CPM_H_ */ 512