bcm1250Lib.h
资源名称:ixp425BSP.rar [点击查看]
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:137k
源码类别:
VxWorks
开发平台:
C/C++
- #define S_MC_EMODE 0
- #define M_MC_EMODE _SB_MAKEMASK(15,S_MC_EMODE)
- #define V_MC_EMODE(x) _SB_MAKEVALUE(x,S_MC_EMODE)
- #define G_MC_EMODE(x) _SB_GETVALUE(x,S_MC_EMODE,M_MC_EMODE)
- #define V_MC_EMODE_DEFAULT V_MC_EMODE(0)
- #define S_MC_MODE 16
- #define M_MC_MODE _SB_MAKEMASK(15,S_MC_MODE)
- #define V_MC_MODE(x) _SB_MAKEVALUE(x,S_MC_MODE)
- #define G_MC_MODE(x) _SB_GETVALUE(x,S_MC_MODE,M_MC_MODE)
- #define V_MC_MODE_DEFAULT V_MC_MODE(0x22)
- #define S_MC_DRAM_TYPE 32
- #define M_MC_DRAM_TYPE _SB_MAKEMASK(3,S_MC_DRAM_TYPE)
- #define V_MC_DRAM_TYPE(x) _SB_MAKEVALUE(x,S_MC_DRAM_TYPE)
- #define G_MC_DRAM_TYPE(x) _SB_GETVALUE(x,S_MC_DRAM_TYPE,M_MC_DRAM_TYPE)
- #define K_MC_DRAM_TYPE_JEDEC 0
- #define K_MC_DRAM_TYPE_FCRAM 1
- #define K_MC_DRAM_TYPE_SGRAM 2
- #define V_MC_DRAM_TYPE_JEDEC V_MC_DRAM_TYPE(K_MC_DRAM_TYPE_JEDEC)
- #define V_MC_DRAM_TYPE_FCRAM V_MC_DRAM_TYPE(K_MC_DRAM_TYPE_FCRAM)
- #define V_MC_DRAM_TYPE_SGRAM V_MC_DRAM_TYPE(K_MC_DRAM_TYPE_SGRAM)
- #define M_MC_EXTERNALDECODE _SB_MAKEMASK1(35)
- /*
- * SDRAM Timing Register (Table 6-15)
- */
- #define M_MC_w2rIDLE_TWOCYCLES _SB_MAKEMASK1(62)
- #define M_MC_r2wIDLE_TWOCYCLES _SB_MAKEMASK1(61)
- #define M_MC_r2rIDLE_TWOCYCLES _SB_MAKEMASK1(60)
- #define S_MC_tFIFO 56
- #define M_MC_tFIFO _SB_MAKEMASK(4,S_MC_tFIFO)
- #define V_MC_tFIFO(x) _SB_MAKEVALUE(x,S_MC_tFIFO)
- #define K_MC_tFIFO_DEFAULT 1
- #define V_MC_tFIFO_DEFAULT V_MC_tFIFO(K_MC_tFIFO_DEFAULT)
- #define S_MC_tRFC 52
- #define M_MC_tRFC _SB_MAKEMASK(4,S_MC_tRFC)
- #define V_MC_tRFC(x) _SB_MAKEVALUE(x,S_MC_tRFC)
- #define K_MC_tRFC_DEFAULT 12
- #define V_MC_tRFC_DEFAULT V_MC_tRFC(K_MC_tRFC_DEFAULT)
- #define S_MC_tCwCr 40
- #define M_MC_tCwCr _SB_MAKEMASK(4,S_MC_tCwCr)
- #define V_MC_tCwCr(x) _SB_MAKEVALUE(x,S_MC_tCwCr)
- #define K_MC_tCwCr_DEFAULT 4
- #define V_MC_tCwCr_DEFAULT V_MC_tCwCr(K_MC_tCwCr_DEFAULT)
- #define S_MC_tRCr 28
- #define M_MC_tRCr _SB_MAKEMASK(4,S_MC_tRCr)
- #define V_MC_tRCr(x) _SB_MAKEVALUE(x,S_MC_tRCr)
- #define K_MC_tRCr_DEFAULT 9
- #define V_MC_tRCr_DEFAULT V_MC_tRCr(K_MC_tRCr_DEFAULT)
- #define S_MC_tRCw 24
- #define M_MC_tRCw _SB_MAKEMASK(4,S_MC_tRCw)
- #define V_MC_tRCw(x) _SB_MAKEVALUE(x,S_MC_tRCw)
- #define K_MC_tRCw_DEFAULT 10
- #define V_MC_tRCw_DEFAULT V_MC_tRCw(K_MC_tRCw_DEFAULT)
- #define S_MC_tRRD 20
- #define M_MC_tRRD _SB_MAKEMASK(4,S_MC_tRRD)
- #define V_MC_tRRD(x) _SB_MAKEVALUE(x,S_MC_tRRD)
- #define K_MC_tRRD_DEFAULT 2
- #define V_MC_tRRD_DEFAULT V_MC_tRRD(K_MC_tRRD_DEFAULT)
- #define S_MC_tRP 16
- #define M_MC_tRP _SB_MAKEMASK(4,S_MC_tRP)
- #define V_MC_tRP(x) _SB_MAKEVALUE(x,S_MC_tRP)
- #define K_MC_tRP_DEFAULT 4
- #define V_MC_tRP_DEFAULT V_MC_tRP(K_MC_tRP_DEFAULT)
- #define S_MC_tCwD 8
- #define M_MC_tCwD _SB_MAKEMASK(4,S_MC_tCwD)
- #define V_MC_tCwD(x) _SB_MAKEVALUE(x,S_MC_tCwD)
- #define K_MC_tCwD_DEFAULT 1
- #define V_MC_tCwD_DEFAULT V_MC_tCwD(K_MC_tCwD_DEFAULT)
- #define M_tCrDh _SB_MAKEMASK1(7)
- #define S_MC_tCrD 4
- #define M_MC_tCrD _SB_MAKEMASK(3,S_MC_tCrD)
- #define V_MC_tCrD(x) _SB_MAKEVALUE(x,S_MC_tCrD)
- #define K_MC_tCrD_DEFAULT 2
- #define V_MC_tCrD_DEFAULT V_MC_tCrD(K_MC_tCrD_DEFAULT)
- #define S_MC_tRCD 0
- #define M_MC_tRCD _SB_MAKEMASK(4,S_MC_tRCD)
- #define V_MC_tRCD(x) _SB_MAKEVALUE(x,S_MC_tRCD)
- #define K_MC_tRCD_DEFAULT 3
- #define V_MC_tRCD_DEFAULT V_MC_tRCD(K_MC_tRCD_DEFAULT)
- #define V_MC_TIMING_DEFAULT V_MC_tFIFO(K_MC_tFIFO_DEFAULT) |
- V_MC_tRFC(K_MC_tRFC_DEFAULT) |
- V_MC_tCwCr(K_MC_tCwCr_DEFAULT) |
- V_MC_tRCr(K_MC_tRCr_DEFAULT) |
- V_MC_tRCw(K_MC_tRCw_DEFAULT) |
- V_MC_tRRD(K_MC_tRRD_DEFAULT) |
- V_MC_tRP(K_MC_tRP_DEFAULT) |
- V_MC_tCwD(K_MC_tCwD_DEFAULT) |
- V_MC_tCrD(K_MC_tCrD_DEFAULT) |
- V_MC_tRCD(K_MC_tRCD_DEFAULT) |
- M_MC_r2rIDLE_TWOCYCLES
- /*
- * Errata says these are not the default
- * M_MC_w2rIDLE_TWOCYCLES |
- * M_MC_r2wIDLE_TWOCYCLES |
- */
- /*
- * Chip Select Start Address Register (Table 6-17)
- */
- #define S_MC_CS0_START 0
- #define M_MC_CS0_START _SB_MAKEMASK(16,S_MC_CS0_START)
- #define V_MC_CS0_START(x) _SB_MAKEVALUE(x,S_MC_CS0_START)
- #define G_MC_CS0_START(x) _SB_GETVALUE(x,S_MC_CS0_START,M_MC_CS0_START)
- #define S_MC_CS1_START 16
- #define M_MC_CS1_START _SB_MAKEMASK(16,S_MC_CS1_START)
- #define V_MC_CS1_START(x) _SB_MAKEVALUE(x,S_MC_CS1_START)
- #define G_MC_CS1_START(x) _SB_GETVALUE(x,S_MC_CS1_START,M_MC_CS1_START)
- #define S_MC_CS2_START 32
- #define M_MC_CS2_START _SB_MAKEMASK(16,S_MC_CS2_START)
- #define V_MC_CS2_START(x) _SB_MAKEVALUE(x,S_MC_CS2_START)
- #define G_MC_CS2_START(x) _SB_GETVALUE(x,S_MC_CS2_START,M_MC_CS2_START)
- #define S_MC_CS3_START 48
- #define M_MC_CS3_START _SB_MAKEMASK(16,S_MC_CS3_START)
- #define V_MC_CS3_START(x) _SB_MAKEVALUE(x,S_MC_CS3_START)
- #define G_MC_CS3_START(x) _SB_GETVALUE(x,S_MC_CS3_START,M_MC_CS3_START)
- /*
- * Chip Select End Address Register (Table 6-18)
- */
- #define S_MC_CS0_END 0
- #define M_MC_CS0_END _SB_MAKEMASK(16,S_MC_CS0_END)
- #define V_MC_CS0_END(x) _SB_MAKEVALUE(x,S_MC_CS0_END)
- #define G_MC_CS0_END(x) _SB_GETVALUE(x,S_MC_CS0_END,M_MC_CS0_END)
- #define S_MC_CS1_END 16
- #define M_MC_CS1_END _SB_MAKEMASK(16,S_MC_CS1_END)
- #define V_MC_CS1_END(x) _SB_MAKEVALUE(x,S_MC_CS1_END)
- #define G_MC_CS1_END(x) _SB_GETVALUE(x,S_MC_CS1_END,M_MC_CS1_END)
- #define S_MC_CS2_END 32
- #define M_MC_CS2_END _SB_MAKEMASK(16,S_MC_CS2_END)
- #define V_MC_CS2_END(x) _SB_MAKEVALUE(x,S_MC_CS2_END)
- #define G_MC_CS2_END(x) _SB_GETVALUE(x,S_MC_CS2_END,M_MC_CS2_END)
- #define S_MC_CS3_END 48
- #define M_MC_CS3_END _SB_MAKEMASK(16,S_MC_CS3_END)
- #define V_MC_CS3_END(x) _SB_MAKEVALUE(x,S_MC_CS3_END)
- #define G_MC_CS3_END(x) _SB_GETVALUE(x,S_MC_CS3_END,M_MC_CS3_END)
- /*
- * Chip Select Interleave Register (Table 6-19)
- */
- #define S_MC_INTLV_RESERVED 0
- #define M_MC_INTLV_RESERVED _SB_MAKEMASK(5,S_MC_INTLV_RESERVED)
- #define S_MC_INTERLEAVE 7
- #define M_MC_INTERLEAVE _SB_MAKEMASK(18,S_MC_INTERLEAVE)
- #define V_MC_INTERLEAVE(x) _SB_MAKEVALUE(x,S_MC_INTERLEAVE)
- #define S_MC_INTLV_MBZ 25
- #define M_MC_INTLV_MBZ _SB_MAKEMASK(39,S_MC_INTLV_MBZ)
- /*
- * Row Address Bits Register (Table 6-20)
- */
- #define S_MC_RAS_RESERVED 0
- #define M_MC_RAS_RESERVED _SB_MAKEMASK(5,S_MC_RAS_RESERVED)
- #define S_MC_RAS_SELECT 12
- #define M_MC_RAS_SELECT _SB_MAKEMASK(25,S_MC_RAS_SELECT)
- #define V_MC_RAS_SELECT(x) _SB_MAKEVALUE(x,S_MC_RAS_SELECT)
- #define S_MC_RAS_MBZ 37
- #define M_MC_RAS_MBZ _SB_MAKEMASK(27,S_MC_RAS_MBZ)
- /*
- * Column Address Bits Register (Table 6-21)
- */
- #define S_MC_CAS_RESERVED 0
- #define M_MC_CAS_RESERVED _SB_MAKEMASK(5,S_MC_CAS_RESERVED)
- #define S_MC_CAS_SELECT 5
- #define M_MC_CAS_SELECT _SB_MAKEMASK(18,S_MC_CAS_SELECT)
- #define V_MC_CAS_SELECT(x) _SB_MAKEVALUE(x,S_MC_CAS_SELECT)
- #define S_MC_CAS_MBZ 23
- #define M_MC_CAS_MBZ _SB_MAKEMASK(41,S_MC_CAS_MBZ)
- /*
- * Bank Address Address Bits Register (Table 6-22)
- */
- #define S_MC_BA_RESERVED 0
- #define M_MC_BA_RESERVED _SB_MAKEMASK(5,S_MC_BA_RESERVED)
- #define S_MC_BA_SELECT 5
- #define M_MC_BA_SELECT _SB_MAKEMASK(20,S_MC_BA_SELECT)
- #define V_MC_BA_SELECT(x) _SB_MAKEVALUE(x,S_MC_BA_SELECT)
- #define S_MC_BA_MBZ 25
- #define M_MC_BA_MBZ _SB_MAKEMASK(39,S_MC_BA_MBZ)
- /*
- * Chip Select Attribute Register (Table 6-23)
- */
- #define K_MC_CS_ATTR_CLOSED 0
- #define K_MC_CS_ATTR_CASCHECK 1
- #define K_MC_CS_ATTR_HINT 2
- #define K_MC_CS_ATTR_OPEN 3
- #define S_MC_CS0_PAGE 0
- #define M_MC_CS0_PAGE _SB_MAKEMASK(2,S_MC_CS0_PAGE)
- #define V_MC_CS0_PAGE(x) _SB_MAKEVALUE(x,S_MC_CS0_PAGE)
- #define G_MC_CS0_PAGE(x) _SB_GETVALUE(x,S_MC_CS0_PAGE,M_MC_CS0_PAGE)
- #define S_MC_CS1_PAGE 16
- #define M_MC_CS1_PAGE _SB_MAKEMASK(2,S_MC_CS1_PAGE)
- #define V_MC_CS1_PAGE(x) _SB_MAKEVALUE(x,S_MC_CS1_PAGE)
- #define G_MC_CS1_PAGE(x) _SB_GETVALUE(x,S_MC_CS1_PAGE,M_MC_CS1_PAGE)
- #define S_MC_CS2_PAGE 32
- #define M_MC_CS2_PAGE _SB_MAKEMASK(2,S_MC_CS2_PAGE)
- #define V_MC_CS2_PAGE(x) _SB_MAKEVALUE(x,S_MC_CS2_PAGE)
- #define G_MC_CS2_PAGE(x) _SB_GETVALUE(x,S_MC_CS2_PAGE,M_MC_CS2_PAGE)
- #define S_MC_CS3_PAGE 48
- #define M_MC_CS3_PAGE _SB_MAKEMASK(2,S_MC_CS3_PAGE)
- #define V_MC_CS3_PAGE(x) _SB_MAKEVALUE(x,S_MC_CS3_PAGE)
- #define G_MC_CS3_PAGE(x) _SB_GETVALUE(x,S_MC_CS3_PAGE,M_MC_CS3_PAGE)
- /*
- * ECC Test ECC Register (Table 6-25)
- */
- #define S_MC_ECC_INVERT 0
- #define M_MC_ECC_INVERT _SB_MAKEMASK(8,S_MC_ECC_INVERT)
- /* *********************************************************************
- * DMA constants
- ********************************************************************* */
- /*
- * Ethernet and Serial DMA Configuration Register 0 (Table 7-4)
- * Registers: DMA_CONFIG0_MAC_x_RX_CH_0
- * Registers: DMA_CONFIG0_MAC_x_TX_CH_0
- * Registers: DMA_CONFIG0_SER_x_RX
- * Registers: DMA_CONFIG0_SER_x_TX
- */
- #define M_DMA_DROP _SB_MAKEMASK1(0)
- #define M_DMA_CHAIN_SEL _SB_MAKEMASK1(1)
- #define M_DMA_RESERVED1 _SB_MAKEMASK1(2)
- #define M_DMA_EOP_INT_EN _SB_MAKEMASK1(3)
- #define M_DMA_HWM_INT_EN _SB_MAKEMASK1(4)
- #define M_DMA_LWM_INT_EN _SB_MAKEMASK1(5)
- #define M_DMA_TBX_EN _SB_MAKEMASK1(6)
- #define M_DMA_TDX_EN _SB_MAKEMASK1(7)
- #define S_DMA_INT_PKTCNT _SB_MAKE64(8)
- #define M_DMA_INT_PKTCNT _SB_MAKEMASK(8,S_DMA_INT_PKTCNT)
- #define V_DMA_INT_PKTCNT(x) _SB_MAKEVALUE(x,S_DMA_INT_PKTCNT)
- #define G_DMA_INT_PKTCNT(x) _SB_GETVALUE(x,S_DMA_INT_PKTCNT,M_DMA_INT_PKTCNT)
- #define S_DMA_RINGSZ _SB_MAKE64(16)
- #define M_DMA_RINGSZ _SB_MAKEMASK(16,S_DMA_RINGSZ)
- #define V_DMA_RINGSZ(x) _SB_MAKEVALUE(x,S_DMA_RINGSZ)
- #define G_DMA_RINGSZ(x) _SB_GETVALUE(x,S_DMA_RINGSZ,M_DMA_RINGSZ)
- #define S_DMA_HIGH_WATERMARK _SB_MAKE64(32)
- #define M_DMA_HIGH_WATERMARK _SB_MAKEMASK(16,S_DMA_HIGH_WATERMARK)
- #define V_DMA_HIGH_WATERMARK(x) _SB_MAKEVALUE(x,S_DMA_HIGH_WATERMARK)
- #define G_DMA_HIGH_WATERMARK(x) _SB_GETVALUE(x,S_DMA_HIGH_WATERMARK,M_DMA_HIGH_WATERMARK)
- #define S_DMA_LOW_WATERMARK _SB_MAKE64(48)
- #define M_DMA_LOW_WATERMARK _SB_MAKEMASK(16,S_DMA_LOW_WATERMARK)
- #define V_DMA_LOW_WATERMARK(x) _SB_MAKEVALUE(x,S_DMA_LOW_WATERMARK)
- #define G_DMA_LOW_WATERMARK(x) _SB_GETVALUE(x,S_DMA_LOW_WATERMARK,M_DMA_LOW_WATERMARK)
- /*
- * Ethernet and Serial DMA Configuration Register 2 (Table 7-5)
- * Registers: DMA_CONFIG1_MAC_x_RX_CH_0
- * Registers: DMA_CONFIG1_DMA_x_TX_CH_0
- * Registers: DMA_CONFIG1_SER_x_RX
- * Registers: DMA_CONFIG1_SER_x_TX
- */
- #define M_DMA_HDR_CF_EN _SB_MAKEMASK1(0)
- #define M_DMA_ASIC_XFR_EN _SB_MAKEMASK1(1)
- #define M_DMA_PRE_ADDR_EN _SB_MAKEMASK1(2)
- #define M_DMA_FLOW_CTL_EN _SB_MAKEMASK1(3)
- #define M_DMA_NO_DSCR_UPDT _SB_MAKEMASK1(4)
- #define M_DMA_L2CA _SB_MAKEMASK1(5)
- #define M_DMA_MBZ1 _SB_MAKEMASK(6,15)
- #define S_DMA_HDR_SIZE _SB_MAKE64(21)
- #define M_DMA_HDR_SIZE _SB_MAKEMASK(9,S_DMA_HDR_SIZE)
- #define V_DMA_HDR_SIZE(x) _SB_MAKEVALUE(x,S_DMA_HDR_SIZE)
- #define G_DMA_HDR_SIZE(x) _SB_GETVALUE(x,S_DMA_HDR_SIZE,M_DMA_HDR_SIZE)
- #define M_DMA_MBZ2 _SB_MAKEMASK(5,32)
- #define S_DMA_ASICXFR_SIZE _SB_MAKE64(37)
- #define M_DMA_ASICXFR_SIZE _SB_MAKEMASK(9,S_DMA_ASICXFR_SIZE)
- #define V_DMA_ASICXFR_SIZE(x) _SB_MAKEVALUE(x,S_DMA_ASICXFR_SIZE)
- #define G_DMA_ASICXFR_SIZE(x) _SB_GETVALUE(x,S_DMA_ASICXFR_SIZE,M_DMA_ASICXFR_SIZE)
- #define S_DMA_INT_TIMEOUT _SB_MAKE64(48)
- #define M_DMA_INT_TIMEOUT _SB_MAKEMASK(16,S_DMA_INT_TIMEOUT)
- #define V_DMA_INT_TIMEOUT(x) _SB_MAKEVALUE(x,S_DMA_INT_TIMEOUT)
- #define G_DMA_INT_TIMEOUT(x) _SB_GETVALUE(x,S_DMA_INT_TIMEOUT,M_DMA_INT_TIMEOUT)
- /*
- * Ethernet and Serial DMA Descriptor base address (Table 7-6)
- */
- #define M_DMA_DSCRBASE_MBZ _SB_MAKEMASK(4,0)
- /*
- * ASIC Mode Base Address (Table 7-7)
- */
- #define M_DMA_ASIC_BASE_MBZ _SB_MAKEMASK(20,0)
- /*
- * DMA Descriptor Count Registers (Table 7-8)
- */
- /* No bitfields */
- /*
- * Current Descriptor Address Register (Table 7-11)
- */
- #define S_DMA_CURDSCR_ADDR _SB_MAKE64(0)
- #define M_DMA_CURDSCR_ADDR _SB_MAKEMASK(40,S_DMA_CURDSCR_ADDR)
- #define S_DMA_CURDSCR_COUNT _SB_MAKE64(48)
- #define M_DMA_CURDSCR_COUNT _SB_MAKEMASK(16,S_DMA_CURDSCR_COUNT)
- /* *********************************************************************
- * DMA Descriptors
- ********************************************************************* */
- /*
- * Descriptor doubleword "A" (Table 7-12)
- */
- #define S_DMA_DSCRA_OFFSET _SB_MAKE64(0)
- #define M_DMA_DSCRA_OFFSET _SB_MAKEMASK(5,S_DMA_DSCRA_OFFSET)
- /* Note: Don't shift the address over, just mask it with the mask below */
- #define S_DMA_DSCRA_A_ADDR _SB_MAKE64(5)
- #define M_DMA_DSCRA_A_ADDR _SB_MAKEMASK(35,S_DMA_DSCRA_A_ADDR)
- #define M_DMA_DSCRA_A_ADDR_OFFSET (M_DMA_DSCRA_OFFSET | M_DMA_DSCRA_A_ADDR)
- #define S_DMA_DSCRA_A_SIZE _SB_MAKE64(40)
- #define M_DMA_DSCRA_A_SIZE _SB_MAKEMASK(9,S_DMA_DSCRA_A_SIZE)
- #define V_DMA_DSCRA_A_SIZE(x) _SB_MAKEVALUE(x,S_DMA_DSCRA_A_SIZE)
- #define G_DMA_DSCRA_A_SIZE(x) _SB_GETVALUE(x,S_DMA_DSCRA_A_SIZE,M_DMA_DSCRA_A_SIZE)
- #define M_DMA_DSCRA_INTERRUPT _SB_MAKEMASK1(49)
- #define M_DMA_DSCRA_OFFSETB _SB_MAKEMASK1(50)
- #define S_DMA_DSCRA_STATUS _SB_MAKE64(51)
- #define M_DMA_DSCRA_STATUS _SB_MAKEMASK(13,S_DMA_DSCRA_STATUS)
- #define V_DMA_DSCRA_STATUS(x) _SB_MAKEVALUE(x,S_DMA_DSCRA_STATUS)
- #define G_DMA_DSCRA_STATUS(x) _SB_GETVALUE(x,S_DMA_DSCRA_STATUS,M_DMA_DSCRA_STATUS)
- /*
- * Descriptor doubleword "B" (Table 7-13)
- */
- #define S_DMA_DSCRB_OPTIONS _SB_MAKE64(0)
- #define M_DMA_DSCRB_OPTIONS _SB_MAKEMASK(4,S_DMA_DSCRB_OPTIONS)
- #define V_DMA_DSCRB_OPTIONS(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_OPTIONS)
- #define G_DMA_DSCRB_OPTIONS(x) _SB_GETVALUE(x,S_DMA_DSCRB_OPTIONS,M_DMA_DSCRB_OPTIONS)
- #define R_DMA_DSCRB_ADDR _SB_MAKE64(0x10)
- /* Note: Don't shift the address over, just mask it with the mask below */
- #define S_DMA_DSCRB_B_ADDR _SB_MAKE64(5)
- #define M_DMA_DSCRB_B_ADDR _SB_MAKEMASK(35,S_DMA_DSCRB_B_ADDR)
- #define S_DMA_DSCRB_B_SIZE _SB_MAKE64(40)
- #define M_DMA_DSCRB_B_SIZE _SB_MAKEMASK(9,S_DMA_DSCRB_B_SIZE)
- #define V_DMA_DSCRB_B_SIZE(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_B_SIZE)
- #define G_DMA_DSCRB_B_SIZE(x) _SB_GETVALUE(x,S_DMA_DSCRB_B_SIZE,M_DMA_DSCRB_B_SIZE)
- #define M_DMA_DSCRB_B_VALID _SB_MAKEMASK1(49)
- #define S_DMA_DSCRB_PKT_SIZE _SB_MAKE64(50)
- #define M_DMA_DSCRB_PKT_SIZE _SB_MAKEMASK(14,S_DMA_DSCRB_PKT_SIZE)
- #define V_DMA_DSCRB_PKT_SIZE(x) _SB_MAKEVALUE(x,S_DMA_DSCRB_PKT_SIZE)
- #define G_DMA_DSCRB_PKT_SIZE(x) _SB_GETVALUE(x,S_DMA_DSCRB_PKT_SIZE,M_DMA_DSCRB_PKT_SIZE)
- /*
- * Ethernet Descriptor Status Bits (Table 7-15)
- */
- #define M_DMA_ETHRX_BADIP4CS _SB_MAKEMASK1(51)
- #define M_DMA_ETHRX_DSCRERR _SB_MAKEMASK1(52)
- #define S_DMA_ETHRX_RXCH 53
- #define M_DMA_ETHRX_RXCH _SB_MAKEMASK(2,S_DMA_ETHRX_RXCH)
- #define V_DMA_ETHRX_RXCH(x) _SB_MAKEVALUE(x,S_DMA_ETHRX_RXCH)
- #define G_DMA_ETHRX_RXCH(x) _SB_GETVALUE(x,S_DMA_ETHRX_RXCH,M_DMA_ETHRX_RXCH)
- #define S_DMA_ETHRX_PKTTYPE 55
- #define M_DMA_ETHRX_PKTTYPE _SB_MAKEMASK(3,S_DMA_ETHRX_PKTTYPE)
- #define V_DMA_ETHRX_PKTTYPE(x) _SB_MAKEVALUE(x,S_DMA_ETHRX_PKTTYPE)
- #define G_DMA_ETHRX_PKTTYPE(x) _SB_GETVALUE(x,S_DMA_ETHRX_PKTTYPE,M_DMA_ETHRX_PKTTYPE)
- #define K_DMA_ETHRX_PKTTYPE_IPV4 0
- #define K_DMA_ETHRX_PKTTYPE_ARPV4 1
- #define K_DMA_ETHRX_PKTTYPE_802 2
- #define K_DMA_ETHRX_PKTTYPE_OTHER 3
- #define K_DMA_ETHRX_PKTTYPE_USER0 4
- #define K_DMA_ETHRX_PKTTYPE_USER1 5
- #define K_DMA_ETHRX_PKTTYPE_USER2 6
- #define K_DMA_ETHRX_PKTTYPE_USER3 7
- #define M_DMA_ETHRX_MATCH_EXACT _SB_MAKEMASK1(58)
- #define M_DMA_ETHRX_MATCH_HASH _SB_MAKEMASK1(59)
- #define M_DMA_ETHRX_BCAST _SB_MAKEMASK1(60)
- #define M_DMA_ETHRX_MCAST _SB_MAKEMASK1(61)
- #define M_DMA_ETHRX_BAD _SB_MAKEMASK1(62)
- #define M_DMA_ETHRX_SOP _SB_MAKEMASK1(63)
- /*
- * Ethernet Transmit Status Bits (Table 7-16)
- */
- #define M_DMA_ETHTX_SOP _SB_MAKEMASK1(63)
- /*
- * Ethernet Transmit Options (Table 7-17)
- */
- #define K_DMA_ETHTX_NOTSOP _SB_MAKE64(0x00)
- #define K_DMA_ETHTX_APPENDCRC _SB_MAKE64(0x01)
- #define K_DMA_ETHTX_REPLACECRC _SB_MAKE64(0x02)
- #define K_DMA_ETHTX_APPENDCRC_APPENDPAD _SB_MAKE64(0x03)
- #define K_DMA_ETHTX_APPENDVLAN_REPLACECRC _SB_MAKE64(0x04)
- #define K_DMA_ETHTX_REMOVEVLAN_REPLACECRC _SB_MAKE64(0x05)
- #define K_DMA_ETHTX_REPLACEVLAN_REPLACECRC _SB_MAKE64(0x6)
- #define K_DMA_ETHTX_NOMODS _SB_MAKE64(0x07)
- #define K_DMA_ETHTX_RESERVED1 _SB_MAKE64(0x08)
- #define K_DMA_ETHTX_REPLACESADDR_APPENDCRC _SB_MAKE64(0x09)
- #define K_DMA_ETHTX_REPLACESADDR_REPLACECRC _SB_MAKE64(0x0A)
- #define K_DMA_ETHTX_REPLACESADDR_APPENDCRC_APPENDPAD _SB_MAKE64(0x0B)
- #define K_DMA_ETHTX_REPLACESADDR_APPENDVLAN_REPLACECRC _SB_MAKE64(0x0C)
- #define K_DMA_ETHTX_REPLACESADDR_REMOVEVLAN_REPLACECRC _SB_MAKE64(0x0D)
- #define K_DMA_ETHTX_REPLACESADDR_REPLACEVLAN_REPLACECRC _SB_MAKE64(0x0E)
- #define K_DMA_ETHTX_RESERVED2 _SB_MAKE64(0x0F)
- /*
- * Serial Receive Options (Table 7-18)
- */
- #define M_DMA_SERRX_CRC_ERROR _SB_MAKEMASK1(56)
- #define M_DMA_SERRX_ABORT _SB_MAKEMASK1(57)
- #define M_DMA_SERRX_OCTET_ERROR _SB_MAKEMASK1(58)
- #define M_DMA_SERRX_LONGFRAME_ERROR _SB_MAKEMASK1(59)
- #define M_DMA_SERRX_SHORTFRAME_ERROR _SB_MAKEMASK1(60)
- #define M_DMA_SERRX_OVERRUN_ERROR _SB_MAKEMASK1(61)
- #define M_DMA_SERRX_GOOD _SB_MAKEMASK1(62)
- #define M_DMA_SERRX_SOP _SB_MAKEMASK1(63)
- /*
- * Serial Transmit Status Bits (Table 7-20)
- */
- #define M_DMA_SERTX_FLAG _SB_MAKEMASK1(63)
- /*
- * Serial Transmit Options (Table 7-21)
- */
- #define K_DMA_SERTX_RESERVED _SB_MAKEMASK1(0)
- #define K_DMA_SERTX_APPENDCRC _SB_MAKEMASK1(1)
- #define K_DMA_SERTX_APPENDPAD _SB_MAKEMASK1(2)
- #define K_DMA_SERTX_ABORT _SB_MAKEMASK1(3)
- /* *********************************************************************
- * Data Mover Registers
- ********************************************************************* */
- /*
- * Data Mover Descriptor Base Address Register (Table 7-22)
- * Register: DM_DSCR_BASE_0
- * Register: DM_DSCR_BASE_1
- * Register: DM_DSCR_BASE_2
- * Register: DM_DSCR_BASE_3
- */
- #define M_DM_DSCR_BASE_MBZ _SB_MAKEMASK(3,0)
- /* Note: Just mask the base address and then OR it in. */
- #define S_DM_DSCR_BASE_ADDR _SB_MAKE64(3)
- #define M_DM_DSCR_BASE_ADDR _SB_MAKEMASK(36,S_DM_DSCR_BASE_ADDR)
- #define S_DM_DSCR_BASE_RINGSZ _SB_MAKE64(40)
- #define M_DM_DSCR_BASE_RINGSZ _SB_MAKEMASK(16,S_DM_DSCR_BASE_RINGSZ)
- #define V_DM_DSCR_BASE_RINGSZ(x) _SB_MAKEVALUE(x,S_DM_DSCR_BASE_RINGSZ)
- #define G_DM_DSCR_BASE_RINGSZ(x) _SB_GETVALUE(x,S_DM_DSCR_BASE_RINGSZ,M_DM_DSCR_BASE_RINGSZ)
- #define S_DM_DSCR_BASE_PRIORITY _SB_MAKE64(56)
- #define M_DM_DSCR_BASE_PRIORITY _SB_MAKEMASK(3,S_DM_DSCR_BASE_PRIORITY)
- #define V_DM_DSCR_BASE_PRIORITY(x) _SB_MAKEVALUE(x,S_DM_DSCR_BASE_PRIORITY)
- #define G_DM_DSCR_BASE_PRIORITY(x) _SB_GETVALUE(x,S_DM_DSCR_BASE_PRIORITY,M_DM_DSCR_BASE_PRIORITY)
- #define K_DM_DSCR_BASE_PRIORITY_1 0
- #define K_DM_DSCR_BASE_PRIORITY_2 1
- #define K_DM_DSCR_BASE_PRIORITY_4 2
- #define K_DM_DSCR_BASE_PRIORITY_8 3
- #define K_DM_DSCR_BASE_PRIORITY_16 4
- #define M_DM_DSCR_BASE_ACTIVE _SB_MAKEMASK1(59)
- #define M_DM_DSCR_BASE_INTERRUPT _SB_MAKEMASK1(60)
- #define M_DM_DSCR_BASE_RESET _SB_MAKEMASK1(61) /* write register */
- #define M_DM_DSCR_BASE_ERROR _SB_MAKEMASK1(61) /* read register */
- #define M_DM_DSCR_BASE_ABORT _SB_MAKEMASK1(62)
- #define M_DM_DSCR_BASE_ENABL _SB_MAKEMASK1(63)
- /*
- * Data Mover Descriptor Count Register (Table 7-25)
- */
- /* no bitfields */
- /*
- * Data Mover Current Descriptor Address (Table 7-24)
- * Register: DM_CUR_DSCR_ADDR_0
- * Register: DM_CUR_DSCR_ADDR_1
- * Register: DM_CUR_DSCR_ADDR_2
- * Register: DM_CUR_DSCR_ADDR_3
- */
- #define S_DM_CUR_DSCR_DSCR_ADDR _SB_MAKE64(0)
- #define M_DM_CUR_DSCR_DSCR_ADDR _SB_MAKEMASK(40,S_DM_CUR_DSCR_DSCR_ADDR)
- #define S_DM_CUR_DSCR_DSCR_COUNT _SB_MAKE64(48)
- #define M_DM_CUR_DSCR_DSCR_COUNT _SB_MAKEMASK(16,S_DM_CUR_DSCR_DSCR_COUNT)
- #define V_DM_CUR_DSCR_DSCR_COUNT(r) _SB_MAKEVALUE(r,S_DM_CUR_DSCR_DSCR_COUNT)
- #define G_DM_CUR_DSCR_DSCR_COUNT(r) _SB_GETVALUE(r,S_DM_CUR_DSCR_DSCR_COUNT,
- M_DM_CUR_DSCR_DSCR_COUNT)
- /*
- * Data Mover Descriptor Doubleword "A" (Table 7-26)
- */
- #define S_DM_DSCRA_DST_ADDR _SB_MAKE64(0)
- #define M_DM_DSCRA_DST_ADDR _SB_MAKEMASK(40,S_DM_DSCRA_DST_ADDR)
- #define M_DM_DSCRA_UN_DEST _SB_MAKEMASK1(40)
- #define M_DM_DSCRA_UN_SRC _SB_MAKEMASK1(41)
- #define M_DM_DSCRA_INTERRUPT _SB_MAKEMASK1(42)
- #define M_DM_DSCRA_THROTTLE _SB_MAKEMASK1(43)
- #define S_DM_DSCRA_DIR_DEST _SB_MAKE64(44)
- #define M_DM_DSCRA_DIR_DEST _SB_MAKEMASK(2,S_DM_DSCRA_DIR_DEST)
- #define V_DM_DSCRA_DIR_DEST(x) _SB_MAKEVALUE(x,S_DM_DSCRA_DIR_DEST)
- #define G_DM_DSCRA_DIR_DEST(x) _SB_GETVALUE(x,S_DM_DSCRA_DIR_DEST,M_DM_DSCRA_DIR_DEST)
- #define K_DM_DSCRA_DIR_DEST_INCR 0
- #define K_DM_DSCRA_DIR_DEST_DECR 1
- #define K_DM_DSCRA_DIR_DEST_CONST 2
- #define V_DM_DSCRA_DIR_DEST_INCR _SB_MAKEVALUE(K_DM_DSCRA_DIR_DEST_INCR,S_DM_DSCRA_DIR_DEST)
- #define V_DM_DSCRA_DIR_DEST_DECR _SB_MAKEVALUE(K_DM_DSCRA_DIR_DEST_DECR,S_DM_DSCRA_DIR_DEST)
- #define V_DM_DSCRA_DIR_DEST_CONST _SB_MAKEVALUE(K_DM_DSCRA_DIR_DEST_CONST,S_DM_DSCRA_DIR_DEST)
- #define S_DM_DSCRA_DIR_SRC _SB_MAKE64(46)
- #define M_DM_DSCRA_DIR_SRC _SB_MAKEMASK(2,S_DM_DSCRA_DIR_SRC)
- #define V_DM_DSCRA_DIR_SRC(x) _SB_MAKEVALUE(x,S_DM_DSCRA_DIR_SRC)
- #define G_DM_DSCRA_DIR_SRC(x) _SB_GETVALUE(x,S_DM_DSCRA_DIR_SRC,M_DM_DSCRA_DIR_SRC)
- #define K_DM_DSCRA_DIR_SRC_INCR 0
- #define K_DM_DSCRA_DIR_SRC_DECR 1
- #define K_DM_DSCRA_DIR_SRC_CONST 2
- #define V_DM_DSCRA_DIR_SRC_INCR _SB_MAKEVALUE(K_DM_DSCRA_DIR_SRC_INCR,S_DM_DSCRA_DIR_SRC)
- #define V_DM_DSCRA_DIR_SRC_DECR _SB_MAKEVALUE(K_DM_DSCRA_DIR_SRC_DECR,S_DM_DSCRA_DIR_SRC)
- #define V_DM_DSCRA_DIR_SRC_CONST _SB_MAKEVALUE(K_DM_DSCRA_DIR_SRC_CONST,S_DM_DSCRA_DIR_SRC)
- #define M_DM_DSCRA_ZERO_MEM _SB_MAKEMASK1(48)
- #define M_DM_DSCRA_PREFETCH _SB_MAKEMASK1(49)
- #define M_DM_DSCRA_L2C_DEST _SB_MAKEMASK1(50)
- #define M_DM_DSCRA_L2C_SRC _SB_MAKEMASK1(51)
- #define M_DM_DSCRA_RESERVED2 _SB_MAKEMASK(12,52)
- /*
- * Data Mover Descriptor Doubleword "B" (Table 7-25)
- */
- #define S_DM_DSCRB_SRC_ADDR _SB_MAKE64(0)
- #define M_DM_DSCRB_SRC_ADDR _SB_MAKEMASK(40,S_DM_DSCRB_SRC_ADDR)
- #define S_DM_DSCRB_SRC_LENGTH _SB_MAKE64(40)
- #define M_DM_DSCRB_SRC_LENGTH _SB_MAKEMASK(20,S_DM_DSCRB_SRC_LENGTH)
- #define V_DM_DSCRB_SRC_LENGTH(x) _SB_MAKEVALUE(x,S_DM_DSCRB_SRC_LENGTH)
- #define G_DM_DSCRB_SRC_LENGTH(x) _SB_GETVALUE(x,S_DM_DSCRB_SRC_LENGTH,M_DM_DSCRB_SRC_LENGTH)
- /* *********************************************************************
- * Ethernet MAC Registers
- ********************************************************************* */
- /*
- * MAC Configuration Register (Table 9-13)
- * Register: MAC_CFG_0
- * Register: MAC_CFG_1
- * Register: MAC_CFG_2
- */
- /* Updated to spec 0.2 */
- #define M_MAC_RESERVED0 _SB_MAKEMASK1(0)
- #define M_MAC_TX_HOLD_SOP_EN _SB_MAKEMASK1(1)
- #define M_MAC_RETRY_EN _SB_MAKEMASK1(2)
- #define M_MAC_RET_DRPREQ_EN _SB_MAKEMASK1(3)
- #define M_MAC_RET_UFL_EN _SB_MAKEMASK1(4)
- #define M_MAC_BURST_EN _SB_MAKEMASK1(5)
- #define S_MAC_TX_PAUSE _SB_MAKE64(6)
- #define M_MAC_TX_PAUSE_CNT _SB_MAKEMASK(3,S_MAC_TX_PAUSE)
- #define V_MAC_TX_PAUSE_CNT(x) _SB_MAKEVALUE(x,S_MAC_TX_PAUSE)
- #define K_MAC_TX_PAUSE_CNT_512 0
- #define K_MAC_TX_PAUSE_CNT_1K 1
- #define K_MAC_TX_PAUSE_CNT_2K 2
- #define K_MAC_TX_PAUSE_CNT_4K 3
- #define K_MAC_TX_PAUSE_CNT_8K 4
- #define K_MAC_TX_PAUSE_CNT_16K 5
- #define K_MAC_TX_PAUSE_CNT_32K 6
- #define K_MAC_TX_PAUSE_CNT_64K 7
- #define V_MAC_TX_PAUSE_CNT_512 V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_512)
- #define V_MAC_TX_PAUSE_CNT_1K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_1K)
- #define V_MAC_TX_PAUSE_CNT_2K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_2K)
- #define V_MAC_TX_PAUSE_CNT_4K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_4K)
- #define V_MAC_TX_PAUSE_CNT_8K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_8K)
- #define V_MAC_TX_PAUSE_CNT_16K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_16K)
- #define V_MAC_TX_PAUSE_CNT_32K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_32K)
- #define V_MAC_TX_PAUSE_CNT_64K V_MAC_TX_PAUSE_CNT(K_MAC_TX_PAUSE_CNT_64K)
- #define M_MAC_RESERVED1 _SB_MAKEMASK(8,9)
- #define M_MAC_AP_STAT_EN _SB_MAKEMASK1(17)
- #define M_MAC_RESERVED2 _SB_MAKEMASK1(18)
- #define M_MAC_DRP_ERRPKT_EN _SB_MAKEMASK1(19)
- #define M_MAC_DRP_FCSERRPKT_EN _SB_MAKEMASK1(20)
- #define M_MAC_DRP_CODEERRPKT_EN _SB_MAKEMASK1(21)
- #define M_MAC_DRP_DRBLERRPKT_EN _SB_MAKEMASK1(22)
- #define M_MAC_DRP_RNTPKT_EN _SB_MAKEMASK1(23)
- #define M_MAC_DRP_OSZPKT_EN _SB_MAKEMASK1(24)
- #define M_MAC_DRP_LENERRPKT_EN _SB_MAKEMASK1(25)
- #define M_MAC_RESERVED3 _SB_MAKEMASK(6,26)
- #define M_MAC_BYPASS_SEL _SB_MAKEMASK1(32)
- #define M_MAC_HDX_EN _SB_MAKEMASK1(33)
- #define S_MAC_SPEED_SEL _SB_MAKE64(34)
- #define M_MAC_SPEED_SEL _SB_MAKEMASK(2,S_MAC_SPEED_SEL)
- #define V_MAC_SPEED_SEL(x) _SB_MAKEVALUE(x,S_MAC_SPEED_SEL)
- #define G_MAC_SPEED_SEL(x) _SB_GETVALUE(x,S_MAC_SPEED_SEL,M_MAC_SPEED_SEL)
- #define K_MAC_SPEED_SEL_10MBPS 0
- #define K_MAC_SPEED_SEL_100MBPS 1
- #define K_MAC_SPEED_SEL_1000MBPS 2
- #define K_MAC_SPEED_SEL_RESERVED 3
- #define V_MAC_SPEED_SEL_10MBPS V_MAC_SPEED_SEL(K_MAC_SPEED_SEL_10MBPS)
- #define V_MAC_SPEED_SEL_100MBPS V_MAC_SPEED_SEL(K_MAC_SPEED_SEL_100MBPS)
- #define V_MAC_SPEED_SEL_1000MBPS V_MAC_SPEED_SEL(K_MAC_SPEED_SEL_1000MBPS)
- #define V_MAC_SPEED_SEL_RESERVED V_MAC_SPEED_SEL(K_MAC_SPEED_SEL_RESERVED)
- #define M_MAC_TX_CLK_EDGE_SEL _SB_MAKEMASK1(36)
- #define M_MAC_LOOPBACK_SEL _SB_MAKEMASK1(37)
- #define M_MAC_FAST_SYNC _SB_MAKEMASK1(38)
- #define M_MAC_SS_EN _SB_MAKEMASK1(39)
- #define S_MAC_BYPASS_CFG _SB_MAKE64(40)
- #define M_MAC_BYPASS_CFG _SB_MAKEMASK(2,S_MAC_BYPASS_CFG)
- #define V_MAC_BYPASS_CFG(x) _SB_MAKEVALUE(x,S_MAC_BYPASS_CFG)
- #define G_MAC_BYPASS_CFG(x) _SB_GETVALUE(x,S_MAC_BYPASS_CFG,M_MAC_BYPASS_CFG)
- #define K_MAC_BYPASS_GMII 0
- #define K_MAC_BYPASS_ENCODED 1
- #define K_MAC_BYPASS_SOP 2
- #define K_MAC_BYPASS_EOP 3
- #define M_MAC_BYPASS_16 _SB_MAKEMASK1(42)
- #define M_MAC_BYPASS_FCS_CHK _SB_MAKEMASK1(43)
- #define M_MAC_RESERVED4 _SB_MAKEMASK(2,44)
- #define S_MAC_BYPASS_IFG _SB_MAKE64(46)
- #define M_MAC_BYPASS_IFG _SB_MAKEMASK(8,S_MAC_BYPASS_IFG)
- #define V_MAC_BYPASS_IFG(x) _SB_MAKEVALUE(x,S_MAC_BYPASS_IFG)
- #define G_MAC_BYPASS_IFG(x) _SB_GETVALUE(x,S_MAC_BYPASS_IFG,M_MAC_BYPASS_IFG)
- #define K_MAC_FC_CMD_DISABLED 0
- #define K_MAC_FC_CMD_ENABLED 1
- #define K_MAC_FC_CMD_ENAB_FALSECARR 2
- #define V_MAC_FC_CMD_DISABLED V_MAC_FC_CMD(K_MAC_FC_CMD_DISABLED)
- #define V_MAC_FC_CMD_ENABLED V_MAC_FC_CMD(K_MAC_FC_CMD_ENABLED)
- #define V_MAC_FC_CMD_ENAB_FALSECARR V_MAC_FC_CMD(K_MAC_FC_CMD_ENAB_FALSECARR)
- #define M_MAC_FC_SEL _SB_MAKEMASK1(54)
- #define S_MAC_FC_CMD _SB_MAKE64(55)
- #define M_MAC_FC_CMD _SB_MAKEMASK(2,S_MAC_FC_CMD)
- #define V_MAC_FC_CMD(x) _SB_MAKEVALUE(x,S_MAC_FC_CMD)
- #define G_MAC_FC_CMD(x) _SB_GETVALUE(x,S_MAC_FC_CMD,M_MAC_FC_CMD)
- #define S_MAC_RX_CH_SEL _SB_MAKE64(57)
- #define M_MAC_RX_CH_SEL _SB_MAKEMASK(7,S_MAC_RX_CH_SEL)
- #define V_MAC_RX_CH_SEL(x) _SB_MAKEVALUE(x,S_MAC_RX_CH_SEL)
- #define G_MAC_RX_CH_SEL(x) _SB_GETVALUE(x,S_MAC_RX_CH_SEL,M_MAC_RX_CH_SEL)
- /*
- * MAC Enable Registers
- * Register: MAC_ENABLE_0
- * Register: MAC_ENABLE_1
- * Register: MAC_ENABLE_2
- */
- #define M_MAC_RXDMA_EN0 _SB_MAKEMASK1(0)
- #define M_MAC_RXDMA_EN1 _SB_MAKEMASK1(1)
- #define M_MAC_TXDMA_EN0 _SB_MAKEMASK1(4)
- #define M_MAC_TXDMA_EN1 _SB_MAKEMASK1(5)
- #define M_MAC_PORT_RESET _SB_MAKEMASK1(8)
- #define M_MAC_RX_ENABLE _SB_MAKEMASK1(10)
- #define M_MAC_TX_ENABLE _SB_MAKEMASK1(11)
- #define M_MAC_BYP_RX_ENABLE _SB_MAKEMASK1(12)
- #define M_MAC_BYP_TX_ENABLE _SB_MAKEMASK1(13)
- /*
- * MAC DMA Control Register
- * Register: MAC_TXD_CTL_0
- * Register: MAC_TXD_CTL_1
- * Register: MAC_TXD_CTL_2
- */
- #define S_MAC_TXD_WEIGHT0 _SB_MAKE64(0)
- #define M_MAC_TXD_WEIGHT0 _SB_MAKEMASK(4,S_MAC_TXD_WEIGHT0)
- #define V_MAC_TXD_WEIGHT0(x) _SB_MAKEVALUE(x,S_MAC_TXD_WEIGHT0)
- #define G_MAC_TXD_WEIGHT0(x) _SB_GETVALUE(x,S_MAC_TXD_WEIGHT0,M_MAC_TXD_WEIGHT0)
- #define S_MAC_TXD_WEIGHT1 _SB_MAKE64(4)
- #define M_MAC_TXD_WEIGHT1 _SB_MAKEMASK(4,S_MAC_TXD_WEIGHT1)
- #define V_MAC_TXD_WEIGHT1(x) _SB_MAKEVALUE(x,S_MAC_TXD_WEIGHT1)
- #define G_MAC_TXD_WEIGHT1(x) _SB_GETVALUE(x,S_MAC_TXD_WEIGHT1,M_MAC_TXD_WEIGHT1)
- /*
- * MAC Fifo Threshhold registers (Table 9-14)
- * Register: MAC_THRSH_CFG_0
- * Register: MAC_THRSH_CFG_1
- * Register: MAC_THRSH_CFG_2
- */
- #define S_MAC_TX_WR_THRSH _SB_MAKE64(0)
- #define M_MAC_TX_WR_THRSH _SB_MAKEMASK(6,S_MAC_TX_WR_THRSH)
- #define V_MAC_TX_WR_THRSH(x) _SB_MAKEVALUE(x,S_MAC_TX_WR_THRSH)
- #define G_MAC_TX_WR_THRSH(x) _SB_GETVALUE(x,S_MAC_TX_WR_THRSH,M_MAC_TX_WR_THRSH)
- #define S_MAC_TX_RD_THRSH _SB_MAKE64(8)
- #define M_MAC_TX_RD_THRSH _SB_MAKEMASK(6,S_MAC_TX_RD_THRSH)
- #define V_MAC_TX_RD_THRSH(x) _SB_MAKEVALUE(x,S_MAC_TX_RD_THRSH)
- #define G_MAC_TX_RD_THRSH(x) _SB_GETVALUE(x,S_MAC_TX_RD_THRSH,M_MAC_TX_RD_THRSH)
- #define S_MAC_TX_RL_THRSH _SB_MAKE64(16)
- #define M_MAC_TX_RL_THRSH _SB_MAKEMASK(4,S_MAC_TX_RL_THRSH)
- #define V_MAC_TX_RL_THRSH(x) _SB_MAKEVALUE(x,S_MAC_TX_RL_THRSH)
- #define G_MAC_TX_RL_THRSH(x) _SB_GETVALUE(x,S_MAC_TX_RL_THRSH,M_MAC_TX_RL_THRSH)
- #define S_MAC_RX_PL_THRSH _SB_MAKE64(24)
- #define M_MAC_RX_PL_THRSH _SB_MAKEMASK(6,S_MAC_RX_WR_THRSH)
- #define V_MAC_RX_PL_THRSH(x) _SB_MAKEVALUE(x,S_MAC_RX_PL_THRSH)
- #define G_MAC_RX_PL_THRSH(x) _SB_GETVALUE(x,S_MAC_RX_PL_THRSH,M_MAC_RX_PL_THRSH)
- #define S_MAC_RX_RD_THRSH _SB_MAKE64(32)
- #define M_MAC_RX_RD_THRSH _SB_MAKEMASK(6,S_MAC_RX_RD_THRSH)
- #define V_MAC_RX_RD_THRSH(x) _SB_MAKEVALUE(x,S_MAC_RX_RD_THRSH)
- #define G_MAC_RX_RD_THRSH(x) _SB_GETVALUE(x,S_MAC_RX_RD_THRSH,M_MAC_RX_RD_THRSH)
- #define S_MAC_RX_RL_THRSH _SB_MAKE64(40)
- #define M_MAC_RX_RL_THRSH _SB_MAKEMASK(6,S_MAC_RX_RL_THRSH)
- #define V_MAC_RX_RL_THRSH(x) _SB_MAKEVALUE(x,S_MAC_RX_RL_THRSH)
- #define G_MAC_RX_RL_THRSH(x) _SB_GETVALUE(x,S_MAC_RX_RL_THRSH,M_MAC_RX_RL_THRSH)
- /*
- * MAC Frame Configuration Registers (Table 9-15)
- * Register: MAC_FRAME_CFG_0
- * Register: MAC_FRAME_CFG_1
- * Register: MAC_FRAME_CFG_2
- */
- #define S_MAC_IFG_RX _SB_MAKE64(0)
- #define M_MAC_IFG_RX _SB_MAKEMASK(6,S_MAC_IFG_RX)
- #define V_MAC_IFG_RX(x) _SB_MAKEVALUE(x,S_MAC_IFG_RX)
- #define G_MAC_IFG_RX(x) _SB_GETVALUE(x,S_MAC_IFG_RX,M_MAC_IFG_RX)
- #define S_MAC_IFG_TX _SB_MAKE64(6)
- #define M_MAC_IFG_TX _SB_MAKEMASK(6,S_MAC_IFG_TX)
- #define V_MAC_IFG_TX(x) _SB_MAKEVALUE(x,S_MAC_IFG_TX)
- #define G_MAC_IFG_TX(x) _SB_GETVALUE(x,S_MAC_IFG_TX,M_MAC_IFG_TX)
- #define S_MAC_IFG_THRSH _SB_MAKE64(12)
- #define M_MAC_IFG_THRSH _SB_MAKEMASK(6,S_MAC_IFG_THRSH)
- #define V_MAC_IFG_THRSH(x) _SB_MAKEVALUE(x,S_MAC_IFG_THRSH)
- #define G_MAC_IFG_THRSH(x) _SB_GETVALUE(x,S_MAC_IFG_THRSH,M_MAC_IFG_THRSH)
- #define S_MAC_BACKOFF_SEL _SB_MAKE64(18)
- #define M_MAC_BACKOFF_SEL _SB_MAKEMASK(4,S_MAC_BACKOFF_SEL)
- #define V_MAC_BACKOFF_SEL(x) _SB_MAKEVALUE(x,S_MAC_BACKOFF_SEL)
- #define G_MAC_BACKOFF_SEL(x) _SB_GETVALUE(x,S_MAC_BACKOFF_SEL,M_MAC_BACKOFF_SEL)
- #define S_MAC_LFSR_SEED _SB_MAKE64(22)
- #define M_MAC_LFSR_SEED _SB_MAKEMASK(8,S_MAC_LFSR_SEED)
- #define V_MAC_LFSR_SEED(x) _SB_MAKEVALUE(x,S_MAC_LFSR_SEED)
- #define G_MAC_LFSR_SEED(x) _SB_GETVALUE(x,S_MAC_LFSR_SEED,M_MAC_LFSR_SEED)
- #define S_MAC_SLOT_SIZE _SB_MAKE64(30)
- #define M_MAC_SLOT_SIZE _SB_MAKEMASK(10,S_MAC_SLOT_SIZE)
- #define V_MAC_SLOT_SIZE(x) _SB_MAKEVALUE(x,S_MAC_SLOT_SIZE)
- #define G_MAC_SLOT_SIZE(x) _SB_GETVALUE(x,S_MAC_SLOT_SIZE,M_MAC_SLOT_SIZE)
- #define S_MAC_MIN_FRAMESZ _SB_MAKE64(40)
- #define M_MAC_MIN_FRAMESZ _SB_MAKEMASK(8,S_MAC_MIN_FRAMESZ)
- #define V_MAC_MIN_FRAMESZ(x) _SB_MAKEVALUE(x,S_MAC_MIN_FRAMESZ)
- #define G_MAC_MIN_FRAMESZ(x) _SB_GETVALUE(x,S_MAC_MIN_FRAMESZ,M_MAC_MIN_FRAMESZ)
- #define S_MAC_MAX_FRAMESZ _SB_MAKE64(48)
- #define M_MAC_MAX_FRAMESZ _SB_MAKEMASK(16,S_MAC_MAX_FRAMESZ)
- #define V_MAC_MAX_FRAMESZ(x) _SB_MAKEVALUE(x,S_MAC_MAX_FRAMESZ)
- #define G_MAC_MAX_FRAMESZ(x) _SB_GETVALUE(x,S_MAC_MAX_FRAMESZ,M_MAC_MAX_FRAMESZ)
- /*
- * These constants are used to configure the fields within the Frame
- * Configuration Register.
- */
- #define K_MAC_IFG_RX_10 _SB_MAKE64(18)
- #define K_MAC_IFG_RX_100 _SB_MAKE64(18)
- #define K_MAC_IFG_RX_1000 _SB_MAKE64(6)
- #define K_MAC_IFG_TX_10 _SB_MAKE64(20)
- #define K_MAC_IFG_TX_100 _SB_MAKE64(20)
- #define K_MAC_IFG_TX_1000 _SB_MAKE64(8)
- #define K_MAC_IFG_THRSH_10 _SB_MAKE64(12)
- #define K_MAC_IFG_THRSH_100 _SB_MAKE64(12)
- #define K_MAC_IFG_THRSH_1000 _SB_MAKE64(4)
- #define K_MAC_SLOT_SIZE_10 _SB_MAKE64(0)
- #define K_MAC_SLOT_SIZE_100 _SB_MAKE64(0)
- #define K_MAC_SLOT_SIZE_1000 _SB_MAKE64(0)
- #define V_MAC_IFG_RX_10 V_MAC_IFG_RX(K_MAC_IFG_RX_10)
- #define V_MAC_IFG_RX_100 V_MAC_IFG_RX(K_MAC_IFG_RX_100)
- #define V_MAC_IFG_RX_1000 V_MAC_IFG_RX(K_MAC_IFG_RX_1000)
- #define V_MAC_IFG_TX_10 V_MAC_IFG_TX(K_MAC_IFG_TX_10)
- #define V_MAC_IFG_TX_100 V_MAC_IFG_TX(K_MAC_IFG_TX_100)
- #define V_MAC_IFG_TX_1000 V_MAC_IFG_TX(K_MAC_IFG_TX_1000)
- #define V_MAC_IFG_THRSH_10 V_MAC_IFG_THRSH(K_MAC_IFG_THRSH_10)
- #define V_MAC_IFG_THRSH_100 V_MAC_IFG_THRSH(K_MAC_IFG_THRSH_100)
- #define V_MAC_IFG_THRSH_1000 V_MAC_IFG_THRSH(K_MAC_IFG_THRSH_1000)
- #define V_MAC_SLOT_SIZE_10 V_MAC_SLOT_SIZE(K_MAC_SLOT_SIZE_10)
- #define V_MAC_SLOT_SIZE_100 V_MAC_SLOT_SIZE(K_MAC_SLOT_SIZE_100)
- #define V_MAC_SLOT_SIZE_1000 V_MAC_SLOT_SIZE(K_MAC_SLOT_SIZE_1000)
- #define K_MAC_MIN_FRAMESZ_DEFAULT _SB_MAKE64(64)
- #define K_MAC_MAX_FRAMESZ_DEFAULT _SB_MAKE64(1518)
- #define V_MAC_MIN_FRAMESZ_DEFAULT V_MAC_MIN_FRAMESZ(K_MAC_MIN_FRAMESZ_DEFAULT)
- #define V_MAC_MAX_FRAMESZ_DEFAULT V_MAC_MAX_FRAMESZ(K_MAC_MAX_FRAMESZ_DEFAULT)
- /*
- * MAC VLAN Tag Registers (Table 9-16)
- * Register: MAC_VLANTAG_0
- * Register: MAC_VLANTAG_1
- * Register: MAC_VLANTAG_2
- */
- /* No bit fields: lower 32 bits of register are the tags */
- /*
- * MAC Status Registers (Table 9-17)
- * Also used for the MAC Interrupt Mask Register (Table 9-18)
- * Register: MAC_STATUS_0
- * Register: MAC_STATUS_1
- * Register: MAC_STATUS_2
- * Register: MAC_INT_MASK_0
- * Register: MAC_INT_MASK_1
- * Register: MAC_INT_MASK_2
- */
- /*
- * Use these constants to shift the appropriate channel
- * into the CH0 position so the same tests can be used
- * on each channel.
- */
- #define S_MAC_RX_CH0 _SB_MAKE64(0)
- #define S_MAC_RX_CH1 _SB_MAKE64(8)
- #define S_MAC_TX_CH0 _SB_MAKE64(16)
- #define S_MAC_TX_CH1 _SB_MAKE64(24)
- #define S_MAC_TXCHANNELS _SB_MAKE64(16) /* this is 1st TX chan */
- #define S_MAC_CHANWIDTH _SB_MAKE64(8) /* bits between channels */
- /*
- * These are the same as RX channel 0. The idea here
- * is that you'll use one of the "S_" things above
- * and pass just the six bits to a DMA-channel-specific ISR
- */
- #define M_MAC_INT_CHANNEL _SB_MAKEMASK(8,0)
- #define M_MAC_INT_EOP_COUNT _SB_MAKEMASK1(0)
- #define M_MAC_INT_EOP_TIMER _SB_MAKEMASK1(1)
- #define M_MAC_INT_EOP_SEEN _SB_MAKEMASK1(2)
- #define M_MAC_INT_HWM _SB_MAKEMASK1(3)
- #define M_MAC_INT_LWM _SB_MAKEMASK1(4)
- #define M_MAC_INT_DSCR _SB_MAKEMASK1(5)
- #define M_MAC_INT_ERR _SB_MAKEMASK1(6)
- #define M_MAC_INT_DZERO _SB_MAKEMASK1(7) /* only for TX channels */
- #define M_MAC_RX_UNDRFL _SB_MAKEMASK1(40)
- #define M_MAC_RX_OVRFL _SB_MAKEMASK1(41)
- #define M_MAC_TX_UNDRFL _SB_MAKEMASK1(42)
- #define M_MAC_TX_OVRFL _SB_MAKEMASK1(43)
- #define M_MAC_LTCOL_ERR _SB_MAKEMASK1(44)
- #define M_MAC_EXCOL_ERR _SB_MAKEMASK1(45)
- #define M_MAC_CNTR_OVRFL_ERR _SB_MAKEMASK1(46)
- #define S_MAC_COUNTER_ADDR _SB_MAKE64(47)
- #define M_MAC_COUNTER_ADDR _SB_MAKEMASK(5,S_MAC_COUNTER_ADDR)
- #define V_MAC_COUNTER_ADDR(x) _SB_MAKEVALUE(x,S_MAC_COUNTER_ADDR)
- #define G_MAC_COUNTER_ADDR(x) _SB_GETVALUE(x,S_MAC_COUNTER_ADDR,M_MAC_COUNTER_ADDR)
- /*
- * MAC Fifo Pointer Registers (Table 9-19) [Debug register]
- * Register: MAC_FIFO_PTRS_0
- * Register: MAC_FIFO_PTRS_1
- * Register: MAC_FIFO_PTRS_2
- */
- #define S_MAC_TX_WRPTR _SB_MAKE64(0)
- #define M_MAC_TX_WRPTR _SB_MAKEMASK(6,S_MAC_TX_WRPTR)
- #define V_MAC_TX_WRPTR(x) _SB_MAKEVALUE(x,S_MAC_TX_WRPTR)
- #define G_MAC_TX_WRPTR(x) _SB_GETVALUE(x,S_MAC_TX_WRPTR,M_MAC_TX_WRPTR)
- #define S_MAC_TX_RDPTR _SB_MAKE64(8)
- #define M_MAC_TX_RDPTR _SB_MAKEMASK(6,S_MAC_TX_RDPTR)
- #define V_MAC_TX_RDPTR(x) _SB_MAKEVALUE(x,S_MAC_TX_RDPTR)
- #define G_MAC_TX_RDPTR(x) _SB_GETVALUE(x,S_MAC_TX_RDPTR,M_MAC_TX_RDPTR)
- #define S_MAC_RX_WRPTR _SB_MAKE64(16)
- #define M_MAC_RX_WRPTR _SB_MAKEMASK(6,S_MAC_RX_WRPTR)
- #define V_MAC_RX_WRPTR(x) _SB_MAKEVALUE(x,S_MAC_RX_WRPTR)
- #define G_MAC_RX_WRPTR(x) _SB_GETVALUE(x,S_MAC_RX_WRPTR,M_MAC_TX_WRPTR)
- #define S_MAC_RX_RDPTR _SB_MAKE64(24)
- #define M_MAC_RX_RDPTR _SB_MAKEMASK(6,S_MAC_RX_RDPTR)
- #define V_MAC_RX_RDPTR(x) _SB_MAKEVALUE(x,S_MAC_RX_RDPTR)
- #define G_MAC_RX_RDPTR(x) _SB_GETVALUE(x,S_MAC_RX_RDPTR,M_MAC_TX_RDPTR)
- /*
- * MAC Fifo End Of Packet Count Registers (Table 9-20) [Debug register]
- * Register: MAC_EOPCNT_0
- * Register: MAC_EOPCNT_1
- * Register: MAC_EOPCNT_2
- */
- #define S_MAC_TX_EOP_COUNTER _SB_MAKE64(0)
- #define M_MAC_TX_EOP_COUNTER _SB_MAKEMASK(6,S_MAC_TX_EOP_COUNTER)
- #define V_MAC_TX_EOP_COUNTER(x) _SB_MAKEVALUE(x,S_MAC_TX_EOP_COUNTER)
- #define G_MAC_TX_EOP_COUNTER(x) _SB_GETVALUE(x,S_MAC_TX_EOP_COUNTER,M_MAC_TX_EOP_COUNTER)
- #define S_MAC_RX_EOP_COUNTER _SB_MAKE64(8)
- #define M_MAC_RX_EOP_COUNTER _SB_MAKEMASK(6,S_MAC_RX_EOP_COUNTER)
- #define V_MAC_RX_EOP_COUNTER(x) _SB_MAKEVALUE(x,S_MAC_RX_EOP_COUNTER)
- #define G_MAC_RX_EOP_COUNTER(x) _SB_GETVALUE(x,S_MAC_RX_EOP_COUNTER,M_MAC_RX_EOP_COUNTER)
- /*
- * MAC Recieve Address Filter Exact Match Registers (Table 9-21)
- * Registers: MAC_ADDR0_0 through MAC_ADDR7_0
- * Registers: MAC_ADDR0_1 through MAC_ADDR7_1
- * Registers: MAC_ADDR0_2 through MAC_ADDR7_2
- */
- /* No bitfields */
- /*
- * MAC Recieve Address Filter Hash Match Registers (Table 9-22)
- * Registers: MAC_HASH0_0 through MAC_HASH7_0
- * Registers: MAC_HASH0_1 through MAC_HASH7_1
- * Registers: MAC_HASH0_2 through MAC_HASH7_2
- */
- /* No bitfields */
- /*
- * MAC Transmit Source Address Registers (Table 9-23)
- * Register: MAC_ETHERNET_ADDR_0
- * Register: MAC_ETHERNET_ADDR_1
- * Register: MAC_ETHERNET_ADDR_2
- */
- /* No bitfields */
- /*
- * MAC Packet Type Configuration Register
- * Register: MAC_TYPE_CFG_0
- * Register: MAC_TYPE_CFG_1
- * Register: MAC_TYPE_CFG_2
- */
- #define S_TYPECFG_TYPESIZE _SB_MAKE64(16)
- #define S_TYPECFG_TYPE0 _SB_MAKE64(0)
- #define M_TYPECFG_TYPE0 _SB_MAKEMASK(16,S_TYPECFG_TYPE0)
- #define V_TYPECFG_TYPE0(x) _SB_MAKEVALUE(x,S_TYPECFG_TYPE0)
- #define G_TYPECFG_TYPE0(x) _SB_GETVALUE(x,S_TYPECFG_TYPE0,M_TYPECFG_TYPE0)
- #define S_TYPECFG_TYPE1 _SB_MAKE64(0)
- #define M_TYPECFG_TYPE1 _SB_MAKEMASK(16,S_TYPECFG_TYPE1)
- #define V_TYPECFG_TYPE1(x) _SB_MAKEVALUE(x,S_TYPECFG_TYPE1)
- #define G_TYPECFG_TYPE1(x) _SB_GETVALUE(x,S_TYPECFG_TYPE1,M_TYPECFG_TYPE1)
- #define S_TYPECFG_TYPE2 _SB_MAKE64(0)
- #define M_TYPECFG_TYPE2 _SB_MAKEMASK(16,S_TYPECFG_TYPE2)
- #define V_TYPECFG_TYPE2(x) _SB_MAKEVALUE(x,S_TYPECFG_TYPE2)
- #define G_TYPECFG_TYPE2(x) _SB_GETVALUE(x,S_TYPECFG_TYPE2,M_TYPECFG_TYPE2)
- #define S_TYPECFG_TYPE3 _SB_MAKE64(0)
- #define M_TYPECFG_TYPE3 _SB_MAKEMASK(16,S_TYPECFG_TYPE3)
- #define V_TYPECFG_TYPE3(x) _SB_MAKEVALUE(x,S_TYPECFG_TYPE3)
- #define G_TYPECFG_TYPE3(x) _SB_GETVALUE(x,S_TYPECFG_TYPE3,M_TYPECFG_TYPE3)
- /*
- * MAC Receive Address Filter Control Registers (Table 9-24)
- * Register: MAC_ADFILTER_CFG_0
- * Register: MAC_ADFILTER_CFG_1
- * Register: MAC_ADFILTER_CFG_2
- */
- #define M_MAC_ALLPKT_EN _SB_MAKEMASK1(0)
- #define M_MAC_UCAST_EN _SB_MAKEMASK1(1)
- #define M_MAC_UCAST_INV _SB_MAKEMASK1(2)
- #define M_MAC_MCAST_EN _SB_MAKEMASK1(3)
- #define M_MAC_MCAST_INV _SB_MAKEMASK1(4)
- #define M_MAC_BCAST_EN _SB_MAKEMASK1(5)
- #define M_MAC_DIRECT_INV _SB_MAKEMASK1(6)
- #define S_MAC_IPHDR_OFFSET _SB_MAKE64(8)
- #define M_MAC_IPHDR_OFFSET _SB_MAKEMASK(8,S_MAC_IPHDR_OFFSET)
- #define V_MAC_IPHDR_OFFSET(x) _SB_MAKEVALUE(x,S_MAC_IPHDR_OFFSET)
- #define G_MAC_IPHDR_OFFSET(x) _SB_GETVALUE(x,S_MAC_IPHDR_OFFSET,M_MAC_IPHDR_OFFSET)
- /*
- * MAC Receive Channel Select Registers (Table 9-25)
- */
- /* no bitfields */
- /*
- * MAC MII Management Interface Registers (Table 9-26)
- * Register: MAC_MDIO_0
- * Register: MAC_MDIO_1
- * Register: MAC_MDIO_2
- */
- #define S_MAC_MDC 0
- #define S_MAC_MDIO_DIR 1
- #define S_MAC_MDIO_OUT 2
- #define S_MAC_GENC 3
- #define S_MAC_MDIO_IN 4
- #define M_MAC_MDC _SB_MAKEMASK1(S_MAC_MDC)
- #define M_MAC_MDIO_DIR _SB_MAKEMASK1(S_MAC_MDIO_DIR)
- #define M_MAC_MDIO_DIR_INPUT _SB_MAKEMASK1(S_MAC_MDIO_DIR)
- #define M_MAC_MDIO_OUT _SB_MAKEMASK1(S_MAC_MDIO_OUT)
- #define M_MAC_GENC _SB_MAKEMASK1(S_MAC_GENC)
- #define M_MAC_MDIO_IN _SB_MAKEMASK1(S_MAC_MDIO_IN)
- /* **********************************************************************
- * DUART Registers
- ********************************************************************** */
- /*
- * DUART Mode Register #1 (Table 10-3)
- * Register: DUART_MODE_REG_1_A
- * Register: DUART_MODE_REG_1_B
- */
- #define S_DUART_BITS_PER_CHAR 0
- #define M_DUART_BITS_PER_CHAR _SB_MAKEMASK(2,S_DUART_BITS_PER_CHAR)
- #define V_DUART_BITS_PER_CHAR(x) _SB_MAKEVALUE(x,S_DUART_BITS_PER_CHAR)
- #define K_DUART_BITS_PER_CHAR_RSV0 0
- #define K_DUART_BITS_PER_CHAR_RSV1 1
- #define K_DUART_BITS_PER_CHAR_7 2
- #define K_DUART_BITS_PER_CHAR_8 3
- #define V_DUART_BITS_PER_CHAR_RSV0 V_DUART_BITS_PER_CHAR(K_DUART_BITS_PER_CHAR_RSV0)
- #define V_DUART_BITS_PER_CHAR_RSV1 V_DUART_BITS_PER_CHAR(K_DUART_BITS_PER_CHAR_RSV1)
- #define V_DUART_BITS_PER_CHAR_7 V_DUART_BITS_PER_CHAR(K_DUART_BITS_PER_CHAR_7)
- #define V_DUART_BITS_PER_CHAR_8 V_DUART_BITS_PER_CHAR(K_DUART_BITS_PER_CHAR_8)
- #define M_DUART_PARITY_TYPE_EVEN 0x00
- #define M_DUART_PARITY_TYPE_ODD _SB_MAKEMASK1(3)
- #define S_DUART_PARITY_MODE 3
- #define M_DUART_PARITY_MODE _SB_MAKEMASK(2,S_DUART_PARITY_MODE)
- #define V_DUART_PARITY_MODE(x) _SB_MAKEVALUE(x,S_DUART_PARITY_MODE)
- #define K_DUART_PARITY_MODE_ADD 0
- #define K_DUART_PARITY_MODE_ADD_FIXED 1
- #define K_DUART_PARITY_MODE_NONE 2
- #define V_DUART_PARITY_MODE_ADD V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_ADD)
- #define V_DUART_PARITY_MODE_ADD_FIXED V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_ADD_FIXED)
- #define V_DUART_PARITY_MODE_NONE V_DUART_PARITY_MODE(K_DUART_PARITY_MODE_NONE)
- #define M_DUART_ERR_MODE _SB_MAKEMASK1(5) /* must be zero */
- #define M_DUART_RX_IRQ_SEL_RXRDY 0
- #define M_DUART_RX_IRQ_SEL_RXFULL _SB_MAKEMASK1(6)
- #define M_DUART_RX_RTS_ENA _SB_MAKEMASK1(7)
- /*
- * DUART Mode Register #2 (Table 10-4)
- * Register: DUART_MODE_REG_2_A
- * Register: DUART_MODE_REG_2_B
- */
- #define M_DUART_MODE_RESERVED1 _SB_MAKEMASK(3,0) /* ignored */
- #define M_DUART_STOP_BIT_LEN_2 _SB_MAKEMASK1(3)
- #define M_DUART_STOP_BIT_LEN_1 0
- #define M_DUART_TX_CTS_ENA _SB_MAKEMASK1(4)
- #define M_DUART_MODE_RESERVED2 _SB_MAKEMASK1(5) /* must be zero */
- #define S_DUART_CHAN_MODE 6
- #define M_DUART_CHAN_MODE _SB_MAKEMASK(2,S_DUART_CHAN_MODE)
- #define V_DUART_CHAN_MODE(x) _SB_MAKEVALUE(x,S_DUART_CHAN_MODE)
- #define K_DUART_CHAN_MODE_NORMAL 0
- #define K_DUART_CHAN_MODE_LCL_LOOP 2
- #define K_DUART_CHAN_MODE_REM_LOOP 3
- #define V_DUART_CHAN_MODE_NORMAL V_DUART_CHAN_MODE(K_DUART_CHAN_MODE_NORMAL)
- #define V_DUART_CHAN_MODE_LCL_LOOP V_DUART_CHAN_MODE(K_DUART_CHAN_MODE_LCL_LOOP)
- #define V_DUART_CHAN_MODE_REM_LOOP V_DUART_CHAN_MODE(K_DUART_CHAN_MODE_REM_LOOP)
- /*
- * DUART Command Register (Table 10-5)
- * Register: DUART_CMD_A
- * Register: DUART_CMD_B
- */
- #define M_DUART_RX_EN _SB_MAKEMASK1(0)
- #define M_DUART_RX_DIS _SB_MAKEMASK1(1)
- #define M_DUART_TX_EN _SB_MAKEMASK1(2)
- #define M_DUART_TX_DIS _SB_MAKEMASK1(3)
- #define S_DUART_MISC_CMD 4
- #define M_DUART_MISC_CMD _SB_MAKEMASK(3,S_DUART_MISC_CMD)
- #define V_DUART_MISC_CMD(x) _SB_MAKEVALUE(x,S_DUART_MISC_CMD)
- #define K_DUART_MISC_CMD_NOACTION0 0
- #define K_DUART_MISC_CMD_NOACTION1 1
- #define K_DUART_MISC_CMD_RESET_RX 2
- #define K_DUART_MISC_CMD_RESET_TX 3
- #define K_DUART_MISC_CMD_NOACTION4 4
- #define K_DUART_MISC_CMD_RESET_BREAK_INT 5
- #define K_DUART_MISC_CMD_START_BREAK 6
- #define K_DUART_MISC_CMD_STOP_BREAK 7
- #define V_DUART_MISC_CMD_NOACTION0 V_DUART_MISC_CMD(K_DUART_MISC_CMD_NOACTION0)
- #define V_DUART_MISC_CMD_NOACTION1 V_DUART_MISC_CMD(K_DUART_MISC_CMD_NOACTION1)
- #define V_DUART_MISC_CMD_RESET_RX V_DUART_MISC_CMD(K_DUART_MISC_CMD_RESET_RX)
- #define V_DUART_MISC_CMD_RESET_TX V_DUART_MISC_CMD(K_DUART_MISC_CMD_RESET_TX)
- #define V_DUART_MISC_CMD_NOACTION4 V_DUART_MISC_CMD(K_DUART_MISC_CMD_NOACTION4)
- #define V_DUART_MISC_CMD_RESET_BREAK_INT V_DUART_MISC_CMD(K_DUART_MISC_CMD_RESET_BREAK_INT)
- #define V_DUART_MISC_CMD_START_BREAK V_DUART_MISC_CMD(K_DUART_MISC_CMD_START_BREAK)
- #define V_DUART_MISC_CMD_STOP_BREAK V_DUART_MISC_CMD(K_DUART_MISC_CMD_STOP_BREAK)
- #define M_DUART_CMD_RESERVED _SB_MAKEMASK1(7)
- /*
- * DUART Status Register (Table 10-6)
- * Register: DUART_STATUS_A
- * Register: DUART_STATUS_B
- * READ-ONLY
- */
- #define M_DUART_RX_RDY _SB_MAKEMASK1(0)
- #define M_DUART_RX_FFUL _SB_MAKEMASK1(1)
- #define M_DUART_TX_RDY _SB_MAKEMASK1(2)
- #define M_DUART_TX_EMT _SB_MAKEMASK1(3)
- #define M_DUART_OVRUN_ERR _SB_MAKEMASK1(4)
- #define M_DUART_PARITY_ERR _SB_MAKEMASK1(5)
- #define M_DUART_FRM_ERR _SB_MAKEMASK1(6)
- #define M_DUART_RCVD_BRK _SB_MAKEMASK1(7)
- /*
- * DUART Baud Rate Register (Table 10-7)
- * Register: DUART_CLK_SEL_A
- * Register: DUART_CLK_SEL_B
- */
- #define M_DUART_CLK_COUNTER _SB_MAKEMASK(12,0)
- #define V_DUART_BAUD_RATE(x) (100000000/((x)*20)-1)
- /*
- * DUART Data Registers (Table 10-8 and 10-9)
- * Register: DUART_RX_HOLD_A
- * Register: DUART_RX_HOLD_B
- * Register: DUART_TX_HOLD_A
- * Register: DUART_TX_HOLD_B
- */
- #define M_DUART_RX_DATA _SB_MAKEMASK(8,0)
- #define M_DUART_TX_DATA _SB_MAKEMASK(8,0)
- /*
- * DUART Input Port Register (Table 10-10)
- * Register: DUART_IN_PORT
- */
- #define M_DUART_IN_PIN0_VAL _SB_MAKEMASK1(0)
- #define M_DUART_IN_PIN1_VAL _SB_MAKEMASK1(1)
- #define M_DUART_IN_PIN2_VAL _SB_MAKEMASK1(2)
- #define M_DUART_IN_PIN3_VAL _SB_MAKEMASK1(3)
- #define M_DUART_IN_PIN4_VAL _SB_MAKEMASK1(4)
- #define M_DUART_IN_PIN5_VAL _SB_MAKEMASK1(5)
- #define M_DUART_RIN0_PIN _SB_MAKEMASK1(6)
- #define M_DUART_RIN1_PIN _SB_MAKEMASK1(7)
- /*
- * DUART Input Port Change Status Register (Tables 10-11, 10-12, and 10-13)
- * Register: DUART_INPORT_CHNG
- */
- #define S_DUART_IN_PIN_VAL 0
- #define M_DUART_IN_PIN_VAL _SB_MAKEMASK(4,S_DUART_IN_PIN_VAL)
- #define S_DUART_IN_PIN_CHNG 4
- #define M_DUART_IN_PIN_CHNG _SB_MAKEMASK(4,S_DUART_IN_PIN_CHNG)
- /*
- * DUART Output port control register (Table 10-14)
- * Register: DUART_OPCR
- */
- #define M_DUART_OPCR_RESERVED0 _SB_MAKEMASK1(0) /* must be zero */
- #define M_DUART_OPC2_SEL _SB_MAKEMASK1(1)
- #define M_DUART_OPCR_RESERVED1 _SB_MAKEMASK1(2) /* must be zero */
- #define M_DUART_OPC3_SEL _SB_MAKEMASK1(3)
- #define M_DUART_OPCR_RESERVED2 _SB_MAKEMASK(4,4) /* must be zero */
- /*
- * DUART Aux Control Register (Table 10-15)
- * Register: DUART_AUX_CTRL
- */
- #define M_DUART_IP0_CHNG_ENA _SB_MAKEMASK1(0)
- #define M_DUART_IP1_CHNG_ENA _SB_MAKEMASK1(1)
- #define M_DUART_IP2_CHNG_ENA _SB_MAKEMASK1(2)
- #define M_DUART_IP3_CHNG_ENA _SB_MAKEMASK1(3)
- #define M_DUART_ACR_RESERVED _SB_MAKEMASK(4,4)
- /*
- * DUART Interrupt Status Register (Table 10-16)
- * Register: DUART_ISR
- */
- #define M_DUART_ISR_TX_A _SB_MAKEMASK1(0)
- #define M_DUART_ISR_RX_A _SB_MAKEMASK1(1)
- #define M_DUART_ISR_BRK_A _SB_MAKEMASK1(2)
- #define M_DUART_ISR_IN_A _SB_MAKEMASK1(3)
- #define M_DUART_ISR_TX_B _SB_MAKEMASK1(4)
- #define M_DUART_ISR_RX_B _SB_MAKEMASK1(5)
- #define M_DUART_ISR_BRK_B _SB_MAKEMASK1(6)
- #define M_DUART_ISR_IN_B _SB_MAKEMASK1(7)
- /*
- * DUART Channel A Interrupt Status Register (Table 10-17)
- * DUART Channel B Interrupt Status Register (Table 10-18)
- * Register: DUART_ISR_A
- * Register: DUART_ISR_B
- */
- #define M_DUART_ISR_TX _SB_MAKEMASK1(0)
- #define M_DUART_ISR_RX _SB_MAKEMASK1(1)
- #define M_DUART_ISR_BRK _SB_MAKEMASK1(2)
- #define M_DUART_ISR_IN _SB_MAKEMASK1(3)
- #define M_DUART_ISR_RESERVED _SB_MAKEMASK(4,4)
- /*
- * DUART Interrupt Mask Register (Table 10-19)
- * Register: DUART_IMR
- */
- #define M_DUART_IMR_TX_A _SB_MAKEMASK1(0)
- #define M_DUART_IMR_RX_A _SB_MAKEMASK1(1)
- #define M_DUART_IMR_BRK_A _SB_MAKEMASK1(2)
- #define M_DUART_IMR_IN_A _SB_MAKEMASK1(3)
- #define M_DUART_IMR_ALL_A _SB_MAKEMASK(4,4)
- #define M_DUART_IMR_TX_B _SB_MAKEMASK1(4)
- #define M_DUART_IMR_RX_B _SB_MAKEMASK1(5)
- #define M_DUART_IMR_BRK_B _SB_MAKEMASK1(5)
- #define M_DUART_IMR_IN_B _SB_MAKEMASK1(7)
- #define M_DUART_IMR_ALL_B _SB_MAKEMASK(4,4)
- /*
- * DUART Channel A Interrupt Mask Register (Table 10-20)
- * DUART Channel B Interrupt Mask Register (Table 10-21)
- * Register: DUART_IMR_A
- * Register: DUART_IMR_B
- */
- #define M_DUART_IMR_TX _SB_MAKEMASK1(0)
- #define M_DUART_IMR_RX _SB_MAKEMASK1(1)
- #define M_DUART_IMR_BRK _SB_MAKEMASK1(2)
- #define M_DUART_IMR_IN _SB_MAKEMASK1(3)
- #define M_DUART_IMR_ALL _SB_MAKEMASK(4,0)
- #define M_DUART_IMR_RESERVED _SB_MAKEMASK(4,4)
- /*
- * DUART Output Port Set Register (Table 10-22)
- * Register: DUART_SET_OPR
- */
- #define M_DUART_SET_OPR0 _SB_MAKEMASK1(0)
- #define M_DUART_SET_OPR1 _SB_MAKEMASK1(1)
- #define M_DUART_SET_OPR2 _SB_MAKEMASK1(2)
- #define M_DUART_SET_OPR3 _SB_MAKEMASK1(3)
- #define M_DUART_OPSR_RESERVED _SB_MAKEMASK(4,4)
- /*
- * DUART Output Port Clear Register (Table 10-23)
- * Register: DUART_CLEAR_OPR
- */
- #define M_DUART_CLR_OPR0 _SB_MAKEMASK1(0)
- #define M_DUART_CLR_OPR1 _SB_MAKEMASK1(1)
- #define M_DUART_CLR_OPR2 _SB_MAKEMASK1(2)
- #define M_DUART_CLR_OPR3 _SB_MAKEMASK1(3)
- #define M_DUART_OPCR_RESERVED _SB_MAKEMASK(4,4)
- /*
- * DUART Output Port RTS Register (Table 10-24)
- * Register: DUART_OUT_PORT
- */
- #define M_DUART_OUT_PIN_SET0 _SB_MAKEMASK1(0)
- #define M_DUART_OUT_PIN_SET1 _SB_MAKEMASK1(1)
- #define M_DUART_OUT_PIN_CLR0 _SB_MAKEMASK1(2)
- #define M_DUART_OUT_PIN_CLR1 _SB_MAKEMASK1(3)
- #define M_DUART_OPRR_RESERVED _SB_MAKEMASK(4,4)
- #define M_DUART_OUT_PIN_SET(chan)
- (chan == 0 ? M_DUART_OUT_PIN_SET0 : M_DUART_OUT_PIN_SET1)
- #define M_DUART_OUT_PIN_CLR(chan)
- (chan == 0 ? M_DUART_OUT_PIN_CLR0 : M_DUART_OUT_PIN_CLR1)
- /*
- * To be added: Synchronous Serial definitions
- */
- /* **********************************************************************
- * Generic Bus constants
- ********************************************************************** */
- /*
- * Generic Bus Region Configuration Registers (Table 11-4)
- */
- #define M_IO_RDY_ACTIVE _SB_MAKEMASK1(0)
- #define M_IO_ENA_RDY _SB_MAKEMASK1(1)
- #define S_IO_WIDTH_SEL 2
- #define M_IO_WIDTH_SEL _SB_MAKEMASK(2,S_IO_WIDTH_SEL)
- #define K_IO_WIDTH_SEL_1 0
- #define K_IO_WIDTH_SEL_2 1
- #define K_IO_WIDTH_SEL_4 3
- #define V_IO_WIDTH_SEL(x) _SB_MAKEVALUE(x,S_IO_WIDTH_SEL)
- #define G_IO_WIDTH_SEL(x) _SB_GETVALUE(x,S_IO_WIDTH_SEL,M_IO_WIDTH_SEL)
- #define M_IO_PARITY_ENA _SB_MAKEMASK1(4)
- #define M_IO_PARITY_ODD _SB_MAKEMASK1(6)
- #define M_IO_NONMUX _SB_MAKEMASK1(7)
- #define S_IO_TIMEOUT 8
- #define M_IO_TIMEOUT _SB_MAKEMASK(8,S_IO_TIMEOUT)
- #define V_IO_TIMEOUT(x) _SB_MAKEVALUE(x,S_IO_TIMEOUT)
- #define G_IO_TIMEOUT(x) _SB_GETVALUE(x,S_IO_TIMEOUT,M_IO_TIMEOUT)
- /*
- * Generic Bus Region Size register (Table 11-5)
- */
- #define S_IO_MULT_SIZE 0
- #define M_IO_MULT_SIZE _SB_MAKEMASK(12,S_IO_MULT_SIZE)
- #define V_IO_MULT_SIZE(x) _SB_MAKEVALUE(x,S_IO_MULT_SIZE)
- #define G_IO_MULT_SIZE(x) _SB_GETVALUE(x,S_IO_MULT_SIZE,M_IO_MULT_SIZE)
- #define S_IO_REGSIZE 16 /* # bits to shift size for this reg */
- /*
- * Generic Bus Region Address (Table 11-6)
- */
- #define S_IO_START_ADDR 0
- #define M_IO_START_ADDR _SB_MAKEMASK(14,S_IO_START_ADDR)
- #define V_IO_START_ADDR(x) _SB_MAKEVALUE(x,S_IO_START_ADDR)
- #define G_IO_START_ADDR(x) _SB_GETVALUE(x,S_IO_START_ADDR,M_IO_START_ADDR)
- #define S_IO_ADDRBASE 16 /* # bits to shift addr for this reg */
- /*
- * Generic Bus Region 0 Timing Registers (Table 11-7)
- */
- #define S_IO_ALE_WIDTH 0
- #define M_IO_ALE_WIDTH _SB_MAKEMASK(3,S_IO_ALE_WIDTH)
- #define V_IO_ALE_WIDTH(x) _SB_MAKEVALUE(x,S_IO_ALE_WIDTH)
- #define G_IO_ALE_WIDTH(x) _SB_GETVALUE(x,S_IO_ALE_WIDTH,M_IO_ALE_WIDTH)
- #define S_IO_ALE_TO_CS 4
- #define M_IO_ALE_TO_CS _SB_MAKEMASK(2,S_IO_ALE_TO_CS)
- #define V_IO_ALE_TO_CS(x) _SB_MAKEVALUE(x,S_IO_ALE_TO_CS)
- #define G_IO_ALE_TO_CS(x) _SB_GETVALUE(x,S_IO_ALE_TO_CS,M_IO_ALE_TO_CS)
- #define S_IO_CS_WIDTH 8
- #define M_IO_CS_WIDTH _SB_MAKEMASK(5,S_IO_CS_WIDTH)
- #define V_IO_CS_WIDTH(x) _SB_MAKEVALUE(x,S_IO_CS_WIDTH)
- #define G_IO_CS_WIDTH(x) _SB_GETVALUE(x,S_IO_CS_WIDTH,M_IO_CS_WIDTH)
- #define S_IO_RDY_SMPLE 13
- #define M_IO_RDY_SMPLE _SB_MAKEMASK(3,S_IO_RDY_SMPLE)
- #define V_IO_RDY_SMPLE(x) _SB_MAKEVALUE(x,S_IO_RDY_SMPLE)
- #define G_IO_RDY_SMPLE(x) _SB_GETVALUE(x,S_IO_RDY_SMPLE,M_IO_RDY_SMPLE)
- /*
- * Generic Bus Timing 1 Registers (Table 11-8)
- */
- #define S_IO_ALE_TO_WRITE 0
- #define M_IO_ALE_TO_WRITE _SB_MAKEMASK(3,S_IO_ALE_TO_WRITE)
- #define V_IO_ALE_TO_WRITE(x) _SB_MAKEVALUE(x,S_IO_ALE_TO_WRITE)
- #define G_IO_ALE_TO_WRITE(x) _SB_GETVALUE(x,S_IO_ALE_TO_WRITE,M_IO_ALE_TO_WRITE)
- #define S_IO_WRITE_WIDTH 4
- #define M_IO_WRITE_WIDTH _SB_MAKEMASK(4,S_IO_WRITE_WIDTH)
- #define V_IO_WRITE_WIDTH(x) _SB_MAKEVALUE(x,S_IO_WRITE_WIDTH)
- #define G_IO_WRITE_WIDTH(x) _SB_GETVALUE(x,S_IO_WRITE_WIDTH,M_IO_WRITE_WIDTH)
- #define S_IO_IDLE_CYCLE 8
- #define M_IO_IDLE_CYCLE _SB_MAKEMASK(4,S_IO_IDLE_CYCLE)
- #define V_IO_IDLE_CYCLE(x) _SB_MAKEVALUE(x,S_IO_IDLE_CYCLE)
- #define G_IO_IDLE_CYCLE(x) _SB_GETVALUE(x,S_IO_IDLE_CYCLE,M_IO_IDLE_CYCLE)
- #define S_IO_CS_TO_OE 12
- #define M_IO_CS_TO_OE _SB_MAKEMASK(2,S_IO_CS_TO_OE)
- #define V_IO_CS_TO_OE(x) _SB_MAKEVALUE(x,S_IO_CS_TO_OE)
- #define G_IO_CS_TO_OE(x) _SB_GETVALUE(x,S_IO_CS_TO_OE,M_IO_CS_TO_OE)
- #define S_IO_OE_TO_CS 14
- #define M_IO_OE_TO_CS _SB_MAKEMASK(2,S_IO_OE_TO_CS)
- #define V_IO_OE_TO_CS(x) _SB_MAKEVALUE(x,S_IO_OE_TO_CS)
- #define G_IO_OE_TO_CS(x) _SB_GETVALUE(x,S_IO_OE_TO_CS,M_IO_OE_TO_CS)
- /*
- * Generic Bus Interrupt Status Register (Table 11-9)
- */
- #define M_IO_CS_ERR_INT _SB_MAKEMASK(0,8)
- #define M_IO_CS0_ERR_INT _SB_MAKEMASK1(0)
- #define M_IO_CS1_ERR_INT _SB_MAKEMASK1(1)
- #define M_IO_CS2_ERR_INT _SB_MAKEMASK1(2)
- #define M_IO_CS3_ERR_INT _SB_MAKEMASK1(3)
- #define M_IO_CS4_ERR_INT _SB_MAKEMASK1(4)
- #define M_IO_CS5_ERR_INT _SB_MAKEMASK1(5)
- #define M_IO_CS6_ERR_INT _SB_MAKEMASK1(6)
- #define M_IO_CS7_ERR_INT _SB_MAKEMASK1(7)
- #define M_IO_RD_PAR_INT _SB_MAKEMASK1(9)
- #define M_IO_TIMEOUT_INT _SB_MAKEMASK1(10)
- #define M_IO_ILL_ADDR_INT _SB_MAKEMASK1(11)
- #define M_IO_MULT_CS_INT _SB_MAKEMASK1(12)
- /*
- * PCMCIA configuration register (Table 12-6)
- */
- #define M_PCMCIA_CFG_ATTRMEM _SB_MAKEMASK1(0)
- #define M_PCMCIA_CFG_3VEN _SB_MAKEMASK1(1)
- #define M_PCMCIA_CFG_5VEN _SB_MAKEMASK1(2)
- #define M_PCMCIA_CFG_VPPEN _SB_MAKEMASK1(3)
- #define M_PCMCIA_CFG_RESET _SB_MAKEMASK1(4)
- #define M_PCMCIA_CFG_APWRONEN _SB_MAKEMASK1(5)
- #define M_PCMCIA_CFG_CDMASK _SB_MAKEMASK1(6)
- #define M_PCMCIA_CFG_WPMASK _SB_MAKEMASK1(7)
- #define M_PCMCIA_CFG_RDYMASK _SB_MAKEMASK1(8)
- #define M_PCMCIA_CFG_PWRCTL _SB_MAKEMASK1(9)
- /*
- * PCMCIA status register (Table 12-7)
- */
- #define M_PCMCIA_STATUS_CD1 _SB_MAKEMASK1(0)
- #define M_PCMCIA_STATUS_CD2 _SB_MAKEMASK1(1)
- #define M_PCMCIA_STATUS_VS1 _SB_MAKEMASK1(2)
- #define M_PCMCIA_STATUS_VS2 _SB_MAKEMASK1(3)
- #define M_PCMCIA_STATUS_WP _SB_MAKEMASK1(4)
- #define M_PCMCIA_STATUS_RDY _SB_MAKEMASK1(5)
- #define M_PCMCIA_STATUS_3VEN _SB_MAKEMASK1(6)
- #define M_PCMCIA_STATUS_5VEN _SB_MAKEMASK1(7)
- #define M_PCMCIA_STATUS_CDCHG _SB_MAKEMASK1(8)
- #define M_PCMCIA_STATUS_WPCHG _SB_MAKEMASK1(9)
- #define M_PCMCIA_STATUS_RDYCHG _SB_MAKEMASK1(10)
- /*
- * GPIO Interrupt Type Register (table 13-3)
- */
- #define K_GPIO_INTR_DISABLE 0
- #define K_GPIO_INTR_EDGE 1
- #define K_GPIO_INTR_LEVEL 2
- #define K_GPIO_INTR_SPLIT 3
- #define S_GPIO_INTR_TYPEX(n) (((n)/2)*2)
- #define M_GPIO_INTR_TYPEX(n) _SB_MAKEMASK(2,S_GPIO_INTR_TYPEX(n))
- #define V_GPIO_INTR_TYPEX(n,x) _SB_MAKEVALUE(x,S_GPIO_INTR_TYPEX(n))
- #define G_GPIO_INTR_TYPEX(n,x) _SB_GETVALUE(x,S_GPIO_INTR_TYPEX(n),M_GPIO_INTR_TYPEX(n))
- #define S_GPIO_INTR_TYPE0 0
- #define M_GPIO_INTR_TYPE0 _SB_MAKEMASK(2,S_GPIO_INTR_TYPE0)
- #define V_GPIO_INTR_TYPE0(x) _SB_MAKEVALUE(x,S_GPIO_INTR_TYPE0)
- #define G_GPIO_INTR_TYPE0(x) _SB_GETVALUE(x,S_GPIO_INTR_TYPE0,M_GPIO_INTR_TYPE0)
- #define S_GPIO_INTR_TYPE2 2
- #define M_GPIO_INTR_TYPE2 _SB_MAKEMASK(2,S_GPIO_INTR_TYPE2)
- #define V_GPIO_INTR_TYPE2(x) _SB_MAKEVALUE(x,S_GPIO_INTR_TYPE2)
- #define G_GPIO_INTR_TYPE2(x) _SB_GETVALUE(x,S_GPIO_INTR_TYPE2,M_GPIO_INTR_TYPE2)
- #define S_GPIO_INTR_TYPE4 4
- #define M_GPIO_INTR_TYPE4 _SB_MAKEMASK(2,S_GPIO_INTR_TYPE4)
- #define V_GPIO_INTR_TYPE4(x) _SB_MAKEVALUE(x,S_GPIO_INTR_TYPE4)
- #define G_GPIO_INTR_TYPE4(x) _SB_GETVALUE(x,S_GPIO_INTR_TYPE4,M_GPIO_INTR_TYPE4)
- #define S_GPIO_INTR_TYPE6 6
- #define M_GPIO_INTR_TYPE6 _SB_MAKEMASK(2,S_GPIO_INTR_TYPE6)
- #define V_GPIO_INTR_TYPE6(x) _SB_MAKEVALUE(x,S_GPIO_INTR_TYPE6)
- #define G_GPIO_INTR_TYPE6(x) _SB_GETVALUE(x,S_GPIO_INTR_TYPE6,M_GPIO_INTR_TYPE6)
- #define S_GPIO_INTR_TYPE8 8
- #define M_GPIO_INTR_TYPE8 _SB_MAKEMASK(2,S_GPIO_INTR_TYPE8)
- #define V_GPIO_INTR_TYPE8(x) _SB_MAKEVALUE(x,S_GPIO_INTR_TYPE8)
- #define G_GPIO_INTR_TYPE8(x) _SB_GETVALUE(x,S_GPIO_INTR_TYPE8,M_GPIO_INTR_TYPE8)
- #define S_GPIO_INTR_TYPE10 10
- #define M_GPIO_INTR_TYPE10 _SB_MAKEMASK(2,S_GPIO_INTR_TYPE10)
- #define V_GPIO_INTR_TYPE10(x) _SB_MAKEVALUE(x,S_GPIO_INTR_TYPE10)
- #define G_GPIO_INTR_TYPE10(x) _SB_GETVALUE(x,S_GPIO_INTR_TYPE10,M_GPIO_INTR_TYPE10)
- #define S_GPIO_INTR_TYPE12 12
- #define M_GPIO_INTR_TYPE12 _SB_MAKEMASK(2,S_GPIO_INTR_TYPE12)
- #define V_GPIO_INTR_TYPE12(x) _SB_MAKEVALUE(x,S_GPIO_INTR_TYPE12)
- #define G_GPIO_INTR_TYPE12(x) _SB_GETVALUE(x,S_GPIO_INTR_TYPE12,M_GPIO_INTR_TYPE12)
- #define S_GPIO_INTR_TYPE14 14
- #define M_GPIO_INTR_TYPE14 _SB_MAKEMASK(2,S_GPIO_INTR_TYPE14)
- #define V_GPIO_INTR_TYPE14(x) _SB_MAKEVALUE(x,S_GPIO_INTR_TYPE14)
- #define G_GPIO_INTR_TYPE14(x) _SB_GETVALUE(x,S_GPIO_INTR_TYPE14,M_GPIO_INTR_TYPE14)
- /* **********************************************************************
- * System Management Bus constants
- ********************************************************************** */
- /*
- * SMBus Clock Frequency Register (Table 14-2)
- */
- #define S_SMB_FREQ_DIV 0
- #define M_SMB_FREQ_DIV _SB_MAKEMASK(13,S_SMB_FREQ_DIV)
- #define V_SMB_FREQ_DIV(x) _SB_MAKEVALUE(x,S_SMB_FREQ_DIV)
- #define K_SMB_FREQ_400KHZ 0x1F
- #define K_SMB_FREQ_100KHZ 0x7D
- #define S_SMB_CMD 0
- #define M_SMB_CMD _SB_MAKEMASK(8,S_SMB_CMD)
- #define V_SMB_CMD(x) _SB_MAKEVALUE(x,S_SMB_CMD)
- /*
- * SMBus control register (Table 14-4)
- */
- #define M_SMB_ERR_INTR _SB_MAKEMASK1(0)
- #define M_SMB_FINISH_INTR _SB_MAKEMASK1(1)
- #define M_SMB_DATA_OUT _SB_MAKEMASK1(4)
- #define M_SMB_DATA_DIR _SB_MAKEMASK1(5)
- #define M_SMB_DATA_DIR_OUTPUT M_SMB_DATA_DIR
- #define M_SMB_CLK_OUT _SB_MAKEMASK1(6)
- #define M_SMB_DIRECT_ENABLE _SB_MAKEMASK1(7)
- /*
- * SMBus status registers (Table 14-5)
- */
- #define M_SMB_BUSY _SB_MAKEMASK1(0)
- #define M_SMB_ERROR _SB_MAKEMASK1(1)
- #define M_SMB_ERROR_TYPE _SB_MAKEMASK1(2)
- #define M_SMB_REF _SB_MAKEMASK1(6)
- #define M_SMB_DATA_IN _SB_MAKEMASK1(7)
- /*
- * SMBus Start/Command registers (Table 14-9)
- */
- #define S_SMB_ADDR 0
- #define M_SMB_ADDR _SB_MAKEMASK(7,S_SMB_ADDR)
- #define V_SMB_ADDR(x) _SB_MAKEVALUE(x,S_SMB_ADDR)
- #define G_SMB_ADDR(x) _SB_GETVALUE(x,S_SMB_ADDR,M_SMB_ADDR)
- #define M_SMB_QDATA _SB_MAKEMASK1(7)
- #define S_SMB_TT 8
- #define M_SMB_TT _SB_MAKEMASK(3,S_SMB_TT)
- #define V_SMB_TT(x) _SB_MAKEVALUE(x,S_SMB_TT)
- #define G_SMB_TT(x) _SB_GETVALUE(x,S_SMB_TT,M_SMB_TT)
- #define K_SMB_TT_WR1BYTE 0
- #define K_SMB_TT_WR2BYTE 1
- #define K_SMB_TT_WR3BYTE 2
- #define K_SMB_TT_CMD_RD1BYTE 3
- #define K_SMB_TT_CMD_RD2BYTE 4
- #define K_SMB_TT_RD1BYTE 5
- #define K_SMB_TT_QUICKCMD 6
- #define K_SMB_TT_EEPROMREAD 7
- #define V_SMB_TT_WR1BYTE V_SMB_TT(K_SMB_TT_WR1BYTE)
- #define V_SMB_TT_WR2BYTE V_SMB_TT(K_SMB_TT_WR2BYTE)
- #define V_SMB_TT_WR3BYTE V_SMB_TT(K_SMB_TT_WR3BYTE)
- #define V_SMB_TT_CMD_RD1BYTE V_SMB_TT(K_SMB_TT_CMD_RD1BYTE)
- #define V_SMB_TT_CMD_RD2BYTE V_SMB_TT(K_SMB_TT_CMD_RD2BYTE)
- #define V_SMB_TT_RD1BYTE V_SMB_TT(K_SMB_TT_RD1BYTE)
- #define V_SMB_TT_QUICKCMD V_SMB_TT(K_SMB_TT_QUICKCMD)
- #define V_SMB_TT_EEPROMREAD V_SMB_TT(K_SMB_TT_EEPROMREAD)
- #define M_SMB_PEC _SB_MAKEMASK1(15)
- /*
- * SMBus Data Register (Table 14-6) and SMBus Extra Register (Table 14-7)
- */
- #define S_SMB_LB 0
- #define M_SMB_LB _SB_MAKEMASK(8,S_SMB_LB)
- #define V_SMB_LB(x) _SB_MAKEVALUE(x,S_SMB_LB)
- #define S_SMB_MB 8
- #define M_SMB_MB _SB_MAKEMASK(8,S_SMB_MB)
- #define V_SMB_MB(x) _SB_MAKEVALUE(x,S_SMB_MB)
- /*
- * SMBus Packet Error Check register (Table 14-8)
- */
- #define S_SPEC_PEC 0
- #define M_SPEC_PEC _SB_MAKEMASK(8,S_SPEC_PEC)
- #define V_SPEC_MB(x) _SB_MAKEVALUE(x,S_SPEC_PEC)
- #ifndef _ASMLANGUAGE
- #if (CPU==MIPS64)
- #define MIPS3_SD(addr, value)
- (* (volatile unsigned long long *) (addr) = (value))
- #define MIPS3_LD(addr) (*(volatile unsigned long long *) (addr))
- #else /* (CPU==MIPS64) */
- void mips3_sd( volatile unsigned long long *, unsigned long long );
- unsigned long long mips3_ld( volatile unsigned long long * );
- #define MIPS3_SD(addr, value)
- mips3_sd((volatile unsigned long long *) (addr), (value))
- #define MIPS3_LD(addr) mips3_ld((volatile unsigned long long *) (addr))
- #endif /* (CPU==MIPS64) */
- #endif /* _ASMLANGUAGE */
- #ifdef __cplusplus
- }
- #endif
- #endif /* __INCbcm1250Libh */