Skip to content

Commit 422f3a6

Browse files
Vikash Garodiagouravk-qualcomm
authored andcommitted
BACKPORT: media: iris: Move vpu register defines to common header file
Some of vpu4 register defines are common with vpu3x. Move those into the common register defines header. This is done to reuse the defines for vpu4 in subsequent patch which enables the power sequence for vpu4. Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Co-developed-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com> Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com> Signed-off-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com> Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com> Co-developed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Signed-off-by: Bryan O'Donoghue <bod@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org> Link: https://lore.kernel.org/all/20251210-knp_video-v4-4-8d11d840358a@oss.qualcomm.com/ (cherry picked from commit 2fc9b85)
1 parent 1fbfb19 commit 422f3a6

3 files changed

Lines changed: 61 additions & 85 deletions

File tree

drivers/media/platform/qcom/iris/iris_vpu3x.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,48 +11,6 @@
1111
#include "iris_vpu_common.h"
1212
#include "iris_vpu_register_defines.h"
1313

14-
#define WRAPPER_TZ_BASE_OFFS 0x000C0000
15-
#define AON_BASE_OFFS 0x000E0000
16-
#define AON_MVP_NOC_RESET 0x0001F000
17-
18-
#define WRAPPER_DEBUG_BRIDGE_LPI_CONTROL (WRAPPER_BASE_OFFS + 0x54)
19-
#define WRAPPER_DEBUG_BRIDGE_LPI_STATUS (WRAPPER_BASE_OFFS + 0x58)
20-
#define WRAPPER_IRIS_CPU_NOC_LPI_CONTROL (WRAPPER_BASE_OFFS + 0x5C)
21-
#define REQ_POWER_DOWN_PREP BIT(0)
22-
#define WRAPPER_IRIS_CPU_NOC_LPI_STATUS (WRAPPER_BASE_OFFS + 0x60)
23-
#define NOC_LPI_STATUS_DONE BIT(0) /* Indicates the NOC handshake is complete */
24-
#define NOC_LPI_STATUS_DENY BIT(1) /* Indicates the NOC handshake is denied */
25-
#define NOC_LPI_STATUS_ACTIVE BIT(2) /* Indicates the NOC is active */
26-
#define WRAPPER_CORE_CLOCK_CONFIG (WRAPPER_BASE_OFFS + 0x88)
27-
#define CORE_CLK_RUN 0x0
28-
/* VPU v3.5 */
29-
#define WRAPPER_IRIS_VCODEC_VPU_WRAPPER_SPARE_0 (WRAPPER_BASE_OFFS + 0x78)
30-
31-
#define WRAPPER_TZ_CTL_AXI_CLOCK_CONFIG (WRAPPER_TZ_BASE_OFFS + 0x14)
32-
#define CTL_AXI_CLK_HALT BIT(0)
33-
#define CTL_CLK_HALT BIT(1)
34-
35-
#define WRAPPER_TZ_QNS4PDXFIFO_RESET (WRAPPER_TZ_BASE_OFFS + 0x18)
36-
#define RESET_HIGH BIT(0)
37-
38-
#define CPU_CS_AHB_BRIDGE_SYNC_RESET (CPU_CS_BASE_OFFS + 0x160)
39-
#define CORE_BRIDGE_SW_RESET BIT(0)
40-
#define CORE_BRIDGE_HW_RESET_DISABLE BIT(1)
41-
42-
#define CPU_CS_X2RPMH (CPU_CS_BASE_OFFS + 0x168)
43-
#define MSK_SIGNAL_FROM_TENSILICA BIT(0)
44-
#define MSK_CORE_POWER_ON BIT(1)
45-
46-
#define AON_WRAPPER_MVP_NOC_RESET_REQ (AON_MVP_NOC_RESET + 0x000)
47-
#define VIDEO_NOC_RESET_REQ (BIT(0) | BIT(1))
48-
49-
#define AON_WRAPPER_MVP_NOC_RESET_ACK (AON_MVP_NOC_RESET + 0x004)
50-
51-
#define VCODEC_SS_IDLE_STATUSN (VCODEC_BASE_OFFS + 0x70)
52-
53-
#define AON_WRAPPER_MVP_NOC_LPI_CONTROL (AON_BASE_OFFS)
54-
#define AON_WRAPPER_MVP_NOC_LPI_STATUS (AON_BASE_OFFS + 0x4)
55-
5614
#define AON_WRAPPER_MVP_NOC_CORE_SW_RESET (AON_BASE_OFFS + 0x18)
5715
#define SW_RESET BIT(0)
5816
#define AON_WRAPPER_MVP_NOC_CORE_CLK_CONTROL (AON_BASE_OFFS + 0x20)

