Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ properties:
- qcom,qcs8300-iris
- qcom,sm8550-iris
- qcom,sm8650-iris
- qcom,x1p42100-iris

reg:
maxItems: 1
Expand All @@ -41,13 +42,16 @@ properties:
- const: mmcx

clocks:
maxItems: 3
minItems: 3
maxItems: 4

clock-names:
minItems: 3
items:
- const: iface
- const: core
- const: vcodec0_core
- const: vcodec0_bse

firmware-name:
maxItems: 1
Expand Down Expand Up @@ -115,6 +119,23 @@ allOf:
maxItems: 1
reset-names:
maxItems: 1
- if:
properties:
compatible:
enum:
- qcom,x1p42100-iris
then:
properties:
clocks:
minItems: 4
clock-names:
minItems: 4
else:
properties:
clocks:
maxItems: 3
clock-names:
maxItems: 3

unevaluatedProperties: false

Expand Down
4 changes: 4 additions & 0 deletions arch/arm64/boot/dts/qcom/purwa-iot-som.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,10 @@
firmware-name = "qcom/x1p42100/gen71500_zap.mbn";
};

&iris {
status = "okay";
};

&pcie3 {
pinctrl-0 = <&pcie3_default>;
pinctrl-names = "default";
Expand Down
50 changes: 50 additions & 0 deletions arch/arm64/boot/dts/qcom/purwa.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
/delete-node/ &cpu_pd11;
/delete-node/ &gpu_opp_table;
/delete-node/ &gpu_speed_bin;
/delete-node/ &iris_opp_table;
/delete-node/ &pcie3_phy;
/delete-node/ &thermal_zones;
/delete-node/ &etm8;
Expand Down Expand Up @@ -167,6 +168,55 @@
compatible = "qcom,x1p42100-gpucc";
};

&iris {
compatible = "qcom,x1p42100-iris";

clocks = <&gcc GCC_VIDEO_AXI0_CLK>,
<&videocc VIDEO_CC_MVS0C_CLK>,
<&videocc VIDEO_CC_MVS0_CLK>,
<&videocc VIDEO_CC_MVS0_BSE_CLK>;
clock-names = "iface",
"core",
"vcodec0_core",
"vcodec0_bse";

operating-points-v2 = <&iris_opp_table_x1p42100>;

iris_opp_table_x1p42100: opp-table {
compatible = "operating-points-v2";

opp-210000000 {
opp-hz = /bits/ 64 <210000000 105000000>;
required-opps = <&rpmhpd_opp_low_svs_d1>,
<&rpmhpd_opp_low_svs>;
};

opp-300000000 {
opp-hz = /bits/ 64 <300000000 150000000>;
required-opps = <&rpmhpd_opp_low_svs_d1>,
<&rpmhpd_opp_svs>;
};

opp-335000000 {
opp-hz = /bits/ 64 <335000000 167500000>;
required-opps = <&rpmhpd_opp_svs>,
<&rpmhpd_opp_svs_l1>;
};

opp-424000000 {
opp-hz = /bits/ 64 <424000000 212000000>;
required-opps = <&rpmhpd_opp_svs>,
<&rpmhpd_opp_nom>;
};

opp-500000000 {
opp-hz = /bits/ 64 <500000000 250000000>;
required-opps = <&rpmhpd_opp_svs>,
<&rpmhpd_opp_turbo>;
};
};
};

