0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef __CPM1__
0019 #define __CPM1__
0020
0021 #include <linux/init.h>
0022 #include <asm/8xx_immap.h>
0023 #include <asm/ptrace.h>
0024 #include <asm/cpm.h>
0025
0026
0027
0028 #define CPM_CR_RST ((ushort)0x8000)
0029 #define CPM_CR_OPCODE ((ushort)0x0f00)
0030 #define CPM_CR_CHAN ((ushort)0x00f0)
0031 #define CPM_CR_FLG ((ushort)0x0001)
0032
0033
0034
0035 #define CPM_CR_CH_SCC1 ((ushort)0x0000)
0036 #define CPM_CR_CH_I2C ((ushort)0x0001)
0037 #define CPM_CR_CH_SCC2 ((ushort)0x0004)
0038 #define CPM_CR_CH_SPI ((ushort)0x0005)
0039 #define CPM_CR_CH_TIMER CPM_CR_CH_SPI
0040 #define CPM_CR_CH_SCC3 ((ushort)0x0008)
0041 #define CPM_CR_CH_SMC1 ((ushort)0x0009)
0042 #define CPM_CR_CH_SCC4 ((ushort)0x000c)
0043 #define CPM_CR_CH_SMC2 ((ushort)0x000d)
0044
0045 #define mk_cr_cmd(CH, CMD) ((CMD << 8) | (CH << 4))
0046
0047
0048
0049
0050 extern cpm8xx_t __iomem *cpmp;
0051
0052 #define cpm_dpalloc cpm_muram_alloc
0053 #define cpm_dpfree cpm_muram_free
0054 #define cpm_dpram_addr cpm_muram_addr
0055 #define cpm_dpram_phys cpm_muram_dma
0056
0057 extern void cpm_setbrg(uint brg, uint rate);
0058
0059 extern void __init cpm_load_patch(cpm8xx_t *cp);
0060
0061 extern void cpm_reset(void);
0062
0063
0064
0065 #define PROFF_SCC1 ((uint)0x0000)
0066 #define PROFF_IIC ((uint)0x0080)
0067 #define PROFF_SCC2 ((uint)0x0100)
0068 #define PROFF_SPI ((uint)0x0180)
0069 #define PROFF_SCC3 ((uint)0x0200)
0070 #define PROFF_SMC1 ((uint)0x0280)
0071 #define PROFF_DSP1 ((uint)0x02c0)
0072 #define PROFF_SCC4 ((uint)0x0300)
0073 #define PROFF_SMC2 ((uint)0x0380)
0074
0075
0076
0077
0078 typedef struct smc_uart {
0079 ushort smc_rbase;
0080 ushort smc_tbase;
0081 u_char smc_rfcr;
0082 u_char smc_tfcr;
0083 ushort smc_mrblr;
0084 uint smc_rstate;
0085 uint smc_idp;
0086 ushort smc_rbptr;
0087 ushort smc_ibc;
0088 uint smc_rxtmp;
0089 uint smc_tstate;
0090 uint smc_tdp;
0091 ushort smc_tbptr;
0092 ushort smc_tbc;
0093 uint smc_txtmp;
0094 ushort smc_maxidl;
0095 ushort smc_tmpidl;
0096 ushort smc_brklen;
0097 ushort smc_brkec;
0098 ushort smc_brkcr;
0099 ushort smc_rmask;
0100 char res1[8];
0101 ushort smc_rpbase;
0102 } smc_uart_t;
0103
0104
0105
0106 #define SMC_EB ((u_char)0x10)
0107
0108
0109
0110 #define SMCMR_REN ((ushort)0x0001)
0111 #define SMCMR_TEN ((ushort)0x0002)
0112 #define SMCMR_DM ((ushort)0x000c)
0113 #define SMCMR_SM_GCI ((ushort)0x0000)
0114 #define SMCMR_SM_UART ((ushort)0x0020)
0115 #define SMCMR_SM_TRANS ((ushort)0x0030)
0116 #define SMCMR_SM_MASK ((ushort)0x0030)
0117 #define SMCMR_PM_EVEN ((ushort)0x0100)
0118 #define SMCMR_REVD SMCMR_PM_EVEN
0119 #define SMCMR_PEN ((ushort)0x0200)
0120 #define SMCMR_BS SMCMR_PEN
0121 #define SMCMR_SL ((ushort)0x0400)
0122 #define SMCR_CLEN_MASK ((ushort)0x7800)
0123 #define smcr_mk_clen(C) (((C) << 11) & SMCR_CLEN_MASK)
0124
0125
0126
0127
0128
0129
0130 typedef struct smc_centronics {
0131 ushort scent_rbase;
0132 ushort scent_tbase;
0133 u_char scent_cfcr;
0134 u_char scent_smask;
0135 ushort scent_mrblr;
0136 uint scent_rstate;
0137 uint scent_r_ptr;
0138 ushort scent_rbptr;
0139 ushort scent_r_cnt;
0140 uint scent_rtemp;
0141 uint scent_tstate;
0142 uint scent_t_ptr;
0143 ushort scent_tbptr;
0144 ushort scent_t_cnt;
0145 uint scent_ttemp;
0146 ushort scent_max_sl;
0147 ushort scent_sl_cnt;
0148 ushort scent_character1;
0149 ushort scent_character2;
0150 ushort scent_character3;
0151 ushort scent_character4;
0152 ushort scent_character5;
0153 ushort scent_character6;
0154 ushort scent_character7;
0155 ushort scent_character8;
0156 ushort scent_rccm;
0157 ushort scent_rccr;
0158 } smc_cent_t;
0159
0160
0161
0162 #define SMC_CENT_F ((u_char)0x08)
0163 #define SMC_CENT_PE ((u_char)0x04)
0164 #define SMC_CENT_S ((u_char)0x02)
0165
0166
0167
0168 #define SMCM_BRKE ((unsigned char)0x40)
0169 #define SMCM_BRK ((unsigned char)0x10)
0170 #define SMCM_TXE ((unsigned char)0x10)
0171 #define SMCM_BSY ((unsigned char)0x04)
0172 #define SMCM_TX ((unsigned char)0x02)
0173 #define SMCM_RX ((unsigned char)0x01)
0174
0175
0176
0177 #define CPM_BRG_RST ((uint)0x00020000)
0178 #define CPM_BRG_EN ((uint)0x00010000)
0179 #define CPM_BRG_EXTC_INT ((uint)0x00000000)
0180 #define CPM_BRG_EXTC_CLK2 ((uint)0x00004000)
0181 #define CPM_BRG_EXTC_CLK6 ((uint)0x00008000)
0182 #define CPM_BRG_ATB ((uint)0x00002000)
0183 #define CPM_BRG_CD_MASK ((uint)0x00001ffe)
0184 #define CPM_BRG_DIV16 ((uint)0x00000001)
0185
0186
0187
0188 #define SICR_RCLK_SCC1_BRG1 ((uint)0x00000000)
0189 #define SICR_TCLK_SCC1_BRG1 ((uint)0x00000000)
0190 #define SICR_RCLK_SCC2_BRG2 ((uint)0x00000800)
0191 #define SICR_TCLK_SCC2_BRG2 ((uint)0x00000100)
0192 #define SICR_RCLK_SCC3_BRG3 ((uint)0x00100000)
0193 #define SICR_TCLK_SCC3_BRG3 ((uint)0x00020000)
0194 #define SICR_RCLK_SCC4_BRG4 ((uint)0x18000000)
0195 #define SICR_TCLK_SCC4_BRG4 ((uint)0x03000000)
0196
0197
0198
0199 #define SCC_GSMRH_IRP ((uint)0x00040000)
0200 #define SCC_GSMRH_GDE ((uint)0x00010000)
0201 #define SCC_GSMRH_TCRC_CCITT ((uint)0x00008000)
0202 #define SCC_GSMRH_TCRC_BISYNC ((uint)0x00004000)
0203 #define SCC_GSMRH_TCRC_HDLC ((uint)0x00000000)
0204 #define SCC_GSMRH_REVD ((uint)0x00002000)
0205 #define SCC_GSMRH_TRX ((uint)0x00001000)
0206 #define SCC_GSMRH_TTX ((uint)0x00000800)
0207 #define SCC_GSMRH_CDP ((uint)0x00000400)
0208 #define SCC_GSMRH_CTSP ((uint)0x00000200)
0209 #define SCC_GSMRH_CDS ((uint)0x00000100)
0210 #define SCC_GSMRH_CTSS ((uint)0x00000080)
0211 #define SCC_GSMRH_TFL ((uint)0x00000040)
0212 #define SCC_GSMRH_RFW ((uint)0x00000020)
0213 #define SCC_GSMRH_TXSY ((uint)0x00000010)
0214 #define SCC_GSMRH_SYNL16 ((uint)0x0000000c)
0215 #define SCC_GSMRH_SYNL8 ((uint)0x00000008)
0216 #define SCC_GSMRH_SYNL4 ((uint)0x00000004)
0217 #define SCC_GSMRH_RTSM ((uint)0x00000002)
0218 #define SCC_GSMRH_RSYN ((uint)0x00000001)
0219
0220 #define SCC_GSMRL_SIR ((uint)0x80000000)
0221 #define SCC_GSMRL_EDGE_NONE ((uint)0x60000000)
0222 #define SCC_GSMRL_EDGE_NEG ((uint)0x40000000)
0223 #define SCC_GSMRL_EDGE_POS ((uint)0x20000000)
0224 #define SCC_GSMRL_EDGE_BOTH ((uint)0x00000000)
0225 #define SCC_GSMRL_TCI ((uint)0x10000000)
0226 #define SCC_GSMRL_TSNC_3 ((uint)0x0c000000)
0227 #define SCC_GSMRL_TSNC_4 ((uint)0x08000000)
0228 #define SCC_GSMRL_TSNC_14 ((uint)0x04000000)
0229 #define SCC_GSMRL_TSNC_INF ((uint)0x00000000)
0230 #define SCC_GSMRL_RINV ((uint)0x02000000)
0231 #define SCC_GSMRL_TINV ((uint)0x01000000)
0232 #define SCC_GSMRL_TPL_128 ((uint)0x00c00000)
0233 #define SCC_GSMRL_TPL_64 ((uint)0x00a00000)
0234 #define SCC_GSMRL_TPL_48 ((uint)0x00800000)
0235 #define SCC_GSMRL_TPL_32 ((uint)0x00600000)
0236 #define SCC_GSMRL_TPL_16 ((uint)0x00400000)
0237 #define SCC_GSMRL_TPL_8 ((uint)0x00200000)
0238 #define SCC_GSMRL_TPL_NONE ((uint)0x00000000)
0239 #define SCC_GSMRL_TPP_ALL1 ((uint)0x00180000)
0240 #define SCC_GSMRL_TPP_01 ((uint)0x00100000)
0241 #define SCC_GSMRL_TPP_10 ((uint)0x00080000)
0242 #define SCC_GSMRL_TPP_ZEROS ((uint)0x00000000)
0243 #define SCC_GSMRL_TEND ((uint)0x00040000)
0244 #define SCC_GSMRL_TDCR_32 ((uint)0x00030000)
0245 #define SCC_GSMRL_TDCR_16 ((uint)0x00020000)
0246 #define SCC_GSMRL_TDCR_8 ((uint)0x00010000)
0247 #define SCC_GSMRL_TDCR_1 ((uint)0x00000000)
0248 #define SCC_GSMRL_RDCR_32 ((uint)0x0000c000)
0249 #define SCC_GSMRL_RDCR_16 ((uint)0x00008000)
0250 #define SCC_GSMRL_RDCR_8 ((uint)0x00004000)
0251 #define SCC_GSMRL_RDCR_1 ((uint)0x00000000)
0252 #define SCC_GSMRL_RENC_DFMAN ((uint)0x00003000)
0253 #define SCC_GSMRL_RENC_MANCH ((uint)0x00002000)
0254 #define SCC_GSMRL_RENC_FM0 ((uint)0x00001000)
0255 #define SCC_GSMRL_RENC_NRZI ((uint)0x00000800)
0256 #define SCC_GSMRL_RENC_NRZ ((uint)0x00000000)
0257 #define SCC_GSMRL_TENC_DFMAN ((uint)0x00000600)
0258 #define SCC_GSMRL_TENC_MANCH ((uint)0x00000400)
0259 #define SCC_GSMRL_TENC_FM0 ((uint)0x00000200)
0260 #define SCC_GSMRL_TENC_NRZI ((uint)0x00000100)
0261 #define SCC_GSMRL_TENC_NRZ ((uint)0x00000000)
0262 #define SCC_GSMRL_DIAG_LE ((uint)0x000000c0)
0263 #define SCC_GSMRL_DIAG_ECHO ((uint)0x00000080)
0264 #define SCC_GSMRL_DIAG_LOOP ((uint)0x00000040)
0265 #define SCC_GSMRL_DIAG_NORM ((uint)0x00000000)
0266 #define SCC_GSMRL_ENR ((uint)0x00000020)
0267 #define SCC_GSMRL_ENT ((uint)0x00000010)
0268 #define SCC_GSMRL_MODE_ENET ((uint)0x0000000c)
0269 #define SCC_GSMRL_MODE_QMC ((uint)0x0000000a)
0270 #define SCC_GSMRL_MODE_DDCMP ((uint)0x00000009)
0271 #define SCC_GSMRL_MODE_BISYNC ((uint)0x00000008)
0272 #define SCC_GSMRL_MODE_V14 ((uint)0x00000007)
0273 #define SCC_GSMRL_MODE_AHDLC ((uint)0x00000006)
0274 #define SCC_GSMRL_MODE_PROFIBUS ((uint)0x00000005)
0275 #define SCC_GSMRL_MODE_UART ((uint)0x00000004)
0276 #define SCC_GSMRL_MODE_SS7 ((uint)0x00000003)
0277 #define SCC_GSMRL_MODE_ATALK ((uint)0x00000002)
0278 #define SCC_GSMRL_MODE_HDLC ((uint)0x00000000)
0279
0280 #define SCC_TODR_TOD ((ushort)0x8000)
0281
0282
0283
0284 #define SCCM_TXE ((unsigned char)0x10)
0285 #define SCCM_BSY ((unsigned char)0x04)
0286 #define SCCM_TX ((unsigned char)0x02)
0287 #define SCCM_RX ((unsigned char)0x01)
0288
0289 typedef struct scc_param {
0290 ushort scc_rbase;
0291 ushort scc_tbase;
0292 u_char scc_rfcr;
0293 u_char scc_tfcr;
0294 ushort scc_mrblr;
0295 uint scc_rstate;
0296 uint scc_idp;
0297 ushort scc_rbptr;
0298 ushort scc_ibc;
0299 uint scc_rxtmp;
0300 uint scc_tstate;
0301 uint scc_tdp;
0302 ushort scc_tbptr;
0303 ushort scc_tbc;
0304 uint scc_txtmp;
0305 uint scc_rcrc;
0306 uint scc_tcrc;
0307 } sccp_t;
0308
0309
0310
0311 #define SCC_EB ((u_char)0x10)
0312
0313
0314
0315 typedef struct scc_enet {
0316 sccp_t sen_genscc;
0317 uint sen_cpres;
0318 uint sen_cmask;
0319 uint sen_crcec;
0320 uint sen_alec;
0321 uint sen_disfc;
0322 ushort sen_pads;
0323 ushort sen_retlim;
0324 ushort sen_retcnt;
0325 ushort sen_maxflr;
0326 ushort sen_minflr;
0327 ushort sen_maxd1;
0328 ushort sen_maxd2;
0329 ushort sen_maxd;
0330 ushort sen_dmacnt;
0331 ushort sen_maxb;
0332 ushort sen_gaddr1;
0333 ushort sen_gaddr2;
0334 ushort sen_gaddr3;
0335 ushort sen_gaddr4;
0336 uint sen_tbuf0data0;
0337 uint sen_tbuf0data1;
0338 uint sen_tbuf0rba;
0339 uint sen_tbuf0crc;
0340 ushort sen_tbuf0bcnt;
0341 ushort sen_paddrh;
0342 ushort sen_paddrm;
0343 ushort sen_paddrl;
0344 ushort sen_pper;
0345 ushort sen_rfbdptr;
0346 ushort sen_tfbdptr;
0347 ushort sen_tlbdptr;
0348 uint sen_tbuf1data0;
0349 uint sen_tbuf1data1;
0350 uint sen_tbuf1rba;
0351 uint sen_tbuf1crc;
0352 ushort sen_tbuf1bcnt;
0353 ushort sen_txlen;
0354 ushort sen_iaddr1;
0355 ushort sen_iaddr2;
0356 ushort sen_iaddr3;
0357 ushort sen_iaddr4;
0358 ushort sen_boffcnt;
0359
0360
0361
0362
0363 ushort sen_taddrh;
0364 ushort sen_taddrm;
0365 ushort sen_taddrl;
0366 } scc_enet_t;
0367
0368
0369
0370 #define SCCE_ENET_GRA ((ushort)0x0080)
0371 #define SCCE_ENET_TXE ((ushort)0x0010)
0372 #define SCCE_ENET_RXF ((ushort)0x0008)
0373 #define SCCE_ENET_BSY ((ushort)0x0004)
0374 #define SCCE_ENET_TXB ((ushort)0x0002)
0375 #define SCCE_ENET_RXB ((ushort)0x0001)
0376
0377
0378
0379 #define SCC_PSMR_HBC ((ushort)0x8000)
0380 #define SCC_PSMR_FC ((ushort)0x4000)
0381 #define SCC_PSMR_RSH ((ushort)0x2000)
0382 #define SCC_PSMR_IAM ((ushort)0x1000)
0383 #define SCC_PSMR_ENCRC ((ushort)0x0800)
0384 #define SCC_PSMR_PRO ((ushort)0x0200)
0385 #define SCC_PSMR_BRO ((ushort)0x0100)
0386 #define SCC_PSMR_SBT ((ushort)0x0080)
0387 #define SCC_PSMR_LPB ((ushort)0x0040)
0388 #define SCC_PSMR_SIP ((ushort)0x0020)
0389 #define SCC_PSMR_LCW ((ushort)0x0010)
0390 #define SCC_PSMR_NIB22 ((ushort)0x000a)
0391 #define SCC_PSMR_FDE ((ushort)0x0001)
0392
0393
0394
0395 typedef struct scc_uart {
0396 sccp_t scc_genscc;
0397 char res1[8];
0398 ushort scc_maxidl;
0399 ushort scc_idlc;
0400 ushort scc_brkcr;
0401 ushort scc_parec;
0402 ushort scc_frmec;
0403 ushort scc_nosec;
0404 ushort scc_brkec;
0405 ushort scc_brkln;
0406 ushort scc_uaddr1;
0407 ushort scc_uaddr2;
0408 ushort scc_rtemp;
0409 ushort scc_toseq;
0410 ushort scc_char1;
0411 ushort scc_char2;
0412 ushort scc_char3;
0413 ushort scc_char4;
0414 ushort scc_char5;
0415 ushort scc_char6;
0416 ushort scc_char7;
0417 ushort scc_char8;
0418 ushort scc_rccm;
0419 ushort scc_rccr;
0420 ushort scc_rlbc;
0421 } scc_uart_t;
0422
0423
0424
0425 #define UART_SCCM_GLR ((ushort)0x1000)
0426 #define UART_SCCM_GLT ((ushort)0x0800)
0427 #define UART_SCCM_AB ((ushort)0x0200)
0428 #define UART_SCCM_IDL ((ushort)0x0100)
0429 #define UART_SCCM_GRA ((ushort)0x0080)
0430 #define UART_SCCM_BRKE ((ushort)0x0040)
0431 #define UART_SCCM_BRKS ((ushort)0x0020)
0432 #define UART_SCCM_CCR ((ushort)0x0008)
0433 #define UART_SCCM_BSY ((ushort)0x0004)
0434 #define UART_SCCM_TX ((ushort)0x0002)
0435 #define UART_SCCM_RX ((ushort)0x0001)
0436
0437
0438
0439 #define SCU_PSMR_FLC ((ushort)0x8000)
0440 #define SCU_PSMR_SL ((ushort)0x4000)
0441 #define SCU_PSMR_CL ((ushort)0x3000)
0442 #define SCU_PSMR_UM ((ushort)0x0c00)
0443 #define SCU_PSMR_FRZ ((ushort)0x0200)
0444 #define SCU_PSMR_RZS ((ushort)0x0100)
0445 #define SCU_PSMR_SYN ((ushort)0x0080)
0446 #define SCU_PSMR_DRT ((ushort)0x0040)
0447 #define SCU_PSMR_PEN ((ushort)0x0010)
0448 #define SCU_PSMR_RPM ((ushort)0x000c)
0449 #define SCU_PSMR_REVP ((ushort)0x0008)
0450 #define SCU_PSMR_TPM ((ushort)0x0003)
0451 #define SCU_PSMR_TEVP ((ushort)0x0002)
0452
0453
0454
0455 typedef struct scc_trans {
0456 sccp_t st_genscc;
0457 uint st_cpres;
0458 uint st_cmask;
0459 } scc_trans_t;
0460
0461
0462
0463 typedef struct iic {
0464 ushort iic_rbase;
0465 ushort iic_tbase;
0466 u_char iic_rfcr;
0467 u_char iic_tfcr;
0468 ushort iic_mrblr;
0469 uint iic_rstate;
0470 uint iic_rdp;
0471 ushort iic_rbptr;
0472 ushort iic_rbc;
0473 uint iic_rxtmp;
0474 uint iic_tstate;
0475 uint iic_tdp;
0476 ushort iic_tbptr;
0477 ushort iic_tbc;
0478 uint iic_txtmp;
0479 char res1[4];
0480 ushort iic_rpbase;
0481 char res2[2];
0482 } iic_t;
0483
0484
0485
0486
0487 #define RCCR_TIME 0x8000
0488 #define RCCR_TIMEP(t) (((t) & 0x3F)<<8)
0489 #define RCCR_TIME_MASK 0x00FF
0490
0491
0492 #define PROFF_RTMR ((uint)0x01B0)
0493
0494 typedef struct risc_timer_pram {
0495 unsigned short tm_base;
0496 unsigned short tm_ptr;
0497 unsigned short r_tmr;
0498 unsigned short r_tmv;
0499 unsigned long tm_cmd;
0500 unsigned long tm_cnt;
0501 } rt_pram_t;
0502
0503
0504 #define TM_CMD_VALID 0x80000000
0505 #define TM_CMD_RESTART 0x40000000
0506 #define TM_CMD_PWM 0x20000000
0507 #define TM_CMD_NUM(n) (((n)&0xF)<<16)
0508 #define TM_CMD_PERIOD(p) ((p)&0xFFFF)
0509
0510
0511
0512
0513
0514
0515
0516
0517 #define CPMVEC_NR 32
0518 #define CPMVEC_PIO_PC15 ((ushort)0x1f)
0519 #define CPMVEC_SCC1 ((ushort)0x1e)
0520 #define CPMVEC_SCC2 ((ushort)0x1d)
0521 #define CPMVEC_SCC3 ((ushort)0x1c)
0522 #define CPMVEC_SCC4 ((ushort)0x1b)
0523 #define CPMVEC_PIO_PC14 ((ushort)0x1a)
0524 #define CPMVEC_TIMER1 ((ushort)0x19)
0525 #define CPMVEC_PIO_PC13 ((ushort)0x18)
0526 #define CPMVEC_PIO_PC12 ((ushort)0x17)
0527 #define CPMVEC_SDMA_CB_ERR ((ushort)0x16)
0528 #define CPMVEC_IDMA1 ((ushort)0x15)
0529 #define CPMVEC_IDMA2 ((ushort)0x14)
0530 #define CPMVEC_TIMER2 ((ushort)0x12)
0531 #define CPMVEC_RISCTIMER ((ushort)0x11)
0532 #define CPMVEC_I2C ((ushort)0x10)
0533 #define CPMVEC_PIO_PC11 ((ushort)0x0f)
0534 #define CPMVEC_PIO_PC10 ((ushort)0x0e)
0535 #define CPMVEC_TIMER3 ((ushort)0x0c)
0536 #define CPMVEC_PIO_PC9 ((ushort)0x0b)
0537 #define CPMVEC_PIO_PC8 ((ushort)0x0a)
0538 #define CPMVEC_PIO_PC7 ((ushort)0x09)
0539 #define CPMVEC_TIMER4 ((ushort)0x07)
0540 #define CPMVEC_PIO_PC6 ((ushort)0x06)
0541 #define CPMVEC_SPI ((ushort)0x05)
0542 #define CPMVEC_SMC1 ((ushort)0x04)
0543 #define CPMVEC_SMC2 ((ushort)0x03)
0544 #define CPMVEC_PIO_PC5 ((ushort)0x02)
0545 #define CPMVEC_PIO_PC4 ((ushort)0x01)
0546 #define CPMVEC_ERROR ((ushort)0x00)
0547
0548
0549
0550 #define CICR_SCD_SCC4 ((uint)0x00c00000)
0551 #define CICR_SCC_SCC3 ((uint)0x00200000)
0552 #define CICR_SCB_SCC2 ((uint)0x00040000)
0553 #define CICR_SCA_SCC1 ((uint)0x00000000)
0554 #define CICR_IRL_MASK ((uint)0x0000e000)
0555 #define CICR_HP_MASK ((uint)0x00001f00)
0556 #define CICR_IEN ((uint)0x00000080)
0557 #define CICR_SPS ((uint)0x00000001)
0558
0559 #define CPM_PIN_INPUT 0
0560 #define CPM_PIN_OUTPUT 1
0561 #define CPM_PIN_PRIMARY 0
0562 #define CPM_PIN_SECONDARY 2
0563 #define CPM_PIN_GPIO 4
0564 #define CPM_PIN_OPENDRAIN 8
0565 #define CPM_PIN_FALLEDGE 16
0566 #define CPM_PIN_ANYEDGE 0
0567
0568 enum cpm_port {
0569 CPM_PORTA,
0570 CPM_PORTB,
0571 CPM_PORTC,
0572 CPM_PORTD,
0573 CPM_PORTE,
0574 };
0575
0576 void cpm1_set_pin(enum cpm_port port, int pin, int flags);
0577
0578 enum cpm_clk_dir {
0579 CPM_CLK_RX,
0580 CPM_CLK_TX,
0581 CPM_CLK_RTX
0582 };
0583
0584 enum cpm_clk_target {
0585 CPM_CLK_SCC1,
0586 CPM_CLK_SCC2,
0587 CPM_CLK_SCC3,
0588 CPM_CLK_SCC4,
0589 CPM_CLK_SMC1,
0590 CPM_CLK_SMC2,
0591 };
0592
0593 enum cpm_clk {
0594 CPM_BRG1,
0595 CPM_BRG2,
0596 CPM_BRG3,
0597 CPM_BRG4,
0598 CPM_CLK1,
0599 CPM_CLK2,
0600 CPM_CLK3,
0601 CPM_CLK4,
0602 CPM_CLK5,
0603 CPM_CLK6,
0604 CPM_CLK7,
0605 CPM_CLK8,
0606 };
0607
0608 int cpm1_clk_setup(enum cpm_clk_target target, int clock, int mode);
0609 int cpm1_gpiochip_add16(struct device *dev);
0610 int cpm1_gpiochip_add32(struct device *dev);
0611
0612 #endif