ppc860Sio.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:29k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* Copyright 1984-1998 Wind River Systems, Inc. */
  2. /*
  3. modification history
  4. --------------------
  5. 01g,07jan99,cn   fixed properly SPR# 22503 and SPR# 24296.
  6. 01f,22oct98,cn   added missing parenthesis in some defines (SPR# 22503).
  7. 01e,13apr98,map  moved SCC device definitions to ../multi/ppc860Cpm.h
  8.                  renamed SCC_DEV to SCC_UART_DEV
  9. 01d,26mar98,map  added SMC, SCC, PIP defines.
  10. 01c,24may96,tpr  changed statusMode from VINT16 to VUINT16.
  11. 01b,22apr96,cah  change definitions to be offsets from a known #define
  12.  constant, rather than from a run-time IMMR register value.
  13.  Changes are required in sysSerial.c for this as well.
  14. 01a,11apr96,cah  created.
  15. */
  16. /*
  17.  * This file contains constants for the Motorola MPC860 PowerPC
  18.  * microcontroller chip.
  19.  */
  20. #ifndef __INCppc860Sioh
  21. #define __INCppc860Sioh
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. #ifndef _ASMLANGUAGE
  26. #include "sioLib.h"
  27. #include "drv/multi/ppc860Cpm.h"
  28. #include "drv/multi/ppc860Siu.h"
  29. /* device and channel structures */
  30. /* 
  31.  * The PPC860SMC_CHAN structure defines a serial I/O channel which
  32.  * describes the (TBD) registers for a given channel. 
  33.  * Also the various SIO driver functions ( ioctl, txStarup, callbackInstall,
  34.  * pollInput, polloutput ) that this channel could utilize are declared 
  35.  * here.
  36.  */
  37. /*  roughly things copied in structure form from multi/m68360.h    */
  38. /* MPC860 Dual Ported Ram addresses */
  39. #define PPC860_DPR_SCC1(dprbase)     ((VINT32 *) ((dprbase) + 0x1c00))
  40. #define PPC860_DPR_I2C(dprbase)      ((VINT32 *) ((dprbase) + 0x1c80))
  41. #define PPC860_DPR_MISC(dprbase)     ((VINT32 *) ((dprbase) + 0x1cb0))
  42. #define PPC860_DPR_IDMA1(dprbase)    ((VINT32 *) ((dprbase) + 0x1cc0))
  43. #define PPC860_DPR_SCC2(dprbase)     ((VINT32 *) ((dprbase) + 0x1d00))
  44. #define PPC860_DPR_SPI(dprbase)      ((VINT32 *) ((dprbase) + 0x1d80))
  45. #define PPC860_DPR_TMR(dprbase)      ((VINT32 *) ((dprbase) + 0x1db0))
  46. #define PPC860_DPR_IDMA2(dprbase)    ((VINT32 *) ((dprbase) + 0x1dc0))
  47. #define PPC860_DPR_SCC3(dprbase)     ((VINT32 *) ((dprbase) + 0x1e00))
  48. #define PPC860_DPR_SMC1(dprbase)     ((VINT32 *) ((dprbase) + 0x1e80))
  49. #define PPC860_DPR_DSP1(dprbase)     ((VINT32 *) ((dprbase) + 0x1ec0))
  50. #define PPC860_DPR_SCC4(dprbase)     ((VINT32 *) ((dprbase) + 0x1f00))
  51. #define PPC860_DPR_SMC2(dprbase)     ((VINT32 *) ((dprbase) + 0x1f80))
  52. #define PPC860_DPR_DSP2(dprbase)     ((VINT32 *) ((dprbase) + 0x1fc0))
  53. /*
  54.  * dual-ported parameter RAM SMC offsets                     
  55.  * access these with SMC_RBASE(base_dpram_addr_of_this_SMC1) 
  56.  * base_dpram_addr_of_this_SMC1 == PPC860_DPR_SMC1(dprbase)  
  57.  * or == PPC860_DPR_SMC2(dprbase)                            
  58.  */
  59. #define SMC_RBASE(base)   ((VINT16 *) ((base) + 0x00)) /* Rx Buff Descr Base */
  60. #define SMC_TBASE(base)   ((VINT16 *) ((base) + 0x02)) /* Tx Buff Descr Base */
  61. #define SMC_RFCR(base)    ((VINT8  *) ((base) + 0x04)) /* Rx Function Code */
  62. #define SMC_TFCR(base)    ((VINT8  *) ((base) + 0x05)) /* Tx Function Code */
  63. #define SMC_MRBLR(base)   ((VINT16 *) ((base) + 0x06)) /* Max Rcv Buff Length */
  64. #define SMC_RSTATE(base)  ((VINT32 *) ((base) + 0x08)) /* Rx Internal State */
  65. #define SMC_RBPTR(base)   ((VINT16 *) ((base) + 0x10)) /* Rx Buffer Pointer */
  66. #define SMC_TSTATE(base)  ((VINT32 *) ((base) + 0x18)) /* Tx Internal State */
  67. #define SMC_TBPTR(base)   ((VINT16 *) ((base) + 0x20)) /* Tx Buffer Pointer */
  68. #define SMC_MAX_IDL(base) ((VINT16 *) ((base) + 0x28)) /* Max Idle characters */
  69. #define SMC_IDLC(base)    ((VINT16 *) ((base) + 0x2A)) /* Temp Idle counter */
  70. #define SMC_BRKLN(base)   ((VINT16 *) ((base) + 0x2C)) /* Last Rx Break length*/
  71. #define SMC_BRKEC(base)   ((VINT16 *) ((base) + 0x2E)) /* Rx Brk Cond counter */
  72. #define SMC_BRKCR(base)   ((VINT16 *) ((base) + 0x30)) /* Break Count reg (Tx)*/
  73. #define SMC_RMASK(base)   ((VINT16 *) ((base) + 0x32)) /* Temp bit mask */
  74. /* dual ported parameter RAM PIP offsets */
  75.                            
  76. #define PIP_RBASE(base)   ((VINT16 *)((base) + 0x00)) /* Rx Buff Descr Base */
  77. #define PIP_TBASE(base)   ((VINT16 *)((base) + 0x01)) /* Tx Buff Descr Base */
  78. #define PIP_CFCR(base)    ((VINT8  *)((base) + 0x04)) /* Cent. Function Code */
  79. #define PIP_SMASK(base)   ((VINT8  *)((base) + 0x05)) /* Status mask */
  80. /* 
  81.  * dual-ported parameter RAM SCC offsets                       
  82.  * access these with SCC_RBASE(base_dpram_addr_of_this_SCC1)    
  83.  * base_dpram_addr_of_this_SCC1 == PPC860_DPR_SCC1(dprbase)    
  84.  * or == PPC860_DPR_SCC1(dprbase)                              
  85.  */
  86. #define SCC_RBASE(base)   ((VINT16 *) ((base) + 0x00)) /* Rx Buff Descr Base */
  87. #define SCC_TBASE(base)   ((VINT16 *) ((base) + 0x02)) /* Tx Buff Descr Base */
  88. #define SCC_RFCR(base)    ((VINT8  *) ((base) + 0x04)) /* Rx Function Code */
  89. #define SCC_TFCR(base)    ((VINT8  *) ((base) + 0x05)) /* Tx Function Code */
  90. #define SCC_MRBLR(base)   ((VINT16 *) ((base) + 0x06)) /* Max Rcv Buff Length */
  91. #define SCC_RSTATE(base)  ((VINT32 *) ((base) + 0x08)) /* Rx Internal State */
  92. #define SCC_RBPTR(base)   ((VINT16 *) ((base) + 0x10)) /* Rx Buffer Pointer */
  93. #define SCC_TSTATE(base)  ((VINT32 *) ((base) + 0x18)) /* Tx Internal State */
  94. #define SCC_TBPTR(base)   ((VINT16 *) ((base) + 0x20)) /* Tx Buffer Pointer */
  95. #define SCC_RCRC(base)    ((VINT16 *) ((base) + 0x28)) /* Max Idle characters */
  96. #define SCC_TCRC(base)    ((VINT16 *) ((base) + 0x2C)) /* Max Idle characters */
  97. #define SCC_MAX_IDL(base) ((VINT16 *) ((base) + 0x38)) /* Max Idle characters */
  98. #define SCC_IDLC(base)    ((VINT16 *) ((base) + 0x3A)) /* Temp Idle counter */
  99. #define SCC_BRKCR(base)   ((VINT16 *) ((base) + 0x3C)) /* Break Count Reg (Tx)*/
  100. #define SCC_PAREC(base)   ((VINT16 *) ((base) + 0x3E)) /* Rx Parity Err Cnt */
  101. #define SCC_FRMEC(base)   ((VINT16 *) ((base) + 0x40)) /* Rx Frame Err Cnt */
  102. #define SCC_NOSEC(base)   ((VINT16 *) ((base) + 0x42)) /* Receive Noise Cnt */
  103. /*
  104.  * dual-ported parameter RAM I2C offsets
  105.  * access these with I2C_RPBASE(base_dpram_addr_of_I2C)
  106.  */
  107. #define I2C_RPBASE(base)  ((VINT16 *) ((char *)base + 0x2C))
  108. typedef struct          /* SMC_BUF */
  109.     {
  110.     VUINT16 statusMode;             /* status and control */
  111.     VINT16      dataLength;             /* length of data buffer in bytes */
  112.     u_char *    dataPointer;            /* points to data buffer */
  113.     } SMC_BUF;
  114. typedef struct          /* SMC_PARAM */
  115.     {                 /* offset description*/
  116.     VINT16      rbase;          /* 00 Rx buffer descriptor base address */
  117.     VINT16      tbase;          /* 02 Tx buffer descriptor base address */
  118.     VINT8       rfcr;           /* 04 Rx function code */
  119.     VINT8       tfcr;           /* 05 Tx function code */
  120.     VINT16      mrblr;          /* 06 maximum receive buffer length */
  121.     VINT32      rstate;         /* 08 Rx internal state */
  122.     VINT32      res1;           /* 0C Rx internal data pointer */
  123.     VINT16      rbptr;          /* 10 Rx buffer descriptor pointer */
  124.     VINT16      res2;           /* 12 reserved/internal */
  125.     VINT32      res3;           /* 14 reserved/internal */
  126.     VINT32      tstate;         /* 18 Tx internal state */
  127.     VINT32      res4;           /* 1C reserved/internal */
  128.     VINT16      tbptr;          /* 20 Tx buffer descriptor pointer */
  129.     VINT16      res5;           /* 22 reserved/internal */
  130.     VINT32      res6;           /* 24 reserved/internal */
  131.     VINT16      maxidl;         /* 28 Maximum idle characters */
  132.     VINT16      idlc;           /* 2A temporary idle counter */
  133.     VINT16      brkln;          /* 2C last recv break length */
  134.     VINT16      brkec;          /* 2E recv break condition counter */
  135.     VINT16      brkcr;          /* 30 xmit break count register */
  136.     VINT16      r_mask;         /* 32 temporary bit mask */
  137.     } SMC_PARAM;
  138. typedef struct          /* SMC */
  139.     {
  140.     SMC_PARAM   param;                  /* SMC parameters */
  141.     } SMC;
  142. typedef struct          /* SMC_REG */
  143.     {
  144.     VINT16      smcmr;                  /* SMC Mode register */
  145.     VINT8 res1[2]; /* reserved */
  146.     VINT8       smce;                   /* SMC Event register */
  147.     VINT8 res2[3]; /* reserved */
  148.     VINT8       smcm;                   /* SMC Mask register */
  149.     } SMC_REG;
  150. /* SMC device descriptor */
  151. typedef struct          /* SMC_DEV */
  152.     {
  153.     int                 smcNum;         /* number of SMC device (1 or 2)*/
  154.     int                 txBdNum;        /* number of transmit buf descriptors */
  155.     int                 rxBdNum;        /* number of receive buf descriptors */
  156.     SMC_BUF *           txBdBase;       /* transmit BD base address */
  157.     SMC_BUF *           rxBdBase;       /* receive BD base address */
  158.     u_char *            txBufBase;      /* transmit buffer base address */
  159.     u_char *            rxBufBase;      /* receive buffer base address */
  160.     VINT32              txBufSize;      /* transmit buffer size */
  161.     VINT32              rxBufSize;      /* receive buffer size */
  162.     int                 txBdNext;       /* next transmit BD to fill */
  163.     int                 rxBdNext;       /* next receive BD to read */
  164.     volatile SMC *      pSmc;           /* SMC parameter RAM. Must point */
  165. /* at DPRAM area for SMC1 or SMC2 */
  166.     volatile SMC_REG *  pSmcReg;        /* SMC registers must point at */
  167. /* SMCMR1 or SMCMR2 */
  168.     VINT32              intMask;        /* interrupt acknowledge mask */
  169.     } SMC_DEV;
  170. /* SCC device descriptor */
  171. typedef struct          /* SCC_UART_DEV */
  172.     {
  173.     int  sccNum; /* number of SCC device */
  174.     int  txBdNum; /* number of transmit buf descriptors */
  175.     int  rxBdNum; /* number of receive buf descriptors */
  176.     SCC_BUF *  txBdBase; /* transmit BD base address */
  177.     SCC_BUF *  rxBdBase; /* receive BD base address */
  178.     u_char *  txBufBase; /* transmit buffer base address */
  179.     u_char * rxBufBase; /* receive buffer base address */
  180.     VINT32  txBufSize; /* transmit buffer size */
  181.     VINT32  rxBufSize; /* receive buffer size */
  182.     int txBdNext; /* next transmit BD to fill */
  183.     int rxBdNext; /* next receive BD to read */
  184.     volatile SCC * pScc; /* SCC parameter RAM */
  185.     volatile SCC_REG * pSccReg; /* SCC registers */
  186.     VINT32 intMask; /* interrupt acknowledge mask */
  187.     } SCC_UART_DEV;
  188. typedef struct           /* I2C_PARAM */
  189.     { /* offset description */
  190.     VINT16  rbase; /* 00 Rx buffer descriptors base address */
  191.     VINT16  tbase; /* 02 Tx buffer descriptors base address */
  192.     VINT8  rfcr; /* 04 Rx function code */
  193.     VINT8  tfcr; /* 05 Tx function code */
  194.     VINT16  mrblr; /* 06 maximum receive buffer length */
  195.     VINT32  ris; /* 08 Rx internal state */
  196.     VINT32  ridp; /* 0c Rx internal data pointer */
  197.     VINT16  rbptr; /* 10 Rx buffer descriptor pointer */
  198.     VINT16  ribc; /* 12 Rx internal byte count */
  199.     VINT32  rt; /* 14 Rx temp */
  200.     VINT32  tis; /* 18 Tx internal state */
  201.     VINT32  tidp; /* 1c Tx internal data pointer */
  202.     VINT16  tbptr; /* 20 Tx buffer descriptor pointer */
  203.     VINT16  tibc; /* 22 Tx internal byte count */
  204.     VINT32  tt; /* 24 Tx temp */
  205.     VINT32  notused; /* 28 not used */
  206.     VINT16  rpbase; /* 2c relocatable parameter RAM base */
  207.     VINT16  reserved; /* 2e reserved */
  208.     } I2C_PARAM;
  209. /* standard dual-mode serial driver header structure follows      */
  210. typedef struct ppc860_chan /* PPC860SMC_CHAN */
  211.     {
  212.     /* always goes first */
  213.     SIO_DRV_FUNCS *pDrvFuncs; /* driver functions */
  214.     
  215.     /* callbacks */
  216.     STATUS (*getTxChar)(); /* pointer to a xmitr function */
  217.     STATUS (*putRcvChar)();/* pointer to a recvr function */
  218.     void * getTxArg;
  219.     void * putRcvArg;
  220.     VINT16              int_vec;        /* interrupt vector number */
  221.     VINT16              channelMode;    /* SIO_MODE                */
  222.     int                 baudRate;
  223.     int                 clockRate;      /* CPU clock frequency (Hz) */
  224.     int                 bgrNum;         /* number of BRG being used */
  225.     VINT32 *            pBaud;          /* BRG registers */
  226.     VINT32              regBase;        /* register/DPR base address */
  227.     SMC_DEV             uart;           /* UART SCC device */
  228.     } PPC860SMC_CHAN;
  229. /* serial procedures */
  230. IMPORT void ppc860DevInit (PPC860SMC_CHAN *);
  231. IMPORT void ppc860Int (PPC860SMC_CHAN *);
  232. IMPORT void ppc800DevInit (PPC860SMC_CHAN *);
  233. IMPORT void ppc800Int (PPC860SMC_CHAN *);
  234. /*  standard dual-mode serial driver header structure follows - SCC */
  235. typedef struct ppc860Scc_chan /* PPC860SCC_CHAN */
  236.     {
  237.     /* always goes first */
  238.     SIO_DRV_FUNCS *pDrvFuncs; /* driver functions */
  239.     
  240.     /* callbacks */
  241.     STATUS (*getTxChar)(); /* pointer to a xmitr function */
  242.     STATUS (*putRcvChar)();/* pointer to a recvr function */
  243.     void * getTxArg;
  244.     void * putRcvArg;
  245.     VINT16              int_vec;        /* interrupt vector number */
  246.     VINT16              channelMode;    /* SIO_MODE                */
  247.     int                 baudRate;
  248.     int                 clockRate;      /* CPU clock frequency (Hz) */
  249.     int                 bgrNum;         /* number of BRG being used */
  250.     VINT32 *            pBaud;          /* BRG registers */
  251.     VINT32              regBase;        /* register/DPR base address */
  252.     SCC_UART_DEV        uart;           /* UART SCC device */
  253.     } PPC860SCC_CHAN;
  254. /* function declarations */
  255. IMPORT void ppc860SccInt (PPC860SCC_CHAN *);
  256. IMPORT void ppc860SccDevInit (PPC860SCC_CHAN *);
  257. /* channels */
  258. #define PPC860_CHANNEL_A 0
  259. #define PPC860_CHANNEL_B 1
  260. #define PPC860SMC_N_CHANS    2 /* number of serial channels on chip */
  261. /* SIO -- mpc860 serial channel chip -- register definitions */
  262. /* Buffer Descriptor Pointer Definitions */
  263. /* Receive BD status bits 16-bit value */
  264. #define BD_RX_EMPTY_BIT 0x8000 /* buffer is empty */
  265. #define BD_RX_WRAP_BIT 0x2000 /* last BD in chain */
  266. #define BD_RX_INTERRUPT_BIT 0x1000 /* set interrupt when filled */
  267. #define BD_RX_CON_MODE_BIT 0x0200 /* Continuous Mode bit */
  268. #define BD_RX_IDLE_CLOSE_BIT 0x0100 /* Close on IDLE recv bit */
  269. #define BD_RX_BREAK_CLOSE_BIT 0x0020 /* Close on break recv bit */
  270. #define BD_RX_FRAME_CLOSE_BIT 0x0010 /* Close on frame error bit */
  271. #define BD_RX_PARITY_ERROR_BIT 0x0008 /* Parity error in last byte */
  272. #define BD_RX_OVERRUN_ERROR_BIT 0x0002 /* Overrun occurred */
  273. /* Transmit BD status bits 16-bit value */
  274. #define BD_TX_READY_BIT 0x8000 /* Transmit ready/busy bit */
  275. #define BD_TX_WRAP_BIT 0x2000 /* last BD in chain */
  276. #define BD_TX_INTERRUPT_BIT 0x1000 /* set interrupt when emptied */
  277. #define BD_TX_CON_MODE_BIT 0x0200 /* Continuous Mode bit */
  278. #define BD_TX_PREAMBLE_BIT 0x0100 /* send preamble sequence */
  279. #define BD_STATUS_OFFSET 0x00 /* two bytes */
  280. #define BD_DATA_LENGTH_OFFSET 0x02 /* two bytes */
  281. #define BD_BUF_POINTER_OFFSET 0x04 /* four bytes */
  282. /*
  283.  * MPC860 internal register/memory map (section 17 of prelim. spec)
  284.  * note that these are offsets from the value stored in the IMMR
  285.  * register, which is in the PowerPC special register address space
  286.  * at register number 638
  287.  */
  288. /**** SIU module configuration ***/
  289. #define MPC860_SIUMCR(base) ((VINT32 *) ((base) + 0x00))
  290. /**** System Protection Control ***/
  291. #define MPC860_SYPCR(base) ((VINT32 *) ((base) + 0x04))
  292. /**** SW watch dog timer value ***/
  293. #define MPC860_SWT(base) ((VINT32 *) ((base) + 0x08))
  294. /*** Software service reg ***/
  295. #define MPC860_SWSR(base) ((VINT16 *) ((base) + 0x0E))
  296. /*** Interrupt pending reg ***/
  297. #define MPC860_SIPEND(base) ((VINT32 *) ((base) + 0x10))
  298. /*** Interrupt Mask reg ***/
  299. #define MPC860_SIMASK(base) ((VINT32 *) ((base) + 0x14))
  300. /*** Interrupt Edge level mask ***/
  301. #define MPC860_SIEL(base) ((VINT32 *) ((base) + 0x18))
  302. /*** Interrupt Vector reg ***/
  303. #define MPC860_SIVEC(base) ((VINT32 *) ((base) + 0x1C))
  304. /*** Transfer error status ***/
  305. #define MPC860_TESR(base) ((VINT32 *) ((base) + 0x20))
  306. /*** SDMA Config reg ***/
  307. #define MPC860_SDCR(base) ((VINT32 *) ((base) + 0x30))
  308. /*** CP Interrupt vector reg ***/
  309. #define MPC860_CIVR(base) ((VINT16 *) ((base) + 0x930))
  310. /*** CP Interrupt config reg ***/
  311. #define MPC860_CICR(base) ((VINT32 *) ((base) + 0x940))
  312. /*** CP Interrupt pending reg ***/
  313. #define MPC860_CIPR(base) ((VINT32 *) ((base) + 0x944))
  314. /*** CP Interrupt mask reg ***/
  315. #define MPC860_CIMR(base) ((VINT32 *) ((base) + 0x948))
  316. /*** CP Interrupt in-service reg ***/
  317. #define MPC860_CISR(base) ((VINT32 *) ((base) + 0x94C))
  318. /*** Port A data direction reg ***/
  319. #define MPC860_PADIR(base) ((VINT16 *) ((base) + 0x950))
  320. /*** Port A pin assign reg ***/
  321. #define MPC860_PAPAR(base) ((VINT16 *) ((base) + 0x952))
  322. /*** Port A open drain reg ***/
  323. #define MPC860_PAODR(base) ((VINT16 *) ((base) + 0x954))
  324. /*** Port A data reg ***/
  325. #define MPC860_PADAT(base) ((VINT16 *) ((base) + 0x956))
  326. /*** Port C data direction reg ***/
  327. #define MPC860_PCDIR(base) ((VINT16 *) ((base) + 0x960))
  328. /*** Port C pin assign reg ***/
  329. #define MPC860_PCPAR(base) ((VINT16 *) ((base) + 0x962))
  330. /*** Port C special options reg ***/
  331. #define MPC860_PCSO(base) ((VINT16 *) ((base) + 0x964))
  332. /*** Port C data reg ***/
  333. #define MPC860_PCDAT(base) ((VINT16 *) ((base) + 0x966))
  334. /*** Port C interrupt control reg ***/
  335. #define MPC860_PCINT(base) ((VINT16 *) ((base) + 0x968))
  336. /*** Port D data direction reg ***/
  337. #define MPC860_PDDIR(base) ((VINT16 *) ((base) + 0x970))
  338. /*** Port D pin assign reg ***/
  339. #define MPC860_PDPAR(base) ((VINT16 *) ((base) + 0x972))
  340. /*** Port D data reg ***/
  341. #define MPC860_PDDAT(base) ((VINT16 *) ((base) + 0x976))
  342. /*** Comm processor cmd reg ***/
  343. #define MPC860_CPCR(base) ((VINT16 *) ((base) + 0x9C0))
  344. /*** RISC config reg ***/
  345. #define MPC860_RCCR(base) ((VINT16 *) ((base) + 0x9C4))
  346. /*** RISC dev support status reg ***/
  347. #define MPC860_RMDS(base) ((VINT8  *) ((base) + 0x9C7))
  348. /*** RISC ucode dev spt control reg ***/
  349. #define MPC860_RMDR(base) ((VINT32 *) ((base) + 0x9C8))
  350. /*** RISC controller trap reg 1 ***/
  351. #define MPC860_RCTR1(base) ((VINT16 *) ((base) + 0x9CC))
  352. /*** RISC controller trap reg 2 ***/
  353. #define MPC860_RCTR2(base) ((VINT16 *) ((base) + 0x9CE))
  354. /*** RISC controller trap reg 3 ***/
  355. #define MPC860_RCTR3(base) ((VINT16 *) ((base) + 0x9D0))
  356. /*** RISC controller trap reg 4 ***/
  357. #define MPC860_RCTR4(base) ((VINT16 *) ((base) + 0x9D2))
  358. /*** RISC Timers event reg ***/
  359. #define MPC860_RTER(base) ((VINT16 *) ((base) + 0x9D6))
  360. /*** RISC Timers mask reg ***/
  361. #define MPC860_RTMR(base) ((VINT16 *) ((base) + 0x9DA))
  362. /*** baud rate generation register set ***/
  363. /*** BRG1 configuration reg ***/
  364. #define MPC860_BRGC1(base) ((VINT32 *) ((base) + 0x9F0))
  365. /*** BRG2 configuration reg ***/
  366. #define MPC860_BRGC2(base) ((VINT32 *) ((base) + 0x9F4))
  367. /*** BRG3 configuration reg ***/
  368. #define MPC860_BRGC3(base) ((VINT32 *) ((base) + 0x9F8))
  369. /*** BRG4 configuration reg ***/
  370. #define MPC860_BRGC4(base) ((VINT32 *) ((base) + 0x9FC))
  371. /*** SCC1 Mode reg low ***/
  372. #define MPC860_GSMR_L1(base) ((VINT32 *) ((base) + 0xA00))
  373. /*** SCC1 Mode reg High ***/
  374. #define MPC860_GSMR_H1(base) ((VINT32 *) ((base) + 0xA04))
  375. /*** SCC1 Protocol Specific Mode reg ***/
  376. #define MPC860_PSMR1(base) ((VINT16 *) ((base) + 0xA08))
  377. /*** SCC1 Transmit-On-Demand reg ***/
  378. #define MPC860_TODR1(base) ((VINT16 *) ((base) + 0xA0C))
  379. /*** SCC1 Data Synchronization reg ***/
  380. #define MPC860_DSR1(base) ((VINT16 *) ((base) + 0xA0E))
  381. /*** SCC1 Event reg ***/
  382. #define MPC860_SCCE1(base) ((VINT16 *) ((base) + 0xA10))
  383. /*** SCC1 Mask reg ***/
  384. #define MPC860_SCCM1(base) ((VINT16 *) ((base) + 0xA14))
  385. /*** SCC1 Status reg ***/
  386. #define MPC860_SCCS1(base) ((VINT8  *) ((base) + 0xA17))
  387. /*** SCC2 Mode reg low ***/
  388. #define MPC860_GSMR_L2(base) ((VINT32 *) ((base) + 0xA20))
  389. /*** SCC2 Mode reg High ***/
  390. #define MPC860_GSMR_H2(base) ((VINT32 *) ((base) + 0xA24))
  391. /*** SCC2 Protocol Specific Mode reg ***/
  392. #define MPC860_PSMR2(base) ((VINT16 *) ((base) + 0xA28))
  393. /*** SCC2 Transmit-On-Demand reg ***/
  394. #define MPC860_TODR2(base) ((VINT16 *) ((base) + 0xA2C))
  395. /*** SCC2 Data Synchronization reg ***/
  396. #define MPC860_DSR2(base) ((VINT16 *) ((base) + 0xA2E))
  397. /*** SCC2 Event reg ***/
  398. #define MPC860_SCCE2(base) ((VINT16 *) ((base) + 0xA30))
  399. /*** SCC2 Mask reg ***/
  400. #define MPC860_SCCM2(base) ((VINT16 *) ((base) + 0xA34))
  401. /*** SCC2 Status reg ***/
  402. #define MPC860_SCCS2(base) ((VINT8  *) ((base) + 0xA37))
  403. /*** SCC3 Mode reg low ***/
  404. #define MPC860_GSMR_L3(base) ((VINT32 *) ((base) + 0xA40))
  405. /*** SCC3 Mode reg High ***/
  406. #define MPC860_GSMR_H3(base) ((VINT32 *) ((base) + 0xA44))
  407. /*** SCC3 Protocol Specific Mode reg ***/
  408. #define MPC860_PSMR3(base) ((VINT16 *) ((base) + 0xA48))
  409. /*** SCC3 Transmit-On-Demand reg ***/
  410. #define MPC860_TODR3(base) ((VINT16 *) ((base) + 0xA4C))
  411. /*** SCC3 Data Synchronization reg ***/
  412. #define MPC860_DSR3(base) ((VINT16 *) ((base) + 0xA4E))
  413. /*** SCC3 Event reg ***/
  414. #define MPC860_SCCE3(base) ((VINT16 *) ((base) + 0xA50))
  415. /*** SCC3 Mask reg ***/
  416. #define MPC860_SCCM3(base) ((VINT16 *) ((base) + 0xA54))
  417. /*** SCC3 Status reg ***/
  418. #define MPC860_SCCS3(base) ((VINT8  *) ((base) + 0xA57))
  419. /*** SCC4 Mode reg low ***/
  420. #define MPC860_GSMR_L4(base) ((VINT32 *) ((base) + 0xA60))
  421. /*** SCC4 Mode reg High ***/
  422. #define MPC860_GSMR_H4(base) ((VINT32 *) ((base) + 0xA64))
  423. /*** SCC4 Protocol Specific Mode reg ***/
  424. #define MPC860_PSMR4(base) ((VINT16 *) ((base) + 0xA68))
  425. /*** SCC4 Transmit-On-Demand reg ***/
  426. #define MPC860_TODR4(base) ((VINT16 *) ((base) + 0xA6C))
  427. /*** SCC4 Data Synchronization reg ***/
  428. #define MPC860_DSR4(base) ((VINT16 *) ((base) + 0xA6E))
  429. /*** SCC4 Event reg ***/
  430. #define MPC860_SCCE4(base) ((VINT16 *) ((base) + 0xA70))
  431. /*** SCC4 Mask reg ***/
  432. #define MPC860_SCCM4(base) ((VINT16 *) ((base) + 0xA74))
  433. /*** SCC4 Status reg ***/
  434. #define MPC860_SCCS4(base) ((VINT8  *) ((base) + 0xA77))
  435. /*** SMC1 Mode reg ***/
  436. #define MPC860_SMCMR1(base) ((VINT16 *) ((base) + 0xA82))
  437. /*** SMC1 Event reg ***/
  438. #define MPC860_SMCE1(base) ((VINT8  *) ((base) + 0xA86))
  439. /*** SMC1 Mask reg ***/
  440. #define MPC860_SMCM1(base) ((VINT8  *) ((base) + 0xA8A))
  441. /*** SMC2 Mode reg ***/
  442. #define MPC860_SMCMR2(base) ((VINT16 *) ((base) + 0xA92))
  443. /*** SMC2 or PIP Event reg ***/
  444. #define MPC860_SMCE2(base) ((VINT8  *) ((base) + 0xA96))
  445. /*** SMC2 Mask reg ***/
  446. #define MPC860_SMCM2(base) ((VINT8  *) ((base) + 0xA9A))
  447. /*** SPI Mode reg ***/
  448. #define MPC860_SPMODE(base) ((VINT16 *) ((base) + 0xAA0))
  449. /*** SPI Event reg ***/
  450. #define MPC860_SPIE(base) ((VINT8  *) ((base) + 0xAA6))
  451. /*** SPI Mask reg ***/
  452. #define MPC860_SPIM(base) ((VINT8  *) ((base) + 0xAAA))
  453. /*** SPI Command reg ***/
  454. #define MPC860_SPCOM(base) ((VINT8  *) ((base) + 0xAAD))
  455. /*** PIP Configuration reg ***/
  456. #define MPC860_PIPC(base) ((VINT16 *) ((base) + 0xAB2))
  457. /*** PIP Timing params reg ***/
  458. #define MPC860_PTPR(base) ((VINT16 *) ((base) + 0xAB6))
  459. /*** Port B data direction reg ***/
  460. #define MPC860_PBDIR(base) ((VINT32 *) ((base) + 0xAB8))
  461. /*** Port B pin assign reg ***/
  462. #define MPC860_PBPAR(base) ((VINT32 *) ((base) + 0xABC))
  463. /*** Port B open drain reg ***/
  464. #define MPC860_PBODR(base) ((VINT16 *) ((base) + 0xAC2))
  465. /*** Port B Data register ***/
  466. #define MPC860_PBDAT(base) ((VINT32 *) ((base) + 0xAC4))
  467. /*** SI Mode reg ***/
  468. #define MPC860_SIMODE(base) ((VINT32 *) ((base) + 0xAE0))
  469. /*** SI Global Mode reg ***/
  470. #define MPC860_SIGMR(base) ((VINT8  *) ((base) + 0xAE4))
  471. /*** SI Status reg ***/
  472. #define MPC860_SISTR(base) ((VINT8  *) ((base) + 0xAE6))
  473. /*** SI Command reg ***/
  474. #define MPC860_SICMR(base) ((VINT8  *) ((base) + 0xAE7))
  475. /*** SI Clock route reg ***/
  476. #define MPC860_SICR(base) ((VINT32 *) ((base) + 0xAEC))
  477. /*** SI RAM pointers reg ***/
  478. #define MPC860_SIRP(base) ((VINT32 *) ((base) + 0xAF0))
  479. /*** SI Routing RAM base addr ***/
  480. #define MPC860_SIRAM_BASE(base) ((base) + 0xC00)
  481. /*** Data Param RAM base addr ***/
  482. #define MPC860_DPRAM_BASE(base) ((base) + 0x2000)
  483. /* Register Equates By Bit */
  484. /* Equates for Baud Rate Generation Registers */
  485. #define MPC860_BRGC_RST 0x20000 /* 1 = reset BRG */
  486. #define MPC860_BRGC_ENABLE_CNT 0x10000 /* 1 = enable clocks to BRG */
  487. #define MPC860_BRGC_BRGCLK_SRC 0x00000 /* Baud Rate Gen clock src */
  488. #define MPC860_BRGC_CLK2_SRC  0x04000 /* CLK2 pin = BRG source */
  489. #define MPC860_BRGC_CLK6_SRC 0x08000 /* CLK6 pin = BRG source */
  490. #define MPC860_BRGC_AUTOBAUD 0x02000 /* 1 = autobaud on Rx */
  491. /* 0 = normal operation */
  492. #define MPC860_BRGC_CLKDIV_MASK 0x01FFE /* 12 bit value */
  493. #define MPC860_BRGC_CLKDIV_SHIFT    0x1 /* shifted up one bit */
  494. #define MPC860_BRGC_PRESCALE_16 0x00001 /* 1 = divide-by-16 clock */
  495. /* Equates for SIMODE register */
  496. #define MPC860_SIMODE_SMC2_MUX 0x80000000 /* connected to mux SI */
  497. #define MPC860_SIMODE_SMC2_NMSI 0x00000000 /* connected to mux SI */
  498. #define MPC860_SIMODE_SMC2_BRG1 0x00000000 /* BRG1 is clock source */
  499. #define MPC860_SIMODE_SMC2_BRG2 0x10000000 /* BRG2 is clock source */
  500. #define MPC860_SIMODE_SMC2_BRG3 0x20000000 /* BRG3 is clock source */
  501. #define MPC860_SIMODE_SMC2_BRG4 0x30000000 /* BRG4 is clock source */
  502. #define MPC860_SIMODE_SMC2_CLK5 0x40000000 /* CLK5 is clock source */
  503. #define MPC860_SIMODE_SMC2_CLK6 0x50000000 /* CLK6 is clock source */
  504. #define MPC860_SIMODE_SMC2_CLK7 0x60000000 /* CLK7 is clock source */
  505. #define MPC860_SIMODE_SMC2_CLK8 0x70000000 /* CLK8 is clock source */
  506. #define MPC860_SIMODE_SMC1_MUX 0x00008000 /* connected to mux SI */
  507. #define MPC860_SIMODE_SMC1_NMSI 0x00000000 /* connected to mux SI */
  508. #define MPC860_SIMODE_SMC1_BRG1 0x00000000 /* BRG1 is clock source */
  509. #define MPC860_SIMODE_SMC1_BRG2 0x00001000 /* BRG2 is clock source */
  510. #define MPC860_SIMODE_SMC1_BRG3 0x00002000 /* BRG3 is clock source */
  511. #define MPC860_SIMODE_SMC1_BRG4 0x00003000 /* BRG4 is clock source */
  512. #define MPC860_SIMODE_SMC1_CLK1 0x00004000 /* CLK1 is clock source */
  513. #define MPC860_SIMODE_SMC1_CLK2 0x00005000 /* CLK2 is clock source */
  514. #define MPC860_SIMODE_SMC1_CLK3 0x00006000 /* CLK3 is clock source */
  515. #define MPC860_SIMODE_SMC1_CLK4 0x00007000 /* CLK4 is clock source */
  516. #define MPC860_SIMODE_TDMB_NORM 0x00000000 /* normal operation */
  517. #define MPC860_SIMODE_TDMB_ECHO 0x04000000 /* auto echo */
  518. #define MPC860_SIMODE_TDMB_LOOP 0x08000000 /* internal loopback */
  519. #define MPC860_SIMODE_TDMB_LCTR 0x0C000000 /* loopback control */
  520. /*
  521.  * Equates for SMCE SM UART-mode Event Register
  522.  * writing a one to these location clears an event/interrupt
  523.  */
  524. #define MPC860_SMCE_UART_BRK_EVENT 0x10 /* break char received */
  525. #define MPC860_SMCE_UART_BSY_EVENT 0x04 /* char discarded no bufs */
  526. #define MPC860_SMCE_UART_TX_EVENT 0x02 /* char transmitted */
  527. #define MPC860_SMCE_UART_RX_EVENT 0x01 /* char received  */
  528. #define MPC860_SMCE_UART_ALL_EVENTS ( 
  529. MPC860_SMCE_UART_BRK_EVENT    | 
  530. MPC860_SMCE_UART_BSY_EVENT    | 
  531. MPC860_SMCE_UART_TX_EVENT     | 
  532. MPC860_SMCE_UART_RX_EVENT      )
  533. /* 
  534.  * Equates for SMCM SM UART-mode Mask Register
  535.  * writing a one to these locations masks an event/interrupt
  536.  */
  537. #define MPC860_SMCM_UART_BRK_MASK 0x10 /* break char received */
  538. #define MPC860_SMCM_UART_BSY_MASK 0x04 /* char discarded no bufs */
  539. #define MPC860_SMCM_UART_TX_MASK 0x02 /* char transmitted */
  540. #define MPC860_SMCM_UART_RX_MASK 0x01 /* char received  */
  541. /* Equates for CICR register CP interrupt configuration register */
  542. #define MPC860_CICR_IRL_LEVEL_0 0x00000000 /* highest interrupt level */
  543. #define MPC860_CICR_IRL_LEVEL_1 0x00020000
  544. #define MPC860_CICR_IRL_LEVEL_2 0x00040000
  545. #define MPC860_CICR_IRL_LEVEL_3 0x00060000
  546. #define MPC860_CICR_IRL_LEVEL_4 0x00080000 /* standard value */
  547. #define MPC860_CICR_IRL_LEVEL_5 0x000A0000
  548. #define MPC860_CICR_IRL_LEVEL_6 0x000C0000
  549. #define MPC860_CICR_IRL_LEVEL_7 0x000E0000 /* lowest */
  550. #define MPC860_CICR_HP_SRC_STD 0x0001F000 /* highest priority int */
  551. #define MPC860_CICR_MASTER_IEN 0x00000080 /* master interrupt enable */
  552. /* Equates for CIMR register CP interrupt mask register */
  553. #define MPC860_CIMR_SCC1_MASK 0x40000000 /* mask SCC1 interrupt */
  554. #define MPC860_CIMR_SCC2_MASK 0x20000000 /* mask SCC2 interrupt */
  555. #define MPC860_CIMR_SMC1_MASK 0x00000010 /* mask SMC1 interrupt */
  556. #define MPC860_CIMR_SMC2_MASK 0x00000008 /* mask SMC2 interrupt */
  557. /* Equates for RFCR register receive function code register */
  558. #define MPC860_RFCR_DEC_LE 0x00 /* DEC little endian mode */
  559. #define MPC860_RFCR_PPC_LE 0x08 /* PPC little endian mode */
  560. /* reverse transmission order of */
  561. /* bytes compared to DEC/Intel mode */
  562. #define MPC860_RFCR_MOT_BE 0x18 /* big endian mode */
  563. /* Equates for TFCR register transmission function code register */
  564. #define MPC860_TFCR_DEC_LE 0x00 /* DEC little endian mode */
  565. #define MPC860_TFCR_PPC_LE 0x08 /* PPC little endian mode */
  566. /* reverse transmission order of */
  567. /* bytes compared to DEC/Intel mode */
  568. #define MPC860_TFCR_MOT_BE 0x18 /* big endian mode */
  569. /* Equates for SMC Mode Register SMCMR */
  570. #define MPC860_SMCMR_CLEN_MASK 0x7800 /* # bits in char minus one */
  571. /* set to # data bits + # parity */
  572. /* bits + # stop bits */
  573. #define MPC860_SMCMR_CLEN_STD 0x4800 /* for 8-N-1 std serial I/O */
  574. #define MPC860_SMCMR_STOPLEN_1 0x0000 /* stop length = 1 */
  575. #define MPC860_SMCMR_STOPLEN_2 0x0400 /* stop length = 2 */
  576. #define MPC860_SMCMR_NO_PARITY 0x0000 /* parity disabled */
  577. #define MPC860_SMCMR_PARITY 0x0200 /* parity enabled */
  578. #define MPC860_SMCMR_PARITY_ODD 0x0000 /* odd parity if enabled */
  579. #define MPC860_SMCMR_PARITY_EVEN 0x0100 /* even parity if enabled */
  580. #define MPC860_SMCMR_GCI_MODE 0x0000 /* GCI or SCIT mode */
  581. #define MPC860_SMCMR_UART_MODE 0x0020 /* UART mode */
  582. #define MPC860_SMCMR_TRANS_MODE 0x0030 /* totally transparent mode */
  583. #define MPC860_SMCMR_NORM_MODE 0x0000 /* normal operation mode */
  584. #define MPC860_SMCMR_LOOP_MODE 0x0004 /* local loopback mode */
  585. #define MPC860_SMCMR_ECHO_MODE 0x0008 /* echo mode */
  586. #define MPC860_SMCMR_TX_ENABLE 0x0002 /* enable transmitter */
  587. #define MPC860_SMCMR_TX_DISABLE 0x0000 /* disable transmitter */
  588. #define MPC860_SMCMR_RX_ENABLE 0x0001 /* enable receiver */
  589. #define MPC860_SMCMR_RX_DISABLE 0x0000 /* disable receiver */
  590. #define MPC860_SMCMR_STD_MODE  ( 
  591. MPC860_SMCMR_CLEN_STD  | 
  592. MPC860_SMCMR_STOPLEN_1 | 
  593. MPC860_SMCMR_NO_PARITY | 
  594. MPC860_SMCMR_UART_MODE | 
  595. MPC860_SMCMR_NORM_MODE )
  596. #define MPC860_SCMCR_STD_MODE_ENABLED ( 
  597. MPC860_SMCMR_STD_MODE  | 
  598. MPC860_SMCMR_TX_ENABLE | 
  599. MPC860_SMCMR_RX_ENABLE        )
  600. #endif /* _ASMLANGUAGE */
  601. #ifdef __cplusplus
  602. }
  603. #endif
  604. #endif /* __INCppc860Sioh */