/* PCIe3 has half the lanes compared to X1E80100 */
&pcie3 {
num-lanes = <4>;
Expand Down
1 change: 1 addition & 0 deletions drivers/media/platform/qcom/iris/iris_platform_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ extern const struct iris_platform_data sm8250_data;
extern const struct iris_platform_data sm8550_data;
extern const struct iris_platform_data sm8650_data;
extern const struct iris_platform_data sm8750_data;
extern const struct iris_platform_data x1p42100_data;

enum platform_clk_type {
IRIS_AXI_CLK, /* AXI0 in case of platforms with multiple AXI clocks */
Expand Down
105 changes: 105 additions & 0 deletions drivers/media/platform/qcom/iris/iris_platform_gen2.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "iris_platform_qcs8300.h"
#include "iris_platform_sm8650.h"
#include "iris_platform_sm8750.h"
#include "iris_platform_x1p42100.h"

#define VIDEO_ARCH_LX 1
#define BITRATE_MAX 245000000
Expand Down Expand Up @@ -1360,3 +1361,107 @@ const struct iris_platform_data qcs8300_data = {
.enc_op_int_buf_tbl = sm8550_enc_op_int_buf_tbl,
.enc_op_int_buf_tbl_size = ARRAY_SIZE(sm8550_enc_op_int_buf_tbl),
};

/*
* Shares most of SM8550 data except:
* - clk_tbl and opp_clk_tbl for x1p42100
* - different firmware
* - different num_vpp_pipe
*/
const struct iris_platform_data x1p42100_data = {
.get_instance = iris_hfi_gen2_get_instance,
.init_hfi_command_ops = iris_hfi_gen2_command_ops_init,
.init_hfi_response_ops = iris_hfi_gen2_response_ops_init,
.get_vpu_buffer_size = iris_vpu_buf_size,
.vpu_ops = &iris_vpu3_ops,
.set_preset_registers = iris_set_sm8550_preset_registers,
.init_cb_devs = sm8550_init_cb_devs,
.deinit_cb_devs = sm8550_deinit_cb_devs,
.icc_tbl = sm8550_icc_table,
.icc_tbl_size = ARRAY_SIZE(sm8550_icc_table),
.clk_rst_tbl = sm8550_clk_reset_table,
.clk_rst_tbl_size = ARRAY_SIZE(sm8550_clk_reset_table),
.bw_tbl_dec = sm8550_bw_table_dec,
.bw_tbl_dec_size = ARRAY_SIZE(sm8550_bw_table_dec),
.pmdomain_tbl = sm8550_pmdomain_table,
.pmdomain_tbl_size = ARRAY_SIZE(sm8550_pmdomain_table),
.opp_pd_tbl = sm8550_opp_pd_table,
.opp_pd_tbl_size = ARRAY_SIZE(sm8550_opp_pd_table),
.clk_tbl = x1p42100_clk_table,
.clk_tbl_size = ARRAY_SIZE(x1p42100_clk_table),
.opp_clk_tbl = x1p42100_opp_clk_table,
/* Upper bound of DMA address range */
.dma_mask = 0xe0000000 - 1,
.fwname = "qcom/vpu/vpu30_1v.mbn",
.pas_id = IRIS_PAS_ID,
.inst_iris_fmts = platform_fmts_sm8550_dec,
.inst_iris_fmts_size = ARRAY_SIZE(platform_fmts_sm8550_dec),
.inst_caps = &platform_inst_cap_sm8550,
.inst_fw_caps_dec = inst_fw_cap_sm8550_dec,
.inst_fw_caps_dec_size = ARRAY_SIZE(inst_fw_cap_sm8550_dec),
.inst_fw_caps_enc = inst_fw_cap_sm8550_enc,
.inst_fw_caps_enc_size = ARRAY_SIZE(inst_fw_cap_sm8550_enc),
.tz_cp_config_data = tz_cp_config_sm8550,
.tz_cp_config_data_size = ARRAY_SIZE(tz_cp_config_sm8550),
.core_arch = VIDEO_ARCH_LX,
.hw_response_timeout = HW_RESPONSE_TIMEOUT_VALUE,
.ubwc_config = &ubwc_config_sm8550,
.num_vpp_pipe = 1,
.max_session_count = 16,
.max_core_mbpf = NUM_MBS_8K * 2,
.max_core_mbps = ((7680 * 4320) / 256) * 60,
.dec_input_config_params_default =
sm8550_vdec_input_config_params_default,
.dec_input_config_params_default_size =
ARRAY_SIZE(sm8550_vdec_input_config_params_default),
.dec_input_config_params_hevc =
sm8550_vdec_input_config_param_hevc,
.dec_input_config_params_hevc_size =
ARRAY_SIZE(sm8550_vdec_input_config_param_hevc),
.dec_input_config_params_vp9 =
sm8550_vdec_input_config_param_vp9,
.dec_input_config_params_vp9_size =
ARRAY_SIZE(sm8550_vdec_input_config_param_vp9),
.dec_input_config_params_av1 =
sm8550_vdec_input_config_param_av1,
.dec_input_config_params_av1_size =
ARRAY_SIZE(sm8550_vdec_input_config_param_av1),
.dec_output_config_params =
sm8550_vdec_output_config_params,
.dec_output_config_params_size =
ARRAY_SIZE(sm8550_vdec_output_config_params),

.enc_input_config_params =
sm8550_venc_input_config_params,
.enc_input_config_params_size =
ARRAY_SIZE(sm8550_venc_input_config_params),
.enc_output_config_params =
sm8550_venc_output_config_params,
.enc_output_config_params_size =
ARRAY_SIZE(sm8550_venc_output_config_params),

.dec_input_prop = sm8550_vdec_subscribe_input_properties,
.dec_input_prop_size = ARRAY_SIZE(sm8550_vdec_subscribe_input_properties),
.dec_output_prop_avc = sm8550_vdec_subscribe_output_properties_avc,
.dec_output_prop_avc_size =
ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_avc),
.dec_output_prop_hevc = sm8550_vdec_subscribe_output_properties_hevc,
.dec_output_prop_hevc_size =
ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_hevc),
.dec_output_prop_vp9 = sm8550_vdec_subscribe_output_properties_vp9,
.dec_output_prop_vp9_size =
ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_vp9),
.dec_output_prop_av1 = sm8550_vdec_subscribe_output_properties_av1,
.dec_output_prop_av1_size =
ARRAY_SIZE(sm8550_vdec_subscribe_output_properties_av1),

