From patchwork Tue Oct 8 11:16:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renjiang Han via B4 Relay X-Patchwork-Id: 13826251 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 778F61D1303 for ; Tue, 8 Oct 2024 11:17:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728386224; cv=none; b=cBuVg/ws9hBZzbBJrurFQ+fWh4+Q0nR2mTdyffVveY7dNIbCiya7ZBJNVRIqUo97OEwjKsOf0RyAo+ez4KazwaZfJjx+cLOjRBlyoGyI9rzmZFm6+qFXrbV+dnIklc7ebhOE/20BBa+F/QgfiM4kld9jksVyHMOw+nR1D5Y/XmA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728386224; c=relaxed/simple; bh=EgbCQaEy7fewueYzDfprjYLeKyf18oJeRwxNPJL3gAc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RMsUIzjCBjgY7GBNf9K5WKtjLHj3j2fUWfA4bdzy7sdET0ZhAvC6n1/X4Moc0O0vE02f6mSg4VlJNFYS4lJswlVs3oE7IBjrvEvwuwKMjLVTNGu+dkw9AIxfWZC8oFOwLUAA2ssr4wFi9hbi86HlKe90GzSw98fs+xbLxrxUxwQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AnCysVzu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AnCysVzu" Received: by smtp.kernel.org (Postfix) with ESMTPS id 479A2C4CEC7; Tue, 8 Oct 2024 11:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728386224; bh=EgbCQaEy7fewueYzDfprjYLeKyf18oJeRwxNPJL3gAc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=AnCysVzuY9+BzE80Q8omTxUB35mKgK6wTOT2Yv03Eq/gEwdMUXlYc1ya72EF8OO// cP3mpY/u1JpX757vL0CYYDEB7GxJX/rVZsiI5vbFZ1TXKt2Km80us58ZOxjZVvWvOw Aqls2r2r4qCss9Z+24hVP2VdNaNAeIldr4iletUNnR0gesmwSmKbKrf39METm+g5UJ tKjaXxa7/5Cojy73nFZd0HDJ1oZbj4S90qOl3ViginIu+irk+vvNuoipiOdawVWPUt 2IbTiRM7mQbs10T83Z7+nCQYrm09caQJJCGgm7VN5hd4w8nYvA6eUg2lg9R8I3tIqX 6aW2Hh8IChB8Q== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B48ECEF150; Tue, 8 Oct 2024 11:17:04 +0000 (UTC) From: Renjiang Han via B4 Relay Date: Tue, 08 Oct 2024 16:46:34 +0530 Subject: [PATCH 1/2] arm64: dts: qcom: add video DT for qcs615 Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241008-add_qcs615_video-v1-1-436ce07bfc63@quicinc.com> References: <20241008-add_qcs615_video-v1-0-436ce07bfc63@quicinc.com> In-Reply-To: <20241008-add_qcs615_video-v1-0-436ce07bfc63@quicinc.com> To: Vikash Garodia Cc: kernel@quicinc.com, Renjiang Han , linux-arm-msm@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728386222; l=3460; i=quic_renjiang@quicinc.com; s=20241001; h=from:subject:message-id; bh=/Bx9teN1YmKVEZFAZmCAcYjiC5RdA6hKz5QrvyVujYA=; b=AKtNMAPx5tz1SYWSdXlpCt3fjK4AcYJdDTuyyKRTBP2ud0g9ZzkCMjtCdW7/edj6dNUvDZsNF zwlQRAD6H1iAKAX+xvvVEbDqyzK3OhyMfJh9WNc90HiwW3/G6U0r7WK X-Developer-Key: i=quic_renjiang@quicinc.com; a=ed25519; pk=8N59kMJUiVH++5QxJzTyHB/wh/kG5LxQ44j9zhUvZmw= X-Endpoint-Received: by B4 Relay for quic_renjiang@quicinc.com/20241001 with auth_id=235 X-Original-From: Renjiang Han Reply-To: quic_renjiang@quicinc.com From: Renjiang Han 1. add video DT in the qcs615.dtsi 2. enable video codec in the qcs615-ride.dts Change-Id: I80017997005878145a22fc8f38c0ffb653938aee Signed-off-by: Renjiang Han --- arch/arm64/boot/dts/qcom/qcs615-ride.dts | 12 +++++ arch/arm64/boot/dts/qcom/qcs615.dtsi | 75 ++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qcs615-ride.dts b/arch/arm64/boot/dts/qcom/qcs615-ride.dts index 73a8213cbbea58715677855c71b5b94e6c534711..c54e01640d4e455b1f985a553b6c5a83be31090e 100644 --- a/arch/arm64/boot/dts/qcom/qcs615-ride.dts +++ b/arch/arm64/boot/dts/qcom/qcs615-ride.dts @@ -262,6 +262,18 @@ &gcc { <&sleep_clk>; }; +&venus { + status = "okay"; + + video-decoder { + status = "okay"; + }; + + video-encoder { + status = "okay"; + }; +}; + &i2c2 { clock-frequency = <400000>; pinctrl-0 = <&qup_i2c2_data_clk &ioexp_intr_active &ioexp_reset_active>; diff --git a/arch/arm64/boot/dts/qcom/qcs615.dtsi b/arch/arm64/boot/dts/qcom/qcs615.dtsi index 1379900f753eff64d17fb1fe106b6a859e7f1aa3..a28a53ac500241f589a45f419ee3cfb8b64bca8b 100644 --- a/arch/arm64/boot/dts/qcom/qcs615.dtsi +++ b/arch/arm64/boot/dts/qcom/qcs615.dtsi @@ -1525,6 +1525,81 @@ usb_dwc3: usb@4e00000 { }; + venus: video-codec@aa00000 { + compatible = "qcom,qcs615-venus"; + reg = <0x0 0xaa00000 0x0 0x100000>; + interrupts = ; + + clocks = <&videocc VIDEO_CC_VENUS_CTL_CORE_CLK>, + <&videocc VIDEO_CC_VENUS_AHB_CLK>, + <&videocc VIDEO_CC_VENUS_CTL_AXI_CLK>, + <&videocc VIDEO_CC_VCODEC0_CORE_CLK>, + <&videocc VIDEO_CC_VCODEC0_AXI_CLK>; + clock-names = "core", "iface", "bus", + "vcodec0_core", "vcodec0_bus"; + + power-domains = <&videocc VENUS_GDSC>, + <&videocc VCODEC0_GDSC>, + <&rpmhpd RPMHPD_CX>; + power-domain-names = "venus", "vcodec0", "cx"; + + operating-points-v2 = <&venus_opp_table>; + + interconnects = <&mmss_noc MASTER_VIDEO_P0 0 &mc_virt SLAVE_EBI1 0>, + <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_VENUS_CFG 0>; + interconnect-names = "video-mem", "cpu-cfg"; + + iommus = <&apps_smmu 0xe40 0x20>, + <&apps_smmu 0xe44 0x20>; + + memory-region = <&pil_video_mem>; + + status = "disabled"; + video-decoder { + compatible = "venus-decoder"; + status = "disabled"; + }; + + video-encoder { + compatible = "venus-encoder"; + status = "disabled"; + }; + + venus_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp-133330000 { + opp-hz = /bits/ 64 <133330000>; + required-opps = <&rpmhpd_opp_low_svs>; + }; + + opp-240000000 { + opp-hz = /bits/ 64 <240000000>; + required-opps = <&rpmhpd_opp_svs>; + }; + + opp-300000000 { + opp-hz = /bits/ 64 <300000000>; + required-opps = <&rpmhpd_opp_svs_l1>; + }; + + opp-380000000 { + opp-hz = /bits/ 64 <380000000>; + required-opps = <&rpmhpd_opp_nom>; + }; + + opp-410000000 { + opp-hz = /bits/ 64 <410000000>; + required-opps = <&rpmhpd_opp_turbo>; + }; + + opp-460000000 { + opp-hz = /bits/ 64 <460000000>; + required-opps = <&rpmhpd_opp_turbo_l1>; + }; + }; + }; + videocc: clock-controller@ab00000 { compatible = "qcom,qcs615-videocc"; reg = <0 0xab00000 0 0x10000>; From patchwork Tue Oct 8 11:16:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Renjiang Han via B4 Relay X-Patchwork-Id: 13826252 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B525F192B8F for ; Tue, 8 Oct 2024 11:17:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728386224; cv=none; b=elCb1EvublAqeU9ZiA7bASPcuzZA/bs/RdqdpTOsQSBOZ0mn2qo/57KqvS9ldOHwx3iQU0Pj8Qd/5GLTFUkAKy1yfLfBTKR6Rbgf54hOb4+C7bLwfte7KRMZTSNWtC36Nti+blgqGV8XbzkV2HRJ47+LxWE8DI6JXSMpSnc+m1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728386224; c=relaxed/simple; bh=LpovLX2LVjsoiwp5sT3n5yohLyUQD6TprBumtupfz90=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=L0/9NPh8BhDudULlwwSXKgeHpveA+309eFbXNLZYQy8TuF6aIWffNpTRv97Ai4jF2ueAB3xpmXi3wskZc5yJ2Y1gPtFdCnW6GR/mxkpiSBVYz1NwFM8HyCS22RCrMDubBhZlxS2UXNeIR6i2XgEUH0gVHBS2PqZq9N9JyIipTqw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lQvoyioL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lQvoyioL" Received: by smtp.kernel.org (Postfix) with ESMTPS id 527D3C4CECD; Tue, 8 Oct 2024 11:17:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728386224; bh=LpovLX2LVjsoiwp5sT3n5yohLyUQD6TprBumtupfz90=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=lQvoyioLbylaSshb3zEEzMXuWbOSYZhYf2iIqj9jgitbO/AL57L4hhkQAwH08rNjT N6q6sODsn4f0LOVlA5EHq3agBBBt+FTerHsqgnW+X6DrQsNdv0UepsT/39D06gYl4M Nq425/ICCuyKupeI/zScevCozhc91b/m0W2drD+z2l5Hrt7NluLNCZJ6GBEdDE8ODR oCXIXxsRotzzzs4VDm6oU5rM+ueKyBE2q2p8YsjjDq7z9/G2h/YQsi/OtOdU4Ooby3 Xs1iYXgUg0R0xcNUiQaLt8M6SPkYrBJF3hwAy4TRtPq0VoTXMrQND6doRZ262/ieFt Mmx7Pxp++q4lQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48355CEF153; Tue, 8 Oct 2024 11:17:04 +0000 (UTC) From: Renjiang Han via B4 Relay Date: Tue, 08 Oct 2024 16:46:35 +0530 Subject: [PATCH 2/2] media: venus: core: add qcs615 DT compatible and resource data Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241008-add_qcs615_video-v1-2-436ce07bfc63@quicinc.com> References: <20241008-add_qcs615_video-v1-0-436ce07bfc63@quicinc.com> In-Reply-To: <20241008-add_qcs615_video-v1-0-436ce07bfc63@quicinc.com> To: Vikash Garodia Cc: kernel@quicinc.com, Renjiang Han , linux-arm-msm@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728386222; l=2818; i=quic_renjiang@quicinc.com; s=20241001; h=from:subject:message-id; bh=Q1QnwhQAJxUdLqNUWY5OfIjtDJPFF3bmncn+F/o0I3w=; b=UGUYGtdz5GtJdTQknjM76kY2aiYDm2kzYiE4VWQ2FIpDaYLv2vooBZa8aWysbgyhawB8HEa/8 n/1VWGGsy8EB+1ZgwxHlB3DSwUAVydTDvY7NcxrRLsr/vCvwwLJCru0 X-Developer-Key: i=quic_renjiang@quicinc.com; a=ed25519; pk=8N59kMJUiVH++5QxJzTyHB/wh/kG5LxQ44j9zhUvZmw= X-Endpoint-Received: by B4 Relay for quic_renjiang@quicinc.com/20241001 with auth_id=235 X-Original-From: Renjiang Han Reply-To: quic_renjiang@quicinc.com From: Renjiang Han add qcs615 DT compatible and resource data Change-Id: I1a06f105f030cbf16f48a32f8c50c814f0dbde7a Signed-off-by: Renjiang Han --- drivers/media/platform/qcom/venus/core.c | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 84e95a46dfc9832981ac1c0c58e226a506896ade..15cd78279cb7487f5f1da4e5d617da7b4a481451 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -816,6 +816,55 @@ static const struct venus_resources sc7180_res = { .fwname = "qcom/venus-5.4/venus.mbn", }; +static const struct freq_tbl qcs615_freq_table[] = { + { 0, 460000000 }, + { 0, 410000000 }, + { 0, 380000000 }, + { 0, 300000000 }, + { 0, 240000000 }, + { 0, 133333333 }, +}; + +static const struct bw_tbl qcs615_bw_table_enc[] = { + { 972000, 951000, 0, 1434000, 0 }, /* 3840x2160@30 */ + { 489600, 723000, 0, 973000, 0 }, /* 1920x1080@60 */ + { 244800, 370000, 0, 495000, 0 }, /* 1920x1080@30 */ +}; + +static const struct bw_tbl qcs615_bw_table_dec[] = { + { 1036800, 1987000, 0, 2797000, 0 }, /* 4096x2160@30 */ + { 489600, 1040000, 0, 1298000, 0 }, /* 1920x1080@60 */ + { 244800, 530000, 0, 659000, 0 }, /* 1920x1080@30 */ +}; + +static const struct venus_resources qcs615_res = { + .freq_tbl = qcs615_freq_table, + .freq_tbl_size = ARRAY_SIZE(qcs615_freq_table), + .bw_tbl_enc = qcs615_bw_table_enc, + .bw_tbl_enc_size = ARRAY_SIZE(qcs615_bw_table_enc), + .bw_tbl_dec = qcs615_bw_table_dec, + .bw_tbl_dec_size = ARRAY_SIZE(qcs615_bw_table_dec), + .clks = {"core", "iface", "bus"}, + .clks_num = 3, + .vcodec0_clks = {"vcodec0_core", "vcodec0_bus"}, + .vcodec_clks_num = 2, + .vcodec_pmdomains = (const char *[]) { "venus", "vcodec0" }, + .vcodec_pmdomains_num = 2, + .opp_pmdomain = (const char *[]) { "cx", NULL }, + .vcodec_num = 1, + .hfi_version = HFI_VERSION_4XX, + .vpu_version = VPU_VERSION_AR50, + .vmem_id = VIDC_RESOURCE_NONE, + .vmem_size = 0, + .vmem_addr = 0, + .dma_mask = 0xe0000000 - 1, + .cp_start = 0, + .cp_size = 0x70800000, + .cp_nonpixel_start = 0x1000000, + .cp_nonpixel_size = 0x24800000, + .fwname = "qcom/venus-5.4/venus.mbn", +}; + static const struct freq_tbl sm8250_freq_table[] = { { 0, 444000000 }, { 0, 366000000 }, @@ -943,6 +992,7 @@ static const struct of_device_id venus_dt_match[] = { { .compatible = "qcom,sc7180-venus", .data = &sc7180_res, }, { .compatible = "qcom,sc7280-venus", .data = &sc7280_res, }, { .compatible = "qcom,sm8250-venus", .data = &sm8250_res, }, + { .compatible = "qcom,qcs615-venus", .data = &qcs615_res, }, { } }; MODULE_DEVICE_TABLE(of, venus_dt_match);