|
31 | 31 | #define SWRM_VERSION_1_5_1 0x01050001 |
32 | 32 | #define SWRM_VERSION_1_7_0 0x01070000 |
33 | 33 | #define SWRM_VERSION_2_0_0 0x02000000 |
| 34 | +#define SWRM_VERSION_3_1_0 0x03010000 |
34 | 35 | #define SWRM_COMP_HW_VERSION 0x00 |
35 | 36 | #define SWRM_COMP_CFG_ADDR 0x04 |
36 | 37 | #define SWRM_COMP_CFG_IRQ_LEVEL_OR_PULSE_MSK BIT(1) |
|
40 | 41 | #define SWRM_COMP_PARAMS_RD_FIFO_DEPTH GENMASK(19, 15) |
41 | 42 | #define SWRM_COMP_PARAMS_DOUT_PORTS_MASK GENMASK(4, 0) |
42 | 43 | #define SWRM_COMP_PARAMS_DIN_PORTS_MASK GENMASK(9, 5) |
| 44 | +#define SWRM_V3_COMP_PARAMS_WR_FIFO_DEPTH GENMASK(17, 10) |
| 45 | +#define SWRM_V3_COMP_PARAMS_RD_FIFO_DEPTH GENMASK(23, 18) |
| 46 | + |
43 | 47 | #define SWRM_COMP_MASTER_ID 0x104 |
44 | 48 | #define SWRM_V1_3_INTERRUPT_STATUS 0x200 |
45 | 49 | #define SWRM_V2_0_INTERRUPT_STATUS 0x5000 |
@@ -296,6 +300,32 @@ static const struct qcom_swrm_data swrm_v2_0_data = { |
296 | 300 | .reg_layout = swrm_v2_0_reg_layout, |
297 | 301 | }; |
298 | 302 |
|
| 303 | +static const unsigned int swrm_v3_0_reg_layout[] = { |
| 304 | + [SWRM_REG_FRAME_GEN_ENABLED] = SWRM_V2_0_LINK_STATUS, |
| 305 | + [SWRM_REG_INTERRUPT_STATUS] = SWRM_V2_0_INTERRUPT_STATUS, |
| 306 | + [SWRM_REG_INTERRUPT_MASK_ADDR] = 0, /* Not present */ |
| 307 | + [SWRM_REG_INTERRUPT_CLEAR] = SWRM_V2_0_INTERRUPT_CLEAR, |
| 308 | + [SWRM_REG_INTERRUPT_CPU_EN] = SWRM_V2_0_INTERRUPT_CPU_EN, |
| 309 | + [SWRM_REG_CMD_FIFO_WR_CMD] = SWRM_V2_0_CMD_FIFO_WR_CMD, |
| 310 | + [SWRM_REG_CMD_FIFO_RD_CMD] = SWRM_V2_0_CMD_FIFO_RD_CMD, |
| 311 | + [SWRM_REG_CMD_FIFO_STATUS] = SWRM_V2_0_CMD_FIFO_STATUS, |
| 312 | + [SWRM_REG_CMD_FIFO_RD_FIFO_ADDR] = SWRM_V2_0_CMD_FIFO_RD_FIFO_ADDR, |
| 313 | + [SWRM_OFFSET_DP_PORT_CTRL_BANK] = 0x1224, |
| 314 | + [SWRM_OFFSET_DP_PORT_CTRL_2_BANK] = 0x1228, |
| 315 | + [SWRM_OFFSET_DP_BLOCK_CTRL_1] = 0x122c, |
| 316 | + [SWRM_OFFSET_DP_BLOCK_CTRL2_BANK] = 0x1230, |
| 317 | + [SWRM_OFFSET_DP_PORT_HCTRL_BANK] = 0x1234, |
| 318 | + [SWRM_OFFSET_DP_BLOCK_CTRL3_BANK] = 0x1238, |
| 319 | + [SWRM_OFFSET_DP_SAMPLECTRL2_BANK] = 0x123c, |
| 320 | +}; |
| 321 | + |
| 322 | +static const struct qcom_swrm_data swrm_v3_0_data = { |
| 323 | + .default_rows = 50, |
| 324 | + .default_cols = 16, |
| 325 | + .sw_clk_gate_required = true, |
| 326 | + .max_reg = SWR_V2_0_MSTR_MAX_REG_ADDR, |
| 327 | + .reg_layout = swrm_v3_0_reg_layout, |
| 328 | +}; |
299 | 329 | #define to_qcom_sdw(b) container_of(b, struct qcom_swrm_ctrl, bus) |
300 | 330 |
|
301 | 331 | static int qcom_swrm_ahb_reg_read(struct qcom_swrm_ctrl *ctrl, int reg, |
@@ -919,7 +949,11 @@ static int qcom_swrm_init(struct qcom_swrm_ctrl *ctrl) |
919 | 949 | swrm_wait_for_frame_gen_enabled(ctrl); |
920 | 950 | ctrl->slave_status = 0; |
921 | 951 | ctrl->reg_read(ctrl, SWRM_COMP_PARAMS, &val); |
922 | | - ctrl->wr_fifo_depth = FIELD_GET(SWRM_COMP_PARAMS_WR_FIFO_DEPTH, val); |
| 952 | + |
| 953 | + if (ctrl->version >= SWRM_VERSION_3_1_0) |
| 954 | + ctrl->wr_fifo_depth = FIELD_GET(SWRM_V3_COMP_PARAMS_WR_FIFO_DEPTH, val); |
| 955 | + else |
| 956 | + ctrl->wr_fifo_depth = FIELD_GET(SWRM_COMP_PARAMS_WR_FIFO_DEPTH, val); |
923 | 957 |
|
924 | 958 | return 0; |
925 | 959 | } |
@@ -1785,6 +1819,7 @@ static const struct of_device_id qcom_swrm_of_match[] = { |
1785 | 1819 | { .compatible = "qcom,soundwire-v1.6.0", .data = &swrm_v1_6_data }, |
1786 | 1820 | { .compatible = "qcom,soundwire-v1.7.0", .data = &swrm_v1_5_data }, |
1787 | 1821 | { .compatible = "qcom,soundwire-v2.0.0", .data = &swrm_v2_0_data }, |
| 1822 | + { .compatible = "qcom,soundwire-v3.1.0", .data = &swrm_v3_0_data }, |
1788 | 1823 | {/* sentinel */}, |
1789 | 1824 | }; |
1790 | 1825 |
|
|
0 commit comments