cassini.h

来自「linux 内核源代码」· C头文件 代码 · 共 1,423 行 · 第 1/5 页

H
1,423
字号
#define    BIM_LOCAL_DEV_PROM          0x02    /* PROM chip select */#define    BIM_LOCAL_DEV_EXT           0x04    /* secondary local bus device chip						  select output enable */#define    BIM_LOCAL_DEV_SOFT_0        0x08    /* sw programmable ctrl bit 0 */#define    BIM_LOCAL_DEV_SOFT_1        0x10    /* sw programmable ctrl bit 1 */#define    BIM_LOCAL_DEV_HW_RESET      0x20    /* internal hw reset. Cassini+ only. *//* access 24 entry BIM read and write buffers. put address in REG_BIM_BUFFER_ADDR * and read/write from/to it REG_BIM_BUFFER_DATA_LOW and _DATA_HI. * _DATA_HI should be the last access of the sequence. * DEFAULT: undefined */#define  REG_BIM_BUFFER_ADDR           0x1024  /* BIM buffer address. for						  purposes. */#define    BIM_BUFFER_ADDR_MASK        0x3F    /* index (0 - 23) of buffer  */#define    BIM_BUFFER_WR_SELECT        0x40    /* write buffer access = 1						  read buffer access = 0 *//* DEFAULT: undefined */#define  REG_BIM_BUFFER_DATA_LOW       0x1028  /* BIM buffer data low */#define  REG_BIM_BUFFER_DATA_HI        0x102C  /* BIM buffer data high *//* set BIM_RAM_BIST_START to start built-in self test for BIM read buffer. * bit auto-clears when done with status read from _SUMMARY and _PASS bits. */#define  REG_BIM_RAM_BIST              0x102C  /* BIM RAM (read buffer) BIST						  control/status */#define    BIM_RAM_BIST_RD_START       0x01    /* start BIST for BIM read buffer */#define    BIM_RAM_BIST_WR_START       0x02    /* start BIST for BIM write buffer.						  Cassini only. reserved in						  Cassini+. */#define    BIM_RAM_BIST_RD_PASS        0x04    /* summary BIST pass status for read						  buffer. */#define    BIM_RAM_BIST_WR_PASS        0x08    /* summary BIST pass status for write						  buffer. Cassini only. reserved						  in Cassini+. */#define    BIM_RAM_BIST_RD_LOW_PASS    0x10    /* read low bank passes BIST */#define    BIM_RAM_BIST_RD_HI_PASS     0x20    /* read high bank passes BIST */#define    BIM_RAM_BIST_WR_LOW_PASS    0x40    /* write low bank passes BIST.						  Cassini only. reserved in						  Cassini+. */#define    BIM_RAM_BIST_WR_HI_PASS     0x80    /* write high bank passes BIST.						  Cassini only. reserved in						  Cassini+. *//* ASUN: i'm not sure what this does as it's not in the spec. * DEFAULT: 0xFC */#define  REG_BIM_DIAG_MUX              0x1030  /* BIM diagnostic probe mux						  select register *//* enable probe monitoring mode and select data appearing on the P_A* bus. bit * values for _SEL_HI_MASK and _SEL_LOW_MASK: * 0x0: internal probe[7:0] (pci arb state, wtc empty w, wtc full w, wtc empty w, *                           wtc empty r, post pci) * 0x1: internal probe[15:8] (pci wbuf comp, pci wpkt comp, pci rbuf comp, *                            pci rpkt comp, txdma wr req, txdma wr ack, *			      txdma wr rdy, txdma wr xfr done) * 0x2: internal probe[23:16] (txdma rd req, txdma rd ack, txdma rd rdy, rxdma rd, *                             rd arb state, rd pci state) * 0x3: internal probe[31:24] (rxdma req, rxdma ack, rxdma rdy, wrarb state, *                             wrpci state) * 0x4: pci io probe[7:0]     0x5: pci io probe[15:8] * 0x6: pci io probe[23:16]   0x7: pci io probe[31:24] * 0x8: pci io probe[39:32]   0x9: pci io probe[47:40] * 0xa: pci io probe[55:48]   0xb: pci io probe[63:56] * the following are not available in Cassini: * 0xc: rx probe[7:0]         0xd: tx probe[7:0] * 0xe: hp probe[7:0] 	      0xf: mac probe[7:0] */#define  REG_PLUS_PROBE_MUX_SELECT     0x1034 /* Cassini+: PROBE MUX SELECT */#define    PROBE_MUX_EN                0x80000000 /* allow probe signals to be						     driven on local bus P_A[15:0]						     for debugging */#define    PROBE_MUX_SUB_MUX_MASK      0x0000FF00 /* select sub module probe signals:						     0x03 = mac[1:0]						     0x0C = rx[1:0]						     0x30 = tx[1:0]						     0xC0 = hp[1:0] */#define    PROBE_MUX_SEL_HI_MASK       0x000000F0 /* select which module to appear						     on P_A[15:8]. see above for						     values. */#define    PROBE_MUX_SEL_LOW_MASK      0x0000000F /* select which module to appear						     on P_A[7:0]. see above for						     values. *//* values mean the same thing as REG_INTR_MASK excep that it's for INTB. DEFAULT: 0x1F */#define  REG_PLUS_INTR_MASK_1          0x1038 /* Cassini+: interrupt mask						 register 2 for INTB */#define  REG_PLUS_INTRN_MASK(x)       (REG_PLUS_INTR_MASK_1 + ((x) - 1)*16)/* bits correspond to both _MASK and _STATUS registers. _ALT corresponds to * all of the alternate (2-4) INTR registers while _1 corresponds to only * _MASK_1 and _STATUS_1 registers. * DEFAULT: 0x7 for MASK registers, 0x0 for ALIAS_CLEAR registers */#define    INTR_RX_DONE_ALT              0x01#define    INTR_RX_COMP_FULL_ALT         0x02#define    INTR_RX_COMP_AF_ALT           0x04#define    INTR_RX_BUF_UNAVAIL_1         0x08#define    INTR_RX_BUF_AE_1              0x10 /* almost empty */#define    INTRN_MASK_RX_EN              0x80#define    INTRN_MASK_CLEAR_ALL          (INTR_RX_DONE_ALT | \                                          INTR_RX_COMP_FULL_ALT | \                                          INTR_RX_COMP_AF_ALT | \                                          INTR_RX_BUF_UNAVAIL_1 | \                                          INTR_RX_BUF_AE_1)#define  REG_PLUS_INTR_STATUS_1        0x103C /* Cassini+: interrupt status						 register 2 for INTB. default: 0x1F */#define  REG_PLUS_INTRN_STATUS(x)       (REG_PLUS_INTR_STATUS_1 + ((x) - 1)*16)#define    INTR_STATUS_ALT_INTX_EN     0x80   /* generate INTX when one of the						 flags are set. enables desc ring. */#define  REG_PLUS_ALIAS_CLEAR_1        0x1040 /* Cassini+: alias clear mask						 register 2 for INTB */#define  REG_PLUS_ALIASN_CLEAR(x)      (REG_PLUS_ALIAS_CLEAR_1 + ((x) - 1)*16)#define  REG_PLUS_INTR_STATUS_ALIAS_1  0x1044 /* Cassini+: interrupt status						 register alias 2 for INTB */#define  REG_PLUS_INTRN_STATUS_ALIAS(x) (REG_PLUS_INTR_STATUS_ALIAS_1 + ((x) - 1)*16)#define REG_SATURN_PCFG               0x106c /* pin configuration register for						integrated macphy */#define   SATURN_PCFG_TLA             0x00000001 /* 1 = phy actled */#define   SATURN_PCFG_FLA             0x00000002 /* 1 = phy link10led */#define   SATURN_PCFG_CLA             0x00000004 /* 1 = phy link100led */#define   SATURN_PCFG_LLA             0x00000008 /* 1 = phy link1000led */#define   SATURN_PCFG_RLA             0x00000010 /* 1 = phy duplexled */#define   SATURN_PCFG_PDS             0x00000020 /* phy debug mode.						    0 = normal */#define   SATURN_PCFG_MTP             0x00000080 /* test point select */#define   SATURN_PCFG_GMO             0x00000100 /* GMII observe. 1 =						    GMII on SERDES pins for						    monitoring. */#define   SATURN_PCFG_FSI             0x00000200 /* 1 = freeze serdes/gmii. all						    pins configed as outputs.						    for power saving when using						    internal phy. */#define   SATURN_PCFG_LAD             0x00000800 /* 0 = mac core led ctrl						    polarity from strapping						    value.						    1 = mac core led ctrl						    polarity active low. *//** transmit dma registers **/#define MAX_TX_RINGS_SHIFT            2#define MAX_TX_RINGS                  (1 << MAX_TX_RINGS_SHIFT)#define MAX_TX_RINGS_MASK             (MAX_TX_RINGS - 1)/* TX configuration. * descr ring sizes size = 32 * (1 << n), n < 9. e.g., 0x8 = 8k. default: 0x8 * DEFAULT: 0x3F000001 */#define  REG_TX_CFG                    0x2004  /* TX config */#define    TX_CFG_DMA_EN               0x00000001  /* enable TX DMA. if cleared, DMA						      will stop after xfer of current						      buffer has been completed. */#define    TX_CFG_FIFO_PIO_SEL         0x00000002  /* TX DMA FIFO can be						      accessed w/ FIFO addr						      and data registers.						      TX DMA should be						      disabled. */#define    TX_CFG_DESC_RING0_MASK      0x0000003C  /* # desc entries in						      ring 1. */#define    TX_CFG_DESC_RING0_SHIFT     2#define    TX_CFG_DESC_RINGN_MASK(a)   (TX_CFG_DESC_RING0_MASK << (a)*4)#define    TX_CFG_DESC_RINGN_SHIFT(a)  (TX_CFG_DESC_RING0_SHIFT + (a)*4)#define    TX_CFG_PACED_MODE           0x00100000  /* TX_ALL only set after						      TX FIFO becomes empty.						      if 0, TX_ALL set						      if descr queue empty. */#define    TX_CFG_DMA_RDPIPE_DIS       0x01000000  /* always set to 1 */#define    TX_CFG_COMPWB_Q1            0x02000000  /* completion writeback happens at						      the end of every packet kicked						      through Q1. */#define    TX_CFG_COMPWB_Q2            0x04000000  /* completion writeback happens at						      the end of every packet kicked						      through Q2. */#define    TX_CFG_COMPWB_Q3            0x08000000  /* completion writeback happens at						      the end of every packet kicked						      through Q3 */#define    TX_CFG_COMPWB_Q4            0x10000000  /* completion writeback happens at						      the end of every packet kicked						      through Q4 */#define    TX_CFG_INTR_COMPWB_DIS      0x20000000  /* disable pre-interrupt completion						      writeback */#define    TX_CFG_CTX_SEL_MASK         0xC0000000  /* selects tx test port						      connection						      0b00: tx mac req,						            tx mac retry req,							    tx ack and tx tag.						      0b01: txdma rd req,						            txdma rd ack,							    txdma rd rdy,							    txdma rd type0						      0b11: txdma wr req,						            txdma wr ack,							    txdma wr rdy,							    txdma wr xfr done. */#define    TX_CFG_CTX_SEL_SHIFT        30/* 11-bit counters that point to next location in FIFO to be loaded/retrieved. * used for diagnostics only. */#define  REG_TX_FIFO_WRITE_PTR         0x2014  /* TX FIFO write pointer */#define  REG_TX_FIFO_SHADOW_WRITE_PTR  0x2018  /* TX FIFO shadow write						  pointer. temp hold reg.					          diagnostics only. */#define  REG_TX_FIFO_READ_PTR          0x201C  /* TX FIFO read pointer */#define  REG_TX_FIFO_SHADOW_READ_PTR   0x2020  /* TX FIFO shadow read						  pointer *//* (ro) 11-bit up/down counter w/ # of frames currently in TX FIFO */#define  REG_TX_FIFO_PKT_CNT           0x2024  /* TX FIFO packet counter *//* current state of all state machines in TX */#define  REG_TX_SM_1                   0x2028  /* TX state machine reg #1 */#define    TX_SM_1_CHAIN_MASK          0x000003FF   /* chaining state machine */#define    TX_SM_1_CSUM_MASK           0x00000C00   /* checksum state machine */#define    TX_SM_1_FIFO_LOAD_MASK      0x0003F000   /* FIFO load state machine.						       = 0x01 when TX disabled. */#define    TX_SM_1_FIFO_UNLOAD_MASK    0x003C0000   /* FIFO unload state machine */#define    TX_SM_1_CACHE_MASK          0x03C00000   /* desc. prefetch cache controller						       state machine */#define    TX_SM_1_CBQ_ARB_MASK        0xF8000000   /* CBQ arbiter state machine */#define  REG_TX_SM_2                   0x202C  /* TX state machine reg #2 */#define    TX_SM_2_COMP_WB_MASK        0x07    /* completion writeback sm */#define	   TX_SM_2_SUB_LOAD_MASK       0x38    /* sub load state machine */#define	   TX_SM_2_KICK_MASK           0xC0    /* kick state machine *//* 64-bit pointer to the transmit data buffer. only the 50 LSB are incremented * while the upper 23 bits are taken from the TX descriptor */#define  REG_TX_DATA_PTR_LOW           0x2030  /* TX data pointer low */#define  REG_TX_DATA_PTR_HI            0x2034  /* TX data pointer high *//* 13 bit registers written by driver w/ descriptor value that follows * last valid xmit descriptor. kick # and complete # values are used by * the xmit dma engine to control tx descr fetching. if > 1 valid * tx descr is available within the cache line being read, cassini will * internally cache up to 4 of them. 0 on reset. _KICK = rw, _COMP = ro. */#define  REG_TX_KICK0                  0x2038  /* TX kick reg #1 */#define  REG_TX_KICKN(x)               (REG_TX_KICK0 + (x)*4)#define  REG_TX_COMP0                  0x2048  /* TX completion reg #1 */#define  REG_TX_COMPN(x)               (REG_TX_COMP0 + (x)*4)/* values of TX_COMPLETE_1-4 are written. each completion register * is 2bytes in size and contiguous. 8B allocation w/ 8B alignment. * NOTE: completion reg values are only written back prior to TX_INTME and * TX_ALL interrupts. at all other times, the most up-to-date index values * should be obtained from the REG_TX_COMPLETE_# registers. * here's the layout: * offset from base addr      completion # byte *           0                TX_COMPLETE_1_MSB *	     1                TX_COMPLETE_1_LSB *           2                TX_COMPLETE_2_MSB *	     3                TX_COMPLETE_2_LSB *           4                TX_COMPLETE_3_MSB *	     5                TX_COMPLETE_3_LSB *           6                TX_COMPLETE_4_MSB *	     7                TX_COMPLETE_4_LSB */#define  TX_COMPWB_SIZE             8#define  REG_TX_COMPWB_DB_LOW       0x2058  /* TX completion write back					       base low */#define  REG_TX_COMPWB_DB_HI        0x205C  /* TX completion write back					       base high */#define    TX_COMPWB_MSB_MASK       0x00000000000000FFULL#define    TX_COMPWB_MSB_SHIFT      0#define    TX_COMPWB_LSB_MASK       0x000000000000FF00ULL#define    TX_COMPWB_LSB_SHIFT      8#define    TX_COMPWB_NEXT(x)        ((x) >> 16)/* 53 MSB used as base address. 11 LSB assumed to be 0. TX desc pointer must * be 2KB-aligned. */#define  REG_TX_DB0_LOW         0x2060  /* TX descriptor base low #1 */#define  REG_TX_DB0_HI          0x2064  /* TX descriptor base hi #1 */#define  REG_TX_DBN_LOW(x)      (REG_TX_DB0_LOW + (x)*8)#define  REG_TX_DBN_HI(x)       (REG_TX_DB0_HI + (x)*8)/* 16-bit registers hold weights for the weighted round-robin of the * four CBQ TX descr rings. weights correspond to # bytes xferred from

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?