3 #ifndef __SOC_COMMON_QCOM_QUP_SE_H__
4 #define __SOC_COMMON_QCOM_QUP_SE_H__
9 #include <soc/addressmap.h>
13 #define QC_GENMASK(h, l) (BIT(h + 1) - BIT(l))
16 #define DEFAULT_IO_OUTPUT_CTRL_MSK QC_GENMASK(6, 0)
19 #define FORCE_DEFAULT BIT(0)
21 #define GENI_FW_REVISION_RO_PROTOCOL_MASK 0x0000FF00
22 #define GENI_FW_REVISION_RO_PROTOCOL_SHIFT 0x00000008
25 #define CFG_AHB_CLK_CGC_ON BIT(0)
26 #define CFG_AHB_WR_ACLK_CGC_ON BIT(1)
27 #define DATA_AHB_CLK_CGC_ON BIT(2)
28 #define SCLK_CGC_ON BIT(3)
29 #define TX_CLK_CGC_ON BIT(4)
30 #define RX_CLK_CGC_ON BIT(5)
31 #define EXT_CLK_CGC_ON BIT(6)
32 #define PROG_RAM_HCLK_OFF BIT(8)
33 #define PROG_RAM_SCLK_OFF BIT(9)
34 #define DEFAULT_CGC_EN (CFG_AHB_CLK_CGC_ON | CFG_AHB_WR_ACLK_CGC_ON \
35 | DATA_AHB_CLK_CGC_ON | SCLK_CGC_ON \
36 | TX_CLK_CGC_ON | RX_CLK_CGC_ON | EXT_CLK_CGC_ON)
39 #define SER_CLK_EN BIT(0)
40 #define CLK_DIV_SHFT 4
41 #define CLK_DIV_MSK (0xFFF << CLK_DIV_SHFT)
44 #define FIFO_IF_DISABLE BIT(0)
47 #define FW_REV_PROTOCOL_MSK QC_GENMASK(15, 8)
48 #define FW_REV_PROTOCOL_SHFT 8
49 #define FW_REV_VERSION_SHFT 0
52 #define CLK_SEL_MSK QC_GENMASK(2, 0)
55 #define GENI_DMA_MODE_EN BIT(0)
58 #define M_OPCODE_MSK QC_GENMASK(31, 27)
59 #define M_OPCODE_SHFT 27
60 #define M_PARAMS_MSK QC_GENMASK(26, 0)
63 #define M_GENI_CMD_CANCEL BIT(2)
64 #define M_GENI_CMD_ABORT BIT(1)
65 #define M_GENI_DISABLE BIT(0)
68 #define S_OPCODE_MSK QC_GENMASK(31, 27)
69 #define S_OPCODE_SHFT 27
70 #define S_PARAMS_MSK QC_GENMASK(26, 0)
73 #define S_GENI_CMD_CANCEL BIT(2)
74 #define S_GENI_CMD_ABORT BIT(1)
75 #define S_GENI_DISABLE BIT(0)
78 #define M_CMD_DONE_EN BIT(0)
79 #define M_CMD_OVERRUN_EN BIT(1)
80 #define M_ILLEGAL_CMD_EN BIT(2)
81 #define M_CMD_FAILURE_EN BIT(3)
82 #define M_CMD_CANCEL_EN BIT(4)
83 #define M_CMD_ABORT_EN BIT(5)
84 #define M_TIMESTAMP_EN BIT(6)
85 #define M_RX_IRQ_EN BIT(7)
86 #define M_GP_SYNC_IRQ_0_EN BIT(8)
87 #define M_GP_IRQ_0_EN BIT(9)
88 #define M_GP_IRQ_1_EN BIT(10)
89 #define M_GP_IRQ_2_EN BIT(11)
90 #define M_GP_IRQ_3_EN BIT(12)
91 #define M_GP_IRQ_4_EN BIT(13)
92 #define M_GP_IRQ_5_EN BIT(14)
93 #define M_IO_DATA_DEASSERT_EN BIT(22)
94 #define M_IO_DATA_ASSERT_EN BIT(23)
95 #define M_RX_FIFO_RD_ERR_EN BIT(24)
96 #define M_RX_FIFO_WR_ERR_EN BIT(25)
97 #define M_RX_FIFO_WATERMARK_EN BIT(26)
98 #define M_RX_FIFO_LAST_EN BIT(27)
99 #define M_TX_FIFO_RD_ERR_EN BIT(28)
100 #define M_TX_FIFO_WR_ERR_EN BIT(29)
101 #define M_TX_FIFO_WATERMARK_EN BIT(30)
102 #define M_SEC_IRQ_EN BIT(31)
103 #define M_COMMON_GENI_M_IRQ_EN (QC_GENMASK(6, 1) | \
104 M_IO_DATA_DEASSERT_EN | \
105 M_IO_DATA_ASSERT_EN | M_RX_FIFO_RD_ERR_EN | \
106 M_RX_FIFO_WR_ERR_EN | M_TX_FIFO_RD_ERR_EN | \
110 #define S_CMD_DONE_EN BIT(0)
111 #define S_CMD_OVERRUN_EN BIT(1)
112 #define S_ILLEGAL_CMD_EN BIT(2)
113 #define S_CMD_FAILURE_EN BIT(3)
114 #define S_CMD_CANCEL_EN BIT(4)
115 #define S_CMD_ABORT_EN BIT(5)
116 #define S_GP_SYNC_IRQ_0_EN BIT(8)
117 #define S_GP_IRQ_0_EN BIT(9)
118 #define S_GP_IRQ_1_EN BIT(10)
119 #define S_GP_IRQ_2_EN BIT(11)
120 #define S_GP_IRQ_3_EN BIT(12)
121 #define S_GP_IRQ_4_EN BIT(13)
122 #define S_GP_IRQ_5_EN BIT(14)
123 #define S_IO_DATA_DEASSERT_EN BIT(22)
124 #define S_IO_DATA_ASSERT_EN BIT(23)
125 #define S_RX_FIFO_RD_ERR_EN BIT(24)
126 #define S_RX_FIFO_WR_ERR_EN BIT(25)
127 #define S_RX_FIFO_WATERMARK_EN BIT(26)
128 #define S_RX_FIFO_LAST_EN BIT(27)
129 #define S_COMMON_GENI_S_IRQ_EN (QC_GENMASK(5, 1) | QC_GENMASK(13, 9) | \
130 S_RX_FIFO_RD_ERR_EN | S_RX_FIFO_WR_ERR_EN)
133 #define WATERMARK_MSK QC_GENMASK(5, 0)
136 #define TX_FIFO_WC QC_GENMASK(27, 0)
139 #define RX_LAST BIT(31)
140 #define RX_LAST_BYTE_VALID_MSK QC_GENMASK(30, 28)
141 #define RX_LAST_BYTE_VALID_SHFT 28
142 #define RX_FIFO_WC_MSK QC_GENMASK(24, 0)
145 #define DMA_RX_IRQ_EN BIT(0)
146 #define DMA_TX_IRQ_EN BIT(1)
147 #define GENI_M_IRQ_EN BIT(2)
148 #define GENI_S_IRQ_EN BIT(3)
151 #define DMA_RX_CLK_CGC_ON BIT(0)
152 #define DMA_TX_CLK_CGC_ON BIT(1)
153 #define DMA_AHB_SLV_CFG_ON BIT(2)
154 #define AHB_SEC_SLV_CLK_CGC_ON BIT(3)
155 #define DUMMY_RX_NON_BUFFERABLE BIT(4)
156 #define RX_DMA_ZERO_PADDING_EN BIT(5)
157 #define RX_DMA_IRQ_DELAY_MSK QC_GENMASK(8, 6)
158 #define RX_DMA_IRQ_DELAY_SHFT 6
160 #define DEFAULT_SE_CLK (19200 * KHz)
161 #define GENI_DFS_IF_CFG_DFS_IF_EN_BMSK BIT(0)
164 #define BYTES_PER_FIFO_WORD 4
165 #define FIFO_WIDTH 32
166 #define FIFO_DEPTH 16
167 #define BITS_PER_WORD 8
168 #define TX_WATERMARK 1
179 #define PACK_VECTOR0 0x0FE
181 #define PACK_VECTOR1 0x1FE
183 #define PACK_VECTOR2 0x2FE
185 #define PACK_VECTOR3 0x3FF
u32 qup_wait_for_s_irq(unsigned int bus)
void qup_m_cancel_and_abort(unsigned int bus)
check_member(qup_regs, geni_clk_sel, 0x7C)
u32 qup_wait_for_m_irq(unsigned int bus)
int qup_handle_transfer(unsigned int bus, const void *dout, void *din, int size, struct stopwatch *timeout)
void qup_s_cancel_and_abort(unsigned int bus)
u8 _reserved9[0x4C000 - 0xF408]
u8 _reserved2[0x14 - 0x10]
u8 _reserved3[0x18 - 0x14]
u32 ee_n_gsi_ee_generic_cmd
u32 gsi_ee_n_scratch_0_addr
u8 _reserved4[0x60 - 0x20]
u32 gsi_ee_n_scratch_1_addr
u8 _reserved8[0xF400 - 0xF01C]
u8 _reserved5[0x80 - 0x64]
u32 gsi_manager_mcs_code_ver
u8 _reserved6[0xB000 - 0x84]
u8 _reserved7[0xF018 - 0xB004]
u32 geni_fw_multilock_sp_ro
u8 _reserved2[0x20 - 0x18]
u8 _reserved19[0xA80 - 0xA04]
u8 _reserved12[0x780 - 0x704]
u32 geni_byte_granularity
u8 _reserved4[0x60 - 0x54]
u8 _reserved25[0x10-0x08]
u8 _reserved26[0x2000 - 0x1014]
u8 _reserved6[0x200 - 0x14C]
u8 _reserved11[0x700 - 0x654]
u8 _reserved22[0xE14 - 0xD64]
u32 geni_tx_watermark_reg
u32 geni_hw_irq_cmd_param_0
u32 geni_fw_multilock_protns_ro
u8 _reserved3[0x40 - 0x34]
u32 geni_s_init_cfg_revision
u32 geni_init_cfg_revision
u8 _reserved5[0x100 - 0x084]
u32 geni_i3c_ibi_search_data
u8 _reserved20[0xC30 - 0xA98]
u8 _reserved18[0xA00 - 0x934]
u8 _reserved14[0x900 - 0x818]
u8 _reserved21[0xD30 - 0xC60]
u32 geni_prog_rom_ctrl_reg
u32 i2c_noise_cancellation_ctl
u32 geni_m_cmd_err_status
u8 _reserved16[0x920 - 0x918]
u8 _reserved8[0x10 - 0x08]
u32 se_geni_fw_multilock_protns
u8 _reserved13[0x800 - 0x784]
u32 geni_s_fw_revision_ro
u32 geni_i3c_ibi_search_pattern
u32 geni_force_default_reg
u8 _reserved10[0x40 - 0x38]
u32 dma_rx_max_burst_size
u32 geni_i3c_sw_ibi_en_recover
u8 _reserved1[0x10 - 0x08]
u8 _reserved7[0x600 - 0x2BC]
u32 geni_rx_rfr_watermark_reg
u8 _reserved17[0x930 - 0x928]
u8 _reserved24[0x1000 - 0x0E4C]
u32 geni_hw_irq_ignore_on_active
u32 uart_tx_trans_cfg_reg
u8 _reserved23[0x40 - 0x34]
u32 geni_fw_multilock_msa_ro
u8 _reserved9[0x30 - 0x2C]
u32 geni_i3c_ibi_cfg_tablen
u32 dma_tx_max_burst_size
u8 _reserved15[0x908 - 0x904]
u32 se_geni_fw_multilock_sp
u32 geni_tx_fifo_threshold
u32 geni_rx_watermark_reg
u32 se_geni_fw_multilock_msa