drivers/media/platform/qcom/iris/iris_vpu_common.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@
1111
#include "iris_vpu_common.h"
1212
#include "iris_vpu_register_defines.h"
1313

14-
#define WRAPPER_TZ_BASE_OFFS 0x000C0000
15-
#define AON_BASE_OFFS 0x000E0000
16-
17-
#define CPU_IC_BASE_OFFS (CPU_BASE_OFFS)
18-
19-
#define CPU_CS_A2HSOFTINTCLR (CPU_CS_BASE_OFFS + 0x1C)
20-
#define CLEAR_XTENSA2HOST_INTR BIT(0)
2114

2215
#define CTRL_INIT (CPU_CS_BASE_OFFS + 0x48)
2316
#define CTRL_STATUS (CPU_CS_BASE_OFFS + 0x4C)
@@ -35,42 +28,6 @@
3528
#define UC_REGION_ADDR (CPU_CS_BASE_OFFS + 0x64)
3629
#define UC_REGION_SIZE (CPU_CS_BASE_OFFS + 0x68)
3730

38-
#define CPU_CS_H2XSOFTINTEN (CPU_CS_BASE_OFFS + 0x148)
39-
#define HOST2XTENSA_INTR_ENABLE BIT(0)
40-
41-
#define CPU_CS_X2RPMH (CPU_CS_BASE_OFFS + 0x168)
42-
#define MSK_SIGNAL_FROM_TENSILICA BIT(0)
43-
#define MSK_CORE_POWER_ON BIT(1)
44-
45-
#define CPU_IC_SOFTINT (CPU_IC_BASE_OFFS + 0x150)
46-
#define CPU_IC_SOFTINT_H2A_SHFT 0x0
47-
48-
#define WRAPPER_INTR_STATUS (WRAPPER_BASE_OFFS + 0x0C)
49-
#define WRAPPER_INTR_STATUS_A2HWD_BMSK BIT(3)
50-
#define WRAPPER_INTR_STATUS_A2H_BMSK BIT(2)
51-
52-
#define WRAPPER_INTR_MASK (WRAPPER_BASE_OFFS + 0x10)
53-
#define WRAPPER_INTR_MASK_A2HWD_BMSK BIT(3)
54-
#define WRAPPER_INTR_MASK_A2HCPU_BMSK BIT(2)
55-
56-
#define WRAPPER_DEBUG_BRIDGE_LPI_CONTROL (WRAPPER_BASE_OFFS + 0x54)
57-
#define WRAPPER_DEBUG_BRIDGE_LPI_STATUS (WRAPPER_BASE_OFFS + 0x58)
58-
#define WRAPPER_IRIS_CPU_NOC_LPI_CONTROL (WRAPPER_BASE_OFFS + 0x5C)
59-
#define WRAPPER_IRIS_CPU_NOC_LPI_STATUS (WRAPPER_BASE_OFFS + 0x60)
60-
61-
#define WRAPPER_TZ_CPU_STATUS (WRAPPER_TZ_BASE_OFFS + 0x10)
62-
#define WRAPPER_TZ_CTL_AXI_CLOCK_CONFIG (WRAPPER_TZ_BASE_OFFS + 0x14)
63-
#define CTL_AXI_CLK_HALT BIT(0)
64-
#define CTL_CLK_HALT BIT(1)
65-
66-
#define WRAPPER_TZ_QNS4PDXFIFO_RESET (WRAPPER_TZ_BASE_OFFS + 0x18)
67-
#define RESET_HIGH BIT(0)
68-
69-
#define AON_WRAPPER_MVP_NOC_LPI_CONTROL (AON_BASE_OFFS)
70-
#define REQ_POWER_DOWN_PREP BIT(0)
71-
72-
#define AON_WRAPPER_MVP_NOC_LPI_STATUS (AON_BASE_OFFS + 0x4)
73-
7431
static void iris_vpu_interrupt_init(struct iris_core *core)
7532
{
7633
u32 mask_val;

drivers/media/platform/qcom/iris/iris_vpu_register_defines.h

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,72 @@
77
#define __IRIS_VPU_REGISTER_DEFINES_H__
88

99
#define VCODEC_BASE_OFFS 0x00000000
10+
#define AON_MVP_NOC_RESET 0x0001F000
1011
#define CPU_BASE_OFFS 0x000A0000
1112
#define WRAPPER_BASE_OFFS 0x000B0000
13+
#define WRAPPER_TZ_BASE_OFFS 0x000C0000
14+
#define AON_BASE_OFFS 0x000E0000
15+
16+
#define VCODEC_SS_IDLE_STATUSN (VCODEC_BASE_OFFS + 0x70)
17+
18+
#define AON_WRAPPER_MVP_NOC_RESET_REQ (AON_MVP_NOC_RESET + 0x000)
19+
#define VIDEO_NOC_RESET_REQ (BIT(0) | BIT(1))
20+
21+
#define AON_WRAPPER_MVP_NOC_RESET_ACK (AON_MVP_NOC_RESET + 0x004)
1222

1323
#define CPU_CS_BASE_OFFS (CPU_BASE_OFFS)
24+
#define CPU_IC_BASE_OFFS (CPU_BASE_OFFS)
25+
26+
#define CPU_CS_A2HSOFTINTCLR (CPU_CS_BASE_OFFS + 0x1C)
27+
#define CLEAR_XTENSA2HOST_INTR BIT(0)
28+
29+
#define CPU_CS_H2XSOFTINTEN (CPU_CS_BASE_OFFS + 0x148)
30+
#define HOST2XTENSA_INTR_ENABLE BIT(0)
31+
32+
#define CPU_IC_SOFTINT (CPU_IC_BASE_OFFS + 0x150)
33+
#define CPU_IC_SOFTINT_H2A_SHFT 0x0
34+
35+
#define CPU_CS_AHB_BRIDGE_SYNC_RESET (CPU_CS_BASE_OFFS + 0x160)
36+
#define CORE_BRIDGE_SW_RESET BIT(0)
37+
#define CORE_BRIDGE_HW_RESET_DISABLE BIT(1)
38+
39+
#define CPU_CS_X2RPMH (CPU_CS_BASE_OFFS + 0x168)
40+
#define MSK_SIGNAL_FROM_TENSILICA BIT(0)
41+
#define MSK_CORE_POWER_ON BIT(1)
1442

43+
#define WRAPPER_INTR_STATUS (WRAPPER_BASE_OFFS + 0x0C)
44+
#define WRAPPER_INTR_STATUS_A2HWD_BMSK BIT(3)
45+
#define WRAPPER_INTR_STATUS_A2H_BMSK BIT(2)
46+
47+
#define WRAPPER_INTR_MASK (WRAPPER_BASE_OFFS + 0x10)
48+
#define WRAPPER_INTR_MASK_A2HWD_BMSK BIT(3)
49+
#define WRAPPER_INTR_MASK_A2HCPU_BMSK BIT(2)
50+
51+
#define WRAPPER_DEBUG_BRIDGE_LPI_CONTROL (WRAPPER_BASE_OFFS + 0x54)
52+
#define WRAPPER_DEBUG_BRIDGE_LPI_STATUS (WRAPPER_BASE_OFFS + 0x58)
53+
#define WRAPPER_IRIS_CPU_NOC_LPI_CONTROL (WRAPPER_BASE_OFFS + 0x5C)
54+
#define REQ_POWER_DOWN_PREP BIT(0)
55+
56+
#define WRAPPER_IRIS_CPU_NOC_LPI_STATUS (WRAPPER_BASE_OFFS + 0x60)
57+
#define NOC_LPI_STATUS_DONE BIT(0) /* Indicates the NOC handshake is complete */
58+
#define NOC_LPI_STATUS_DENY BIT(1) /* Indicates the NOC handshake is denied */
59+
#define NOC_LPI_STATUS_ACTIVE BIT(2) /* Indicates the NOC is active */
60+
61+
#define WRAPPER_IRIS_VCODEC_VPU_WRAPPER_SPARE_0 (WRAPPER_BASE_OFFS + 0x78)
1562
#define WRAPPER_CORE_POWER_STATUS (WRAPPER_BASE_OFFS + 0x80)
63+
#define WRAPPER_CORE_CLOCK_CONFIG (WRAPPER_BASE_OFFS + 0x88)
64+
#define CORE_CLK_RUN 0x0
65+
66+
#define WRAPPER_TZ_CPU_STATUS (WRAPPER_TZ_BASE_OFFS + 0x10)
67+
68+
#define WRAPPER_TZ_CTL_AXI_CLOCK_CONFIG (WRAPPER_TZ_BASE_OFFS + 0x14)
69+
#define CTL_AXI_CLK_HALT BIT(0)
70+
#define CTL_CLK_HALT BIT(1)
71+
72+
#define WRAPPER_TZ_QNS4PDXFIFO_RESET (WRAPPER_TZ_BASE_OFFS + 0x18)
73+
#define RESET_HIGH BIT(0)
74+
75+
#define AON_WRAPPER_MVP_NOC_LPI_CONTROL (AON_BASE_OFFS)
76+
#define AON_WRAPPER_MVP_NOC_LPI_STATUS (AON_BASE_OFFS + 0x4)
1677

1778
#endif

0 commit comments

Comments
 (0)