.dec_ip_int_buf_tbl = sm8550_dec_ip_int_buf_tbl,
.dec_ip_int_buf_tbl_size = ARRAY_SIZE(sm8550_dec_ip_int_buf_tbl),
.dec_op_int_buf_tbl = sm8550_dec_op_int_buf_tbl,
.dec_op_int_buf_tbl_size = ARRAY_SIZE(sm8550_dec_op_int_buf_tbl),

.enc_ip_int_buf_tbl = sm8550_enc_ip_int_buf_tbl,
.enc_ip_int_buf_tbl_size = ARRAY_SIZE(sm8550_enc_ip_int_buf_tbl),
.enc_op_int_buf_tbl = sm8550_enc_op_int_buf_tbl,
.enc_op_int_buf_tbl_size = ARRAY_SIZE(sm8550_enc_op_int_buf_tbl),
};
22 changes: 22 additions & 0 deletions drivers/media/platform/qcom/iris/iris_platform_x1p42100.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/

#ifndef __IRIS_PLATFORM_X1P42100_H__
#define __IRIS_PLATFORM_X1P42100_H__

static const struct platform_clk_data x1p42100_clk_table[] = {
{IRIS_AXI_CLK, "iface" },
{IRIS_CTRL_CLK, "core" },
{IRIS_HW_CLK, "vcodec0_core" },
{IRIS_BSE_HW_CLK, "vcodec0_bse" },
};

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

#endif
4 changes: 4 additions & 0 deletions drivers/media/platform/qcom/iris/iris_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,10 @@ static const struct of_device_id iris_dt_match[] = {
.compatible = "qcom,sm8750-iris",
.data = &sm8750_data,
},
{
.compatible = "qcom,x1p42100-iris",
.data = &x1p42100_data,
},
{ },
};
MODULE_DEVICE_TABLE(of, iris_dt_match);
Expand Down
9 changes: 8 additions & 1 deletion drivers/media/platform/qcom/iris/iris_vpu_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ void iris_vpu_power_off_hw(struct iris_core *core)
{
dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN], false);
iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN]);
iris_disable_unprepare_clock(core, IRIS_BSE_HW_CLK);
iris_disable_unprepare_clock(core, IRIS_HW_AHB_CLK);
iris_disable_unprepare_clock(core, IRIS_HW_CLK);
}
Expand Down Expand Up @@ -292,12 +293,18 @@ int iris_vpu_power_on_hw(struct iris_core *core)
if (ret && ret != -ENOENT)
goto err_disable_hw_clock;

ret = iris_prepare_enable_clock(core, IRIS_BSE_HW_CLK);
if (ret && ret != -ENOENT)
goto err_disable_hw_ahb_clock;

ret = dev_pm_genpd_set_hwmode(core->pmdomain_tbl->pd_devs[IRIS_HW_POWER_DOMAIN], true);
if (ret)
goto err_disable_hw_ahb_clock;
goto err_disable_bse_hw_clock;

return 0;

err_disable_bse_hw_clock:
iris_disable_unprepare_clock(core, IRIS_BSE_HW_CLK);
err_disable_hw_ahb_clock:
iris_disable_unprepare_clock(core, IRIS_HW_AHB_CLK);
err_disable_hw_clock:
Expand Down