Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: platform: qcom/iris: add sm8650 support

Add support for the SM8650 platform by re-using the SM8550
definitions and using the vpu33 ops.

Move the Sm8650 reset tables that differs in a per-SoC platform
header, that will contain mode SoC specific data when
more codecs are introduced.

The SM8650/vpu33 requires more reset lines, but the H.264
decoder capabilities are identical.

Tested-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> # x1e Dell
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>

authored by

Neil Armstrong and committed by
Hans Verkuil
cae67e94 dc40021c

+80
+1
drivers/media/platform/qcom/iris/iris_platform_common.h
··· 35 35 36 36 extern struct iris_platform_data sm8250_data; 37 37 extern struct iris_platform_data sm8550_data; 38 + extern struct iris_platform_data sm8650_data; 38 39 39 40 enum platform_clk_type { 40 41 IRIS_AXI_CLK,
+62
drivers/media/platform/qcom/iris/iris_platform_gen2.c
··· 10 10 #include "iris_platform_common.h" 11 11 #include "iris_vpu_common.h" 12 12 13 + #include "iris_platform_sm8650.h" 14 + 13 15 #define VIDEO_ARCH_LX 1 14 16 15 17 static struct platform_inst_fw_cap inst_fw_cap_sm8550[] = { ··· 237 235 /* Upper bound of DMA address range */ 238 236 .dma_mask = 0xe0000000 - 1, 239 237 .fwname = "qcom/vpu/vpu30_p4.mbn", 238 + .pas_id = IRIS_PAS_ID, 239 + .inst_caps = &platform_inst_cap_sm8550, 240 + .inst_fw_caps = inst_fw_cap_sm8550, 241 + .inst_fw_caps_size = ARRAY_SIZE(inst_fw_cap_sm8550), 242 + .tz_cp_config_data = &tz_cp_config_sm8550, 243 + .core_arch = VIDEO_ARCH_LX, 244 + .hw_response_timeout = HW_RESPONSE_TIMEOUT_VALUE, 245 + .ubwc_config = &ubwc_config_sm8550, 246 + .num_vpp_pipe = 4, 247 + .max_session_count = 16, 248 + .max_core_mbpf = ((8192 * 4352) / 256) * 2, 249 + .input_config_params = 250 + sm8550_vdec_input_config_params, 251 + .input_config_params_size = 252 + ARRAY_SIZE(sm8550_vdec_input_config_params), 253 + .output_config_params = 254 + sm8550_vdec_output_config_params, 255 + .output_config_params_size = 256 + ARRAY_SIZE(sm8550_vdec_output_config_params), 257 + .dec_input_prop = sm8550_vdec_subscribe_input_properties, 258 + .dec_input_prop_size = ARRAY_SIZE(sm8550_vdec_subscribe_input_properties), 259 + .dec_output_prop = sm8550_vdec_subscribe_output_properties, 260 + .dec_output_prop_size = ARRAY_SIZE(sm8550_vdec_subscribe_output_properties), 261 + 262 + .dec_ip_int_buf_tbl = sm8550_dec_ip_int_buf_tbl, 263 + .dec_ip_int_buf_tbl_size = ARRAY_SIZE(sm8550_dec_ip_int_buf_tbl), 264 + .dec_op_int_buf_tbl = sm8550_dec_op_int_buf_tbl, 265 + .dec_op_int_buf_tbl_size = ARRAY_SIZE(sm8550_dec_op_int_buf_tbl), 266 + }; 267 + 268 + /* 269 + * Shares most of SM8550 data except: 270 + * - vpu_ops to iris_vpu33_ops 271 + * - clk_rst_tbl to sm8650_clk_reset_table 272 + * - controller_rst_tbl to sm8650_controller_reset_table 273 + * - fwname to "qcom/vpu/vpu33_p4.mbn" 274 + */ 275 + struct iris_platform_data sm8650_data = { 276 + .get_instance = iris_hfi_gen2_get_instance, 277 + .init_hfi_command_ops = iris_hfi_gen2_command_ops_init, 278 + .init_hfi_response_ops = iris_hfi_gen2_response_ops_init, 279 + .vpu_ops = &iris_vpu33_ops, 280 + .set_preset_registers = iris_set_sm8550_preset_registers, 281 + .icc_tbl = sm8550_icc_table, 282 + .icc_tbl_size = ARRAY_SIZE(sm8550_icc_table), 283 + .clk_rst_tbl = sm8650_clk_reset_table, 284 + .clk_rst_tbl_size = ARRAY_SIZE(sm8650_clk_reset_table), 285 + .controller_rst_tbl = sm8650_controller_reset_table, 286 + .controller_rst_tbl_size = ARRAY_SIZE(sm8650_controller_reset_table), 287 + .bw_tbl_dec = sm8550_bw_table_dec, 288 + .bw_tbl_dec_size = ARRAY_SIZE(sm8550_bw_table_dec), 289 + .pmdomain_tbl = sm8550_pmdomain_table, 290 + .pmdomain_tbl_size = ARRAY_SIZE(sm8550_pmdomain_table), 291 + .opp_pd_tbl = sm8550_opp_pd_table, 292 + .opp_pd_tbl_size = ARRAY_SIZE(sm8550_opp_pd_table), 293 + .clk_tbl = sm8550_clk_table, 294 + .clk_tbl_size = ARRAY_SIZE(sm8550_clk_table), 295 + /* Upper bound of DMA address range */ 296 + .dma_mask = 0xe0000000 - 1, 297 + .fwname = "qcom/vpu/vpu33_p4.mbn", 240 298 .pas_id = IRIS_PAS_ID, 241 299 .inst_caps = &platform_inst_cap_sm8550, 242 300 .inst_fw_caps = inst_fw_cap_sm8550,
+13
drivers/media/platform/qcom/iris/iris_platform_sm8650.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + /* 3 + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. 4 + */ 5 + 6 + #ifndef __IRIS_PLATFORM_SM8650_H__ 7 + #define __IRIS_PLATFORM_SM8650_H__ 8 + 9 + static const char * const sm8650_clk_reset_table[] = { "bus", "core" }; 10 + 11 + static const char * const sm8650_controller_reset_table[] = { "xo" }; 12 + 13 + #endif
+4
drivers/media/platform/qcom/iris/iris_probe.c
··· 345 345 .data = &sm8250_data, 346 346 }, 347 347 #endif 348 + { 349 + .compatible = "qcom,sm8650-iris", 350 + .data = &sm8650_data, 351 + }, 348 352 { }, 349 353 }; 350 354 MODULE_DEVICE_TABLE(of, iris_dt_match);