📄 53c700.h
字号:
* swapping is done by the NCR_700_{read|write}[b] functions */#define SCNTL0_REG 0x00#define FULL_ARBITRATION 0xc0#define PARITY 0x08#define ENABLE_PARITY 0x04#define AUTO_ATN 0x02#define SCNTL1_REG 0x01#define SLOW_BUS 0x80#define ENABLE_SELECT 0x20#define ASSERT_RST 0x08#define ASSERT_EVEN_PARITY 0x04#define SDID_REG 0x02#define SIEN_REG 0x03#define PHASE_MM_INT 0x80#define FUNC_COMP_INT 0x40#define SEL_TIMEOUT_INT 0x20#define SELECT_INT 0x10#define GROSS_ERR_INT 0x08#define UX_DISC_INT 0x04#define RST_INT 0x02#define PAR_ERR_INT 0x01#define SCID_REG 0x04#define SXFER_REG 0x05#define ASYNC_OPERATION 0x00#define SODL_REG 0x06#define SOCL_REG 0x07#define SFBR_REG 0x08#define SIDL_REG 0x09#define SBDL_REG 0x0A#define SBCL_REG 0x0B/* read bits */#define SBCL_IO 0x01/*write bits */#define SYNC_DIV_AS_ASYNC 0x00#define SYNC_DIV_1_0 0x01#define SYNC_DIV_1_5 0x02#define SYNC_DIV_2_0 0x03#define DSTAT_REG 0x0C#define ILGL_INST_DETECTED 0x01#define WATCH_DOG_INTERRUPT 0x02#define SCRIPT_INT_RECEIVED 0x04#define ABORTED 0x10#define SSTAT0_REG 0x0D#define PARITY_ERROR 0x01#define SCSI_RESET_DETECTED 0x02#define UNEXPECTED_DISCONNECT 0x04#define SCSI_GROSS_ERROR 0x08#define SELECTED 0x10#define SELECTION_TIMEOUT 0x20#define FUNCTION_COMPLETE 0x40#define PHASE_MISMATCH 0x80#define SSTAT1_REG 0x0E#define SIDL_REG_FULL 0x80#define SODR_REG_FULL 0x40#define SODL_REG_FULL 0x20#define SSTAT2_REG 0x0F#define CTEST0_REG 0x14#define BTB_TIMER_DISABLE 0x40#define CTEST1_REG 0x15#define CTEST2_REG 0x16#define CTEST3_REG 0x17#define CTEST4_REG 0x18#define DISABLE_FIFO 0x00#define SLBE 0x10#define SFWR 0x08#define BYTE_LANE0 0x04#define BYTE_LANE1 0x05#define BYTE_LANE2 0x06#define BYTE_LANE3 0x07#define SCSI_ZMODE 0x20#define ZMODE 0x40#define CTEST5_REG 0x19#define MASTER_CONTROL 0x10#define DMA_DIRECTION 0x08#define CTEST7_REG 0x1B#define BURST_DISABLE 0x80 /* 710 only */#define SEL_TIMEOUT_DISABLE 0x10 /* 710 only */#define DFP 0x08#define EVP 0x04#define DIFF 0x01#define CTEST6_REG 0x1A#define TEMP_REG 0x1C#define DFIFO_REG 0x20#define FLUSH_DMA_FIFO 0x80#define CLR_FIFO 0x40#define ISTAT_REG 0x21#define ABORT_OPERATION 0x80#define SOFTWARE_RESET_710 0x40#define DMA_INT_PENDING 0x01#define SCSI_INT_PENDING 0x02#define CONNECTED 0x08#define CTEST8_REG 0x22#define LAST_DIS_ENBL 0x01#define SHORTEN_FILTERING 0x04#define ENABLE_ACTIVE_NEGATION 0x10#define GENERATE_RECEIVE_PARITY 0x20#define CLR_FIFO_710 0x04#define FLUSH_DMA_FIFO_710 0x08#define CTEST9_REG 0x23#define DBC_REG 0x24#define DCMD_REG 0x27#define DNAD_REG 0x28#define DIEN_REG 0x39#define BUS_FAULT 0x20#define ABORT_INT 0x10#define INT_INST_INT 0x04#define WD_INT 0x02#define ILGL_INST_INT 0x01#define DCNTL_REG 0x3B#define SOFTWARE_RESET 0x01#define COMPAT_700_MODE 0x01#define SCRPTS_16BITS 0x20#define ASYNC_DIV_2_0 0x00#define ASYNC_DIV_1_5 0x40#define ASYNC_DIV_1_0 0x80#define ASYNC_DIV_3_0 0xc0#define DMODE_710_REG 0x38#define DMODE_700_REG 0x34#define BURST_LENGTH_1 0x00#define BURST_LENGTH_2 0x40#define BURST_LENGTH_4 0x80#define BURST_LENGTH_8 0xC0#define DMODE_FC1 0x10#define DMODE_FC2 0x20#define BW16 32 #define MODE_286 16#define IO_XFER 8#define FIXED_ADDR 4#define DSP_REG 0x2C#define DSPS_REG 0x30/* Parameters to begin SDTR negotiations. Empirically, I find that * the 53c700-66 cannot handle an offset >8, so don't change this */#define NCR_700_MAX_OFFSET 8/* Was hoping the max offset would be greater for the 710, but * empirically it seems to be 8 also */#define NCR_710_MAX_OFFSET 8#define NCR_700_MIN_XFERP 1#define NCR_710_MIN_XFERP 0#define NCR_700_MIN_PERIOD 25 /* for SDTR message, 100ns */#define script_patch_32(script, symbol, value) \{ \ int i; \ for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); i++) { \ __u32 val = bS_to_cpu((script)[A_##symbol##_used[i]]) + value; \ (script)[A_##symbol##_used[i]] = bS_to_host(val); \ dma_cache_wback((unsigned long)&(script)[A_##symbol##_used[i]], 4); \ DEBUG((" script, patching %s at %d to 0x%lx\n", \ #symbol, A_##symbol##_used[i], (value))); \ } \}#define script_patch_32_abs(script, symbol, value) \{ \ int i; \ for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); i++) { \ (script)[A_##symbol##_used[i]] = bS_to_host(value); \ dma_cache_wback((unsigned long)&(script)[A_##symbol##_used[i]], 4); \ DEBUG((" script, patching %s at %d to 0x%lx\n", \ #symbol, A_##symbol##_used[i], (value))); \ } \}/* Used for patching the SCSI ID in the SELECT instruction */#define script_patch_ID(script, symbol, value) \{ \ int i; \ for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); i++) { \ __u32 val = bS_to_cpu((script)[A_##symbol##_used[i]]); \ val &= 0xff00ffff; \ val |= ((value) & 0xff) << 16; \ (script)[A_##symbol##_used[i]] = bS_to_host(val); \ dma_cache_wback((unsigned long)&(script)[A_##symbol##_used[i]], 4); \ DEBUG((" script, patching ID field %s at %d to 0x%x\n", \ #symbol, A_##symbol##_used[i], val)); \ } \}#define script_patch_16(script, symbol, value) \{ \ int i; \ for(i=0; i< (sizeof(A_##symbol##_used) / sizeof(__u32)); i++) { \ __u32 val = bS_to_cpu((script)[A_##symbol##_used[i]]); \ val &= 0xffff0000; \ val |= ((value) & 0xffff); \ (script)[A_##symbol##_used[i]] = bS_to_host(val); \ dma_cache_wback((unsigned long)&(script)[A_##symbol##_used[i]], 4); \ DEBUG((" script, patching short field %s at %d to 0x%x\n", \ #symbol, A_##symbol##_used[i], val)); \ } \}#endif#ifdef CONFIG_53C700_MEM_MAPPEDstatic inline __u8NCR_700_readb(struct Scsi_Host *host, __u32 reg){ const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) = (struct NCR_700_Host_Parameters *)host->hostdata[0]; return readb(host->base + (reg^bE));}static inline __u32NCR_700_readl(struct Scsi_Host *host, __u32 reg){ __u32 value = __raw_readl(host->base + reg); const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) = (struct NCR_700_Host_Parameters *)host->hostdata[0];#if 1 /* sanity check the register */ if((reg & 0x3) != 0) BUG();#endif return bS_to_cpu(value);}static inline voidNCR_700_writeb(__u8 value, struct Scsi_Host *host, __u32 reg){ const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) = (struct NCR_700_Host_Parameters *)host->hostdata[0]; writeb(value, host->base + (reg^bE));}static inline voidNCR_700_writel(__u32 value, struct Scsi_Host *host, __u32 reg){ const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) = (struct NCR_700_Host_Parameters *)host->hostdata[0];#if 1 /* sanity check the register */ if((reg & 0x3) != 0) BUG();#endif __raw_writel(bS_to_host(value), host->base + reg);}#elif defined(CONFIG_53C700_IO_MAPPED)static inline __u8NCR_700_readb(struct Scsi_Host *host, __u32 reg){ const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) = (struct NCR_700_Host_Parameters *)host->hostdata[0]; return inb(host->base + (reg^bE));}static inline __u32NCR_700_readl(struct Scsi_Host *host, __u32 reg){ __u32 value = inl(host->base + reg); const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) = (struct NCR_700_Host_Parameters *)host->hostdata[0];#if 1 /* sanity check the register */ if((reg & 0x3) != 0) BUG();#endif return bS_to_cpu(value);}static inline voidNCR_700_writeb(__u8 value, struct Scsi_Host *host, __u32 reg){ const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) = (struct NCR_700_Host_Parameters *)host->hostdata[0]; outb(value, host->base + (reg^bE));}static inline voidNCR_700_writel(__u32 value, struct Scsi_Host *host, __u32 reg){ const struct NCR_700_Host_Parameters *hostdata __attribute__((unused)) = (struct NCR_700_Host_Parameters *)host->hostdata[0];#if 1 /* sanity check the register */ if((reg & 0x3) != 0) BUG();#endif outl(bS_to_host(value), host->base + reg);}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -