From patchwork Fri Sep 29 08:38:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 13403817 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65D80E743FC for ; Fri, 29 Sep 2023 08:38:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232881AbjI2Iij (ORCPT ); Fri, 29 Sep 2023 04:38:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232835AbjI2Iih (ORCPT ); Fri, 29 Sep 2023 04:38:37 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0833B1B3 for ; Fri, 29 Sep 2023 01:38:34 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-53639fb0ba4so2015281a12.0 for ; Fri, 29 Sep 2023 01:38:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1695976712; x=1696581512; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=fOWusuB+PJKjWg0I1/CANfiCcxqSyq9YW+0X1DGwXrU=; b=u6lLL8ECo0kIt9x8I4vz7H4uB1KlrBw2gHITC2PUnkyZau8rWGm93FdXsyCPksI7d1 2r4KSTj8qkKnr8AKdxDP+jEaz6OHjO4Mpaov+aKwA9XfrlAevfLQz796BrAPUc740pKQ oDIa6U2x9s/GIHqcxYRUaD7WEgZrty0ytB3LIATJYGcZaHAiKUM1VJRIAhXUEe5OM51J qUVDGhCZBDWDmHclGZhTPcLknRw5EOjSGJO6BftM0yoi5NZGlaRB3aihZJ4vV2Vmfyia 8dSGqPoWCVXZZ1jEVhM7exmoRojreMlS+pfaHCMIYBSzsh0nn5SU2LEqr4Tiw84QF4CI iYCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695976712; x=1696581512; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fOWusuB+PJKjWg0I1/CANfiCcxqSyq9YW+0X1DGwXrU=; b=E1Hw7bjjzAB8+HUctdHSflRHez7qQ4Yw4HTmJb+vUZ+vNpZvZJcWEU9I4ZFtvL6yGU 1y5KWlQawra3NQzO2GerwcRTRGeO26lFVYKlVrU9gpZ+kt9ondPalgT4TCQvpQuZn6gq ssC6Dq3AYcTsj+mZcu20FCGLPVlYtzihFZgpaSaappA0439Ptwqc0CGFkmS1p9nuSpAl pXCm1w3if1JV63XP0+GshIs9Ef2kVfgKPjND/nZ0rAdpWgXTL6umgXw+bz4X97gkF5dS 3YI7GWS0eVLABSSVEFjm4Fdaebrc6VMUWRsSNFLG0p+TPEp1FM2PuX93+zQFuI+7rW9l 8avg== X-Gm-Message-State: AOJu0YwJ9ajJT7E76xCpn7KYbxSPZtH9tPaTYoY6LhKLvvj67veulh4r +21JyMYNXbt7n4XBRhPZFPMwgA== X-Google-Smtp-Source: AGHT+IEWR92YMVGrUJ5RbQ/heh37u0ZBG1Ma86v3zGzQBjc8vLO3PtSXU3sJrxy1LVODE3qkkrxcVA== X-Received: by 2002:a17:906:30ca:b0:9b2:794d:62d3 with SMTP id b10-20020a17090630ca00b009b2794d62d3mr2952442ejb.14.1695976712440; Fri, 29 Sep 2023 01:38:32 -0700 (PDT) Received: from otso.luca.vpn.lucaweiss.eu (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id qk8-20020a170906d9c800b009ad89697c86sm12208965ejb.144.2023.09.29.01.38.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 01:38:31 -0700 (PDT) From: Luca Weiss Date: Fri, 29 Sep 2023 10:38:19 +0200 Subject: [PATCH 1/3] media: venus: core: Set up secure memory ranges for SC7280 MIME-Version: 1.0 Message-Id: <20230929-sc7280-venus-pas-v1-1-9c6738cf157a@fairphone.com> References: <20230929-sc7280-venus-pas-v1-0-9c6738cf157a@fairphone.com> In-Reply-To: <20230929-sc7280-venus-pas-v1-0-9c6738cf157a@fairphone.com> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , Konrad Dybcio , Mauro Carvalho Chehab , cros-qcom-dts-watchers@chromium.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.3 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Not all SC7280 devices ship with ChromeOS firmware. Other devices need PAS for image authentication. That requires the predefined virtual address ranges to be passed via scm calls. Define them to enable Venus on non-CrOS SC7280 devices. Signed-off-by: Luca Weiss Reviewed-by: Bryan O'Donoghue Reviewed-by: Konrad Dybcio --- drivers/media/platform/qcom/venus/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c index 054b8e74ba4f..5c6baa0f4d45 100644 --- a/drivers/media/platform/qcom/venus/core.c +++ b/drivers/media/platform/qcom/venus/core.c @@ -881,6 +881,10 @@ static const struct venus_resources sc7280_res = { .vmem_size = 0, .vmem_addr = 0, .dma_mask = 0xe0000000 - 1, + .cp_start = 0, + .cp_size = 0x25800000, + .cp_nonpixel_start = 0x1000000, + .cp_nonpixel_size = 0x24800000, .fwname = "qcom/vpu-2.0/venus.mbn", }; From patchwork Fri Sep 29 08:38:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 13403818 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A60F3E743FA for ; Fri, 29 Sep 2023 08:38:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232613AbjI2Iij (ORCPT ); Fri, 29 Sep 2023 04:38:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232851AbjI2Iih (ORCPT ); Fri, 29 Sep 2023 04:38:37 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C0B81B8 for ; Fri, 29 Sep 2023 01:38:35 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-9b1ebc80d0aso1521331866b.0 for ; Fri, 29 Sep 2023 01:38:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1695976713; x=1696581513; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Eb8SXxyy/PW+V96CqaPd3QJGGDx1CmgmZ0KsU7u1POg=; b=OFwZj2kc3WBPg5A4j1LXYvHp6W5Si7JjPkH9S0+RiWIxvV9pLhFYEPVliAP2q9XC6v oBxaey+2k1ATLwW+VtrCWKuhKe5d7oj/CPvB81bDQ0+JwMMS4i02TOJemdVX5qlC9uG/ ct+gUAjG4I1628mgDG15PtuA6tdpW9nxykffbgLpfT6EtcVbBPq6PW8/PDTunn2NT3YE NnlhKMqU24KbeCS56fvslpwmlbVnu+D4DfqrAJPz42Wg8PIEmCrtSJBTyPHjpYdnGjpw /Iear0TMi0BHtdYx+zgQEHBto3BMFY/dvFl/8uENYIl85ofvKQcAv+Tyw8+52xvNHccg AF4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695976713; x=1696581513; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Eb8SXxyy/PW+V96CqaPd3QJGGDx1CmgmZ0KsU7u1POg=; b=QwlAfHPjoyl6ITD8MHzmjvzVM5zxU8scFPsLPsVfgMmz+UX+UmVtzZClHnVxfE6yEh CBOM8rLX8rfyEt/7tyUwhLN3Wxu33CFumNNC4iD0p6UjkKx5KmzmtIvo2hmyZmtYS+Xh +VKWK3lUnE48DKXiLDkagqaNAPDm9946gEySTn7AqRmlF5gJhJ4V7dR7UlrquwBZQnq9 RgW9i5OoyDaJs+4zkUQHJqC6sAL4YooKbKWNN4BsF2QtaZ6MeHf5on6/YANsFbniFois mfjD4gnpMrPkfwIAQx6ZAdMKGXEKKPC85duzI3rkvW9t7rC3jCY0cVG/8zC4dOD2MdXr mHRg== X-Gm-Message-State: AOJu0Yyq5EZ9M33CRWgHPxuy/ctEsddaVWwOdmB918Ax4VtYa/RoDKHc QA5AVJtYSqRnf96Z4BlFBgiNKA== X-Google-Smtp-Source: AGHT+IHWo6Ad+NGH7yOlybgeRKc1BDC4UBNVMKM73Iv+L+9Io0w560rL/OsLgRo5bWtZz2faxPtTnA== X-Received: by 2002:a17:906:10cd:b0:9ae:7081:402e with SMTP id v13-20020a17090610cd00b009ae7081402emr2825437ejv.64.1695976713284; Fri, 29 Sep 2023 01:38:33 -0700 (PDT) Received: from otso.luca.vpn.lucaweiss.eu (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id qk8-20020a170906d9c800b009ad89697c86sm12208965ejb.144.2023.09.29.01.38.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 01:38:32 -0700 (PDT) From: Luca Weiss Date: Fri, 29 Sep 2023 10:38:20 +0200 Subject: [PATCH 2/3] arm64: dts: qcom: sc7280: Move video-firmware to chrome-common MIME-Version: 1.0 Message-Id: <20230929-sc7280-venus-pas-v1-2-9c6738cf157a@fairphone.com> References: <20230929-sc7280-venus-pas-v1-0-9c6738cf157a@fairphone.com> In-Reply-To: <20230929-sc7280-venus-pas-v1-0-9c6738cf157a@fairphone.com> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , Konrad Dybcio , Mauro Carvalho Chehab , cros-qcom-dts-watchers@chromium.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.3 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org If the video-firmware node is present, the venus driver assumes we're on a non-TZ system. Move the video-firmware node to chrome-common.dtsi so we can use venus on a TZ board. At the same time let's disable the venus node by default as is custom on such nodes. Signed-off-by: Luca Weiss Reviewed-by: Bryan O'Donoghue --- arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi | 8 ++++++++ arch/arm64/boot/dts/qcom/sc7280.dtsi | 6 ++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi b/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi index 5d462ae14ba1..cd491e46666d 100644 --- a/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280-chrome-common.dtsi @@ -104,6 +104,14 @@ &scm { dma-coherent; }; +&venus { + status = "okay"; + + video-firmware { + iommus = <&apps_smmu 0x21a2 0x0>; + }; +}; + &watchdog { status = "okay"; }; diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi index 66f1eb83cca7..fa53f54d4675 100644 --- a/arch/arm64/boot/dts/qcom/sc7280.dtsi +++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi @@ -3740,6 +3740,8 @@ venus: video-codec@aa00000 { <&apps_smmu 0x2184 0x20>; memory-region = <&video_mem>; + status = "disabled"; + video-decoder { compatible = "venus-decoder"; }; @@ -3748,10 +3750,6 @@ video-encoder { compatible = "venus-encoder"; }; - video-firmware { - iommus = <&apps_smmu 0x21a2 0x0>; - }; - venus_opp_table: opp-table { compatible = "operating-points-v2"; From patchwork Fri Sep 29 08:38:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 13403819 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92888E743FA for ; Fri, 29 Sep 2023 08:38:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232901AbjI2Iim (ORCPT ); Fri, 29 Sep 2023 04:38:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232876AbjI2Iii (ORCPT ); Fri, 29 Sep 2023 04:38:38 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 507B11BB for ; Fri, 29 Sep 2023 01:38:35 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9ae7383b7ecso92557766b.0 for ; Fri, 29 Sep 2023 01:38:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1695976714; x=1696581514; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SJ7dWwjIApKtRRNvf80hbFpB8p0JqB1tooDJ9n4DaEc=; b=TgzOm07j+oG1QdQ6M6etJgUeQYZp+TXhNEwce6SC7NegU1rvUIB8qWIqSre70gvqIl MZoLTwZhnSm4GD9A7X5nEcFjM5oklp7VbT6v2YugXw9sAAVaRZKFefkHoVYLwtQPQqmA kwLGp3DeDUejD6/DoBtKu4NVoQF23G9vRfrPyPHWSFuCBwpVq2JqnteNoGkCboByweNL rW7vkuPdNX+G8+XZjZ0EYIFQSrZIN9tIaanqwXw4ghxwvG+XB10HbW9hYVpN433PmAm8 RxdVY393/oodVrOK4Cp5rIRsjrBeNtzJXY45LiiHcVFwVhGvLxwbKznFsmVG2+9g9t0x zOVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695976714; x=1696581514; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SJ7dWwjIApKtRRNvf80hbFpB8p0JqB1tooDJ9n4DaEc=; b=LLSxmSzyZ0qLhBUFRdmziRqPsktN6m7NtE25ItJOVmw8MdQIzegCmMZW6aAvCu3Jlh VCTWSlopBo3cXCQtKh59lS0SwmGIegTEoQlYlcSxb//qXXV/n+kyPazJIjZRNQfsjnfZ J6DZ0oobHQW6tNF8H2vm3onS+R1qsdtJNxGiAHoUMaRX+K819zANo6B33oaYbMr6rOdX wGSgYQzqfSLvNp+bxl8EPzxFvD4FBxK/Rs8Nx4kBL+5eMebH44G1Fsd0j137Zf0IBhJk bmU9bWQSE3ZolXkDYPsNHnqEN7qhBdDc2ePhsKITMwyofqYpBmZaXrGuH74yvdLFG6ca aDLA== X-Gm-Message-State: AOJu0YwXQuZzvEggM8ye55eUxIYxZEgpy3vpoFx68WkZar3ndCtwMqR1 GsFdlZT4Phj8glb+sMo05UDoVQ== X-Google-Smtp-Source: AGHT+IEhBGY5oEalRjg4MOYzaPZSrg/MxpppdFL+uwcBakrAbyblbQv0sSsQVIzDZ1igXxgYsQTD2A== X-Received: by 2002:a17:906:8a73:b0:9a1:b528:d0f6 with SMTP id hy19-20020a1709068a7300b009a1b528d0f6mr3157220ejc.27.1695976713867; Fri, 29 Sep 2023 01:38:33 -0700 (PDT) Received: from otso.luca.vpn.lucaweiss.eu (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id qk8-20020a170906d9c800b009ad89697c86sm12208965ejb.144.2023.09.29.01.38.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 01:38:33 -0700 (PDT) From: Luca Weiss Date: Fri, 29 Sep 2023 10:38:21 +0200 Subject: [PATCH 3/3] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable venus node MIME-Version: 1.0 Message-Id: <20230929-sc7280-venus-pas-v1-3-9c6738cf157a@fairphone.com> References: <20230929-sc7280-venus-pas-v1-0-9c6738cf157a@fairphone.com> In-Reply-To: <20230929-sc7280-venus-pas-v1-0-9c6738cf157a@fairphone.com> To: Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Andy Gross , Bjorn Andersson , Konrad Dybcio , Mauro Carvalho Chehab , cros-qcom-dts-watchers@chromium.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.3 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Enable the venus node so that the video encoder/decoder will start working. Signed-off-by: Luca Weiss Reviewed-by: Bryan O'Donoghue Reviewed-by: Konrad Dybcio --- arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts index 2de0b8c26c35..d29f10f822c9 100644 --- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts +++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts @@ -665,3 +665,8 @@ &usb_1_qmpphy { status = "okay"; }; + +&venus { + firmware-name = "qcom/qcm6490/fairphone5/venus.mbn"; + status = "okay"; +};