summaryrefslogtreecommitdiff
path: root/drivers/media/platform/qcom/iris/iris_platform_vpu_ar50lt.c
blob: 43460b82ae77abe1b90ae057fb3145a53b306801 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include "iris_core.h"
#include "iris_ctrls.h"
#include "iris_hfi_gen2.h"
#include "iris_hfi_gen2_defines.h"
#include "iris_platform_common.h"
#include "iris_vpu_buffer.h"
#include "iris_vpu_common.h"

#define WRAPPER_INTR_STATUS_A2HWD_BMSK		0x10

static const struct iris_firmware_desc iris_vpu_ar50lt_p1_gen1_s6_desc = {
	.firmware_data = &iris_hfi_gen1_ar50lt_data,
	.get_vpu_buffer_size = iris_vpu_ar50lt_gen1_buf_size,
	.fwname = "qcom/venus-6.0/venus.mbn",
};

static const struct iris_firmware_desc iris_vpu_ar50lt_p1_gen2_s6_desc = {
	.firmware_data = &iris_hfi_gen2_ar50lt_data,
	.get_vpu_buffer_size = iris_vpu_ar50lt_gen2_buf_size,
	.fwname = "qcom/vpu/ar50lt_p1_gen2_s6.mbn",
};

static const u32 iris_fmts_ar50lt_dec[] = {
	V4L2_PIX_FMT_H264,
	V4L2_PIX_FMT_HEVC,
	V4L2_PIX_FMT_VP9,
};

static const struct bw_info iris_bw_table_dec_ar50lt[] = {
	{ ((1920 * 1080) / 256) * 60, 1564000, },
	{ ((1920 * 1080) / 256) * 30,  791000, },
	{ ((1280 * 720) / 256) * 60,   688000, },
	{ ((1280 * 720) / 256) * 30,   347000, },
};

static const struct icc_info iris_icc_info_ar50lt[] = {
	{ "cpu-cfg",    1000, 1000     },
	{ "video-mem",  1000, 6500000  },
};

static const char * const iris_pmdomain_table_ar50lt[] = { "venus", "vcodec0" };

static const char * const iris_opp_pd_table_ar50lt[] = { "cx" };

static const struct platform_clk_data iris_clk_table_ar50lt[] = {
	{IRIS_CTRL_CLK,    "core"         },
	{IRIS_AXI_CLK,     "iface"        },
	{IRIS_AHB_CLK,     "bus"          },
	{IRIS_HW_CLK,      "vcodec0_core" },
	{IRIS_HW_AHB_CLK,  "vcodec0_bus"  },
	{IRIS_THROTTLE_CLK, "throttle"    },
};

static const char * const iris_opp_clk_table_ar50lt[] = {
	"vcodec0_core",
	NULL,
};

static const struct tz_cp_config tz_cp_config_ar50lt[] = {
	{
		.cp_start = 0,
		.cp_size = 0x25800000,
		.cp_nonpixel_start = 0x01000000,
		.cp_nonpixel_size = 0x24800000,
	},
};

static struct platform_inst_caps platform_inst_cap_ar50lt = {
	.min_frame_width = 128,
	.max_frame_width = 1920,
	.min_frame_height = 128,
	.max_frame_height = 1920,
	.max_mbpf = (1920 * 1088) / 256,
	.mb_cycles_vpp = 440,
	.mb_cycles_fw = 733003,
	.mb_cycles_fw_vpp = 225975,
	.max_frame_rate = 120,
	.max_operating_rate = 120,
};

const struct iris_platform_data qcm2290_data = {
	.firmware_desc_gen1 = &iris_vpu_ar50lt_p1_gen1_s6_desc,
	.firmware_desc_gen2 = &iris_vpu_ar50lt_p1_gen2_s6_desc,
	.vpu_ops = &iris_vpu_ar50lt_ops,
	.icc_tbl = iris_icc_info_ar50lt,
	.icc_tbl_size = ARRAY_SIZE(iris_icc_info_ar50lt),
	.bw_tbl_dec = iris_bw_table_dec_ar50lt,
	.bw_tbl_dec_size = ARRAY_SIZE(iris_bw_table_dec_ar50lt),
	.pmdomain_tbl = iris_pmdomain_table_ar50lt,
	.pmdomain_tbl_size = ARRAY_SIZE(iris_pmdomain_table_ar50lt),
	.opp_pd_tbl = iris_opp_pd_table_ar50lt,
	.opp_pd_tbl_size = ARRAY_SIZE(iris_opp_pd_table_ar50lt),
	.clk_tbl = iris_clk_table_ar50lt,
	.clk_tbl_size = ARRAY_SIZE(iris_clk_table_ar50lt),
	.opp_clk_tbl = iris_opp_clk_table_ar50lt,
	/* Upper bound of DMA address range */
	.dma_mask = 0xe0000000 - 1,
	.inst_iris_fmts = iris_fmts_ar50lt_dec,
	.inst_iris_fmts_size = ARRAY_SIZE(iris_fmts_ar50lt_dec),
	.inst_caps = &platform_inst_cap_ar50lt,
	.slice_caps = &iris_ar50lt_slice_caps,
	.tz_cp_config_data = tz_cp_config_ar50lt,
	.tz_cp_config_data_size = ARRAY_SIZE(tz_cp_config_ar50lt),
	.num_vpp_pipe = 1,
	.no_rpmh = true,
	.wd_intr_mask = WRAPPER_INTR_STATUS_A2HWD_BMSK,
	.icc_ib_multiplier = 2,
	.max_session_count = 8,
	.max_core_mbpf = ((1920 * 1088) / 256) * 4,
	/* Concurrency: 1080p@30 decode + 1080p@30 encode */
	/* Concurrency: 3 * 1080p@30 decode */
	.max_core_mbps = (((1920 * 1088) / 256) * 90),
};