1 // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 #ifndef __SPI_REG_H__ 15 #define __SPI_REG_H__ 16 17 18 #include "soc.h" 19 #define REG_SPI_BASE(i) (DR_REG_SPI1_BASE + (((i)>1) ? (((i)* 0x1000) + 0x20000) : (((~(i)) & 1)* 0x1000 ))) 20 21 #define SPI_CMD_REG(i) (REG_SPI_BASE(i) + 0x0) 22 /* SPI_FLASH_READ : R/W ;bitpos:[31] ;default: 1'b0 ; */ 23 /*description: Read flash enable. Read flash operation will be triggered when 24 the bit is set. The bit will be cleared once the operation done. 1: enable 0: disable.*/ 25 #define SPI_FLASH_READ (BIT(31)) 26 #define SPI_FLASH_READ_M (BIT(31)) 27 #define SPI_FLASH_READ_V 0x1 28 #define SPI_FLASH_READ_S 31 29 /* SPI_FLASH_WREN : R/W ;bitpos:[30] ;default: 1'b0 ; */ 30 /*description: Write flash enable. Write enable command will be sent when the 31 bit is set. The bit will be cleared once the operation done. 1: enable 0: disable.*/ 32 #define SPI_FLASH_WREN (BIT(30)) 33 #define SPI_FLASH_WREN_M (BIT(30)) 34 #define SPI_FLASH_WREN_V 0x1 35 #define SPI_FLASH_WREN_S 30 36 /* SPI_FLASH_WRDI : R/W ;bitpos:[29] ;default: 1'b0 ; */ 37 /*description: Write flash disable. Write disable command will be sent when 38 the bit is set. The bit will be cleared once the operation done. 1: enable 0: disable.*/ 39 #define SPI_FLASH_WRDI (BIT(29)) 40 #define SPI_FLASH_WRDI_M (BIT(29)) 41 #define SPI_FLASH_WRDI_V 0x1 42 #define SPI_FLASH_WRDI_S 29 43 /* SPI_FLASH_RDID : R/W ;bitpos:[28] ;default: 1'b0 ; */ 44 /*description: Read JEDEC ID . Read ID command will be sent when the bit is 45 set. The bit will be cleared once the operation done. 1: enable 0: disable.*/ 46 #define SPI_FLASH_RDID (BIT(28)) 47 #define SPI_FLASH_RDID_M (BIT(28)) 48 #define SPI_FLASH_RDID_V 0x1 49 #define SPI_FLASH_RDID_S 28 50 /* SPI_FLASH_RDSR : R/W ;bitpos:[27] ;default: 1'b0 ; */ 51 /*description: Read status register-1. Read status operation will be triggered 52 when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ 53 #define SPI_FLASH_RDSR (BIT(27)) 54 #define SPI_FLASH_RDSR_M (BIT(27)) 55 #define SPI_FLASH_RDSR_V 0x1 56 #define SPI_FLASH_RDSR_S 27 57 /* SPI_FLASH_WRSR : R/W ;bitpos:[26] ;default: 1'b0 ; */ 58 /*description: Write status register enable. Write status operation will 59 be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ 60 #define SPI_FLASH_WRSR (BIT(26)) 61 #define SPI_FLASH_WRSR_M (BIT(26)) 62 #define SPI_FLASH_WRSR_V 0x1 63 #define SPI_FLASH_WRSR_S 26 64 /* SPI_FLASH_PP : R/W ;bitpos:[25] ;default: 1'b0 ; */ 65 /*description: Page program enable(1 byte ~256 bytes data to be programmed). 66 Page program operation will be triggered when the bit is set. The bit will be cleared once the operation done .1: enable 0: disable.*/ 67 #define SPI_FLASH_PP (BIT(25)) 68 #define SPI_FLASH_PP_M (BIT(25)) 69 #define SPI_FLASH_PP_V 0x1 70 #define SPI_FLASH_PP_S 25 71 /* SPI_FLASH_SE : R/W ;bitpos:[24] ;default: 1'b0 ; */ 72 /*description: Sector erase enable. A 4KB sector is erased via SPI command 20H. Sector erase operation will be triggered 73 when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ 74 #define SPI_FLASH_SE (BIT(24)) 75 #define SPI_FLASH_SE_M (BIT(24)) 76 #define SPI_FLASH_SE_V 0x1 77 #define SPI_FLASH_SE_S 24 78 /* SPI_FLASH_BE : R/W ;bitpos:[23] ;default: 1'b0 ; */ 79 /*description: Block erase enable. A 64KB block is erased via SPI command D8H. Block erase operation will be triggered 80 when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ 81 #define SPI_FLASH_BE (BIT(23)) 82 #define SPI_FLASH_BE_M (BIT(23)) 83 #define SPI_FLASH_BE_V 0x1 84 #define SPI_FLASH_BE_S 23 85 /* SPI_FLASH_CE : R/W ;bitpos:[22] ;default: 1'b0 ; */ 86 /*description: Chip erase enable. Chip erase operation will be triggered when 87 the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ 88 #define SPI_FLASH_CE (BIT(22)) 89 #define SPI_FLASH_CE_M (BIT(22)) 90 #define SPI_FLASH_CE_V 0x1 91 #define SPI_FLASH_CE_S 22 92 /* SPI_FLASH_DP : R/W ;bitpos:[21] ;default: 1'b0 ; */ 93 /*description: Drive Flash into power down. An operation will be triggered 94 when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ 95 #define SPI_FLASH_DP (BIT(21)) 96 #define SPI_FLASH_DP_M (BIT(21)) 97 #define SPI_FLASH_DP_V 0x1 98 #define SPI_FLASH_DP_S 21 99 /* SPI_FLASH_RES : R/W ;bitpos:[20] ;default: 1'b0 ; */ 100 /*description: This bit combined with reg_resandres bit releases Flash from 101 the power-down state or high performance mode and obtains the devices ID. The bit will be cleared once the operation done.1: enable 0: disable.*/ 102 #define SPI_FLASH_RES (BIT(20)) 103 #define SPI_FLASH_RES_M (BIT(20)) 104 #define SPI_FLASH_RES_V 0x1 105 #define SPI_FLASH_RES_S 20 106 /* SPI_FLASH_HPM : R/W ;bitpos:[19] ;default: 1'b0 ; */ 107 /*description: Drive Flash into high performance mode. The bit will be cleared 108 once the operation done.1: enable 0: disable.*/ 109 #define SPI_FLASH_HPM (BIT(19)) 110 #define SPI_FLASH_HPM_M (BIT(19)) 111 #define SPI_FLASH_HPM_V 0x1 112 #define SPI_FLASH_HPM_S 19 113 /* SPI_USR : R/W ;bitpos:[18] ;default: 1'b0 ; */ 114 /*description: User define command enable. An operation will be triggered when 115 the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ 116 #define SPI_USR (BIT(18)) 117 #define SPI_USR_M (BIT(18)) 118 #define SPI_USR_V 0x1 119 #define SPI_USR_S 18 120 /* SPI_FLASH_PES : R/W ;bitpos:[17] ;default: 1'b0 ; */ 121 /*description: program erase suspend bit program erase suspend operation will 122 be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ 123 #define SPI_FLASH_PES (BIT(17)) 124 #define SPI_FLASH_PES_M (BIT(17)) 125 #define SPI_FLASH_PES_V 0x1 126 #define SPI_FLASH_PES_S 17 127 /* SPI_FLASH_PER : R/W ;bitpos:[16] ;default: 1'b0 ; */ 128 /*description: program erase resume bit program erase suspend operation will 129 be triggered when the bit is set. The bit will be cleared once the operation done.1: enable 0: disable.*/ 130 #define SPI_FLASH_PER (BIT(16)) 131 #define SPI_FLASH_PER_M (BIT(16)) 132 #define SPI_FLASH_PER_V 0x1 133 #define SPI_FLASH_PER_S 16 134 135 #define SPI_ADDR_REG(i) (REG_SPI_BASE(i) + 0x4) 136 //The CSV actually is wrong here. It indicates that the lower 8 bits of this register are reserved. This is not true, 137 //all 32 bits of SPI_ADDR_REG are usable/used. 138 139 #define SPI_CTRL_REG(i) (REG_SPI_BASE(i) + 0x8) 140 /* SPI_WR_BIT_ORDER : R/W ;bitpos:[26] ;default: 1'b0 ; */ 141 /*description: In command address write-data (MOSI) phases 1: LSB firs 0: MSB first*/ 142 #define SPI_WR_BIT_ORDER (BIT(26)) 143 #define SPI_WR_BIT_ORDER_M (BIT(26)) 144 #define SPI_WR_BIT_ORDER_V 0x1 145 #define SPI_WR_BIT_ORDER_S 26 146 /* SPI_RD_BIT_ORDER : R/W ;bitpos:[25] ;default: 1'b0 ; */ 147 /*description: In read-data (MISO) phase 1: LSB first 0: MSB first*/ 148 #define SPI_RD_BIT_ORDER (BIT(25)) 149 #define SPI_RD_BIT_ORDER_M (BIT(25)) 150 #define SPI_RD_BIT_ORDER_V 0x1 151 #define SPI_RD_BIT_ORDER_S 25 152 /* SPI_FREAD_QIO : R/W ;bitpos:[24] ;default: 1'b0 ; */ 153 /*description: In the read operations address phase and read-data phase apply 154 4 signals. 1: enable 0: disable.*/ 155 #define SPI_FREAD_QIO (BIT(24)) 156 #define SPI_FREAD_QIO_M (BIT(24)) 157 #define SPI_FREAD_QIO_V 0x1 158 #define SPI_FREAD_QIO_S 24 159 /* SPI_FREAD_DIO : R/W ;bitpos:[23] ;default: 1'b0 ; */ 160 /*description: In the read operations address phase and read-data phase apply 161 2 signals. 1: enable 0: disable.*/ 162 #define SPI_FREAD_DIO (BIT(23)) 163 #define SPI_FREAD_DIO_M (BIT(23)) 164 #define SPI_FREAD_DIO_V 0x1 165 #define SPI_FREAD_DIO_S 23 166 /* SPI_WRSR_2B : R/W ;bitpos:[22] ;default: 1'b0 ; */ 167 /*description: two bytes data will be written to status register when it is 168 set. 1: enable 0: disable.*/ 169 #define SPI_WRSR_2B (BIT(22)) 170 #define SPI_WRSR_2B_M (BIT(22)) 171 #define SPI_WRSR_2B_V 0x1 172 #define SPI_WRSR_2B_S 22 173 /* SPI_WP_REG : R/W ;bitpos:[21] ;default: 1'b1 ; */ 174 /*description: Write protect signal output when SPI is idle. 1: output high 0: output low.*/ 175 #define SPI_WP_REG (BIT(21)) 176 #define SPI_WP_REG_M (BIT(21)) 177 #define SPI_WP_REG_V 0x1 178 #define SPI_WP_REG_S 21 179 /* SPI_FREAD_QUAD : R/W ;bitpos:[20] ;default: 1'b0 ; */ 180 /*description: In the read operations read-data phase apply 4 signals. 1: enable 0: disable.*/ 181 #define SPI_FREAD_QUAD (BIT(20)) 182 #define SPI_FREAD_QUAD_M (BIT(20)) 183 #define SPI_FREAD_QUAD_V 0x1 184 #define SPI_FREAD_QUAD_S 20 185 /* SPI_RESANDRES : R/W ;bitpos:[15] ;default: 1'b1 ; */ 186 /*description: The Device ID is read out to SPI_RD_STATUS register, this bit 187 combine with spi_flash_res bit. 1: enable 0: disable.*/ 188 #define SPI_RESANDRES (BIT(15)) 189 #define SPI_RESANDRES_M (BIT(15)) 190 #define SPI_RESANDRES_V 0x1 191 #define SPI_RESANDRES_S 15 192 /* SPI_FREAD_DUAL : R/W ;bitpos:[14] ;default: 1'b0 ; */ 193 /*description: In the read operations read-data phase apply 2 signals. 1: enable 0: disable.*/ 194 #define SPI_FREAD_DUAL (BIT(14)) 195 #define SPI_FREAD_DUAL_M (BIT(14)) 196 #define SPI_FREAD_DUAL_V 0x1 197 #define SPI_FREAD_DUAL_S 14 198 /* SPI_FASTRD_MODE : R/W ;bitpos:[13] ;default: 1'b1 ; */ 199 /*description: This bit enable the bits: spi_fread_qio spi_fread_dio spi_fread_qout 200 and spi_fread_dout. 1: enable 0: disable.*/ 201 #define SPI_FASTRD_MODE (BIT(13)) 202 #define SPI_FASTRD_MODE_M (BIT(13)) 203 #define SPI_FASTRD_MODE_V 0x1 204 #define SPI_FASTRD_MODE_S 13 205 /* SPI_WAIT_FLASH_IDLE_EN : R/W ;bitpos:[12] ;default: 1'b0 ; */ 206 /*description: wait flash idle when program flash or erase flash. 1: enable 0: disable.*/ 207 #define SPI_WAIT_FLASH_IDLE_EN (BIT(12)) 208 #define SPI_WAIT_FLASH_IDLE_EN_M (BIT(12)) 209 #define SPI_WAIT_FLASH_IDLE_EN_V 0x1 210 #define SPI_WAIT_FLASH_IDLE_EN_S 12 211 /* SPI_TX_CRC_EN : R/W ;bitpos:[11] ;default: 1'b0 ; */ 212 /*description: For SPI1 enable crc32 when writing encrypted data to flash. 213 1: enable 0:disable*/ 214 #define SPI_TX_CRC_EN (BIT(11)) 215 #define SPI_TX_CRC_EN_M (BIT(11)) 216 #define SPI_TX_CRC_EN_V 0x1 217 #define SPI_TX_CRC_EN_S 11 218 /* SPI_FCS_CRC_EN : R/W ;bitpos:[10] ;default: 1'b1 ; */ 219 /*description: For SPI1 initialize crc32 module before writing encrypted data 220 to flash. Active low.*/ 221 #define SPI_FCS_CRC_EN (BIT(10)) 222 #define SPI_FCS_CRC_EN_M (BIT(10)) 223 #define SPI_FCS_CRC_EN_V 0x1 224 #define SPI_FCS_CRC_EN_S 10 225 226 #define SPI_CTRL1_REG(i) (REG_SPI_BASE(i) + 0xC) 227 /* SPI_CS_HOLD_DELAY : R/W ;bitpos:[31:28] ;default: 4'h5 ; */ 228 /*description: SPI cs signal is delayed by spi clock cycles*/ 229 #define SPI_CS_HOLD_DELAY 0x0000000F 230 #define SPI_CS_HOLD_DELAY_M ((SPI_CS_HOLD_DELAY_V)<<(SPI_CS_HOLD_DELAY_S)) 231 #define SPI_CS_HOLD_DELAY_V 0xF 232 #define SPI_CS_HOLD_DELAY_S 28 233 /* SPI_CS_HOLD_DELAY_RES : R/W ;bitpos:[27:16] ;default: 12'hfff ; */ 234 /*description: Delay cycles of resume Flash when resume Flash is enable by spi clock.*/ 235 #define SPI_CS_HOLD_DELAY_RES 0x00000FFF 236 #define SPI_CS_HOLD_DELAY_RES_M ((SPI_CS_HOLD_DELAY_RES_V)<<(SPI_CS_HOLD_DELAY_RES_S)) 237 #define SPI_CS_HOLD_DELAY_RES_V 0xFFF 238 #define SPI_CS_HOLD_DELAY_RES_S 16 239 240 #define SPI_RD_STATUS_REG(i) (REG_SPI_BASE(i) + 0x10) 241 /* SPI_STATUS_EXT : R/W ;bitpos:[31:24] ;default: 8'h00 ; */ 242 /*description: In the slave mode,it is the status for master to read out.*/ 243 #define SPI_STATUS_EXT 0x000000FF 244 #define SPI_STATUS_EXT_M ((SPI_STATUS_EXT_V)<<(SPI_STATUS_EXT_S)) 245 #define SPI_STATUS_EXT_V 0xFF 246 #define SPI_STATUS_EXT_S 24 247 /* SPI_WB_MODE : R/W ;bitpos:[23:16] ;default: 8'h00 ; */ 248 /*description: Mode bits in the flash fast read mode, it is combined with spi_fastrd_mode bit.*/ 249 #define SPI_WB_MODE 0x000000FF 250 #define SPI_WB_MODE_M ((SPI_WB_MODE_V)<<(SPI_WB_MODE_S)) 251 #define SPI_WB_MODE_V 0xFF 252 #define SPI_WB_MODE_S 16 253 /* SPI_STATUS : R/W ;bitpos:[15:0] ;default: 16'b0 ; */ 254 /*description: In the slave mode, it is the status for master to read out.*/ 255 #define SPI_STATUS 0x0000FFFF 256 #define SPI_STATUS_M ((SPI_STATUS_V)<<(SPI_STATUS_S)) 257 #define SPI_STATUS_V 0xFFFF 258 #define SPI_STATUS_S 0 259 260 #define SPI_CTRL2_REG(i) (REG_SPI_BASE(i) + 0x14) 261 /* SPI_CS_DELAY_NUM : R/W ;bitpos:[31:28] ;default: 4'h0 ; */ 262 /*description: spi_cs signal is delayed by system clock cycles*/ 263 #define SPI_CS_DELAY_NUM 0x0000000F 264 #define SPI_CS_DELAY_NUM_M ((SPI_CS_DELAY_NUM_V)<<(SPI_CS_DELAY_NUM_S)) 265 #define SPI_CS_DELAY_NUM_V 0xF 266 #define SPI_CS_DELAY_NUM_S 28 267 /* SPI_CS_DELAY_MODE : R/W ;bitpos:[27:26] ;default: 2'h0 ; */ 268 /*description: spi_cs signal is delayed by spi_clk . 0: zero 1: if spi_ck_out_edge 269 or spi_ck_i_edge is set 1 delayed by half cycle else delayed by one cycle 2: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by one cycle else delayed by half cycle 3: delayed one cycle*/ 270 #define SPI_CS_DELAY_MODE 0x00000003 271 #define SPI_CS_DELAY_MODE_M ((SPI_CS_DELAY_MODE_V)<<(SPI_CS_DELAY_MODE_S)) 272 #define SPI_CS_DELAY_MODE_V 0x3 273 #define SPI_CS_DELAY_MODE_S 26 274 /* SPI_MOSI_DELAY_NUM : R/W ;bitpos:[25:23] ;default: 3'h0 ; */ 275 /*description: MOSI signals are delayed by system clock cycles*/ 276 #define SPI_MOSI_DELAY_NUM 0x00000007 277 #define SPI_MOSI_DELAY_NUM_M ((SPI_MOSI_DELAY_NUM_V)<<(SPI_MOSI_DELAY_NUM_S)) 278 #define SPI_MOSI_DELAY_NUM_V 0x7 279 #define SPI_MOSI_DELAY_NUM_S 23 280 /* SPI_MOSI_DELAY_MODE : R/W ;bitpos:[22:21] ;default: 2'h0 ; */ 281 /*description: MOSI signals are delayed by spi_clk. 0: zero 1: if spi_ck_out_edge 282 or spi_ck_i_edge is set 1 delayed by half cycle else delayed by one cycle 2: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by one cycle else delayed by half cycle 3: delayed one cycle*/ 283 #define SPI_MOSI_DELAY_MODE 0x00000003 284 #define SPI_MOSI_DELAY_MODE_M ((SPI_MOSI_DELAY_MODE_V)<<(SPI_MOSI_DELAY_MODE_S)) 285 #define SPI_MOSI_DELAY_MODE_V 0x3 286 #define SPI_MOSI_DELAY_MODE_S 21 287 /* SPI_MISO_DELAY_NUM : R/W ;bitpos:[20:18] ;default: 3'h0 ; */ 288 /*description: MISO signals are delayed by system clock cycles*/ 289 #define SPI_MISO_DELAY_NUM 0x00000007 290 #define SPI_MISO_DELAY_NUM_M ((SPI_MISO_DELAY_NUM_V)<<(SPI_MISO_DELAY_NUM_S)) 291 #define SPI_MISO_DELAY_NUM_V 0x7 292 #define SPI_MISO_DELAY_NUM_S 18 293 /* SPI_MISO_DELAY_MODE : R/W ;bitpos:[17:16] ;default: 2'h0 ; */ 294 /*description: MISO signals are delayed by spi_clk. 0: zero 1: if spi_ck_out_edge 295 or spi_ck_i_edge is set 1 delayed by half cycle else delayed by one cycle 2: if spi_ck_out_edge or spi_ck_i_edge is set 1 delayed by one cycle else delayed by half cycle 3: delayed one cycle*/ 296 #define SPI_MISO_DELAY_MODE 0x00000003 297 #define SPI_MISO_DELAY_MODE_M ((SPI_MISO_DELAY_MODE_V)<<(SPI_MISO_DELAY_MODE_S)) 298 #define SPI_MISO_DELAY_MODE_V 0x3 299 #define SPI_MISO_DELAY_MODE_S 16 300 /* SPI_CK_OUT_HIGH_MODE : R/W ;bitpos:[15:12] ;default: 4'h0 ; */ 301 /*description: modify spi clock duty ratio when the value is lager than 8, 302 the bits are combined with spi_clkcnt_N bits and spi_clkcnt_H bits.*/ 303 #define SPI_CK_OUT_HIGH_MODE 0x0000000F 304 #define SPI_CK_OUT_HIGH_MODE_M ((SPI_CK_OUT_HIGH_MODE_V)<<(SPI_CK_OUT_HIGH_MODE_S)) 305 #define SPI_CK_OUT_HIGH_MODE_V 0xF 306 #define SPI_CK_OUT_HIGH_MODE_S 12 307 /* SPI_CK_OUT_LOW_MODE : R/W ;bitpos:[11:8] ;default: 4'h0 ; */ 308 /*description: modify spi clock duty ratio when the value is lager than 8, 309 the bits are combined with spi_clkcnt_N bits and spi_clkcnt_L bits.*/ 310 #define SPI_CK_OUT_LOW_MODE 0x0000000F 311 #define SPI_CK_OUT_LOW_MODE_M ((SPI_CK_OUT_LOW_MODE_V)<<(SPI_CK_OUT_LOW_MODE_S)) 312 #define SPI_CK_OUT_LOW_MODE_V 0xF 313 #define SPI_CK_OUT_LOW_MODE_S 8 314 /* SPI_HOLD_TIME : R/W ;bitpos:[7:4] ;default: 4'h1 ; */ 315 /*description: delay cycles of cs pin by spi clock, this bits combined with spi_cs_hold bit.*/ 316 #define SPI_HOLD_TIME 0x0000000F 317 #define SPI_HOLD_TIME_M ((SPI_HOLD_TIME_V)<<(SPI_HOLD_TIME_S)) 318 #define SPI_HOLD_TIME_V 0xF 319 #define SPI_HOLD_TIME_S 4 320 /* SPI_SETUP_TIME : R/W ;bitpos:[3:0] ;default: 4'h1 ; */ 321 /*description: (cycles-1) of ¡°prepare¡± phase by spi clock, this bits combined 322 with spi_cs_setup bit.*/ 323 #define SPI_SETUP_TIME 0x0000000F 324 #define SPI_SETUP_TIME_M ((SPI_SETUP_TIME_V)<<(SPI_SETUP_TIME_S)) 325 #define SPI_SETUP_TIME_V 0xF 326 #define SPI_SETUP_TIME_S 0 327 328 #define SPI_CLOCK_REG(i) (REG_SPI_BASE(i) + 0x18) 329 /* SPI_CLK_EQU_SYSCLK : R/W ;bitpos:[31] ;default: 1'b1 ; */ 330 /*description: In the master mode 1: spi_clk is eqaul to system 0: spi_clk is 331 divided from system clock.*/ 332 #define SPI_CLK_EQU_SYSCLK (BIT(31)) 333 #define SPI_CLK_EQU_SYSCLK_M (BIT(31)) 334 #define SPI_CLK_EQU_SYSCLK_V 0x1 335 #define SPI_CLK_EQU_SYSCLK_S 31 336 /* SPI_CLKDIV_PRE : R/W ;bitpos:[30:18] ;default: 13'b0 ; */ 337 /*description: In the master mode it is pre-divider of spi_clk.*/ 338 #define SPI_CLKDIV_PRE 0x00001FFF 339 #define SPI_CLKDIV_PRE_M ((SPI_CLKDIV_PRE_V)<<(SPI_CLKDIV_PRE_S)) 340 #define SPI_CLKDIV_PRE_V 0x1FFF 341 #define SPI_CLKDIV_PRE_S 18 342 /* SPI_CLKCNT_N : R/W ;bitpos:[17:12] ;default: 6'h3 ; */ 343 /*description: In the master mode it is the divider of spi_clk. So spi_clk frequency 344 is system/(spi_clkdiv_pre+1)/(spi_clkcnt_N+1)*/ 345 #define SPI_CLKCNT_N 0x0000003F 346 #define SPI_CLKCNT_N_M ((SPI_CLKCNT_N_V)<<(SPI_CLKCNT_N_S)) 347 #define SPI_CLKCNT_N_V 0x3F 348 #define SPI_CLKCNT_N_S 12 349 /* SPI_CLKCNT_H : R/W ;bitpos:[11:6] ;default: 6'h1 ; */ 350 /*description: In the master mode it must be floor((spi_clkcnt_N+1)/2-1). In 351 the slave mode it must be 0.*/ 352 #define SPI_CLKCNT_H 0x0000003F 353 #define SPI_CLKCNT_H_M ((SPI_CLKCNT_H_V)<<(SPI_CLKCNT_H_S)) 354 #define SPI_CLKCNT_H_V 0x3F 355 #define SPI_CLKCNT_H_S 6 356 /* SPI_CLKCNT_L : R/W ;bitpos:[5:0] ;default: 6'h3 ; */ 357 /*description: In the master mode it must be equal to spi_clkcnt_N. In the slave 358 mode it must be 0.*/ 359 #define SPI_CLKCNT_L 0x0000003F 360 #define SPI_CLKCNT_L_M ((SPI_CLKCNT_L_V)<<(SPI_CLKCNT_L_S)) 361 #define SPI_CLKCNT_L_V 0x3F 362 #define SPI_CLKCNT_L_S 0 363 364 #define SPI_USER_REG(i) (REG_SPI_BASE(i) + 0x1C) 365 /* SPI_USR_COMMAND : R/W ;bitpos:[31] ;default: 1'b1 ; */ 366 /*description: This bit enable the command phase of an operation.*/ 367 #define SPI_USR_COMMAND (BIT(31)) 368 #define SPI_USR_COMMAND_M (BIT(31)) 369 #define SPI_USR_COMMAND_V 0x1 370 #define SPI_USR_COMMAND_S 31 371 /* SPI_USR_ADDR : R/W ;bitpos:[30] ;default: 1'b0 ; */ 372 /*description: This bit enable the address phase of an operation.*/ 373 #define SPI_USR_ADDR (BIT(30)) 374 #define SPI_USR_ADDR_M (BIT(30)) 375 #define SPI_USR_ADDR_V 0x1 376 #define SPI_USR_ADDR_S 30 377 /* SPI_USR_DUMMY : R/W ;bitpos:[29] ;default: 1'b0 ; */ 378 /*description: This bit enable the dummy phase of an operation.*/ 379 #define SPI_USR_DUMMY (BIT(29)) 380 #define SPI_USR_DUMMY_M (BIT(29)) 381 #define SPI_USR_DUMMY_V 0x1 382 #define SPI_USR_DUMMY_S 29 383 /* SPI_USR_MISO : R/W ;bitpos:[28] ;default: 1'b0 ; */ 384 /*description: This bit enable the read-data phase of an operation.*/ 385 #define SPI_USR_MISO (BIT(28)) 386 #define SPI_USR_MISO_M (BIT(28)) 387 #define SPI_USR_MISO_V 0x1 388 #define SPI_USR_MISO_S 28 389 /* SPI_USR_MOSI : R/W ;bitpos:[27] ;default: 1'b0 ; */ 390 /*description: This bit enable the write-data phase of an operation.*/ 391 #define SPI_USR_MOSI (BIT(27)) 392 #define SPI_USR_MOSI_M (BIT(27)) 393 #define SPI_USR_MOSI_V 0x1 394 #define SPI_USR_MOSI_S 27 395 /* SPI_USR_DUMMY_IDLE : R/W ;bitpos:[26] ;default: 1'b0 ; */ 396 /*description: spi clock is disable in dummy phase when the bit is enable.*/ 397 #define SPI_USR_DUMMY_IDLE (BIT(26)) 398 #define SPI_USR_DUMMY_IDLE_M (BIT(26)) 399 #define SPI_USR_DUMMY_IDLE_V 0x1 400 #define SPI_USR_DUMMY_IDLE_S 26 401 /* SPI_USR_MOSI_HIGHPART : R/W ;bitpos:[25] ;default: 1'b0 ; */ 402 /*description: write-data phase only access to high-part of the buffer spi_w8~spi_w15. 403 1: enable 0: disable.*/ 404 #define SPI_USR_MOSI_HIGHPART (BIT(25)) 405 #define SPI_USR_MOSI_HIGHPART_M (BIT(25)) 406 #define SPI_USR_MOSI_HIGHPART_V 0x1 407 #define SPI_USR_MOSI_HIGHPART_S 25 408 /* SPI_USR_MISO_HIGHPART : R/W ;bitpos:[24] ;default: 1'b0 ; */ 409 /*description: read-data phase only access to high-part of the buffer spi_w8~spi_w15. 410 1: enable 0: disable.*/ 411 #define SPI_USR_MISO_HIGHPART (BIT(24)) 412 #define SPI_USR_MISO_HIGHPART_M (BIT(24)) 413 #define SPI_USR_MISO_HIGHPART_V 0x1 414 #define SPI_USR_MISO_HIGHPART_S 24 415 /* SPI_USR_PREP_HOLD : R/W ;bitpos:[23] ;default: 1'b0 ; */ 416 /*description: spi is hold at prepare state the bit combined with spi_usr_hold_pol bit.*/ 417 #define SPI_USR_PREP_HOLD (BIT(23)) 418 #define SPI_USR_PREP_HOLD_M (BIT(23)) 419 #define SPI_USR_PREP_HOLD_V 0x1 420 #define SPI_USR_PREP_HOLD_S 23 421 /* SPI_USR_CMD_HOLD : R/W ;bitpos:[22] ;default: 1'b0 ; */ 422 /*description: spi is hold at command state the bit combined with spi_usr_hold_pol bit.*/ 423 #define SPI_USR_CMD_HOLD (BIT(22)) 424 #define SPI_USR_CMD_HOLD_M (BIT(22)) 425 #define SPI_USR_CMD_HOLD_V 0x1 426 #define SPI_USR_CMD_HOLD_S 22 427 /* SPI_USR_ADDR_HOLD : R/W ;bitpos:[21] ;default: 1'b0 ; */ 428 /*description: spi is hold at address state the bit combined with spi_usr_hold_pol bit.*/ 429 #define SPI_USR_ADDR_HOLD (BIT(21)) 430 #define SPI_USR_ADDR_HOLD_M (BIT(21)) 431 #define SPI_USR_ADDR_HOLD_V 0x1 432 #define SPI_USR_ADDR_HOLD_S 21 433 /* SPI_USR_DUMMY_HOLD : R/W ;bitpos:[20] ;default: 1'b0 ; */ 434 /*description: spi is hold at dummy state the bit combined with spi_usr_hold_pol bit.*/ 435 #define SPI_USR_DUMMY_HOLD (BIT(20)) 436 #define SPI_USR_DUMMY_HOLD_M (BIT(20)) 437 #define SPI_USR_DUMMY_HOLD_V 0x1 438 #define SPI_USR_DUMMY_HOLD_S 20 439 /* SPI_USR_DIN_HOLD : R/W ;bitpos:[19] ;default: 1'b0 ; */ 440 /*description: spi is hold at data in state the bit combined with spi_usr_hold_pol bit.*/ 441 #define SPI_USR_DIN_HOLD (BIT(19)) 442 #define SPI_USR_DIN_HOLD_M (BIT(19)) 443 #define SPI_USR_DIN_HOLD_V 0x1 444 #define SPI_USR_DIN_HOLD_S 19 445 /* SPI_USR_DOUT_HOLD : R/W ;bitpos:[18] ;default: 1'b0 ; */ 446 /*description: spi is hold at data out state the bit combined with spi_usr_hold_pol bit.*/ 447 #define SPI_USR_DOUT_HOLD (BIT(18)) 448 #define SPI_USR_DOUT_HOLD_M (BIT(18)) 449 #define SPI_USR_DOUT_HOLD_V 0x1 450 #define SPI_USR_DOUT_HOLD_S 18 451 /* SPI_USR_HOLD_POL : R/W ;bitpos:[17] ;default: 1'b0 ; */ 452 /*description: It is combined with hold bits to set the polarity of spi hold 453 line 1: spi will be held when spi hold line is high 0: spi will be held when spi hold line is low*/ 454 #define SPI_USR_HOLD_POL (BIT(17)) 455 #define SPI_USR_HOLD_POL_M (BIT(17)) 456 #define SPI_USR_HOLD_POL_V 0x1 457 #define SPI_USR_HOLD_POL_S 17 458 /* SPI_SIO : R/W ;bitpos:[16] ;default: 1'b0 ; */ 459 /*description: Set the bit to enable 3-line half duplex communication mosi 460 and miso signals share the same pin. 1: enable 0: disable.*/ 461 #define SPI_SIO (BIT(16)) 462 #define SPI_SIO_M (BIT(16)) 463 #define SPI_SIO_V 0x1 464 #define SPI_SIO_S 16 465 /* SPI_FWRITE_QIO : R/W ;bitpos:[15] ;default: 1'b0 ; */ 466 /*description: In the write operations address phase and read-data phase apply 4 signals.*/ 467 #define SPI_FWRITE_QIO (BIT(15)) 468 #define SPI_FWRITE_QIO_M (BIT(15)) 469 #define SPI_FWRITE_QIO_V 0x1 470 #define SPI_FWRITE_QIO_S 15 471 /* SPI_FWRITE_DIO : R/W ;bitpos:[14] ;default: 1'b0 ; */ 472 /*description: In the write operations address phase and read-data phase apply 2 signals.*/ 473 #define SPI_FWRITE_DIO (BIT(14)) 474 #define SPI_FWRITE_DIO_M (BIT(14)) 475 #define SPI_FWRITE_DIO_V 0x1 476 #define SPI_FWRITE_DIO_S 14 477 /* SPI_FWRITE_QUAD : R/W ;bitpos:[13] ;default: 1'b0 ; */ 478 /*description: In the write operations read-data phase apply 4 signals*/ 479 #define SPI_FWRITE_QUAD (BIT(13)) 480 #define SPI_FWRITE_QUAD_M (BIT(13)) 481 #define SPI_FWRITE_QUAD_V 0x1 482 #define SPI_FWRITE_QUAD_S 13 483 /* SPI_FWRITE_DUAL : R/W ;bitpos:[12] ;default: 1'b0 ; */ 484 /*description: In the write operations read-data phase apply 2 signals*/ 485 #define SPI_FWRITE_DUAL (BIT(12)) 486 #define SPI_FWRITE_DUAL_M (BIT(12)) 487 #define SPI_FWRITE_DUAL_V 0x1 488 #define SPI_FWRITE_DUAL_S 12 489 /* SPI_WR_BYTE_ORDER : R/W ;bitpos:[11] ;default: 1'b0 ; */ 490 /*description: In command address write-data (MOSI) phases 1: big-endian 0: litte_endian*/ 491 #define SPI_WR_BYTE_ORDER (BIT(11)) 492 #define SPI_WR_BYTE_ORDER_M (BIT(11)) 493 #define SPI_WR_BYTE_ORDER_V 0x1 494 #define SPI_WR_BYTE_ORDER_S 11 495 /* SPI_RD_BYTE_ORDER : R/W ;bitpos:[10] ;default: 1'b0 ; */ 496 /*description: In read-data (MISO) phase 1: big-endian 0: little_endian*/ 497 #define SPI_RD_BYTE_ORDER (BIT(10)) 498 #define SPI_RD_BYTE_ORDER_M (BIT(10)) 499 #define SPI_RD_BYTE_ORDER_V 0x1 500 #define SPI_RD_BYTE_ORDER_S 10 501 /* SPI_CK_OUT_EDGE : R/W ;bitpos:[7] ;default: 1'b0 ; */ 502 /*description: the bit combined with spi_mosi_delay_mode bits to set mosi signal delay mode.*/ 503 #define SPI_CK_OUT_EDGE (BIT(7)) 504 #define SPI_CK_OUT_EDGE_M (BIT(7)) 505 #define SPI_CK_OUT_EDGE_V 0x1 506 #define SPI_CK_OUT_EDGE_S 7 507 /* SPI_CK_I_EDGE : R/W ;bitpos:[6] ;default: 1'b1 ; */ 508 /*description: In the slave mode the bit is same as spi_ck_out_edge in master 509 mode. It is combined with spi_miso_delay_mode bits.*/ 510 #define SPI_CK_I_EDGE (BIT(6)) 511 #define SPI_CK_I_EDGE_M (BIT(6)) 512 #define SPI_CK_I_EDGE_V 0x1 513 #define SPI_CK_I_EDGE_S 6 514 /* SPI_CS_SETUP : R/W ;bitpos:[5] ;default: 1'b0 ; */ 515 /*description: spi cs is enable when spi is in ¡°prepare¡± phase. 1: enable 0: disable.*/ 516 #define SPI_CS_SETUP (BIT(5)) 517 #define SPI_CS_SETUP_M (BIT(5)) 518 #define SPI_CS_SETUP_V 0x1 519 #define SPI_CS_SETUP_S 5 520 /* SPI_CS_HOLD : R/W ;bitpos:[4] ;default: 1'b0 ; */ 521 /*description: spi cs keep low when spi is in ¡°done¡± phase. 1: enable 0: disable.*/ 522 #define SPI_CS_HOLD (BIT(4)) 523 #define SPI_CS_HOLD_M (BIT(4)) 524 #define SPI_CS_HOLD_V 0x1 525 #define SPI_CS_HOLD_S 4 526 /* SPI_DOUTDIN : R/W ;bitpos:[0] ;default: 1'b0 ; */ 527 /*description: Set the bit to enable full duplex communication. 1: enable 0: disable.*/ 528 #define SPI_DOUTDIN (BIT(0)) 529 #define SPI_DOUTDIN_M (BIT(0)) 530 #define SPI_DOUTDIN_V 0x1 531 #define SPI_DOUTDIN_S 0 532 533 #define SPI_USER1_REG(i) (REG_SPI_BASE(i) + 0x20) 534 /* SPI_USR_ADDR_BITLEN : RO ;bitpos:[31:26] ;default: 6'd23 ; */ 535 /*description: The length in bits of address phase. The register value shall be (bit_num-1).*/ 536 #define SPI_USR_ADDR_BITLEN 0x0000003F 537 #define SPI_USR_ADDR_BITLEN_M ((SPI_USR_ADDR_BITLEN_V)<<(SPI_USR_ADDR_BITLEN_S)) 538 #define SPI_USR_ADDR_BITLEN_V 0x3F 539 #define SPI_USR_ADDR_BITLEN_S 26 540 /* SPI_USR_DUMMY_CYCLELEN : R/W ;bitpos:[7:0] ;default: 8'd7 ; */ 541 /*description: The length in spi_clk cycles of dummy phase. The register value 542 shall be (cycle_num-1).*/ 543 #define SPI_USR_DUMMY_CYCLELEN 0x000000FF 544 #define SPI_USR_DUMMY_CYCLELEN_M ((SPI_USR_DUMMY_CYCLELEN_V)<<(SPI_USR_DUMMY_CYCLELEN_S)) 545 #define SPI_USR_DUMMY_CYCLELEN_V 0xFF 546 #define SPI_USR_DUMMY_CYCLELEN_S 0 547 548 #define SPI_USER2_REG(i) (REG_SPI_BASE(i) + 0x24) 549 /* SPI_USR_COMMAND_BITLEN : R/W ;bitpos:[31:28] ;default: 4'd7 ; */ 550 /*description: The length in bits of command phase. The register value shall be (bit_num-1)*/ 551 #define SPI_USR_COMMAND_BITLEN 0x0000000F 552 #define SPI_USR_COMMAND_BITLEN_M ((SPI_USR_COMMAND_BITLEN_V)<<(SPI_USR_COMMAND_BITLEN_S)) 553 #define SPI_USR_COMMAND_BITLEN_V 0xF 554 #define SPI_USR_COMMAND_BITLEN_S 28 555 /* SPI_USR_COMMAND_VALUE : R/W ;bitpos:[15:0] ;default: 16'b0 ; */ 556 /*description: The value of command.*/ 557 #define SPI_USR_COMMAND_VALUE 0x0000FFFF 558 #define SPI_USR_COMMAND_VALUE_M ((SPI_USR_COMMAND_VALUE_V)<<(SPI_USR_COMMAND_VALUE_S)) 559 #define SPI_USR_COMMAND_VALUE_V 0xFFFF 560 #define SPI_USR_COMMAND_VALUE_S 0 561 562 #define SPI_MOSI_DLEN_REG(i) (REG_SPI_BASE(i) + 0x28) 563 /* SPI_USR_MOSI_DBITLEN : R/W ;bitpos:[23:0] ;default: 24'h0 ; */ 564 /*description: The length in bits of write-data. The register value shall be (bit_num-1).*/ 565 #define SPI_USR_MOSI_DBITLEN 0x00FFFFFF 566 #define SPI_USR_MOSI_DBITLEN_M ((SPI_USR_MOSI_DBITLEN_V)<<(SPI_USR_MOSI_DBITLEN_S)) 567 #define SPI_USR_MOSI_DBITLEN_V 0xFFFFFF 568 #define SPI_USR_MOSI_DBITLEN_S 0 569 570 #define SPI_MISO_DLEN_REG(i) (REG_SPI_BASE(i) + 0x2C) 571 /* SPI_USR_MISO_DBITLEN : R/W ;bitpos:[23:0] ;default: 24'h0 ; */ 572 /*description: The length in bits of read-data. The register value shall be (bit_num-1).*/ 573 #define SPI_USR_MISO_DBITLEN 0x00FFFFFF 574 #define SPI_USR_MISO_DBITLEN_M ((SPI_USR_MISO_DBITLEN_V)<<(SPI_USR_MISO_DBITLEN_S)) 575 #define SPI_USR_MISO_DBITLEN_V 0xFFFFFF 576 #define SPI_USR_MISO_DBITLEN_S 0 577 578 #define SPI_SLV_WR_STATUS_REG(i) (REG_SPI_BASE(i) + 0x30) 579 /* SPI_SLV_WR_ST : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 580 /*description: In the slave mode this register are the status register for the 581 master to write into. In the master mode this register are the higher 32bits in the 64 bits address condition.*/ 582 #define SPI_SLV_WR_ST 0xFFFFFFFF 583 #define SPI_SLV_WR_ST_M ((SPI_SLV_WR_ST_V)<<(SPI_SLV_WR_ST_S)) 584 #define SPI_SLV_WR_ST_V 0xFFFFFFFF 585 #define SPI_SLV_WR_ST_S 0 586 587 #define SPI_PIN_REG(i) (REG_SPI_BASE(i) + 0x34) 588 /* SPI_CS_KEEP_ACTIVE : R/W ;bitpos:[30] ;default: 1'b0 ; */ 589 /*description: spi cs line keep low when the bit is set.*/ 590 #define SPI_CS_KEEP_ACTIVE (BIT(30)) 591 #define SPI_CS_KEEP_ACTIVE_M (BIT(30)) 592 #define SPI_CS_KEEP_ACTIVE_V 0x1 593 #define SPI_CS_KEEP_ACTIVE_S 30 594 /* SPI_CK_IDLE_EDGE : R/W ;bitpos:[29] ;default: 1'b0 ; */ 595 /*description: 1: spi clk line is high when idle 0: spi clk line is low when idle*/ 596 #define SPI_CK_IDLE_EDGE (BIT(29)) 597 #define SPI_CK_IDLE_EDGE_M (BIT(29)) 598 #define SPI_CK_IDLE_EDGE_V 0x1 599 #define SPI_CK_IDLE_EDGE_S 29 600 /* SPI_MASTER_CK_SEL : R/W ;bitpos:[13:11] ;default: 3'b0 ; */ 601 /*description: In the master mode spi cs line is enable as spi clk it is combined 602 with spi_cs0_dis spi_cs1_dis spi_cs2_dis.*/ 603 #define SPI_MASTER_CK_SEL 0x00000007 604 #define SPI_MASTER_CK_SEL_M ((SPI_MASTER_CK_SEL_V)<<(SPI_MASTER_CK_SEL_S)) 605 #define SPI_MASTER_CK_SEL_V 0x07 606 #define SPI_MASTER_CK_SEL_S 11 607 /* SPI_MASTER_CS_POL : R/W ;bitpos:[8:6] ;default: 3'b0 ; */ 608 /*description: In the master mode the bits are the polarity of spi cs line 609 the value is equivalent to spi_cs ^ spi_master_cs_pol.*/ 610 #define SPI_MASTER_CS_POL 0x00000007 611 #define SPI_MASTER_CS_POL_M ((SPI_MASTER_CS_POL_V)<<(SPI_MASTER_CS_POL_S)) 612 #define SPI_MASTER_CS_POL_V 0x7 613 #define SPI_MASTER_CS_POL_S 6 614 /* SPI_CK_DIS : R/W ;bitpos:[5] ;default: 1'b0 ; */ 615 /*description: 1: spi clk out disable 0: spi clk out enable*/ 616 #define SPI_CK_DIS (BIT(5)) 617 #define SPI_CK_DIS_M (BIT(5)) 618 #define SPI_CK_DIS_V 0x1 619 #define SPI_CK_DIS_S 5 620 /* SPI_CS2_DIS : R/W ;bitpos:[2] ;default: 1'b1 ; */ 621 /*description: SPI CS2 pin enable, 1: disable CS2, 0: spi_cs2 signal is from/to CS2 pin*/ 622 #define SPI_CS2_DIS (BIT(2)) 623 #define SPI_CS2_DIS_M (BIT(2)) 624 #define SPI_CS2_DIS_V 0x1 625 #define SPI_CS2_DIS_S 2 626 /* SPI_CS1_DIS : R/W ;bitpos:[1] ;default: 1'b1 ; */ 627 /*description: SPI CS1 pin enable, 1: disable CS1, 0: spi_cs1 signal is from/to CS1 pin*/ 628 #define SPI_CS1_DIS (BIT(1)) 629 #define SPI_CS1_DIS_M (BIT(1)) 630 #define SPI_CS1_DIS_V 0x1 631 #define SPI_CS1_DIS_S 1 632 /* SPI_CS0_DIS : R/W ;bitpos:[0] ;default: 1'b0 ; */ 633 /*description: SPI CS0 pin enable, 1: disable CS0, 0: spi_cs0 signal is from/to CS0 pin*/ 634 #define SPI_CS0_DIS (BIT(0)) 635 #define SPI_CS0_DIS_M (BIT(0)) 636 #define SPI_CS0_DIS_V 0x1 637 #define SPI_CS0_DIS_S 0 638 639 #define SPI_SLAVE_REG(i) (REG_SPI_BASE(i) + 0x38) 640 /* SPI_SYNC_RESET : R/W ;bitpos:[31] ;default: 1'b0 ; */ 641 /*description: Software reset enable, reset the spi clock line cs line and data lines.*/ 642 #define SPI_SYNC_RESET (BIT(31)) 643 #define SPI_SYNC_RESET_M (BIT(31)) 644 #define SPI_SYNC_RESET_V 0x1 645 #define SPI_SYNC_RESET_S 31 646 /* SPI_SLAVE_MODE : R/W ;bitpos:[30] ;default: 1'b0 ; */ 647 /*description: 1: slave mode 0: master mode.*/ 648 #define SPI_SLAVE_MODE (BIT(30)) 649 #define SPI_SLAVE_MODE_M (BIT(30)) 650 #define SPI_SLAVE_MODE_V 0x1 651 #define SPI_SLAVE_MODE_S 30 652 /* SPI_SLV_WR_RD_BUF_EN : R/W ;bitpos:[29] ;default: 1'b0 ; */ 653 /*description: write and read buffer enable in the slave mode*/ 654 #define SPI_SLV_WR_RD_BUF_EN (BIT(29)) 655 #define SPI_SLV_WR_RD_BUF_EN_M (BIT(29)) 656 #define SPI_SLV_WR_RD_BUF_EN_V 0x1 657 #define SPI_SLV_WR_RD_BUF_EN_S 29 658 /* SPI_SLV_WR_RD_STA_EN : R/W ;bitpos:[28] ;default: 1'b0 ; */ 659 /*description: write and read status enable in the slave mode*/ 660 #define SPI_SLV_WR_RD_STA_EN (BIT(28)) 661 #define SPI_SLV_WR_RD_STA_EN_M (BIT(28)) 662 #define SPI_SLV_WR_RD_STA_EN_V 0x1 663 #define SPI_SLV_WR_RD_STA_EN_S 28 664 /* SPI_SLV_CMD_DEFINE : R/W ;bitpos:[27] ;default: 1'b0 ; */ 665 /*description: 1: slave mode commands are defined in SPI_SLAVE3. 0: slave mode 666 commands are fixed as: 1: write-status 2: write-buffer and 3: read-buffer.*/ 667 #define SPI_SLV_CMD_DEFINE (BIT(27)) 668 #define SPI_SLV_CMD_DEFINE_M (BIT(27)) 669 #define SPI_SLV_CMD_DEFINE_V 0x1 670 #define SPI_SLV_CMD_DEFINE_S 27 671 /* SPI_TRANS_CNT : RO ;bitpos:[26:23] ;default: 4'b0 ; */ 672 /*description: The operations counter in both the master mode and the slave 673 mode. 4: read-status*/ 674 #define SPI_TRANS_CNT 0x0000000F 675 #define SPI_TRANS_CNT_M ((SPI_TRANS_CNT_V)<<(SPI_TRANS_CNT_S)) 676 #define SPI_TRANS_CNT_V 0xF 677 #define SPI_TRANS_CNT_S 23 678 /* SPI_SLV_LAST_STATE : RO ;bitpos:[22:20] ;default: 3'b0 ; */ 679 /*description: In the slave mode it is the state of spi state machine.*/ 680 #define SPI_SLV_LAST_STATE 0x00000007 681 #define SPI_SLV_LAST_STATE_M ((SPI_SLV_LAST_STATE_V)<<(SPI_SLV_LAST_STATE_S)) 682 #define SPI_SLV_LAST_STATE_V 0x7 683 #define SPI_SLV_LAST_STATE_S 20 684 /* SPI_SLV_LAST_COMMAND : RO ;bitpos:[19:17] ;default: 3'b0 ; */ 685 /*description: In the slave mode it is the value of command.*/ 686 #define SPI_SLV_LAST_COMMAND 0x00000007 687 #define SPI_SLV_LAST_COMMAND_M ((SPI_SLV_LAST_COMMAND_V)<<(SPI_SLV_LAST_COMMAND_S)) 688 #define SPI_SLV_LAST_COMMAND_V 0x7 689 #define SPI_SLV_LAST_COMMAND_S 17 690 /* SPI_CS_I_MODE : R/W ;bitpos:[11:10] ;default: 2'b0 ; */ 691 /*description: In the slave mode this bits used to synchronize the input spi 692 cs signal and eliminate spi cs jitter.*/ 693 #define SPI_CS_I_MODE 0x00000003 694 #define SPI_CS_I_MODE_M ((SPI_CS_I_MODE_V)<<(SPI_CS_I_MODE_S)) 695 #define SPI_CS_I_MODE_V 0x3 696 #define SPI_CS_I_MODE_S 10 697 /* SPI_INT_EN : R/W ;bitpos:[9:5] ;default: 5'b1_0000 ; */ 698 /*description: Interrupt enable bits for the below 5 sources*/ 699 #define SPI_INT_EN 0x0000001F 700 #define SPI_INT_EN_M ((SPI_INT_EN_V)<<(SPI_INT_EN_S)) 701 #define SPI_INT_EN_V 0x1F 702 #define SPI_INT_EN_S 5 703 /* SPI_TRANS_DONE : R/W ;bitpos:[4] ;default: 1'b0 ; */ 704 /*description: The interrupt raw bit for the completion of any operation in 705 both the master mode and the slave mode.*/ 706 #define SPI_TRANS_DONE (BIT(4)) 707 #define SPI_TRANS_DONE_M (BIT(4)) 708 #define SPI_TRANS_DONE_V 0x1 709 #define SPI_TRANS_DONE_S 4 710 /* SPI_SLV_WR_STA_DONE : R/W ;bitpos:[3] ;default: 1'b0 ; */ 711 /*description: The interrupt raw bit for the completion of write-status operation 712 in the slave mode.*/ 713 #define SPI_SLV_WR_STA_DONE (BIT(3)) 714 #define SPI_SLV_WR_STA_DONE_M (BIT(3)) 715 #define SPI_SLV_WR_STA_DONE_V 0x1 716 #define SPI_SLV_WR_STA_DONE_S 3 717 /* SPI_SLV_RD_STA_DONE : R/W ;bitpos:[2] ;default: 1'b0 ; */ 718 /*description: The interrupt raw bit for the completion of read-status operation 719 in the slave mode.*/ 720 #define SPI_SLV_RD_STA_DONE (BIT(2)) 721 #define SPI_SLV_RD_STA_DONE_M (BIT(2)) 722 #define SPI_SLV_RD_STA_DONE_V 0x1 723 #define SPI_SLV_RD_STA_DONE_S 2 724 /* SPI_SLV_WR_BUF_DONE : R/W ;bitpos:[1] ;default: 1'b0 ; */ 725 /*description: The interrupt raw bit for the completion of write-buffer operation 726 in the slave mode.*/ 727 #define SPI_SLV_WR_BUF_DONE (BIT(1)) 728 #define SPI_SLV_WR_BUF_DONE_M (BIT(1)) 729 #define SPI_SLV_WR_BUF_DONE_V 0x1 730 #define SPI_SLV_WR_BUF_DONE_S 1 731 /* SPI_SLV_RD_BUF_DONE : R/W ;bitpos:[0] ;default: 1'b0 ; */ 732 /*description: The interrupt raw bit for the completion of read-buffer operation 733 in the slave mode.*/ 734 #define SPI_SLV_RD_BUF_DONE (BIT(0)) 735 #define SPI_SLV_RD_BUF_DONE_M (BIT(0)) 736 #define SPI_SLV_RD_BUF_DONE_V 0x1 737 #define SPI_SLV_RD_BUF_DONE_S 0 738 739 #define SPI_SLAVE1_REG(i) (REG_SPI_BASE(i) + 0x3C) 740 /* SPI_SLV_STATUS_BITLEN : R/W ;bitpos:[31:27] ;default: 5'b0 ; */ 741 /*description: In the slave mode it is the length of status bit.*/ 742 #define SPI_SLV_STATUS_BITLEN 0x0000001F 743 #define SPI_SLV_STATUS_BITLEN_M ((SPI_SLV_STATUS_BITLEN_V)<<(SPI_SLV_STATUS_BITLEN_S)) 744 #define SPI_SLV_STATUS_BITLEN_V 0x1F 745 #define SPI_SLV_STATUS_BITLEN_S 27 746 /* SPI_SLV_STATUS_FAST_EN : R/W ;bitpos:[26] ;default: 1'b0 ; */ 747 /*description: In the slave mode enable fast read status.*/ 748 #define SPI_SLV_STATUS_FAST_EN (BIT(26)) 749 #define SPI_SLV_STATUS_FAST_EN_M (BIT(26)) 750 #define SPI_SLV_STATUS_FAST_EN_V 0x1 751 #define SPI_SLV_STATUS_FAST_EN_S 26 752 /* SPI_SLV_STATUS_READBACK : R/W ;bitpos:[25] ;default: 1'b1 ; */ 753 /*description: In the slave mode 1:read register of SPI_SLV_WR_STATUS 0: read 754 register of SPI_RD_STATUS.*/ 755 #define SPI_SLV_STATUS_READBACK (BIT(25)) 756 #define SPI_SLV_STATUS_READBACK_M (BIT(25)) 757 #define SPI_SLV_STATUS_READBACK_V 0x1 758 #define SPI_SLV_STATUS_READBACK_S 25 759 /* SPI_SLV_RD_ADDR_BITLEN : R/W ;bitpos:[15:10] ;default: 6'h0 ; */ 760 /*description: In the slave mode it is the address length in bits for read-buffer 761 operation. The register value shall be (bit_num-1).*/ 762 #define SPI_SLV_RD_ADDR_BITLEN 0x0000003F 763 #define SPI_SLV_RD_ADDR_BITLEN_M ((SPI_SLV_RD_ADDR_BITLEN_V)<<(SPI_SLV_RD_ADDR_BITLEN_S)) 764 #define SPI_SLV_RD_ADDR_BITLEN_V 0x3F 765 #define SPI_SLV_RD_ADDR_BITLEN_S 10 766 /* SPI_SLV_WR_ADDR_BITLEN : R/W ;bitpos:[9:4] ;default: 6'h0 ; */ 767 /*description: In the slave mode it is the address length in bits for write-buffer 768 operation. The register value shall be (bit_num-1).*/ 769 #define SPI_SLV_WR_ADDR_BITLEN 0x0000003F 770 #define SPI_SLV_WR_ADDR_BITLEN_M ((SPI_SLV_WR_ADDR_BITLEN_V)<<(SPI_SLV_WR_ADDR_BITLEN_S)) 771 #define SPI_SLV_WR_ADDR_BITLEN_V 0x3F 772 #define SPI_SLV_WR_ADDR_BITLEN_S 4 773 /* SPI_SLV_WRSTA_DUMMY_EN : R/W ;bitpos:[3] ;default: 1'b0 ; */ 774 /*description: In the slave mode it is the enable bit of dummy phase for write-status 775 operations.*/ 776 #define SPI_SLV_WRSTA_DUMMY_EN (BIT(3)) 777 #define SPI_SLV_WRSTA_DUMMY_EN_M (BIT(3)) 778 #define SPI_SLV_WRSTA_DUMMY_EN_V 0x1 779 #define SPI_SLV_WRSTA_DUMMY_EN_S 3 780 /* SPI_SLV_RDSTA_DUMMY_EN : R/W ;bitpos:[2] ;default: 1'b0 ; */ 781 /*description: In the slave mode it is the enable bit of dummy phase for read-status 782 operations.*/ 783 #define SPI_SLV_RDSTA_DUMMY_EN (BIT(2)) 784 #define SPI_SLV_RDSTA_DUMMY_EN_M (BIT(2)) 785 #define SPI_SLV_RDSTA_DUMMY_EN_V 0x1 786 #define SPI_SLV_RDSTA_DUMMY_EN_S 2 787 /* SPI_SLV_WRBUF_DUMMY_EN : R/W ;bitpos:[1] ;default: 1'b0 ; */ 788 /*description: In the slave mode it is the enable bit of dummy phase for write-buffer 789 operations.*/ 790 #define SPI_SLV_WRBUF_DUMMY_EN (BIT(1)) 791 #define SPI_SLV_WRBUF_DUMMY_EN_M (BIT(1)) 792 #define SPI_SLV_WRBUF_DUMMY_EN_V 0x1 793 #define SPI_SLV_WRBUF_DUMMY_EN_S 1 794 /* SPI_SLV_RDBUF_DUMMY_EN : R/W ;bitpos:[0] ;default: 1'b0 ; */ 795 /*description: In the slave mode it is the enable bit of dummy phase for read-buffer 796 operations.*/ 797 #define SPI_SLV_RDBUF_DUMMY_EN (BIT(0)) 798 #define SPI_SLV_RDBUF_DUMMY_EN_M (BIT(0)) 799 #define SPI_SLV_RDBUF_DUMMY_EN_V 0x1 800 #define SPI_SLV_RDBUF_DUMMY_EN_S 0 801 802 #define SPI_SLAVE2_REG(i) (REG_SPI_BASE(i) + 0x40) 803 /* SPI_SLV_WRBUF_DUMMY_CYCLELEN : R/W ;bitpos:[31:24] ;default: 8'b0 ; */ 804 /*description: In the slave mode it is the length in spi_clk cycles of dummy 805 phase for write-buffer operations. The register value shall be (cycle_num-1).*/ 806 #define SPI_SLV_WRBUF_DUMMY_CYCLELEN 0x000000FF 807 #define SPI_SLV_WRBUF_DUMMY_CYCLELEN_M ((SPI_SLV_WRBUF_DUMMY_CYCLELEN_V)<<(SPI_SLV_WRBUF_DUMMY_CYCLELEN_S)) 808 #define SPI_SLV_WRBUF_DUMMY_CYCLELEN_V 0xFF 809 #define SPI_SLV_WRBUF_DUMMY_CYCLELEN_S 24 810 /* SPI_SLV_RDBUF_DUMMY_CYCLELEN : R/W ;bitpos:[23:16] ;default: 8'h0 ; */ 811 /*description: In the slave mode it is the length in spi_clk cycles of dummy 812 phase for read-buffer operations. The register value shall be (cycle_num-1).*/ 813 #define SPI_SLV_RDBUF_DUMMY_CYCLELEN 0x000000FF 814 #define SPI_SLV_RDBUF_DUMMY_CYCLELEN_M ((SPI_SLV_RDBUF_DUMMY_CYCLELEN_V)<<(SPI_SLV_RDBUF_DUMMY_CYCLELEN_S)) 815 #define SPI_SLV_RDBUF_DUMMY_CYCLELEN_V 0xFF 816 #define SPI_SLV_RDBUF_DUMMY_CYCLELEN_S 16 817 /* SPI_SLV_WRSTA_DUMMY_CYCLELEN : R/W ;bitpos:[15:8] ;default: 8'h0 ; */ 818 /*description: In the slave mode it is the length in spi_clk cycles of dummy 819 phase for write-status operations. The register value shall be (cycle_num-1).*/ 820 #define SPI_SLV_WRSTA_DUMMY_CYCLELEN 0x000000FF 821 #define SPI_SLV_WRSTA_DUMMY_CYCLELEN_M ((SPI_SLV_WRSTA_DUMMY_CYCLELEN_V)<<(SPI_SLV_WRSTA_DUMMY_CYCLELEN_S)) 822 #define SPI_SLV_WRSTA_DUMMY_CYCLELEN_V 0xFF 823 #define SPI_SLV_WRSTA_DUMMY_CYCLELEN_S 8 824 /* SPI_SLV_RDSTA_DUMMY_CYCLELEN : R/W ;bitpos:[7:0] ;default: 8'h0 ; */ 825 /*description: In the slave mode it is the length in spi_clk cycles of dummy 826 phase for read-status operations. The register value shall be (cycle_num-1).*/ 827 #define SPI_SLV_RDSTA_DUMMY_CYCLELEN 0x000000FF 828 #define SPI_SLV_RDSTA_DUMMY_CYCLELEN_M ((SPI_SLV_RDSTA_DUMMY_CYCLELEN_V)<<(SPI_SLV_RDSTA_DUMMY_CYCLELEN_S)) 829 #define SPI_SLV_RDSTA_DUMMY_CYCLELEN_V 0xFF 830 #define SPI_SLV_RDSTA_DUMMY_CYCLELEN_S 0 831 832 #define SPI_SLAVE3_REG(i) (REG_SPI_BASE(i) + 0x44) 833 /* SPI_SLV_WRSTA_CMD_VALUE : R/W ;bitpos:[31:24] ;default: 8'b0 ; */ 834 /*description: In the slave mode it is the value of write-status command.*/ 835 #define SPI_SLV_WRSTA_CMD_VALUE 0x000000FF 836 #define SPI_SLV_WRSTA_CMD_VALUE_M ((SPI_SLV_WRSTA_CMD_VALUE_V)<<(SPI_SLV_WRSTA_CMD_VALUE_S)) 837 #define SPI_SLV_WRSTA_CMD_VALUE_V 0xFF 838 #define SPI_SLV_WRSTA_CMD_VALUE_S 24 839 /* SPI_SLV_RDSTA_CMD_VALUE : R/W ;bitpos:[23:16] ;default: 8'b0 ; */ 840 /*description: In the slave mode it is the value of read-status command.*/ 841 #define SPI_SLV_RDSTA_CMD_VALUE 0x000000FF 842 #define SPI_SLV_RDSTA_CMD_VALUE_M ((SPI_SLV_RDSTA_CMD_VALUE_V)<<(SPI_SLV_RDSTA_CMD_VALUE_S)) 843 #define SPI_SLV_RDSTA_CMD_VALUE_V 0xFF 844 #define SPI_SLV_RDSTA_CMD_VALUE_S 16 845 /* SPI_SLV_WRBUF_CMD_VALUE : R/W ;bitpos:[15:8] ;default: 8'b0 ; */ 846 /*description: In the slave mode it is the value of write-buffer command.*/ 847 #define SPI_SLV_WRBUF_CMD_VALUE 0x000000FF 848 #define SPI_SLV_WRBUF_CMD_VALUE_M ((SPI_SLV_WRBUF_CMD_VALUE_V)<<(SPI_SLV_WRBUF_CMD_VALUE_S)) 849 #define SPI_SLV_WRBUF_CMD_VALUE_V 0xFF 850 #define SPI_SLV_WRBUF_CMD_VALUE_S 8 851 /* SPI_SLV_RDBUF_CMD_VALUE : R/W ;bitpos:[7:0] ;default: 8'b0 ; */ 852 /*description: In the slave mode it is the value of read-buffer command.*/ 853 #define SPI_SLV_RDBUF_CMD_VALUE 0x000000FF 854 #define SPI_SLV_RDBUF_CMD_VALUE_M ((SPI_SLV_RDBUF_CMD_VALUE_V)<<(SPI_SLV_RDBUF_CMD_VALUE_S)) 855 #define SPI_SLV_RDBUF_CMD_VALUE_V 0xFF 856 #define SPI_SLV_RDBUF_CMD_VALUE_S 0 857 858 #define SPI_SLV_WRBUF_DLEN_REG(i) (REG_SPI_BASE(i) + 0x48) 859 /* SPI_SLV_WRBUF_DBITLEN : R/W ;bitpos:[23:0] ;default: 24'h0 ; */ 860 /*description: In the slave mode it is the length in bits for write-buffer operations. 861 The register value shall be (bit_num-1).*/ 862 #define SPI_SLV_WRBUF_DBITLEN 0x00FFFFFF 863 #define SPI_SLV_WRBUF_DBITLEN_M ((SPI_SLV_WRBUF_DBITLEN_V)<<(SPI_SLV_WRBUF_DBITLEN_S)) 864 #define SPI_SLV_WRBUF_DBITLEN_V 0xFFFFFF 865 #define SPI_SLV_WRBUF_DBITLEN_S 0 866 867 #define SPI_SLV_RDBUF_DLEN_REG(i) (REG_SPI_BASE(i) + 0x4C) 868 /* SPI_SLV_RDBUF_DBITLEN : R/W ;bitpos:[23:0] ;default: 24'h0 ; */ 869 /*description: In the slave mode it is the length in bits for read-buffer operations. 870 The register value shall be (bit_num-1).*/ 871 #define SPI_SLV_RDBUF_DBITLEN 0x00FFFFFF 872 #define SPI_SLV_RDBUF_DBITLEN_M ((SPI_SLV_RDBUF_DBITLEN_V)<<(SPI_SLV_RDBUF_DBITLEN_S)) 873 #define SPI_SLV_RDBUF_DBITLEN_V 0xFFFFFF 874 #define SPI_SLV_RDBUF_DBITLEN_S 0 875 876 #define SPI_CACHE_FCTRL_REG(i) (REG_SPI_BASE(i) + 0x50) 877 /* SPI_CACHE_FLASH_PES_EN : R/W ;bitpos:[3] ;default: 1'b0 ; */ 878 /*description: For SPI0 spi1 send suspend command before cache read flash 879 1: enable 0:disable.*/ 880 #define SPI_CACHE_FLASH_PES_EN (BIT(3)) 881 #define SPI_CACHE_FLASH_PES_EN_M (BIT(3)) 882 #define SPI_CACHE_FLASH_PES_EN_V 0x1 883 #define SPI_CACHE_FLASH_PES_EN_S 3 884 /* SPI_CACHE_FLASH_USR_CMD : R/W ;bitpos:[2] ;default: 1'b0 ; */ 885 /*description: For SPI0 cache read flash for user define command 1: enable 0:disable.*/ 886 #define SPI_CACHE_FLASH_USR_CMD (BIT(2)) 887 #define SPI_CACHE_FLASH_USR_CMD_M (BIT(2)) 888 #define SPI_CACHE_FLASH_USR_CMD_V 0x1 889 #define SPI_CACHE_FLASH_USR_CMD_S 2 890 /* SPI_CACHE_USR_CMD_4BYTE : R/W ;bitpos:[1] ;default: 1'b0 ; */ 891 /*description: For SPI0 cache read flash with 4 bytes command 1: enable 0:disable.*/ 892 #define SPI_CACHE_USR_CMD_4BYTE (BIT(1)) 893 #define SPI_CACHE_USR_CMD_4BYTE_M (BIT(1)) 894 #define SPI_CACHE_USR_CMD_4BYTE_V 0x1 895 #define SPI_CACHE_USR_CMD_4BYTE_S 1 896 /* SPI_CACHE_REQ_EN : R/W ;bitpos:[0] ;default: 1'b0 ; */ 897 /*description: For SPI0 Cache access enable 1: enable 0:disable.*/ 898 #define SPI_CACHE_REQ_EN (BIT(0)) 899 #define SPI_CACHE_REQ_EN_M (BIT(0)) 900 #define SPI_CACHE_REQ_EN_V 0x1 901 #define SPI_CACHE_REQ_EN_S 0 902 903 #define SPI_CACHE_SCTRL_REG(i) (REG_SPI_BASE(i) + 0x54) 904 /* SPI_CACHE_SRAM_USR_WCMD : R/W ;bitpos:[28] ;default: 1'b1 ; */ 905 /*description: For SPI0 In the spi sram mode cache write sram for user define command*/ 906 #define SPI_CACHE_SRAM_USR_WCMD (BIT(28)) 907 #define SPI_CACHE_SRAM_USR_WCMD_M (BIT(28)) 908 #define SPI_CACHE_SRAM_USR_WCMD_V 0x1 909 #define SPI_CACHE_SRAM_USR_WCMD_S 28 910 /* SPI_SRAM_ADDR_BITLEN : R/W ;bitpos:[27:22] ;default: 6'd23 ; */ 911 /*description: For SPI0 In the sram mode it is the length in bits of address 912 phase. The register value shall be (bit_num-1).*/ 913 #define SPI_SRAM_ADDR_BITLEN 0x0000003F 914 #define SPI_SRAM_ADDR_BITLEN_M ((SPI_SRAM_ADDR_BITLEN_V)<<(SPI_SRAM_ADDR_BITLEN_S)) 915 #define SPI_SRAM_ADDR_BITLEN_V 0x3F 916 #define SPI_SRAM_ADDR_BITLEN_S 22 917 /* SPI_SRAM_DUMMY_CYCLELEN : R/W ;bitpos:[21:14] ;default: 8'b1 ; */ 918 /*description: For SPI0 In the sram mode it is the length in bits of address 919 phase. The register value shall be (bit_num-1).*/ 920 #define SPI_SRAM_DUMMY_CYCLELEN 0x000000FF 921 #define SPI_SRAM_DUMMY_CYCLELEN_M ((SPI_SRAM_DUMMY_CYCLELEN_V)<<(SPI_SRAM_DUMMY_CYCLELEN_S)) 922 #define SPI_SRAM_DUMMY_CYCLELEN_V 0xFF 923 #define SPI_SRAM_DUMMY_CYCLELEN_S 14 924 /* SPI_SRAM_BYTES_LEN : R/W ;bitpos:[13:6] ;default: 8'b32 ; */ 925 /*description: For SPI0 In the sram mode it is the byte length of spi read sram data.*/ 926 #define SPI_SRAM_BYTES_LEN 0x000000FF 927 #define SPI_SRAM_BYTES_LEN_M ((SPI_SRAM_BYTES_LEN_V)<<(SPI_SRAM_BYTES_LEN_S)) 928 #define SPI_SRAM_BYTES_LEN_V 0xFF 929 #define SPI_SRAM_BYTES_LEN_S 6 930 /* SPI_CACHE_SRAM_USR_RCMD : R/W ;bitpos:[5] ;default: 1'b1 ; */ 931 /*description: For SPI0 In the spi sram mode cache read sram for user define command.*/ 932 #define SPI_CACHE_SRAM_USR_RCMD (BIT(5)) 933 #define SPI_CACHE_SRAM_USR_RCMD_M (BIT(5)) 934 #define SPI_CACHE_SRAM_USR_RCMD_V 0x1 935 #define SPI_CACHE_SRAM_USR_RCMD_S 5 936 /* SPI_USR_RD_SRAM_DUMMY : R/W ;bitpos:[4] ;default: 1'b1 ; */ 937 /*description: For SPI0 In the spi sram mode it is the enable bit of dummy 938 phase for read operations.*/ 939 #define SPI_USR_RD_SRAM_DUMMY (BIT(4)) 940 #define SPI_USR_RD_SRAM_DUMMY_M (BIT(4)) 941 #define SPI_USR_RD_SRAM_DUMMY_V 0x1 942 #define SPI_USR_RD_SRAM_DUMMY_S 4 943 /* SPI_USR_WR_SRAM_DUMMY : R/W ;bitpos:[3] ;default: 1'b0 ; */ 944 /*description: For SPI0 In the spi sram mode it is the enable bit of dummy 945 phase for write operations.*/ 946 #define SPI_USR_WR_SRAM_DUMMY (BIT(3)) 947 #define SPI_USR_WR_SRAM_DUMMY_M (BIT(3)) 948 #define SPI_USR_WR_SRAM_DUMMY_V 0x1 949 #define SPI_USR_WR_SRAM_DUMMY_S 3 950 /* SPI_USR_SRAM_QIO : R/W ;bitpos:[2] ;default: 1'b0 ; */ 951 /*description: For SPI0 In the spi sram mode spi quad I/O mode enable 1: enable 0:disable*/ 952 #define SPI_USR_SRAM_QIO (BIT(2)) 953 #define SPI_USR_SRAM_QIO_M (BIT(2)) 954 #define SPI_USR_SRAM_QIO_V 0x1 955 #define SPI_USR_SRAM_QIO_S 2 956 /* SPI_USR_SRAM_DIO : R/W ;bitpos:[1] ;default: 1'b0 ; */ 957 /*description: For SPI0 In the spi sram mode spi dual I/O mode enable 1: enable 0:disable*/ 958 #define SPI_USR_SRAM_DIO (BIT(1)) 959 #define SPI_USR_SRAM_DIO_M (BIT(1)) 960 #define SPI_USR_SRAM_DIO_V 0x1 961 #define SPI_USR_SRAM_DIO_S 1 962 963 #define SPI_SRAM_CMD_REG(i) (REG_SPI_BASE(i) + 0x58) 964 /* SPI_SRAM_RSTIO : R/W ;bitpos:[4] ;default: 1'b0 ; */ 965 /*description: For SPI0 SRAM IO mode reset enable. SRAM IO mode reset operation 966 will be triggered when the bit is set. The bit will be cleared once the operation done*/ 967 #define SPI_SRAM_RSTIO (BIT(4)) 968 #define SPI_SRAM_RSTIO_M (BIT(4)) 969 #define SPI_SRAM_RSTIO_V 0x1 970 #define SPI_SRAM_RSTIO_S 4 971 /* SPI_SRAM_QIO : R/W ;bitpos:[1] ;default: 1'b0 ; */ 972 /*description: For SPI0 SRAM QIO mode enable . SRAM QIO enable command will 973 be send when the bit is set. The bit will be cleared once the operation done.*/ 974 #define SPI_SRAM_QIO (BIT(1)) 975 #define SPI_SRAM_QIO_M (BIT(1)) 976 #define SPI_SRAM_QIO_V 0x1 977 #define SPI_SRAM_QIO_S 1 978 /* SPI_SRAM_DIO : R/W ;bitpos:[0] ;default: 1'b0 ; */ 979 /*description: For SPI0 SRAM DIO mode enable . SRAM DIO enable command will 980 be send when the bit is set. The bit will be cleared once the operation done.*/ 981 #define SPI_SRAM_DIO (BIT(0)) 982 #define SPI_SRAM_DIO_M (BIT(0)) 983 #define SPI_SRAM_DIO_V 0x1 984 #define SPI_SRAM_DIO_S 0 985 986 #define SPI_SRAM_DRD_CMD_REG(i) (REG_SPI_BASE(i) + 0x5C) 987 /* SPI_CACHE_SRAM_USR_RD_CMD_BITLEN : R/W ;bitpos:[31:28] ;default: 4'h0 ; */ 988 /*description: For SPI0 When cache mode is enable it is the length in bits of 989 command phase for SRAM. The register value shall be (bit_num-1).*/ 990 #define SPI_CACHE_SRAM_USR_RD_CMD_BITLEN 0x0000000F 991 #define SPI_CACHE_SRAM_USR_RD_CMD_BITLEN_M ((SPI_CACHE_SRAM_USR_RD_CMD_BITLEN_V)<<(SPI_CACHE_SRAM_USR_RD_CMD_BITLEN_S)) 992 #define SPI_CACHE_SRAM_USR_RD_CMD_BITLEN_V 0xF 993 #define SPI_CACHE_SRAM_USR_RD_CMD_BITLEN_S 28 994 /* SPI_CACHE_SRAM_USR_RD_CMD_VALUE : R/W ;bitpos:[15:0] ;default: 16'h0 ; */ 995 /*description: For SPI0 When cache mode is enable it is the read command value 996 of command phase for SRAM.*/ 997 #define SPI_CACHE_SRAM_USR_RD_CMD_VALUE 0x0000FFFF 998 #define SPI_CACHE_SRAM_USR_RD_CMD_VALUE_M ((SPI_CACHE_SRAM_USR_RD_CMD_VALUE_V)<<(SPI_CACHE_SRAM_USR_RD_CMD_VALUE_S)) 999 #define SPI_CACHE_SRAM_USR_RD_CMD_VALUE_V 0xFFFF 1000 #define SPI_CACHE_SRAM_USR_RD_CMD_VALUE_S 0 1001 1002 #define SPI_SRAM_DWR_CMD_REG(i) (REG_SPI_BASE(i) + 0x60) 1003 /* SPI_CACHE_SRAM_USR_WR_CMD_BITLEN : R/W ;bitpos:[31:28] ;default: 4'h0 ; */ 1004 /*description: For SPI0 When cache mode is enable it is the in bits of command 1005 phase for SRAM. The register value shall be (bit_num-1).*/ 1006 #define SPI_CACHE_SRAM_USR_WR_CMD_BITLEN 0x0000000F 1007 #define SPI_CACHE_SRAM_USR_WR_CMD_BITLEN_M ((SPI_CACHE_SRAM_USR_WR_CMD_BITLEN_V)<<(SPI_CACHE_SRAM_USR_WR_CMD_BITLEN_S)) 1008 #define SPI_CACHE_SRAM_USR_WR_CMD_BITLEN_V 0xF 1009 #define SPI_CACHE_SRAM_USR_WR_CMD_BITLEN_S 28 1010 /* SPI_CACHE_SRAM_USR_WR_CMD_VALUE : R/W ;bitpos:[15:0] ;default: 16'h0 ; */ 1011 /*description: For SPI0 When cache mode is enable it is the write command value 1012 of command phase for SRAM.*/ 1013 #define SPI_CACHE_SRAM_USR_WR_CMD_VALUE 0x0000FFFF 1014 #define SPI_CACHE_SRAM_USR_WR_CMD_VALUE_M ((SPI_CACHE_SRAM_USR_WR_CMD_VALUE_V)<<(SPI_CACHE_SRAM_USR_WR_CMD_VALUE_S)) 1015 #define SPI_CACHE_SRAM_USR_WR_CMD_VALUE_V 0xFFFF 1016 #define SPI_CACHE_SRAM_USR_WR_CMD_VALUE_S 0 1017 1018 #define SPI_SLV_RD_BIT_REG(i) (REG_SPI_BASE(i) + 0x64) 1019 /* SPI_SLV_RDATA_BIT : RW ;bitpos:[23:0] ;default: 24'b0 ; */ 1020 /*description: In the slave mode it is the bit length of read data. The value 1021 is the length - 1.*/ 1022 #define SPI_SLV_RDATA_BIT 0x00FFFFFF 1023 #define SPI_SLV_RDATA_BIT_M ((SPI_SLV_RDATA_BIT_V)<<(SPI_SLV_RDATA_BIT_S)) 1024 #define SPI_SLV_RDATA_BIT_V 0xFFFFFF 1025 #define SPI_SLV_RDATA_BIT_S 0 1026 1027 #define SPI_W0_REG(i) (REG_SPI_BASE(i) + 0x80) 1028 /* SPI_BUF0 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1029 /*description: data buffer*/ 1030 #define SPI_BUF0 0xFFFFFFFF 1031 #define SPI_BUF0_M ((SPI_BUF0_V)<<(SPI_BUF0_S)) 1032 #define SPI_BUF0_V 0xFFFFFFFF 1033 #define SPI_BUF0_S 0 1034 1035 #define SPI_W1_REG(i) (REG_SPI_BASE(i) + 0x84) 1036 /* SPI_BUF1 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1037 /*description: data buffer*/ 1038 #define SPI_BUF1 0xFFFFFFFF 1039 #define SPI_BUF1_M ((SPI_BUF1_V)<<(SPI_BUF1_S)) 1040 #define SPI_BUF1_V 0xFFFFFFFF 1041 #define SPI_BUF1_S 0 1042 1043 #define SPI_W2_REG(i) (REG_SPI_BASE(i) + 0x88) 1044 /* SPI_BUF2 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1045 /*description: data buffer*/ 1046 #define SPI_BUF2 0xFFFFFFFF 1047 #define SPI_BUF2_M ((SPI_BUF2_V)<<(SPI_BUF2_S)) 1048 #define SPI_BUF2_V 0xFFFFFFFF 1049 #define SPI_BUF2_S 0 1050 1051 #define SPI_W3_REG(i) (REG_SPI_BASE(i) + 0x8C) 1052 /* SPI_BUF3 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1053 /*description: data buffer*/ 1054 #define SPI_BUF3 0xFFFFFFFF 1055 #define SPI_BUF3_M ((SPI_BUF3_V)<<(SPI_BUF3_S)) 1056 #define SPI_BUF3_V 0xFFFFFFFF 1057 #define SPI_BUF3_S 0 1058 1059 #define SPI_W4_REG(i) (REG_SPI_BASE(i) + 0x90) 1060 /* SPI_BUF4 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1061 /*description: data buffer*/ 1062 #define SPI_BUF4 0xFFFFFFFF 1063 #define SPI_BUF4_M ((SPI_BUF4_V)<<(SPI_BUF4_S)) 1064 #define SPI_BUF4_V 0xFFFFFFFF 1065 #define SPI_BUF4_S 0 1066 1067 #define SPI_W5_REG(i) (REG_SPI_BASE(i) + 0x94) 1068 /* SPI_BUF5 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1069 /*description: data buffer*/ 1070 #define SPI_BUF5 0xFFFFFFFF 1071 #define SPI_BUF5_M ((SPI_BUF5_V)<<(SPI_BUF5_S)) 1072 #define SPI_BUF5_V 0xFFFFFFFF 1073 #define SPI_BUF5_S 0 1074 1075 #define SPI_W6_REG(i) (REG_SPI_BASE(i) + 0x98) 1076 /* SPI_BUF6 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1077 /*description: data buffer*/ 1078 #define SPI_BUF6 0xFFFFFFFF 1079 #define SPI_BUF6_M ((SPI_BUF6_V)<<(SPI_BUF6_S)) 1080 #define SPI_BUF6_V 0xFFFFFFFF 1081 #define SPI_BUF6_S 0 1082 1083 #define SPI_W7_REG(i) (REG_SPI_BASE(i) + 0x9C) 1084 /* SPI_BUF7 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1085 /*description: data buffer*/ 1086 #define SPI_BUF7 0xFFFFFFFF 1087 #define SPI_BUF7_M ((SPI_BUF7_V)<<(SPI_BUF7_S)) 1088 #define SPI_BUF7_V 0xFFFFFFFF 1089 #define SPI_BUF7_S 0 1090 1091 #define SPI_W8_REG(i) (REG_SPI_BASE(i) + 0xA0) 1092 /* SPI_BUF8 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1093 /*description: data buffer*/ 1094 #define SPI_BUF8 0xFFFFFFFF 1095 #define SPI_BUF8_M ((SPI_BUF8_V)<<(SPI_BUF8_S)) 1096 #define SPI_BUF8_V 0xFFFFFFFF 1097 #define SPI_BUF8_S 0 1098 1099 #define SPI_W9_REG(i) (REG_SPI_BASE(i) + 0xA4) 1100 /* SPI_BUF9 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1101 /*description: data buffer*/ 1102 #define SPI_BUF9 0xFFFFFFFF 1103 #define SPI_BUF9_M ((SPI_BUF9_V)<<(SPI_BUF9_S)) 1104 #define SPI_BUF9_V 0xFFFFFFFF 1105 #define SPI_BUF9_S 0 1106 1107 #define SPI_W10_REG(i) (REG_SPI_BASE(i) + 0xA8) 1108 /* SPI_BUF10 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1109 /*description: data buffer*/ 1110 #define SPI_BUF10 0xFFFFFFFF 1111 #define SPI_BUF10_M ((SPI_BUF10_V)<<(SPI_BUF10_S)) 1112 #define SPI_BUF10_V 0xFFFFFFFF 1113 #define SPI_BUF10_S 0 1114 1115 #define SPI_W11_REG(i) (REG_SPI_BASE(i) + 0xAC) 1116 /* SPI_BUF11 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1117 /*description: data buffer*/ 1118 #define SPI_BUF11 0xFFFFFFFF 1119 #define SPI_BUF11_M ((SPI_BUF11_V)<<(SPI_BUF11_S)) 1120 #define SPI_BUF11_V 0xFFFFFFFF 1121 #define SPI_BUF11_S 0 1122 1123 #define SPI_W12_REG(i) (REG_SPI_BASE(i) + 0xB0) 1124 /* SPI_BUF12 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1125 /*description: data buffer*/ 1126 #define SPI_BUF12 0xFFFFFFFF 1127 #define SPI_BUF12_M ((SPI_BUF12_V)<<(SPI_BUF12_S)) 1128 #define SPI_BUF12_V 0xFFFFFFFF 1129 #define SPI_BUF12_S 0 1130 1131 #define SPI_W13_REG(i) (REG_SPI_BASE(i) + 0xB4) 1132 /* SPI_BUF13 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1133 /*description: data buffer*/ 1134 #define SPI_BUF13 0xFFFFFFFF 1135 #define SPI_BUF13_M ((SPI_BUF13_V)<<(SPI_BUF13_S)) 1136 #define SPI_BUF13_V 0xFFFFFFFF 1137 #define SPI_BUF13_S 0 1138 1139 #define SPI_W14_REG(i) (REG_SPI_BASE(i) + 0xB8) 1140 /* SPI_BUF14 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1141 /*description: data buffer*/ 1142 #define SPI_BUF14 0xFFFFFFFF 1143 #define SPI_BUF14_M ((SPI_BUF14_V)<<(SPI_BUF14_S)) 1144 #define SPI_BUF14_V 0xFFFFFFFF 1145 #define SPI_BUF14_S 0 1146 1147 #define SPI_W15_REG(i) (REG_SPI_BASE(i) + 0xBC) 1148 /* SPI_BUF15 : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1149 /*description: data buffer*/ 1150 #define SPI_BUF15 0xFFFFFFFF 1151 #define SPI_BUF15_M ((SPI_BUF15_V)<<(SPI_BUF15_S)) 1152 #define SPI_BUF15_V 0xFFFFFFFF 1153 #define SPI_BUF15_S 0 1154 1155 #define SPI_TX_CRC_REG(i) (REG_SPI_BASE(i) + 0xC0) 1156 /* SPI_TX_CRC_DATA : R/W ;bitpos:[31:0] ;default: 32'b0 ; */ 1157 /*description: For SPI1 the value of crc32 for 256 bits data.*/ 1158 #define SPI_TX_CRC_DATA 0xFFFFFFFF 1159 #define SPI_TX_CRC_DATA_M ((SPI_TX_CRC_DATA_V)<<(SPI_TX_CRC_DATA_S)) 1160 #define SPI_TX_CRC_DATA_V 0xFFFFFFFF 1161 #define SPI_TX_CRC_DATA_S 0 1162 1163 #define SPI_EXT0_REG(i) (REG_SPI_BASE(i) + 0xF0) 1164 /* SPI_T_PP_ENA : R/W ;bitpos:[31] ;default: 1'b1 ; */ 1165 /*description: page program delay enable.*/ 1166 #define SPI_T_PP_ENA (BIT(31)) 1167 #define SPI_T_PP_ENA_M (BIT(31)) 1168 #define SPI_T_PP_ENA_V 0x1 1169 #define SPI_T_PP_ENA_S 31 1170 /* SPI_T_PP_SHIFT : R/W ;bitpos:[19:16] ;default: 4'd10 ; */ 1171 /*description: page program delay time shift .*/ 1172 #define SPI_T_PP_SHIFT 0x0000000F 1173 #define SPI_T_PP_SHIFT_M ((SPI_T_PP_SHIFT_V)<<(SPI_T_PP_SHIFT_S)) 1174 #define SPI_T_PP_SHIFT_V 0xF 1175 #define SPI_T_PP_SHIFT_S 16 1176 /* SPI_T_PP_TIME : R/W ;bitpos:[11:0] ;default: 12'd80 ; */ 1177 /*description: page program delay time by system clock.*/ 1178 #define SPI_T_PP_TIME 0x00000FFF 1179 #define SPI_T_PP_TIME_M ((SPI_T_PP_TIME_V)<<(SPI_T_PP_TIME_S)) 1180 #define SPI_T_PP_TIME_V 0xFFF 1181 #define SPI_T_PP_TIME_S 0 1182 1183 #define SPI_EXT1_REG(i) (REG_SPI_BASE(i) + 0xF4) 1184 /* SPI_T_ERASE_ENA : R/W ;bitpos:[31] ;default: 1'b1 ; */ 1185 /*description: erase flash delay enable.*/ 1186 #define SPI_T_ERASE_ENA (BIT(31)) 1187 #define SPI_T_ERASE_ENA_M (BIT(31)) 1188 #define SPI_T_ERASE_ENA_V 0x1 1189 #define SPI_T_ERASE_ENA_S 31 1190 /* SPI_T_ERASE_SHIFT : R/W ;bitpos:[19:16] ;default: 4'd15 ; */ 1191 /*description: erase flash delay time shift.*/ 1192 #define SPI_T_ERASE_SHIFT 0x0000000F 1193 #define SPI_T_ERASE_SHIFT_M ((SPI_T_ERASE_SHIFT_V)<<(SPI_T_ERASE_SHIFT_S)) 1194 #define SPI_T_ERASE_SHIFT_V 0xF 1195 #define SPI_T_ERASE_SHIFT_S 16 1196 /* SPI_T_ERASE_TIME : R/W ;bitpos:[11:0] ;default: 12'd0 ; */ 1197 /*description: erase flash delay time by system clock.*/ 1198 #define SPI_T_ERASE_TIME 0x00000FFF 1199 #define SPI_T_ERASE_TIME_M ((SPI_T_ERASE_TIME_V)<<(SPI_T_ERASE_TIME_S)) 1200 #define SPI_T_ERASE_TIME_V 0xFFF 1201 #define SPI_T_ERASE_TIME_S 0 1202 1203 #define SPI_EXT2_REG(i) (REG_SPI_BASE(i) + 0xF8) 1204 /* SPI_ST : RO ;bitpos:[2:0] ;default: 3'b0 ; */ 1205 /*description: The status of spi state machine .*/ 1206 #define SPI_ST 0x00000007 1207 #define SPI_ST_M ((SPI_ST_V)<<(SPI_ST_S)) 1208 #define SPI_ST_V 0x7 1209 #define SPI_ST_S 0 1210 1211 #define SPI_EXT3_REG(i) (REG_SPI_BASE(i) + 0xFC) 1212 /* SPI_INT_HOLD_ENA : R/W ;bitpos:[1:0] ;default: 2'b0 ; */ 1213 /*description: This register is for two SPI masters to share the same cs clock 1214 and data signals. The bits of one SPI are set if the other SPI is busy the SPI will be hold. 1(3): hold at ¡°idle¡± phase 2: hold at ¡°prepare¡± phase.*/ 1215 #define SPI_INT_HOLD_ENA 0x00000003 1216 #define SPI_INT_HOLD_ENA_M ((SPI_INT_HOLD_ENA_V)<<(SPI_INT_HOLD_ENA_S)) 1217 #define SPI_INT_HOLD_ENA_V 0x3 1218 #define SPI_INT_HOLD_ENA_S 0 1219 1220 #define SPI_DMA_CONF_REG(i) (REG_SPI_BASE(i) + 0x100) 1221 /* SPI_DMA_CONTINUE : R/W ;bitpos:[16] ;default: 1'b0 ; */ 1222 /*description: spi dma continue tx/rx data.*/ 1223 #define SPI_DMA_CONTINUE (BIT(16)) 1224 #define SPI_DMA_CONTINUE_M (BIT(16)) 1225 #define SPI_DMA_CONTINUE_V 0x1 1226 #define SPI_DMA_CONTINUE_S 16 1227 /* SPI_DMA_TX_STOP : R/W ;bitpos:[15] ;default: 1'b0 ; */ 1228 /*description: spi dma write data stop when in continue tx/rx mode.*/ 1229 #define SPI_DMA_TX_STOP (BIT(15)) 1230 #define SPI_DMA_TX_STOP_M (BIT(15)) 1231 #define SPI_DMA_TX_STOP_V 0x1 1232 #define SPI_DMA_TX_STOP_S 15 1233 /* SPI_DMA_RX_STOP : R/W ;bitpos:[14] ;default: 1'b0 ; */ 1234 /*description: spi dma read data stop when in continue tx/rx mode.*/ 1235 #define SPI_DMA_RX_STOP (BIT(14)) 1236 #define SPI_DMA_RX_STOP_M (BIT(14)) 1237 #define SPI_DMA_RX_STOP_V 0x1 1238 #define SPI_DMA_RX_STOP_S 14 1239 /* SPI_OUT_DATA_BURST_EN : R/W ;bitpos:[12] ;default: 1'b0 ; */ 1240 /*description: spi dma read data from memory in burst mode.*/ 1241 #define SPI_OUT_DATA_BURST_EN (BIT(12)) 1242 #define SPI_OUT_DATA_BURST_EN_M (BIT(12)) 1243 #define SPI_OUT_DATA_BURST_EN_V 0x1 1244 #define SPI_OUT_DATA_BURST_EN_S 12 1245 /* SPI_INDSCR_BURST_EN : R/W ;bitpos:[11] ;default: 1'b0 ; */ 1246 /*description: read descriptor use burst mode when write data to memory.*/ 1247 #define SPI_INDSCR_BURST_EN (BIT(11)) 1248 #define SPI_INDSCR_BURST_EN_M (BIT(11)) 1249 #define SPI_INDSCR_BURST_EN_V 0x1 1250 #define SPI_INDSCR_BURST_EN_S 11 1251 /* SPI_OUTDSCR_BURST_EN : R/W ;bitpos:[10] ;default: 1'b0 ; */ 1252 /*description: read descriptor use burst mode when read data for memory.*/ 1253 #define SPI_OUTDSCR_BURST_EN (BIT(10)) 1254 #define SPI_OUTDSCR_BURST_EN_M (BIT(10)) 1255 #define SPI_OUTDSCR_BURST_EN_V 0x1 1256 #define SPI_OUTDSCR_BURST_EN_S 10 1257 /* SPI_OUT_EOF_MODE : R/W ;bitpos:[9] ;default: 1'b1 ; */ 1258 /*description: out eof flag generation mode . 1: when dma pop all data from 1259 fifo 0:when ahb push all data to fifo.*/ 1260 #define SPI_OUT_EOF_MODE (BIT(9)) 1261 #define SPI_OUT_EOF_MODE_M (BIT(9)) 1262 #define SPI_OUT_EOF_MODE_V 0x1 1263 #define SPI_OUT_EOF_MODE_S 9 1264 /* SPI_OUT_AUTO_WRBACK : R/W ;bitpos:[8] ;default: 1'b0 ; */ 1265 /*description: when the link is empty jump to next automatically.*/ 1266 #define SPI_OUT_AUTO_WRBACK (BIT(8)) 1267 #define SPI_OUT_AUTO_WRBACK_M (BIT(8)) 1268 #define SPI_OUT_AUTO_WRBACK_V 0x1 1269 #define SPI_OUT_AUTO_WRBACK_S 8 1270 /* SPI_OUT_LOOP_TEST : R/W ;bitpos:[7] ;default: 1'b0 ; */ 1271 /*description: Set bit to test out link.*/ 1272 #define SPI_OUT_LOOP_TEST (BIT(7)) 1273 #define SPI_OUT_LOOP_TEST_M (BIT(7)) 1274 #define SPI_OUT_LOOP_TEST_V 0x1 1275 #define SPI_OUT_LOOP_TEST_S 7 1276 /* SPI_IN_LOOP_TEST : R/W ;bitpos:[6] ;default: 1'b0 ; */ 1277 /*description: Set bit to test in link.*/ 1278 #define SPI_IN_LOOP_TEST (BIT(6)) 1279 #define SPI_IN_LOOP_TEST_M (BIT(6)) 1280 #define SPI_IN_LOOP_TEST_V 0x1 1281 #define SPI_IN_LOOP_TEST_S 6 1282 /* SPI_AHBM_RST : R/W ;bitpos:[5] ;default: 1'b0 ; */ 1283 /*description: reset spi dma ahb master.*/ 1284 #define SPI_AHBM_RST (BIT(5)) 1285 #define SPI_AHBM_RST_M (BIT(5)) 1286 #define SPI_AHBM_RST_V 0x1 1287 #define SPI_AHBM_RST_S 5 1288 /* SPI_AHBM_FIFO_RST : R/W ;bitpos:[4] ;default: 1'b0 ; */ 1289 /*description: reset spi dma ahb master fifo pointer.*/ 1290 #define SPI_AHBM_FIFO_RST (BIT(4)) 1291 #define SPI_AHBM_FIFO_RST_M (BIT(4)) 1292 #define SPI_AHBM_FIFO_RST_V 0x1 1293 #define SPI_AHBM_FIFO_RST_S 4 1294 /* SPI_OUT_RST : R/W ;bitpos:[3] ;default: 1'b0 ; */ 1295 /*description: The bit is used to reset out dma fsm and out data fifo pointer.*/ 1296 #define SPI_OUT_RST (BIT(3)) 1297 #define SPI_OUT_RST_M (BIT(3)) 1298 #define SPI_OUT_RST_V 0x1 1299 #define SPI_OUT_RST_S 3 1300 /* SPI_IN_RST : R/W ;bitpos:[2] ;default: 1'b0 ; */ 1301 /*description: The bit is used to reset in dma fsm and in data fifo pointer.*/ 1302 #define SPI_IN_RST (BIT(2)) 1303 #define SPI_IN_RST_M (BIT(2)) 1304 #define SPI_IN_RST_V 0x1 1305 #define SPI_IN_RST_S 2 1306 1307 #define SPI_DMA_OUT_LINK_REG(i) (REG_SPI_BASE(i) + 0x104) 1308 /* SPI_OUTLINK_RESTART : R/W ;bitpos:[30] ;default: 1'b0 ; */ 1309 /*description: Set the bit to mount on new outlink descriptors.*/ 1310 #define SPI_OUTLINK_RESTART (BIT(30)) 1311 #define SPI_OUTLINK_RESTART_M (BIT(30)) 1312 #define SPI_OUTLINK_RESTART_V 0x1 1313 #define SPI_OUTLINK_RESTART_S 30 1314 /* SPI_OUTLINK_START : R/W ;bitpos:[29] ;default: 1'b0 ; */ 1315 /*description: Set the bit to start to use outlink descriptor.*/ 1316 #define SPI_OUTLINK_START (BIT(29)) 1317 #define SPI_OUTLINK_START_M (BIT(29)) 1318 #define SPI_OUTLINK_START_V 0x1 1319 #define SPI_OUTLINK_START_S 29 1320 /* SPI_OUTLINK_STOP : R/W ;bitpos:[28] ;default: 1'b0 ; */ 1321 /*description: Set the bit to stop to use outlink descriptor.*/ 1322 #define SPI_OUTLINK_STOP (BIT(28)) 1323 #define SPI_OUTLINK_STOP_M (BIT(28)) 1324 #define SPI_OUTLINK_STOP_V 0x1 1325 #define SPI_OUTLINK_STOP_S 28 1326 /* SPI_OUTLINK_ADDR : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ 1327 /*description: The address of the first outlink descriptor.*/ 1328 #define SPI_OUTLINK_ADDR 0x000FFFFF 1329 #define SPI_OUTLINK_ADDR_M ((SPI_OUTLINK_ADDR_V)<<(SPI_OUTLINK_ADDR_S)) 1330 #define SPI_OUTLINK_ADDR_V 0xFFFFF 1331 #define SPI_OUTLINK_ADDR_S 0 1332 1333 #define SPI_DMA_IN_LINK_REG(i) (REG_SPI_BASE(i) + 0x108) 1334 /* SPI_INLINK_RESTART : R/W ;bitpos:[30] ;default: 1'b0 ; */ 1335 /*description: Set the bit to mount on new inlink descriptors.*/ 1336 #define SPI_INLINK_RESTART (BIT(30)) 1337 #define SPI_INLINK_RESTART_M (BIT(30)) 1338 #define SPI_INLINK_RESTART_V 0x1 1339 #define SPI_INLINK_RESTART_S 30 1340 /* SPI_INLINK_START : R/W ;bitpos:[29] ;default: 1'b0 ; */ 1341 /*description: Set the bit to start to use inlink descriptor.*/ 1342 #define SPI_INLINK_START (BIT(29)) 1343 #define SPI_INLINK_START_M (BIT(29)) 1344 #define SPI_INLINK_START_V 0x1 1345 #define SPI_INLINK_START_S 29 1346 /* SPI_INLINK_STOP : R/W ;bitpos:[28] ;default: 1'b0 ; */ 1347 /*description: Set the bit to stop to use inlink descriptor.*/ 1348 #define SPI_INLINK_STOP (BIT(28)) 1349 #define SPI_INLINK_STOP_M (BIT(28)) 1350 #define SPI_INLINK_STOP_V 0x1 1351 #define SPI_INLINK_STOP_S 28 1352 /* SPI_INLINK_AUTO_RET : R/W ;bitpos:[20] ;default: 1'b0 ; */ 1353 /*description: when the bit is set inlink descriptor returns to the next descriptor 1354 while a packet is wrong*/ 1355 #define SPI_INLINK_AUTO_RET (BIT(20)) 1356 #define SPI_INLINK_AUTO_RET_M (BIT(20)) 1357 #define SPI_INLINK_AUTO_RET_V 0x1 1358 #define SPI_INLINK_AUTO_RET_S 20 1359 /* SPI_INLINK_ADDR : R/W ;bitpos:[19:0] ;default: 20'h0 ; */ 1360 /*description: The address of the first inlink descriptor.*/ 1361 #define SPI_INLINK_ADDR 0x000FFFFF 1362 #define SPI_INLINK_ADDR_M ((SPI_INLINK_ADDR_V)<<(SPI_INLINK_ADDR_S)) 1363 #define SPI_INLINK_ADDR_V 0xFFFFF 1364 #define SPI_INLINK_ADDR_S 0 1365 1366 #define SPI_DMA_STATUS_REG(i) (REG_SPI_BASE(i) + 0x10C) 1367 /* SPI_DMA_TX_EN : RO ;bitpos:[1] ;default: 1'b0 ; */ 1368 /*description: spi dma write data status bit.*/ 1369 #define SPI_DMA_TX_EN (BIT(1)) 1370 #define SPI_DMA_TX_EN_M (BIT(1)) 1371 #define SPI_DMA_TX_EN_V 0x1 1372 #define SPI_DMA_TX_EN_S 1 1373 /* SPI_DMA_RX_EN : RO ;bitpos:[0] ;default: 1'b0 ; */ 1374 /*description: spi dma read data status bit.*/ 1375 #define SPI_DMA_RX_EN (BIT(0)) 1376 #define SPI_DMA_RX_EN_M (BIT(0)) 1377 #define SPI_DMA_RX_EN_V 0x1 1378 #define SPI_DMA_RX_EN_S 0 1379 1380 #define SPI_DMA_INT_ENA_REG(i) (REG_SPI_BASE(i) + 0x110) 1381 /* SPI_OUT_TOTAL_EOF_INT_ENA : R/W ;bitpos:[8] ;default: 1'b0 ; */ 1382 /*description: The enable bit for sending all the packets to host done.*/ 1383 #define SPI_OUT_TOTAL_EOF_INT_ENA (BIT(8)) 1384 #define SPI_OUT_TOTAL_EOF_INT_ENA_M (BIT(8)) 1385 #define SPI_OUT_TOTAL_EOF_INT_ENA_V 0x1 1386 #define SPI_OUT_TOTAL_EOF_INT_ENA_S 8 1387 /* SPI_OUT_EOF_INT_ENA : R/W ;bitpos:[7] ;default: 1'b0 ; */ 1388 /*description: The enable bit for sending a packet to host done.*/ 1389 #define SPI_OUT_EOF_INT_ENA (BIT(7)) 1390 #define SPI_OUT_EOF_INT_ENA_M (BIT(7)) 1391 #define SPI_OUT_EOF_INT_ENA_V 0x1 1392 #define SPI_OUT_EOF_INT_ENA_S 7 1393 /* SPI_OUT_DONE_INT_ENA : R/W ;bitpos:[6] ;default: 1'b0 ; */ 1394 /*description: The enable bit for completing usage of a outlink descriptor .*/ 1395 #define SPI_OUT_DONE_INT_ENA (BIT(6)) 1396 #define SPI_OUT_DONE_INT_ENA_M (BIT(6)) 1397 #define SPI_OUT_DONE_INT_ENA_V 0x1 1398 #define SPI_OUT_DONE_INT_ENA_S 6 1399 /* SPI_IN_SUC_EOF_INT_ENA : R/W ;bitpos:[5] ;default: 1'b0 ; */ 1400 /*description: The enable bit for completing receiving all the packets from host.*/ 1401 #define SPI_IN_SUC_EOF_INT_ENA (BIT(5)) 1402 #define SPI_IN_SUC_EOF_INT_ENA_M (BIT(5)) 1403 #define SPI_IN_SUC_EOF_INT_ENA_V 0x1 1404 #define SPI_IN_SUC_EOF_INT_ENA_S 5 1405 /* SPI_IN_ERR_EOF_INT_ENA : R/W ;bitpos:[4] ;default: 1'b0 ; */ 1406 /*description: The enable bit for receiving error.*/ 1407 #define SPI_IN_ERR_EOF_INT_ENA (BIT(4)) 1408 #define SPI_IN_ERR_EOF_INT_ENA_M (BIT(4)) 1409 #define SPI_IN_ERR_EOF_INT_ENA_V 0x1 1410 #define SPI_IN_ERR_EOF_INT_ENA_S 4 1411 /* SPI_IN_DONE_INT_ENA : R/W ;bitpos:[3] ;default: 1'b0 ; */ 1412 /*description: The enable bit for completing usage of a inlink descriptor.*/ 1413 #define SPI_IN_DONE_INT_ENA (BIT(3)) 1414 #define SPI_IN_DONE_INT_ENA_M (BIT(3)) 1415 #define SPI_IN_DONE_INT_ENA_V 0x1 1416 #define SPI_IN_DONE_INT_ENA_S 3 1417 /* SPI_INLINK_DSCR_ERROR_INT_ENA : R/W ;bitpos:[2] ;default: 1'b0 ; */ 1418 /*description: The enable bit for inlink descriptor error.*/ 1419 #define SPI_INLINK_DSCR_ERROR_INT_ENA (BIT(2)) 1420 #define SPI_INLINK_DSCR_ERROR_INT_ENA_M (BIT(2)) 1421 #define SPI_INLINK_DSCR_ERROR_INT_ENA_V 0x1 1422 #define SPI_INLINK_DSCR_ERROR_INT_ENA_S 2 1423 /* SPI_OUTLINK_DSCR_ERROR_INT_ENA : R/W ;bitpos:[1] ;default: 1'b0 ; */ 1424 /*description: The enable bit for outlink descriptor error.*/ 1425 #define SPI_OUTLINK_DSCR_ERROR_INT_ENA (BIT(1)) 1426 #define SPI_OUTLINK_DSCR_ERROR_INT_ENA_M (BIT(1)) 1427 #define SPI_OUTLINK_DSCR_ERROR_INT_ENA_V 0x1 1428 #define SPI_OUTLINK_DSCR_ERROR_INT_ENA_S 1 1429 /* SPI_INLINK_DSCR_EMPTY_INT_ENA : R/W ;bitpos:[0] ;default: 1'b0 ; */ 1430 /*description: The enable bit for lack of enough inlink descriptors.*/ 1431 #define SPI_INLINK_DSCR_EMPTY_INT_ENA (BIT(0)) 1432 #define SPI_INLINK_DSCR_EMPTY_INT_ENA_M (BIT(0)) 1433 #define SPI_INLINK_DSCR_EMPTY_INT_ENA_V 0x1 1434 #define SPI_INLINK_DSCR_EMPTY_INT_ENA_S 0 1435 1436 #define SPI_DMA_INT_RAW_REG(i) (REG_SPI_BASE(i) + 0x114) 1437 /* SPI_OUT_TOTAL_EOF_INT_RAW : RO ;bitpos:[8] ;default: 1'b0 ; */ 1438 /*description: The raw bit for sending all the packets to host done.*/ 1439 #define SPI_OUT_TOTAL_EOF_INT_RAW (BIT(8)) 1440 #define SPI_OUT_TOTAL_EOF_INT_RAW_M (BIT(8)) 1441 #define SPI_OUT_TOTAL_EOF_INT_RAW_V 0x1 1442 #define SPI_OUT_TOTAL_EOF_INT_RAW_S 8 1443 /* SPI_OUT_EOF_INT_RAW : RO ;bitpos:[7] ;default: 1'b0 ; */ 1444 /*description: The raw bit for sending a packet to host done.*/ 1445 #define SPI_OUT_EOF_INT_RAW (BIT(7)) 1446 #define SPI_OUT_EOF_INT_RAW_M (BIT(7)) 1447 #define SPI_OUT_EOF_INT_RAW_V 0x1 1448 #define SPI_OUT_EOF_INT_RAW_S 7 1449 /* SPI_OUT_DONE_INT_RAW : RO ;bitpos:[6] ;default: 1'b0 ; */ 1450 /*description: The raw bit for completing usage of a outlink descriptor.*/ 1451 #define SPI_OUT_DONE_INT_RAW (BIT(6)) 1452 #define SPI_OUT_DONE_INT_RAW_M (BIT(6)) 1453 #define SPI_OUT_DONE_INT_RAW_V 0x1 1454 #define SPI_OUT_DONE_INT_RAW_S 6 1455 /* SPI_IN_SUC_EOF_INT_RAW : RO ;bitpos:[5] ;default: 1'b0 ; */ 1456 /*description: The raw bit for completing receiving all the packets from host.*/ 1457 #define SPI_IN_SUC_EOF_INT_RAW (BIT(5)) 1458 #define SPI_IN_SUC_EOF_INT_RAW_M (BIT(5)) 1459 #define SPI_IN_SUC_EOF_INT_RAW_V 0x1 1460 #define SPI_IN_SUC_EOF_INT_RAW_S 5 1461 /* SPI_IN_ERR_EOF_INT_RAW : RO ;bitpos:[4] ;default: 1'b0 ; */ 1462 /*description: The raw bit for receiving error.*/ 1463 #define SPI_IN_ERR_EOF_INT_RAW (BIT(4)) 1464 #define SPI_IN_ERR_EOF_INT_RAW_M (BIT(4)) 1465 #define SPI_IN_ERR_EOF_INT_RAW_V 0x1 1466 #define SPI_IN_ERR_EOF_INT_RAW_S 4 1467 /* SPI_IN_DONE_INT_RAW : RO ;bitpos:[3] ;default: 1'b0 ; */ 1468 /*description: The raw bit for completing usage of a inlink descriptor.*/ 1469 #define SPI_IN_DONE_INT_RAW (BIT(3)) 1470 #define SPI_IN_DONE_INT_RAW_M (BIT(3)) 1471 #define SPI_IN_DONE_INT_RAW_V 0x1 1472 #define SPI_IN_DONE_INT_RAW_S 3 1473 /* SPI_INLINK_DSCR_ERROR_INT_RAW : RO ;bitpos:[2] ;default: 1'b0 ; */ 1474 /*description: The raw bit for inlink descriptor error.*/ 1475 #define SPI_INLINK_DSCR_ERROR_INT_RAW (BIT(2)) 1476 #define SPI_INLINK_DSCR_ERROR_INT_RAW_M (BIT(2)) 1477 #define SPI_INLINK_DSCR_ERROR_INT_RAW_V 0x1 1478 #define SPI_INLINK_DSCR_ERROR_INT_RAW_S 2 1479 /* SPI_OUTLINK_DSCR_ERROR_INT_RAW : RO ;bitpos:[1] ;default: 1'b0 ; */ 1480 /*description: The raw bit for outlink descriptor error.*/ 1481 #define SPI_OUTLINK_DSCR_ERROR_INT_RAW (BIT(1)) 1482 #define SPI_OUTLINK_DSCR_ERROR_INT_RAW_M (BIT(1)) 1483 #define SPI_OUTLINK_DSCR_ERROR_INT_RAW_V 0x1 1484 #define SPI_OUTLINK_DSCR_ERROR_INT_RAW_S 1 1485 /* SPI_INLINK_DSCR_EMPTY_INT_RAW : RO ;bitpos:[0] ;default: 1'b0 ; */ 1486 /*description: The raw bit for lack of enough inlink descriptors.*/ 1487 #define SPI_INLINK_DSCR_EMPTY_INT_RAW (BIT(0)) 1488 #define SPI_INLINK_DSCR_EMPTY_INT_RAW_M (BIT(0)) 1489 #define SPI_INLINK_DSCR_EMPTY_INT_RAW_V 0x1 1490 #define SPI_INLINK_DSCR_EMPTY_INT_RAW_S 0 1491 1492 #define SPI_DMA_INT_ST_REG(i) (REG_SPI_BASE(i) + 0x118) 1493 /* SPI_OUT_TOTAL_EOF_INT_ST : RO ;bitpos:[8] ;default: 1'b0 ; */ 1494 /*description: The status bit for sending all the packets to host done.*/ 1495 #define SPI_OUT_TOTAL_EOF_INT_ST (BIT(8)) 1496 #define SPI_OUT_TOTAL_EOF_INT_ST_M (BIT(8)) 1497 #define SPI_OUT_TOTAL_EOF_INT_ST_V 0x1 1498 #define SPI_OUT_TOTAL_EOF_INT_ST_S 8 1499 /* SPI_OUT_EOF_INT_ST : RO ;bitpos:[7] ;default: 1'b0 ; */ 1500 /*description: The status bit for sending a packet to host done.*/ 1501 #define SPI_OUT_EOF_INT_ST (BIT(7)) 1502 #define SPI_OUT_EOF_INT_ST_M (BIT(7)) 1503 #define SPI_OUT_EOF_INT_ST_V 0x1 1504 #define SPI_OUT_EOF_INT_ST_S 7 1505 /* SPI_OUT_DONE_INT_ST : RO ;bitpos:[6] ;default: 1'b0 ; */ 1506 /*description: The status bit for completing usage of a outlink descriptor.*/ 1507 #define SPI_OUT_DONE_INT_ST (BIT(6)) 1508 #define SPI_OUT_DONE_INT_ST_M (BIT(6)) 1509 #define SPI_OUT_DONE_INT_ST_V 0x1 1510 #define SPI_OUT_DONE_INT_ST_S 6 1511 /* SPI_IN_SUC_EOF_INT_ST : RO ;bitpos:[5] ;default: 1'b0 ; */ 1512 /*description: The status bit for completing receiving all the packets from host.*/ 1513 #define SPI_IN_SUC_EOF_INT_ST (BIT(5)) 1514 #define SPI_IN_SUC_EOF_INT_ST_M (BIT(5)) 1515 #define SPI_IN_SUC_EOF_INT_ST_V 0x1 1516 #define SPI_IN_SUC_EOF_INT_ST_S 5 1517 /* SPI_IN_ERR_EOF_INT_ST : RO ;bitpos:[4] ;default: 1'b0 ; */ 1518 /*description: The status bit for receiving error.*/ 1519 #define SPI_IN_ERR_EOF_INT_ST (BIT(4)) 1520 #define SPI_IN_ERR_EOF_INT_ST_M (BIT(4)) 1521 #define SPI_IN_ERR_EOF_INT_ST_V 0x1 1522 #define SPI_IN_ERR_EOF_INT_ST_S 4 1523 /* SPI_IN_DONE_INT_ST : RO ;bitpos:[3] ;default: 1'b0 ; */ 1524 /*description: The status bit for completing usage of a inlink descriptor.*/ 1525 #define SPI_IN_DONE_INT_ST (BIT(3)) 1526 #define SPI_IN_DONE_INT_ST_M (BIT(3)) 1527 #define SPI_IN_DONE_INT_ST_V 0x1 1528 #define SPI_IN_DONE_INT_ST_S 3 1529 /* SPI_INLINK_DSCR_ERROR_INT_ST : RO ;bitpos:[2] ;default: 1'b0 ; */ 1530 /*description: The status bit for inlink descriptor error.*/ 1531 #define SPI_INLINK_DSCR_ERROR_INT_ST (BIT(2)) 1532 #define SPI_INLINK_DSCR_ERROR_INT_ST_M (BIT(2)) 1533 #define SPI_INLINK_DSCR_ERROR_INT_ST_V 0x1 1534 #define SPI_INLINK_DSCR_ERROR_INT_ST_S 2 1535 /* SPI_OUTLINK_DSCR_ERROR_INT_ST : RO ;bitpos:[1] ;default: 1'b0 ; */ 1536 /*description: The status bit for outlink descriptor error.*/ 1537 #define SPI_OUTLINK_DSCR_ERROR_INT_ST (BIT(1)) 1538 #define SPI_OUTLINK_DSCR_ERROR_INT_ST_M (BIT(1)) 1539 #define SPI_OUTLINK_DSCR_ERROR_INT_ST_V 0x1 1540 #define SPI_OUTLINK_DSCR_ERROR_INT_ST_S 1 1541 /* SPI_INLINK_DSCR_EMPTY_INT_ST : RO ;bitpos:[0] ;default: 1'b0 ; */ 1542 /*description: The status bit for lack of enough inlink descriptors.*/ 1543 #define SPI_INLINK_DSCR_EMPTY_INT_ST (BIT(0)) 1544 #define SPI_INLINK_DSCR_EMPTY_INT_ST_M (BIT(0)) 1545 #define SPI_INLINK_DSCR_EMPTY_INT_ST_V 0x1 1546 #define SPI_INLINK_DSCR_EMPTY_INT_ST_S 0 1547 1548 #define SPI_DMA_INT_CLR_REG(i) (REG_SPI_BASE(i) + 0x11C) 1549 /* SPI_OUT_TOTAL_EOF_INT_CLR : R/W ;bitpos:[8] ;default: 1'b0 ; */ 1550 /*description: The clear bit for sending all the packets to host done.*/ 1551 #define SPI_OUT_TOTAL_EOF_INT_CLR (BIT(8)) 1552 #define SPI_OUT_TOTAL_EOF_INT_CLR_M (BIT(8)) 1553 #define SPI_OUT_TOTAL_EOF_INT_CLR_V 0x1 1554 #define SPI_OUT_TOTAL_EOF_INT_CLR_S 8 1555 /* SPI_OUT_EOF_INT_CLR : R/W ;bitpos:[7] ;default: 1'b0 ; */ 1556 /*description: The clear bit for sending a packet to host done.*/ 1557 #define SPI_OUT_EOF_INT_CLR (BIT(7)) 1558 #define SPI_OUT_EOF_INT_CLR_M (BIT(7)) 1559 #define SPI_OUT_EOF_INT_CLR_V 0x1 1560 #define SPI_OUT_EOF_INT_CLR_S 7 1561 /* SPI_OUT_DONE_INT_CLR : R/W ;bitpos:[6] ;default: 1'b0 ; */ 1562 /*description: The clear bit for completing usage of a outlink descriptor.*/ 1563 #define SPI_OUT_DONE_INT_CLR (BIT(6)) 1564 #define SPI_OUT_DONE_INT_CLR_M (BIT(6)) 1565 #define SPI_OUT_DONE_INT_CLR_V 0x1 1566 #define SPI_OUT_DONE_INT_CLR_S 6 1567 /* SPI_IN_SUC_EOF_INT_CLR : R/W ;bitpos:[5] ;default: 1'b0 ; */ 1568 /*description: The clear bit for completing receiving all the packets from host.*/ 1569 #define SPI_IN_SUC_EOF_INT_CLR (BIT(5)) 1570 #define SPI_IN_SUC_EOF_INT_CLR_M (BIT(5)) 1571 #define SPI_IN_SUC_EOF_INT_CLR_V 0x1 1572 #define SPI_IN_SUC_EOF_INT_CLR_S 5 1573 /* SPI_IN_ERR_EOF_INT_CLR : R/W ;bitpos:[4] ;default: 1'b0 ; */ 1574 /*description: The clear bit for receiving error.*/ 1575 #define SPI_IN_ERR_EOF_INT_CLR (BIT(4)) 1576 #define SPI_IN_ERR_EOF_INT_CLR_M (BIT(4)) 1577 #define SPI_IN_ERR_EOF_INT_CLR_V 0x1 1578 #define SPI_IN_ERR_EOF_INT_CLR_S 4 1579 /* SPI_IN_DONE_INT_CLR : R/W ;bitpos:[3] ;default: 1'b0 ; */ 1580 /*description: The clear bit for completing usage of a inlink descriptor.*/ 1581 #define SPI_IN_DONE_INT_CLR (BIT(3)) 1582 #define SPI_IN_DONE_INT_CLR_M (BIT(3)) 1583 #define SPI_IN_DONE_INT_CLR_V 0x1 1584 #define SPI_IN_DONE_INT_CLR_S 3 1585 /* SPI_INLINK_DSCR_ERROR_INT_CLR : R/W ;bitpos:[2] ;default: 1'b0 ; */ 1586 /*description: The clear bit for inlink descriptor error.*/ 1587 #define SPI_INLINK_DSCR_ERROR_INT_CLR (BIT(2)) 1588 #define SPI_INLINK_DSCR_ERROR_INT_CLR_M (BIT(2)) 1589 #define SPI_INLINK_DSCR_ERROR_INT_CLR_V 0x1 1590 #define SPI_INLINK_DSCR_ERROR_INT_CLR_S 2 1591 /* SPI_OUTLINK_DSCR_ERROR_INT_CLR : R/W ;bitpos:[1] ;default: 1'b0 ; */ 1592 /*description: The clear bit for outlink descriptor error.*/ 1593 #define SPI_OUTLINK_DSCR_ERROR_INT_CLR (BIT(1)) 1594 #define SPI_OUTLINK_DSCR_ERROR_INT_CLR_M (BIT(1)) 1595 #define SPI_OUTLINK_DSCR_ERROR_INT_CLR_V 0x1 1596 #define SPI_OUTLINK_DSCR_ERROR_INT_CLR_S 1 1597 /* SPI_INLINK_DSCR_EMPTY_INT_CLR : R/W ;bitpos:[0] ;default: 1'b0 ; */ 1598 /*description: The clear bit for lack of enough inlink descriptors.*/ 1599 #define SPI_INLINK_DSCR_EMPTY_INT_CLR (BIT(0)) 1600 #define SPI_INLINK_DSCR_EMPTY_INT_CLR_M (BIT(0)) 1601 #define SPI_INLINK_DSCR_EMPTY_INT_CLR_V 0x1 1602 #define SPI_INLINK_DSCR_EMPTY_INT_CLR_S 0 1603 1604 #define SPI_IN_ERR_EOF_DES_ADDR_REG(i) (REG_SPI_BASE(i) + 0x120) 1605 /* SPI_DMA_IN_ERR_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ 1606 /*description: The inlink descriptor address when spi dma produce receiving error.*/ 1607 #define SPI_DMA_IN_ERR_EOF_DES_ADDR 0xFFFFFFFF 1608 #define SPI_DMA_IN_ERR_EOF_DES_ADDR_M ((SPI_DMA_IN_ERR_EOF_DES_ADDR_V)<<(SPI_DMA_IN_ERR_EOF_DES_ADDR_S)) 1609 #define SPI_DMA_IN_ERR_EOF_DES_ADDR_V 0xFFFFFFFF 1610 #define SPI_DMA_IN_ERR_EOF_DES_ADDR_S 0 1611 1612 #define SPI_IN_SUC_EOF_DES_ADDR_REG(i) (REG_SPI_BASE(i) + 0x124) 1613 /* SPI_DMA_IN_SUC_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ 1614 /*description: The last inlink descriptor address when spi dma produce from_suc_eof.*/ 1615 #define SPI_DMA_IN_SUC_EOF_DES_ADDR 0xFFFFFFFF 1616 #define SPI_DMA_IN_SUC_EOF_DES_ADDR_M ((SPI_DMA_IN_SUC_EOF_DES_ADDR_V)<<(SPI_DMA_IN_SUC_EOF_DES_ADDR_S)) 1617 #define SPI_DMA_IN_SUC_EOF_DES_ADDR_V 0xFFFFFFFF 1618 #define SPI_DMA_IN_SUC_EOF_DES_ADDR_S 0 1619 1620 #define SPI_INLINK_DSCR_REG(i) (REG_SPI_BASE(i) + 0x128) 1621 /* SPI_DMA_INLINK_DSCR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ 1622 /*description: The content of current in descriptor pointer.*/ 1623 #define SPI_DMA_INLINK_DSCR 0xFFFFFFFF 1624 #define SPI_DMA_INLINK_DSCR_M ((SPI_DMA_INLINK_DSCR_V)<<(SPI_DMA_INLINK_DSCR_S)) 1625 #define SPI_DMA_INLINK_DSCR_V 0xFFFFFFFF 1626 #define SPI_DMA_INLINK_DSCR_S 0 1627 1628 #define SPI_INLINK_DSCR_BF0_REG(i) (REG_SPI_BASE(i) + 0x12C) 1629 /* SPI_DMA_INLINK_DSCR_BF0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ 1630 /*description: The content of next in descriptor pointer.*/ 1631 #define SPI_DMA_INLINK_DSCR_BF0 0xFFFFFFFF 1632 #define SPI_DMA_INLINK_DSCR_BF0_M ((SPI_DMA_INLINK_DSCR_BF0_V)<<(SPI_DMA_INLINK_DSCR_BF0_S)) 1633 #define SPI_DMA_INLINK_DSCR_BF0_V 0xFFFFFFFF 1634 #define SPI_DMA_INLINK_DSCR_BF0_S 0 1635 1636 #define SPI_INLINK_DSCR_BF1_REG(i) (REG_SPI_BASE(i) + 0x130) 1637 /* SPI_DMA_INLINK_DSCR_BF1 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ 1638 /*description: The content of current in descriptor data buffer pointer.*/ 1639 #define SPI_DMA_INLINK_DSCR_BF1 0xFFFFFFFF 1640 #define SPI_DMA_INLINK_DSCR_BF1_M ((SPI_DMA_INLINK_DSCR_BF1_V)<<(SPI_DMA_INLINK_DSCR_BF1_S)) 1641 #define SPI_DMA_INLINK_DSCR_BF1_V 0xFFFFFFFF 1642 #define SPI_DMA_INLINK_DSCR_BF1_S 0 1643 1644 #define SPI_OUT_EOF_BFR_DES_ADDR_REG(i) (REG_SPI_BASE(i) + 0x134) 1645 /* SPI_DMA_OUT_EOF_BFR_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ 1646 /*description: The address of buffer relative to the outlink descriptor that produce eof.*/ 1647 #define SPI_DMA_OUT_EOF_BFR_DES_ADDR 0xFFFFFFFF 1648 #define SPI_DMA_OUT_EOF_BFR_DES_ADDR_M ((SPI_DMA_OUT_EOF_BFR_DES_ADDR_V)<<(SPI_DMA_OUT_EOF_BFR_DES_ADDR_S)) 1649 #define SPI_DMA_OUT_EOF_BFR_DES_ADDR_V 0xFFFFFFFF 1650 #define SPI_DMA_OUT_EOF_BFR_DES_ADDR_S 0 1651 1652 #define SPI_OUT_EOF_DES_ADDR_REG(i) (REG_SPI_BASE(i) + 0x138) 1653 /* SPI_DMA_OUT_EOF_DES_ADDR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ 1654 /*description: The last outlink descriptor address when spi dma produce to_eof.*/ 1655 #define SPI_DMA_OUT_EOF_DES_ADDR 0xFFFFFFFF 1656 #define SPI_DMA_OUT_EOF_DES_ADDR_M ((SPI_DMA_OUT_EOF_DES_ADDR_V)<<(SPI_DMA_OUT_EOF_DES_ADDR_S)) 1657 #define SPI_DMA_OUT_EOF_DES_ADDR_V 0xFFFFFFFF 1658 #define SPI_DMA_OUT_EOF_DES_ADDR_S 0 1659 1660 #define SPI_OUTLINK_DSCR_REG(i) (REG_SPI_BASE(i) + 0x13C) 1661 /* SPI_DMA_OUTLINK_DSCR : RO ;bitpos:[31:0] ;default: 32'b0 ; */ 1662 /*description: The content of current out descriptor pointer.*/ 1663 #define SPI_DMA_OUTLINK_DSCR 0xFFFFFFFF 1664 #define SPI_DMA_OUTLINK_DSCR_M ((SPI_DMA_OUTLINK_DSCR_V)<<(SPI_DMA_OUTLINK_DSCR_S)) 1665 #define SPI_DMA_OUTLINK_DSCR_V 0xFFFFFFFF 1666 #define SPI_DMA_OUTLINK_DSCR_S 0 1667 1668 #define SPI_OUTLINK_DSCR_BF0_REG(i) (REG_SPI_BASE(i) + 0x140) 1669 /* SPI_DMA_OUTLINK_DSCR_BF0 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ 1670 /*description: The content of next out descriptor pointer.*/ 1671 #define SPI_DMA_OUTLINK_DSCR_BF0 0xFFFFFFFF 1672 #define SPI_DMA_OUTLINK_DSCR_BF0_M ((SPI_DMA_OUTLINK_DSCR_BF0_V)<<(SPI_DMA_OUTLINK_DSCR_BF0_S)) 1673 #define SPI_DMA_OUTLINK_DSCR_BF0_V 0xFFFFFFFF 1674 #define SPI_DMA_OUTLINK_DSCR_BF0_S 0 1675 1676 #define SPI_OUTLINK_DSCR_BF1_REG(i) (REG_SPI_BASE(i) + 0x144) 1677 /* SPI_DMA_OUTLINK_DSCR_BF1 : RO ;bitpos:[31:0] ;default: 32'b0 ; */ 1678 /*description: The content of current out descriptor data buffer pointer.*/ 1679 #define SPI_DMA_OUTLINK_DSCR_BF1 0xFFFFFFFF 1680 #define SPI_DMA_OUTLINK_DSCR_BF1_M ((SPI_DMA_OUTLINK_DSCR_BF1_V)<<(SPI_DMA_OUTLINK_DSCR_BF1_S)) 1681 #define SPI_DMA_OUTLINK_DSCR_BF1_V 0xFFFFFFFF 1682 #define SPI_DMA_OUTLINK_DSCR_BF1_S 0 1683 1684 #define SPI_DMA_RSTATUS_REG(i) (REG_SPI_BASE(i) + 0x148) 1685 /* SPI_DMA_OUT_STATUS : RO ;bitpos:[31:0] ;default: 32'b0 ; */ 1686 /*description: spi dma read data from memory status.*/ 1687 #define SPI_DMA_OUT_STATUS 0xFFFFFFFF 1688 #define SPI_DMA_OUT_STATUS_M ((SPI_DMA_OUT_STATUS_V)<<(SPI_DMA_OUT_STATUS_S)) 1689 #define SPI_DMA_OUT_STATUS_V 0xFFFFFFFF 1690 #define SPI_DMA_OUT_STATUS_S 0 1691 1692 #define SPI_DMA_TSTATUS_REG(i) (REG_SPI_BASE(i) + 0x14C) 1693 /* SPI_DMA_IN_STATUS : RO ;bitpos:[31:0] ;default: 32'b0 ; */ 1694 /*description: spi dma write data to memory status.*/ 1695 #define SPI_DMA_IN_STATUS 0xFFFFFFFF 1696 #define SPI_DMA_IN_STATUS_M ((SPI_DMA_IN_STATUS_V)<<(SPI_DMA_IN_STATUS_S)) 1697 #define SPI_DMA_IN_STATUS_V 0xFFFFFFFF 1698 #define SPI_DMA_IN_STATUS_S 0 1699 1700 #define SPI_DATE_REG(i) (REG_SPI_BASE(i) + 0x3FC) 1701 /* SPI_DATE : RO ;bitpos:[27:0] ;default: 32'h1604270 ; */ 1702 /*description: SPI register version.*/ 1703 #define SPI_DATE 0x0FFFFFFF 1704 #define SPI_DATE_M ((SPI_DATE_V)<<(SPI_DATE_S)) 1705 #define SPI_DATE_V 0xFFFFFFF 1706 #define SPI_DATE_S 0 1707 1708 1709 1710 1711 #endif /*__SPI_REG_H__ */ 1712