📄 commproc.h
字号:
uint scc_rcrc; /* Internal */ uint scc_tcrc; /* Internal */} sccp_t;/* Function code bits.*/#define SCC_EB ((u_char)0x10) /* Set big endian byte order *//* CPM Ethernet through SCCx. */typedef struct scc_enet { sccp_t sen_genscc; uint sen_cpres; /* Preset CRC */ uint sen_cmask; /* Constant mask for CRC */ uint sen_crcec; /* CRC Error counter */ uint sen_alec; /* alignment error counter */ uint sen_disfc; /* discard frame counter */ ushort sen_pads; /* Tx short frame pad character */ ushort sen_retlim; /* Retry limit threshold */ ushort sen_retcnt; /* Retry limit counter */ ushort sen_maxflr; /* maximum frame length register */ ushort sen_minflr; /* minimum frame length register */ ushort sen_maxd1; /* maximum DMA1 length */ ushort sen_maxd2; /* maximum DMA2 length */ ushort sen_maxd; /* Rx max DMA */ ushort sen_dmacnt; /* Rx DMA counter */ ushort sen_maxb; /* Max BD byte count */ ushort sen_gaddr1; /* Group address filter */ ushort sen_gaddr2; ushort sen_gaddr3; ushort sen_gaddr4; uint sen_tbuf0data0; /* Save area 0 - current frame */ uint sen_tbuf0data1; /* Save area 1 - current frame */ uint sen_tbuf0rba; /* Internal */ uint sen_tbuf0crc; /* Internal */ ushort sen_tbuf0bcnt; /* Internal */ ushort sen_paddrh; /* physical address (MSB) */ ushort sen_paddrm; ushort sen_paddrl; /* physical address (LSB) */ ushort sen_pper; /* persistence */ ushort sen_rfbdptr; /* Rx first BD pointer */ ushort sen_tfbdptr; /* Tx first BD pointer */ ushort sen_tlbdptr; /* Tx last BD pointer */ uint sen_tbuf1data0; /* Save area 0 - current frame */ uint sen_tbuf1data1; /* Save area 1 - current frame */ uint sen_tbuf1rba; /* Internal */ uint sen_tbuf1crc; /* Internal */ ushort sen_tbuf1bcnt; /* Internal */ ushort sen_txlen; /* Tx Frame length counter */ ushort sen_iaddr1; /* Individual address filter */ ushort sen_iaddr2; ushort sen_iaddr3; ushort sen_iaddr4; ushort sen_boffcnt; /* Backoff counter */ /* NOTE: Some versions of the manual have the following items * incorrectly documented. Below is the proper order. */ ushort sen_taddrh; /* temp address (MSB) */ ushort sen_taddrm; ushort sen_taddrl; /* temp address (LSB) */} scc_enet_t;/********************************************************************** * * Board specific configuration settings. * * Please note that we use the presence of a #define SCC_ENET and/or * #define FEC_ENET to enable the SCC resp. FEC ethernet drivers. **********************************************************************//*** ADS *************************************************************/#if defined(CONFIG_MPC860) && defined(CONFIG_ADS)/* This ENET stuff is for the MPC860ADS with ethernet on SCC1. */#define PROFF_ENET PROFF_SCC1#define CPM_CR_ENET CPM_CR_CH_SCC1#define SCC_ENET 0#define PA_ENET_RXD ((ushort)0x0001)#define PA_ENET_TXD ((ushort)0x0002)#define PA_ENET_TCLK ((ushort)0x0100)#define PA_ENET_RCLK ((ushort)0x0200)#define PB_ENET_TENA ((uint)0x00001000)#define PC_ENET_CLSN ((ushort)0x0010)#define PC_ENET_RENA ((ushort)0x0020)#define SICR_ENET_MASK ((uint)0x000000ff)#define SICR_ENET_CLKRT ((uint)0x0000002c)/* 68160 PHY control */#define PC_ENET_ETHLOOP ((ushort)0x0800)#define PC_ENET_TPFLDL ((ushort)0x0400)#define PC_ENET_TPSQEL ((ushort)0x0200)#endif /* MPC860ADS *//*** AMX860 **********************************************/#if defined(CONFIG_AMX860)/* This ENET stuff is for the AMX860 with ethernet on SCC1. */#define PROFF_ENET PROFF_SCC1#define CPM_CR_ENET CPM_CR_CH_SCC1#define SCC_ENET 0#define PA_ENET_RXD ((ushort)0x0001)#define PA_ENET_TXD ((ushort)0x0002)#define PA_ENET_TCLK ((ushort)0x0400)#define PA_ENET_RCLK ((ushort)0x0800)#define PB_ENET_TENA ((uint)0x00001000)#define PC_ENET_CLSN ((ushort)0x0010)#define PC_ENET_RENA ((ushort)0x0020)#define SICR_ENET_MASK ((uint)0x000000ff)#define SICR_ENET_CLKRT ((uint)0x0000003e)/* 68160 PHY control */#define PB_ENET_ETHLOOP ((uint)0x00020000)#define PB_ENET_TPFLDL ((uint)0x00010000)#define PB_ENET_TPSQEL ((uint)0x00008000)#define PD_ENET_ETH_EN ((ushort)0x0004)#endif /* CONFIG_AMX860 *//*** BSEIP **********************************************************/#ifdef CONFIG_BSEIP/* This ENET stuff is for the MPC823 with ethernet on SCC2. * This is unique to the BSE ip-Engine board. */#define PROFF_ENET PROFF_SCC2#define CPM_CR_ENET CPM_CR_CH_SCC2#define SCC_ENET 1#define PA_ENET_RXD ((ushort)0x0004)#define PA_ENET_TXD ((ushort)0x0008)#define PA_ENET_TCLK ((ushort)0x0100)#define PA_ENET_RCLK ((ushort)0x0200)#define PB_ENET_TENA ((uint)0x00002000)#define PC_ENET_CLSN ((ushort)0x0040)#define PC_ENET_RENA ((ushort)0x0080)/* BSE uses port B and C bits for PHY control also.*/#define PB_BSE_POWERUP ((uint)0x00000004)#define PB_BSE_FDXDIS ((uint)0x00008000)#define PC_BSE_LOOPBACK ((ushort)0x0800)#define SICR_ENET_MASK ((uint)0x0000ff00)#define SICR_ENET_CLKRT ((uint)0x00002c00)#endif /* CONFIG_BSEIP *//*** BSEIP **********************************************************/#ifdef CONFIG_FLAGADM/* Enet configuration for the FLAGADM *//* Enet on SCC2 */#define PROFF_ENET PROFF_SCC2#define CPM_CR_ENET CPM_CR_CH_SCC2#define SCC_ENET 1#define PA_ENET_RXD ((ushort)0x0004)#define PA_ENET_TXD ((ushort)0x0008)#define PA_ENET_TCLK ((ushort)0x0100)#define PA_ENET_RCLK ((ushort)0x0400)#define PB_ENET_TENA ((uint)0x00002000)#define PC_ENET_CLSN ((ushort)0x0040)#define PC_ENET_RENA ((ushort)0x0080)#define SICR_ENET_MASK ((uint)0x0000ff00)#define SICR_ENET_CLKRT ((uint)0x00003400)#endif /* CONFIG_FLAGADM *//*** C2MON **********************************************************/#ifdef CONFIG_C2MON# ifndef CONFIG_FEC_ENET /* use SCC for 10Mbps Ethernet */# error "Ethernet on SCC not supported on C2MON Board!"# else /* Use FEC for Fast Ethernet */#undef SCC_ENET#define FEC_ENET#define PD_MII_TXD1 ((ushort)0x1000) /* PD 3 */#define PD_MII_TXD2 ((ushort)0x0800) /* PD 4 */#define PD_MII_TXD3 ((ushort)0x0400) /* PD 5 */#define PD_MII_RX_DV ((ushort)0x0200) /* PD 6 */#define PD_MII_RX_ERR ((ushort)0x0100) /* PD 7 */#define PD_MII_RX_CLK ((ushort)0x0080) /* PD 8 */#define PD_MII_TXD0 ((ushort)0x0040) /* PD 9 */#define PD_MII_RXD0 ((ushort)0x0020) /* PD 10 */#define PD_MII_TX_ERR ((ushort)0x0010) /* PD 11 */#define PD_MII_MDC ((ushort)0x0008) /* PD 12 */#define PD_MII_RXD1 ((ushort)0x0004) /* PD 13 */#define PD_MII_RXD2 ((ushort)0x0002) /* PD 14 */#define PD_MII_RXD3 ((ushort)0x0001) /* PD 15 */#define PD_MII_MASK ((ushort)0x1FFF) /* PD 3...15 */# endif /* CONFIG_FEC_ENET */#endif /* CONFIG_C2MON *//*********************************************************************//*** CCM and PCU E ***********************************************//* The PCU E and CCM use the FEC on a MPC860T for Ethernet */#if defined (CONFIG_PCU_E) || defined(CONFIG_CCM)#define FEC_ENET /* use FEC for EThernet */#undef SCC_ENET#define PD_MII_TXD1 ((ushort)0x1000) /* PD 3 */#define PD_MII_TXD2 ((ushort)0x0800) /* PD 4 */#define PD_MII_TXD3 ((ushort)0x0400) /* PD 5 */#define PD_MII_RX_DV ((ushort)0x0200) /* PD 6 */#define PD_MII_RX_ERR ((ushort)0x0100) /* PD 7 */#define PD_MII_RX_CLK ((ushort)0x0080) /* PD 8 */#define PD_MII_TXD0 ((ushort)0x0040) /* PD 9 */#define PD_MII_RXD0 ((ushort)0x0020) /* PD 10 */#define PD_MII_TX_ERR ((ushort)0x0010) /* PD 11 */#define PD_MII_MDC ((ushort)0x0008) /* PD 12 */#define PD_MII_RXD1 ((ushort)0x0004) /* PD 13 */#define PD_MII_RXD2 ((ushort)0x0002) /* PD 14 */#define PD_MII_RXD3 ((ushort)0x0001) /* PD 15 */#define PD_MII_MASK ((ushort)0x1FFF) /* PD 3...15 */#endif /* CONFIG_PCU_E, CONFIG_CCM *//*** ELPT860 *********************************************************/#ifdef CONFIG_ELPT860/* Bits in parallel I/O port registers that have to be set/cleared * to configure the pins for SCC1 use. */# define PROFF_ENET PROFF_SCC1# define CPM_CR_ENET CPM_CR_CH_SCC1# define SCC_ENET 0# define PA_ENET_RXD ((ushort)0x0001) /* PA 15 */# define PA_ENET_TXD ((ushort)0x0002) /* PA 14 */# define PA_ENET_RCLK ((ushort)0x0100) /* PA 7 */# define PA_ENET_TCLK ((ushort)0x0200) /* PA 6 */# define PC_ENET_TENA ((ushort)0x0001) /* PC 15 */# define PC_ENET_CLSN ((ushort)0x0010) /* PC 11 */# define PC_ENET_RENA ((ushort)0x0020) /* PC 10 *//* Control bits in the SICR to route TCLK (CLK2) and RCLK (CLK1) to * SCC1. Also, make sure GR1 (bit 24) and SC1 (bit 25) are zero. */# define SICR_ENET_MASK ((uint)0x000000FF)# define SICR_ENET_CLKRT ((uint)0x00000025)#endif /* CONFIG_ELPT860 *//*** ESTEEM 192E **************************************************/#ifdef CONFIG_ESTEEM192E/* ESTEEM192E * This ENET stuff is for the MPC850 with ethernet on SCC2. This * is very similar to the RPX-Lite configuration. * Note TENA , LOOPBACK , FDPLEX_DIS on Port B. */#define PROFF_ENET PROFF_SCC2#define CPM_CR_ENET CPM_CR_CH_SCC2#define SCC_ENET 1#define PA_ENET_RXD ((ushort)0x0004)#define PA_ENET_TXD ((ushort)0x0008)#define PA_ENET_TCLK ((ushort)0x0200)#define PA_ENET_RCLK ((ushort)0x0800)#define PB_ENET_TENA ((uint)0x00002000)#define PC_ENET_CLSN ((ushort)0x0040)#define PC_ENET_RENA ((ushort)0x0080)#define SICR_ENET_MASK ((uint)0x0000ff00)#define SICR_ENET_CLKRT ((uint)0x00003d00)#define PB_ENET_LOOPBACK ((uint)0x00004000)#define PB_ENET_FDPLEX_DIS ((uint)0x00008000)#endif/*** FADS823 ********************************************************/#if defined(CONFIG_MPC823FADS) && defined(CONFIG_FADS)/* This ENET stuff is for the MPC823FADS with ethernet on SCC2. */#ifdef CONFIG_SCC2_ENET#define PROFF_ENET PROFF_SCC2#define CPM_CR_ENET CPM_CR_CH_SCC2#define SCC_ENET 1#define CPMVEC_ENET CPMVEC_SCC2#endif#ifdef CONFIG_SCC1_ENET#define PROFF_ENET PROFF_SCC1#define CPM_CR_ENET CPM_CR_CH_SCC1#define SCC_ENET 0#define CPMVEC_ENET CPMVEC_SCC1#endif#define PA_ENET_RXD ((ushort)0x0004)#define PA_ENET_TXD ((ushort)0x0008)#define PA_ENET_TCLK ((ushort)0x0400)#define PA_ENET_RCLK ((ushort)0x0200)#define PB_ENET_TENA ((uint)0x00002000)#define PC_ENET_CLSN ((ushort)0x0040)#define PC_ENET_RENA ((ushort)0x0080)#define SICR_ENET_MASK ((uint)0x0000ff00)#define SICR_ENET_CLKRT ((uint)0x00002e00)#endif /* CONFIG_FADS823FADS *//*** FADS850SAR ********************************************************/#if defined(CONFIG_MPC850SAR) && defined(CONFIG_FADS)/* This ENET stuff is for the MPC850SAR with ethernet on SCC2. Some of * this may be unique to the FADS850SAR configuration. * Note TENA is on Port B. */#define PROFF_ENET PROFF_SCC2#define CPM_CR_ENET CPM_CR_CH_SCC2#define SCC_ENET 1#define PA_ENET_RXD ((ushort)0x0004) /* PA 13 */#define PA_ENET_TXD ((ushort)0x0008) /* PA 12 */#define PA_ENET_RCLK ((ushort)0x0200) /* PA 6 */#define PA_ENET_TCLK ((ushort)0x0800) /* PA 4 */#define PB_ENET_TENA ((uint)0x00002000) /* PB 18 */#define PC_ENET_CLSN ((ushort)0x0040) /* PC 9 */#define PC_ENET_RENA ((ushort)0x0080) /* PC 8 */#define SICR_ENET_MASK ((uint)0x0000ff00)#define SICR_ENET_CLKRT ((uint)0x00002f00) /* RCLK-CLK2, TCLK-CLK4 */#endif /* CONFIG_FADS850SAR *//*** FADS860T********************************************************/#if defined(CONFIG_FADS) && defined(CONFIG_MPC86x)/* * This ENET stuff is for the MPC86xFADS/MPC8xxADS with ethernet on SCC1. */#ifdef CONFIG_SCC1_ENET#define SCC_ENET 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -