Skip to content

Commit 57c3b9f

Browse files
AngeloGioacchino Del Regnomchehab
authored andcommitted
media: venus: core: Add sdm660 DT compatible and resource struct
Add the SDM660 DT compatible and its resource structure in order to support the Venus IP in SDM630, SDM636, SDM660 and SDA variants. This SoC features Venus 4.4 (HFI3XX) with only one subcore, used for both encoding and decoding, and switched on with one main and one subcore dedicated GDSC. Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Stanimir Varbanov <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 96fbc6c commit 57c3b9f

File tree

1 file changed

+64
-0
lines changed
  • drivers/media/platform/qcom/venus

1 file changed

+64
-0
lines changed

drivers/media/platform/qcom/venus/core.c

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,69 @@ static const struct venus_resources msm8996_res = {
568568
.fwname = "qcom/venus-4.2/venus.mdt",
569569
};
570570

571+
static const struct freq_tbl sdm660_freq_table[] = {
572+
{ 979200, 518400000 },
573+
{ 489600, 441600000 },
574+
{ 432000, 404000000 },
575+
{ 244800, 320000000 },
576+
{ 216000, 269330000 },
577+
{ 108000, 133330000 },
578+
};
579+
580+
static const struct reg_val sdm660_reg_preset[] = {
581+
{ 0x80010, 0x001f001f },
582+
{ 0x80018, 0x00000156 },
583+
{ 0x8001c, 0x00000156 },
584+
};
585+
586+
static const struct bw_tbl sdm660_bw_table_enc[] = {
587+
{ 979200, 1044000, 0, 2446336, 0 }, /* 4k UHD @ 30 */
588+
{ 864000, 887000, 0, 2108416, 0 }, /* 720p @ 240 */
589+
{ 489600, 666000, 0, 1207296, 0 }, /* 1080p @ 60 */
590+
{ 432000, 578000, 0, 1058816, 0 }, /* 720p @ 120 */
591+
{ 244800, 346000, 0, 616448, 0 }, /* 1080p @ 30 */
592+
{ 216000, 293000, 0, 534528, 0 }, /* 720p @ 60 */
593+
{ 108000, 151000, 0, 271360, 0 }, /* 720p @ 30 */
594+
};
595+
596+
static const struct bw_tbl sdm660_bw_table_dec[] = {
597+
{ 979200, 2365000, 0, 1892000, 0 }, /* 4k UHD @ 30 */
598+
{ 864000, 1978000, 0, 1554000, 0 }, /* 720p @ 240 */
599+
{ 489600, 1133000, 0, 895000, 0 }, /* 1080p @ 60 */
600+
{ 432000, 994000, 0, 781000, 0 }, /* 720p @ 120 */
601+
{ 244800, 580000, 0, 460000, 0 }, /* 1080p @ 30 */
602+
{ 216000, 501000, 0, 301000, 0 }, /* 720p @ 60 */
603+
{ 108000, 255000, 0, 202000, 0 }, /* 720p @ 30 */
604+
};
605+
606+
static const struct venus_resources sdm660_res = {
607+
.freq_tbl = sdm660_freq_table,
608+
.freq_tbl_size = ARRAY_SIZE(sdm660_freq_table),
609+
.reg_tbl = sdm660_reg_preset,
610+
.reg_tbl_size = ARRAY_SIZE(sdm660_reg_preset),
611+
.bw_tbl_enc = sdm660_bw_table_enc,
612+
.bw_tbl_enc_size = ARRAY_SIZE(sdm660_bw_table_enc),
613+
.bw_tbl_dec = sdm660_bw_table_dec,
614+
.bw_tbl_dec_size = ARRAY_SIZE(sdm660_bw_table_dec),
615+
.clks = {"core", "iface", "bus", "bus_throttle" },
616+
.clks_num = 4,
617+
.vcodec0_clks = { "vcodec0_core" },
618+
.vcodec1_clks = { "vcodec0_core" },
619+
.vcodec_clks_num = 1,
620+
.vcodec_num = 1,
621+
.max_load = 1036800,
622+
.hfi_version = HFI_VERSION_3XX,
623+
.vmem_id = VIDC_RESOURCE_NONE,
624+
.vmem_size = 0,
625+
.vmem_addr = 0,
626+
.cp_start = 0,
627+
.cp_size = 0x79000000,
628+
.cp_nonpixel_start = 0x1000000,
629+
.cp_nonpixel_size = 0x28000000,
630+
.dma_mask = 0xd9000000 - 1,
631+
.fwname = "qcom/venus-4.4/venus.mdt",
632+
};
633+
571634
static const struct freq_tbl sdm845_freq_table[] = {
572635
{ 3110400, 533000000 }, /* 4096x2160@90 */
573636
{ 2073600, 444000000 }, /* 4096x2160@60 */
@@ -793,6 +856,7 @@ static const struct venus_resources sc7280_res = {
793856
static const struct of_device_id venus_dt_match[] = {
794857
{ .compatible = "qcom,msm8916-venus", .data = &msm8916_res, },
795858
{ .compatible = "qcom,msm8996-venus", .data = &msm8996_res, },
859+
{ .compatible = "qcom,sdm660-venus", .data = &sdm660_res, },
796860
{ .compatible = "qcom,sdm845-venus", .data = &sdm845_res, },
797861
{ .compatible = "qcom,sdm845-venus-v2", .data = &sdm845_res_v2, },
798862
{ .compatible = "qcom,sc7180-venus", .data = &sc7180_res, },

0 commit comments

Comments
 (0)