11 #define BLSP0_QUP_REG_BASE ((void *)0x78b5000u)
12 #define BLSP4_QUP_REG_BASE ((void *)0x78b9000u)
13 #define BLSP5_QUP_REG_BASE ((void *)0x7af5000u)
15 #define BLSP0_SPI_CONFIG_REG (BLSP0_QUP_REG_BASE + 0x00000300)
16 #define BLSP4_SPI_CONFIG_REG (BLSP4_QUP_REG_BASE + 0x00000300)
17 #define BLSP5_SPI_CONFIG_REG (BLSP5_QUP_REG_BASE + 0x00000300)
19 #define BLSP0_SPI_IO_CONTROL_REG (BLSP0_QUP_REG_BASE + 0x00000304)
20 #define BLSP4_SPI_IO_CONTROL_REG (BLSP4_QUP_REG_BASE + 0x00000304)
21 #define BLSP5_SPI_IO_CONTROL_REG (BLSP5_QUP_REG_BASE + 0x00000304)
23 #define BLSP0_SPI_ERROR_FLAGS_REG (BLSP0_QUP_REG_BASE + 0x00000308)
24 #define BLSP4_SPI_ERROR_FLAGS_REG (BLSP4_QUP_REG_BASE + 0x00000308)
25 #define BLSP5_SPI_ERROR_FLAGS_REG (BLSP5_QUP_REG_BASE + 0x00000308)
27 #define BLSP0_SPI_DEASSERT_WAIT_REG (BLSP0_QUP_REG_BASE + 0x00000310)
28 #define BLSP4_SPI_DEASSERT_WAIT_REG (BLSP4_QUP_REG_BASE + 0x00000310)
29 #define BLSP5_SPI_DEASSERT_WAIT_REG (BLSP5_QUP_REG_BASE + 0x00000310)
30 #define BLSP0_SPI_ERROR_FLAGS_EN_REG (BLSP0_QUP_REG_BASE + 0x0000030c)
31 #define BLSP4_SPI_ERROR_FLAGS_EN_REG (BLSP4_QUP_REG_BASE + 0x0000030c)
32 #define BLSP5_SPI_ERROR_FLAGS_EN_REG (BLSP5_QUP_REG_BASE + 0x0000030c)
34 #define BLSP0_QUP_CONFIG_REG (BLSP0_QUP_REG_BASE + 0x00000000)
35 #define BLSP4_QUP_CONFIG_REG (BLSP4_QUP_REG_BASE + 0x00000000)
36 #define BLSP5_QUP_CONFIG_REG (BLSP5_QUP_REG_BASE + 0x00000000)
38 #define BLSP0_QUP_ERROR_FLAGS_REG (BLSP0_QUP_REG_BASE + 0x0000001c)
39 #define BLSP4_QUP_ERROR_FLAGS_REG (BLSP4_QUP_REG_BASE + 0x0000001c)
40 #define BLSP5_QUP_ERROR_FLAGS_REG (BLSP5_QUP_REG_BASE + 0x0000001c)
42 #define BLSP0_QUP_ERROR_FLAGS_EN_REG (BLSP0_QUP_REG_BASE + 0x00000020)
43 #define BLSP4_QUP_ERROR_FLAGS_EN_REG (BLSP4_QUP_REG_BASE + 0x00000020)
44 #define BLSP5_QUP_ERROR_FLAGS_EN_REG (BLSP5_QUP_REG_BASE + 0x00000020)
46 #define BLSP0_QUP_OPERATIONAL_MASK (BLSP0_QUP_REG_BASE + 0x00000028)
47 #define BLSP4_QUP_OPERATIONAL_MASK (BLSP4_QUP_REG_BASE + 0x00000028)
48 #define BLSP5_QUP_OPERATIONAL_MASK (BLSP5_QUP_REG_BASE + 0x00000028)
50 #define BLSP0_QUP_OPERATIONAL_REG (BLSP0_QUP_REG_BASE + 0x00000018)
51 #define BLSP4_QUP_OPERATIONAL_REG (BLSP4_QUP_REG_BASE + 0x00000018)
52 #define BLSP5_QUP_OPERATIONAL_REG (BLSP5_QUP_REG_BASE + 0x00000018)
54 #define BLSP0_QUP_IO_MODES_REG (BLSP0_QUP_REG_BASE + 0x00000008)
55 #define BLSP4_QUP_IO_MODES_REG (BLSP4_QUP_REG_BASE + 0x00000008)
56 #define BLSP5_QUP_IO_MODES_REG (BLSP5_QUP_REG_BASE + 0x00000008)
58 #define BLSP0_QUP_STATE_REG (BLSP0_QUP_REG_BASE + 0x00000004)
59 #define BLSP4_QUP_STATE_REG (BLSP4_QUP_REG_BASE + 0x00000004)
60 #define BLSP5_QUP_STATE_REG (BLSP5_QUP_REG_BASE + 0x00000004)
62 #define BLSP0_QUP_INPUT_FIFOc_REG(c) \
63 (BLSP0_QUP_REG_BASE + 0x00000218 + 4 * (c))
64 #define BLSP4_QUP_INPUT_FIFOc_REG(c) \
65 (BLSP4_QUP_REG_BASE + 0x00000218 + 4 * (c))
66 #define BLSP5_QUP_INPUT_FIFOc_REG(c) \
67 (BLSP5_QUP_REG_BASE + 0x00000218 + 4 * (c))
69 #define BLSP0_QUP_OUTPUT_FIFOc_REG(c) \
70 (BLSP0_QUP_REG_BASE + 0x00000110 + 4 * (c))
71 #define BLSP4_QUP_OUTPUT_FIFOc_REG(c) \
72 (BLSP4_QUP_REG_BASE + 0x00000110 + 4 * (c))
73 #define BLSP5_QUP_OUTPUT_FIFOc_REG(c) \
74 (BLSP5_QUP_REG_BASE + 0x00000110 + 4 * (c))
76 #define BLSP0_QUP_MX_INPUT_COUNT_REG (BLSP0_QUP_REG_BASE + 0x00000200)
77 #define BLSP4_QUP_MX_INPUT_COUNT_REG (BLSP4_QUP_REG_BASE + 0x00000200)
78 #define BLSP5_QUP_MX_INPUT_COUNT_REG (BLSP5_QUP_REG_BASE + 0x00000200)
80 #define BLSP0_QUP_MX_OUTPUT_COUNT_REG (BLSP0_QUP_REG_BASE + 0x00000100)
81 #define BLSP4_QUP_MX_OUTPUT_COUNT_REG (BLSP4_QUP_REG_BASE + 0x00000100)
82 #define BLSP5_QUP_MX_OUTPUT_COUNT_REG (BLSP5_QUP_REG_BASE + 0x00000100)
84 #define BLSP0_QUP_SW_RESET_REG (BLSP0_QUP_REG_BASE + 0x0000000c)
85 #define BLSP4_QUP_SW_RESET_REG (BLSP4_QUP_REG_BASE + 0x0000000c)
86 #define BLSP5_QUP_SW_RESET_REG (BLSP5_QUP_REG_BASE + 0x0000000c)
88 #define QUP_CONFIG_MINI_CORE_MSK (0x0F << 8)
89 #define QUP_CONFIG_MINI_CORE_SPI (1 << 8)
90 #define QUP_CONF_INPUT_MSK (1 << 7)
91 #define QUP_CONF_INPUT_ENA (0 << 7)
92 #define QUP_CONF_NO_INPUT (1 << 7)
93 #define QUP_CONF_OUTPUT_MSK (1 << 6)
94 #define QUP_CONF_OUTPUT_ENA (0 << 6)
95 #define QUP_CONF_NO_OUTPUT (1 << 6)
96 #define QUP_CONF_N_MASK 0x1F
97 #define QUP_CONF_N_SPI_8_BIT_WORD 0x07
99 #define SPI_CONFIG_INPUT_FIRST (1 << 9)
100 #define SPI_CONFIG_INPUT_FIRST_BACK (0 << 9)
101 #define SPI_CONFIG_LOOP_BACK_MSK (1 << 8)
102 #define SPI_CONFIG_NO_LOOP_BACK (0 << 8)
103 #define SPI_CONFIG_NO_SLAVE_OPER_MSK (1 << 5)
104 #define SPI_CONFIG_NO_SLAVE_OPER (0 << 5)
106 #define SPI_IO_CTRL_CLK_ALWAYS_ON (0 << 9)
107 #define SPI_IO_CTRL_MX_CS_MODE (1 << 8)
108 #define SPI_IO_CTRL_NO_TRI_STATE (1 << 0)
109 #define SPI_IO_CTRL_FORCE_CS_MSK (1 << 11)
110 #define SPI_IO_CTRL_FORCE_CS_EN (1 << 11)
111 #define SPI_IO_CTRL_FORCE_CS_DIS (0 << 11)
112 #define SPI_IO_CTRL_CLOCK_IDLE_HIGH (1 << 10)
114 #define QUP_IO_MODES_OUTPUT_BIT_SHIFT_MSK (1 << 16)
115 #define QUP_IO_MODES_OUTPUT_BIT_SHIFT_EN (1 << 16)
116 #define QUP_IO_MODES_INPUT_MODE_MSK (0x03 << 12)
117 #define QUP_IO_MODES_INPUT_BLOCK_MODE (0x01 << 12)
118 #define QUP_IO_MODES_OUTPUT_MODE_MSK (0x03 << 10)
119 #define QUP_IO_MODES_OUTPUT_BLOCK_MODE (0x01 << 10)
121 #define SPI_INPUT_BLOCK_SIZE 4
122 #define SPI_OUTPUT_BLOCK_SIZE 4
124 #define MAX_COUNT_SIZE 0xffff
126 #define SPI_CORE_RESET 0
127 #define SPI_CORE_RUNNING 1
160 #define DUMMY_DATA_VAL 0
161 #define TIMEOUT_CNT 100
163 #define ETIMEDOUT -10
169 #define MAX_PACKET_COUNT ((64 * KiB) - 1)
void * qup_mx_output_count
void * qup_error_flags_en
void * qup_mx_input_count
const struct blsp_spi * regs