From nobody Mon Feb 9 09:54:10 2026 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43E50265CBE for ; Tue, 25 Feb 2025 09:05:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740474322; cv=none; b=Uv460T8B9qfTLGEP9Maw1JWq39JdtXjhLQVrZglgcSe4Vr2y/NkLU7HfYokfi9OfOjvVMsbeazGFHl8+tcP2HcFSrQJw5AWnPSgZViY2AyTzkE/blT7lE4YSz8Lj4rIOQ4eyWR4KEAbeGY3eAroseMxaBX1dbY84dqX25j+OnjY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740474322; c=relaxed/simple; bh=o96kxA33+1DrhbtMAFBL4Wa8Hn4604gRt15P/wcggIw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lhr4HNfKaA0RZQWb/IFzIKZGe23RwKc7R1ILMVD0hSgNhUXpB8vfB5qRyqPKWBZODOrem9H+7bP/MBGwv1ncAjsO2T4aablra33IVBoHGTgqToAUSjB8qyRacXnR7FOh2I1hkU7MccUteEoGkPmcOwAmbSQkTS2yW2oDAQWdpTc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=rj99jgDq; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="rj99jgDq" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-38f2b7ce319so4427747f8f.2 for ; Tue, 25 Feb 2025 01:05:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740474318; x=1741079118; 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=8ehOa7QEJ7cqt0L5jMNiAxatA6Uuy7MmcV53RpYdRAY=; b=rj99jgDqK6yECkkzkOV2T2YCwK7ZFa82dpIN4dv/XRJbeSan/x0IFjpVtFQO3sTEoB yJrMru14GwJ9uaS3yhr3C81XSPyOJfgCxhUyFkXMeInCOlneFHov8PPcTygEiMtElOCw cU+M7icH+se3kn+4Ka23usCMMGPY/hMWOx9UQFZl988EWgkFhFySs0LOb1qvXD/l9BbG KOk8teT2EPH7aqATNFt+Q608r8OhBcPtVCWsf2JoMEI1TbY+3mtFJZqSHZex4Wt5Zmil Gq1YnorT0s4NP6oB/hp+J6ARsIo8pD5locW8wFlROiEhvq7PKmnLJDSXUY6TPRk7xA6g nJoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740474318; x=1741079118; 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=8ehOa7QEJ7cqt0L5jMNiAxatA6Uuy7MmcV53RpYdRAY=; b=ml8ok+jiHjDNyfcPDWLNjjKQSgasDzhESdTQjnsGrsbWq67EjDNFBpktMbHKB/JMHo GHoZGzyEcuzZ9wuhAAHWhrMMDzdY541KcbASvBHcziAOe1Jau0t4tDf5/w+5wph2gJ07 fpUwbvM7BiEk+bITFC9StNByh+nyb0rNqRmOlu1oZfW9xpDPABpeN+v7TKI0KHsuR1JZ ynBILo4SF+zcXBYmUhbKpQzeUYIzMxUo0pw6zZLamnStry4P0GH6fU2gugCy71sa7x1T 3RN2WFtI1CnQtHiJM37lp7sqtr2SM7hUuyzWXNQj1+cRz2cG/EmdoehYshkNoeBHH2bX /TNw== X-Forwarded-Encrypted: i=1; AJvYcCWDTUhQdhH/iBT+oqRYzz4e9AvHbsesXz6xKvy0JisgsghZe3o2tGPAxJ16M4QXwItACdRR6cV6/2NpX2o=@vger.kernel.org X-Gm-Message-State: AOJu0Yx07we+lFJL0KRIIglNwFTt8YgMW4lnIDLIIrOQ/JqG6Uy992uO 529FUVOoWjEqPlSmQ9eUGeEQx9GYSve/Ty2umtWdz96OZw8Ziz69JEAeGqGKs9U= X-Gm-Gg: ASbGncs8MkwZ8ZIPH5/UwJe3NHKkG2nzclTbLLvVmmdeT3FAGKytxRz72O/A0Lh+Zav zPpYn4C8LGTlqaCc5J/AbU2UxGSacAuopGL4jLqy/ZcG0Bj+eluIF6AfU//3uWa0szE/QjAMw+E xVdn68GFE4LOpKff/clIZk7/5RLyNWCuDP2V16+TPKaFSGHgP4bywSjK55q574MeR6en2d0KVqi AsyF0miSvwQqw9P/QCAKsXlhHh8s/29YCOMOJY+rZd071mIjipgirV+D80sNEFVBolpyJx7N/nl qZ/NgMchTqBEMLF9avwGcEpVn57NRdWl2FM4gMvFwDtv0Zc= X-Google-Smtp-Source: AGHT+IH2ZJqkhcU51FRNDxP7cqoLd2ysClzetd+2vjMdITpSxqbkRCJvF21LQcIWviwRZOaK7J+uww== X-Received: by 2002:a05:6000:18a9:b0:38f:30a3:51fe with SMTP id ffacd0b85a97d-38f6f09c087mr14993157f8f.42.1740474318541; Tue, 25 Feb 2025 01:05:18 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390cd86c93bsm1573540f8f.26.2025.02.25.01.05.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 01:05:18 -0800 (PST) From: Neil Armstrong Date: Tue, 25 Feb 2025 10:05:09 +0100 Subject: [PATCH 1/4] dt-bindings: media: qcom,sm8550-iris: document SM8650 IRIS accelerator Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250225-topic-sm8x50-iris-v10-v1-1-128ef05d9665@linaro.org> References: <20250225-topic-sm8x50-iris-v10-v1-0-128ef05d9665@linaro.org> In-Reply-To: <20250225-topic-sm8x50-iris-v10-v1-0-128ef05d9665@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1916; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=o96kxA33+1DrhbtMAFBL4Wa8Hn4604gRt15P/wcggIw=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnvYfL1rNkJHBYRMe4xHZwtWc5t05wyovD/w0krXGt XE8I77uJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ72HywAKCRB33NvayMhJ0T+6D/ 9/rAzKiZ2Ef+u7ZXKQWwghwGgPOmMPhvn86QEDzGfNszva4mGYjRQTdQ2QYAEF+TzqtjWCUATNNiLL uDRl93fy9Mb+HgqNiGekRbsHU+eNLvaV+wR5iwbkOMIQ0bfff7AFXZ0wgsLaK4bkA1u6hU/20xn5KW E6kO5FJzVaWfcXPlHzjNgAY2NtqylhmwtC5D7QLDmE7y9BTjhoCxyd+jYfeeXkWeEHHoS0LSkUuTWZ LgP8T2bmZP8w+tWRtgVNUZcHiIi2c8F2uJbGQPSSGTG+YPcKUULX24wqYCp8/F1bAfINqwFU2K3HKh /HX7XSY8yiTIVZqmyxcAb75Q0hhWONoIVSkgfNM+fHXzWX+8Okf777dJoVrVWk9pEnMoP+0QCmyeC8 ZsO6OlhBqhBeFgbV9jSOmZ2eFnAGUva8MQCBLZDBvInki19lpJhDyJn/IoRU5o9QkxbczFae+Vvi85 ZaGlmRSp+ecrJHWYLSNxUx/vq+bx6GzIEqHtOq6S75X5w/8HQTMg7KiHa+q1ipgeB00JNiEeya9SNj Kv8uP1LXEtXe2zckJ8MVX8MVsX64tTzjn2GajCrs23Q9VWBnPiNy4DmCUjaxE5sAmsbyiymYqJG70V nMDoRMUY1+XhKtqYNocT1gRwLzGxxyjGxTJaFzlsvmuu3Vv8Vjza5+7aZRjw== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Document the IRIS video decoder and encoder accelerator found in the SM8650 platform, it requires 2 more reset lines in addition to the properties required for the SM8550 platform. Signed-off-by: Neil Armstrong Reviewed-by: Rob Herring (Arm) --- .../bindings/media/qcom,sm8550-iris.yaml | 33 ++++++++++++++++++= ---- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml = b/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml index e424ea84c211f473a799481fd5463a16580187ed..536cf458dcb08141e5a1ec8c3df= 964196e599a57 100644 --- a/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml +++ b/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml @@ -14,12 +14,11 @@ description: The iris video processing unit is a video encode and decode accelerator present on Qualcomm platforms. =20 -allOf: - - $ref: qcom,venus-common.yaml# - properties: compatible: - const: qcom,sm8550-iris + enum: + - qcom,sm8550-iris + - qcom,sm8650-iris =20 power-domains: maxItems: 4 @@ -49,11 +48,15 @@ properties: - const: video-mem =20 resets: - maxItems: 1 + minItems: 1 + maxItems: 3 =20 reset-names: + minItems: 1 items: - const: bus + - const: xo + - const: core =20 iommus: maxItems: 2 @@ -75,6 +78,26 @@ required: - iommus - dma-coherent =20 +allOf: + - $ref: qcom,venus-common.yaml# + - if: + properties: + compatible: + enum: + - qcom,sm8650-iris + then: + properties: + resets: + minItems: 3 + reset-names: + minItems: 3 + else: + properties: + resets: + maxItems: 1 + reset-names: + maxItems: 1 + unevaluatedProperties: false =20 examples: --=20 2.34.1 From nobody Mon Feb 9 09:54:10 2026 Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28C10265617 for ; Tue, 25 Feb 2025 09:05:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740474323; cv=none; b=AtFqSbbPHg5elQrsoQCg6qYFr/nUPc9nppnwT+81B7W3fKOzUf4EnvXsXjezmNfPtAuKK/02WsYAkWVVQTSsXvGFhjgSH2SecKHL3wvigH3yPgmtWmJKft7dRMeOqYMV4pZeIVl0Xo91wbJuUMTfz7RZ2xpp1iTf4CCqnYCAd5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740474323; c=relaxed/simple; bh=MuVFv0xJA1aIIdUbLAcynY4g87XgdT+Fpu04pLc0qqk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OF/rCvbWin0suJDaaHqJwLaq2tExUqLoxE88ahZpYKonOeJlsbuZBjBM5NrEc3gS1b3iAnPzkTuovjwwz67ygoHSRvy3hTEbdhn0d4+du9FMVPzxVtH77rvvm4ApWFXTslemAXhGUQkbtybo+FLX01piXdU976uWL5BwyR5N2SA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=L13KKHFO; arc=none smtp.client-ip=209.85.221.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="L13KKHFO" Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-38f3ac22948so2678594f8f.0 for ; Tue, 25 Feb 2025 01:05:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740474319; x=1741079119; 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=n1Wm3m4ktQWXQaRTF4Zc5/MnyxbU+OWxULwpKIAGXso=; b=L13KKHFOhjAuAoG0MGtqsInmAHzPZU0nnhRFxlyJAqkd5/aWiIvmcE0iNJqF/nBjp+ WfOxPHpdb8zTEJeL64kvX591mPIAFvSyo1YKczZKM3+MWAZjZfLrVb6Iak66eg8dM+zw +QJRkJh7YQ9+QXmjZXaRVorbngy9jPvqfVJGzlvI+ii1TcJ5/NcNxZrcegTXq0CR5uis p/4xoz7tAD1UszBPF91b2+uc+MfiPEiSjtYVfoSBpibVBqiskYmoUK5et5HIVMhzsmpE 4Xu4gS57TwBqT6IhOdv64q27Mj++Y+0JZwZnbJuOUmgoekzIQJtbMTYmdOEG1rr813vd SgAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740474319; x=1741079119; 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=n1Wm3m4ktQWXQaRTF4Zc5/MnyxbU+OWxULwpKIAGXso=; b=tXvi0x5Prj05pzk4Mpk5S50Sls8LLwWsKQVr0AqXSOLEQwZJ7LtHehmXVGT5Gl9iQo +1OFY+1nUdRq7VufmGpkKNgH7FNKKkp9SS5ULGG1+IWB24wb7DPoEutW1shbgOeWN3oS cHcRy5++iaJNcwlMlUBwjvMvmyOXoj2qCo8q2+VahriSIOrIa2/B9Drj7dXpcKHzUY7L dMjZZJLZAJjHM5TD85eZ94srDLdkVBFOHSbVtjf4Xj71X1uA3bO+x1NOPMM1mdJ3Hr6o TIv8N92fgjSTauM/7Hy5W+2mIm9AneSIXEoRdEW4gfDuTrdfoT60A6BtvRwERW83INDB +guQ== X-Forwarded-Encrypted: i=1; AJvYcCVB47WWSzdXe8Fz3RyDHOzab/ur9uKIv5o05M5hZhzgRuguCN7z2vTRSvqUXWZm/rsi8g561/wPfYqm4oQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/ezlXk+f7zECihQwoJArNPExLVa+RVkpox6FWp7TO9ciqd6xd CvQU/UkO/78ydEk8fCxaqsdsrDisk4up8Ewj5xAejmDFEWZ/T+YxBMAjzuHt7Uo= X-Gm-Gg: ASbGnctIwfbJOgsVwNvP+CoG2jZCP+Jx3emb1ff92IkA+Rdwf8fgibeBkKrxI39nntp CjrFpYAHn5zmLT1e9+jxTygPHOiM1XpMgYF909FLhRF/kH8+KERvqf5oltwDzP5Ln6HdnAuK+78 ssChBuKcNdRerAUSNA5bTBo3E8b2Fn3227LIEuJhuHe8Z7+egTN6W5SmgxgRnI6eKaKpRLdQls7 qMaHsPBtp6jp8Vq0u6DJFZ00LLQt1cqkFxLPyEkiDMqnIwaNji9Bk9vUpp0rjsJu58rHUi/z6QX 5GkzymIWtsrWdSt1aTscfMy5wx2V1dmweZ9wEeudFOtV5k4= X-Google-Smtp-Source: AGHT+IExJfVX2pa7E8zGHho5gW4/I4CUzeqhG7AuJ1CY8Ss/DePppdeXLqIKsLK4iw25aSCA/hBgOA== X-Received: by 2002:adf:ce12:0:b0:38f:4cdc:5d36 with SMTP id ffacd0b85a97d-390cc630c2cmr1583604f8f.43.1740474319256; Tue, 25 Feb 2025 01:05:19 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390cd86c93bsm1573540f8f.26.2025.02.25.01.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 01:05:19 -0800 (PST) From: Neil Armstrong Date: Tue, 25 Feb 2025 10:05:10 +0100 Subject: [PATCH 2/4] media: platform: qcom/iris: add reset_controller & power_off_controller to vpu_ops Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250225-topic-sm8x50-iris-v10-v1-2-128ef05d9665@linaro.org> References: <20250225-topic-sm8x50-iris-v10-v1-0-128ef05d9665@linaro.org> In-Reply-To: <20250225-topic-sm8x50-iris-v10-v1-0-128ef05d9665@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4781; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=MuVFv0xJA1aIIdUbLAcynY4g87XgdT+Fpu04pLc0qqk=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnvYfLpi2ryu2nYjTFw4rJn8OiaJy5B5WJgLv0J0SB noO6oFeJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ72HywAKCRB33NvayMhJ0SJ3D/ 9LqsoPuOuXTSSGjcDIaChAU3qiHXJeQd+SP4Y4Lz51YFykc44TJzIyw2FpeKqPGMGt6/lJ1Am3NOkM oU0cfdc1iGpzgcxt/Mp1guuEFXZRkzSqcceXw/YyE+m7t1AGyu8BRFveUwxTQoaH6BNeLudxBOKLl2 z/wGTmZkMQd1JVzVsX8TLI1F2fmDW38bO1TnQfIGTALiB+kP6LkedkCNaKqD7FQULmr/xYb1lLDOEe bEy/EuP7EuvjCt6vWLh+RC228HcZHFuwyORpP/dNXMJWJxlWGk8x79nfysiG7NSW4i/EiVPD4oxD5e KyZHjoOCsM9JSByZlW7He6usz5D3ZBEp7ievG2E7Ww27GqDH++cynzOFE6meK2fzd8jy25hTrv14Jj STFXGLGt8T1sgdG1WyShCNoNhmwltYzskZGXvzCH5BbvyVEljSSNNpUNxxrIfZGKzLv7wvjWd1rRhF dqZsxiPY4dRnObHfC4DvBIvtaU9rrpT2FCtlj/fRBRlmthEgURkmlqZOXtEGVlQ8991ReN1FOpNBcE utJdBjoQI/61mbJiwpixZNfES81PLGjegIs3Xy6PX3VBE08r4nd3mWWLMeNnaa8Gwl4ONlHnDDFCs+ wyzvJiKy9P0BHNOcAKQqG7gqmGBcuhwl38fwKGA3BgQY+OSK6HGc2q8/gjaA== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE In order to support the SM8650 iris33 hardware, we need to provide specific reset and constoller power off sequences via the vpu_ops callbacks. Add those callbacks, and use the current helpers for currently supported platforms. Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/iris_vpu2.c | 2 ++ drivers/media/platform/qcom/iris/iris_vpu3.c | 2 ++ drivers/media/platform/qcom/iris/iris_vpu_common.c | 14 ++++++++++---- drivers/media/platform/qcom/iris/iris_vpu_common.h | 4 ++++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_vpu2.c b/drivers/media/p= latform/qcom/iris/iris_vpu2.c index 8f502aed43ce2fa6a272a2ce14ff1ca54d3e63a2..093e2068ec35e902f6c7bb3a487= a679f9eada39a 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu2.c +++ b/drivers/media/platform/qcom/iris/iris_vpu2.c @@ -33,6 +33,8 @@ static u64 iris_vpu2_calc_freq(struct iris_inst *inst, si= ze_t data_size) } =20 const struct vpu_ops iris_vpu2_ops =3D { + .reset_controller =3D iris_vpu_reset_controller, .power_off_hw =3D iris_vpu_power_off_hw, + .power_off_controller =3D iris_vpu_power_off_controller, .calc_freq =3D iris_vpu2_calc_freq, }; diff --git a/drivers/media/platform/qcom/iris/iris_vpu3.c b/drivers/media/p= latform/qcom/iris/iris_vpu3.c index b484638e6105a69319232f667ee7ae95e3853698..95f362633c95b101ecfda6480c4= c0b73416bd00c 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu3.c +++ b/drivers/media/platform/qcom/iris/iris_vpu3.c @@ -117,6 +117,8 @@ static u64 iris_vpu3_calculate_frequency(struct iris_in= st *inst, size_t data_siz } =20 const struct vpu_ops iris_vpu3_ops =3D { + .reset_controller =3D iris_vpu_reset_controller, .power_off_hw =3D iris_vpu3_power_off_hardware, + .power_off_controller =3D iris_vpu_power_off_controller, .calc_freq =3D iris_vpu3_calculate_frequency, }; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.c b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.c index fe9896d66848cdcd8c67bd45bbf3b6ce4a01ab10..ec8b10d836d0993bcd722a2bafb= b577b85f41fc9 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.c +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.c @@ -211,7 +211,7 @@ int iris_vpu_prepare_pc(struct iris_core *core) return -EAGAIN; } =20 -static int iris_vpu_power_off_controller(struct iris_core *core) +int iris_vpu_power_off_controller(struct iris_core *core) { u32 val =3D 0; int ret; @@ -264,23 +264,29 @@ void iris_vpu_power_off(struct iris_core *core) { dev_pm_opp_set_rate(core->dev, 0); core->iris_platform_data->vpu_ops->power_off_hw(core); - iris_vpu_power_off_controller(core); + core->iris_platform_data->vpu_ops->power_off_controller(core); iris_unset_icc_bw(core); =20 if (!iris_vpu_watchdog(core, core->intr_status)) disable_irq_nosync(core->irq); } =20 -static int iris_vpu_power_on_controller(struct iris_core *core) +int iris_vpu_reset_controller(struct iris_core *core) { u32 rst_tbl_size =3D core->iris_platform_data->clk_rst_tbl_size; + + return reset_control_bulk_reset(rst_tbl_size, core->resets); +} + +static int iris_vpu_power_on_controller(struct iris_core *core) +{ int ret; =20 ret =3D iris_enable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_= CTRL_POWER_DOMAIN]); if (ret) return ret; =20 - ret =3D reset_control_bulk_reset(rst_tbl_size, core->resets); + ret =3D core->iris_platform_data->vpu_ops->reset_controller(core); if (ret) goto err_disable_power; =20 diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.h index 63fa1fa5a4989e48aebdb6c7619c140000c0b44c..c948d8b5aee87ccf1fd53c5518a= 27294232d8fb8 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h @@ -12,7 +12,9 @@ extern const struct vpu_ops iris_vpu2_ops; extern const struct vpu_ops iris_vpu3_ops; =20 struct vpu_ops { + int (*reset_controller)(struct iris_core *core); void (*power_off_hw)(struct iris_core *core); + int (*power_off_controller)(struct iris_core *core); u64 (*calc_freq)(struct iris_inst *inst, size_t data_size); }; =20 @@ -21,7 +23,9 @@ void iris_vpu_raise_interrupt(struct iris_core *core); void iris_vpu_clear_interrupt(struct iris_core *core); int iris_vpu_watchdog(struct iris_core *core, u32 intr_status); int iris_vpu_prepare_pc(struct iris_core *core); +int iris_vpu_reset_controller(struct iris_core *core); int iris_vpu_power_on(struct iris_core *core); +int iris_vpu_power_off_controller(struct iris_core *core); void iris_vpu_power_off_hw(struct iris_core *core); void iris_vpu_power_off(struct iris_core *core); =20 --=20 2.34.1 From nobody Mon Feb 9 09:54:10 2026 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 064C72661BA for ; Tue, 25 Feb 2025 09:05:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740474325; cv=none; b=MuC7V6TxBj22bHx2/hiVYWotLl/qc7kJkUcRao3gwhR6B7qqL1iXSwechv7E2DSLMG24gsTakwoE2GlWp5g1rOk/3uJwT3yWXGkugEXkMdP4vylCZ6xyacgN/Voh+tLUZzyIL3bmTWJ/eG/MGIOGsynl+NNECIvILTPnQDDttlQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740474325; c=relaxed/simple; bh=bMnp0Uv2RC/2qm+VTO2WwzTvIrV/Oa4fubd2QbCJsQ4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Dm5k9i8Ln5QnbFb0+vuSrN0Rpu5pXR00WrRIo8/zYkq4bVlW7WIM2j4iVk8IAAhOyv35ov1Qa7QQEJp0i6/BLFn/mTkzlCpStfjh+LVRK+2VQoJzpp+VWndk+TnLK8gai5ff+wP4+CrFlM5FYXEVLPnc//8MSINrBrRCl1oDHtE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=izCIGCv+; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="izCIGCv+" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-38f265c6cb0so2592199f8f.2 for ; Tue, 25 Feb 2025 01:05:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740474320; x=1741079120; 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=6Qes3tRHCIiE6XaA2j1UDqLiTUcC6/RfCgficPmtmZ0=; b=izCIGCv+qwqcQQQrVP5X/RnOTMNcG2g9wAdSjvRsz8S9u3T4rHes1m0+r/P2IdG6va 0/EGyv7S7i1El/Pcd1GXP0elJr1XAMEwIpEvg/EEcQ4aE7T8+beDR30mVBQhpCsluhnC dLZd5ZpldVIJ5UleqthXgVYBT7ekce9W4rxFBQvfX7a4obECSiFOSNG+G+YhOZd9MiO0 iRAS1p2QKtMBx8TZmN8/asJ0YOW8a9ht9E+IaRQIqWs9qzKLZHMpO3Ce1Ry5zihdLnrs X28CsrNOTVAWgeSe6PwOB9k6DTKcM1QqloMMBtJgxa4l462KMoJs+vlde7p9BpA2+QQV Uj4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740474320; x=1741079120; 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=6Qes3tRHCIiE6XaA2j1UDqLiTUcC6/RfCgficPmtmZ0=; b=QsUYPUJ1EMuIYuekelDD7gIYla0GH0E5anpESem2N+Bx3Qqt9KSK4BwwjwXGRlsIbd vdTICvUy9qhdk+yNxqKM4v0LOWdgMKbLZcLhMme1PPIzLzLrSvAGUlwcrt5BjdsWlmjR zY0Ax0NyDHqEqjsHjy1abVPc9zBFAVN8ZHBePWdBoM3BUBuxdUNcEVszeDkuK4/CQNeU yWe3J2oGD7EE4sq6fh2E6elUxZYKGs3DxXrPavTzLCl4aQ3pS5oeqSUmJ+06UAUQht78 fifAIvmIIZEZj0KEz6sgwPOHnhOd2T9xbolPUu1mvB0hFPPEVvgIVFgYT+f+1WA7Tu80 P5WA== X-Forwarded-Encrypted: i=1; AJvYcCX1pbM1/XFzj+E6gXlMyh3t4J81iwHPL6gbcr7K9rOLWvYzZ45lMWWY8LZ0dLtW54NqsaxhyXKxF4YDdAk=@vger.kernel.org X-Gm-Message-State: AOJu0Yzbrq4v60/SpUK8HCHOVhlqt8TjIzn1qfy/n/NmA/G2In+loBay P+tttH6SDgcui/U38GeQPggaPfsCaSooVqRC2/s6O8aFgiiDoy0pIyoSxPafQJM= X-Gm-Gg: ASbGnct5bjuu1ZAVygY0NndGlvnccyS0ovVsDqTLd7P4SNR8qseCvKTYTHiUvgvM1CE T/Vu7Ut/1kpuO6YEbv6BaFinR/WzVPVZMNhq/3aEXPFJ3V1UapzlpcAqszlb2DoHle+1QS7iTb/ JimXs013zTy/cSots+s+ZNk5YuSg0cQgjxIQ0h14iKQtSLBL2doxXMbkfIy+WipGPai/zRJW26E CQuDa0J3WkuhBE/L5bJvigEhCjfPiVMm2+9fhzI2x0p3ChpexKZK2SezF3ilytrZrbBzF+dF+Tm ++/1+spYZ95/jemhZ7IEYd0pwCIcGAmwSlASSUphteoVAwM= X-Google-Smtp-Source: AGHT+IGIBleUpJRwMgi0GGFLaVVU/+CSCH6SInFt9ICHblgQKRHs2p9Ms14bMbDwb2+awMJ2P5t/dw== X-Received: by 2002:a05:6000:1a8a:b0:38d:dcf1:d156 with SMTP id ffacd0b85a97d-38f7079f6f3mr14548229f8f.25.1740474319997; Tue, 25 Feb 2025 01:05:19 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390cd86c93bsm1573540f8f.26.2025.02.25.01.05.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 01:05:19 -0800 (PST) From: Neil Armstrong Date: Tue, 25 Feb 2025 10:05:11 +0100 Subject: [PATCH 3/4] media: platform: qcom/iris: add support for vpu33 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250225-topic-sm8x50-iris-v10-v1-3-128ef05d9665@linaro.org> References: <20250225-topic-sm8x50-iris-v10-v1-0-128ef05d9665@linaro.org> In-Reply-To: <20250225-topic-sm8x50-iris-v10-v1-0-128ef05d9665@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=12430; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=bMnp0Uv2RC/2qm+VTO2WwzTvIrV/Oa4fubd2QbCJsQ4=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnvYfM78sDMRxO6p7itptPpcECH1GQFVBMSjtVh6Mg o8067OaJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ72HzAAKCRB33NvayMhJ0VsYD/ sHTQN1AWZCDfEYV3acn/ES7P4RIV1ftVcQpzCm88+0iBRwR5aHHOG3on6mex4e+24vuBLRgcjoj1Th nXs74ce6Dcj31KetoCN4a7uhpdXU9kqjikD3buXM8V92x6CL8FPPJKpa2c29uOk9EcZUd4xO5xBfwS uTOCzvGE3CKZxd/DX1H6M/lyrdWUysO5wxJzEJPGvdomhRisrd0a9d+NNA7C5v30m03g7nBfE0i1z7 7w5aVRrq9dCOFRNcjQx3jYdp70Vmjrtwb5Su3/PbB/hQ7SiNI1lCK2keLZcomIKWX9IVTsnzM2eA8k z0sNHXUDW4Skfdv0btv5KV0jwV5i2A5d9VmrcKsi+Tv3mZYZfOogc+XBdGISKtBM0WrCx5xj67ht+A bl5Dp28ZtVnz1fLUTn/0A9IFjPM46dlTHnLymErYDxDF8qfryYywj9w22oOBpi90Tca6qfDoC8xv5L M+AT90HChU+5uVZ1yC/3k54RLNY5od9FQMm5IMJ3kwAii4AN5uDlYkwSRF5tkDNuCk5n961w3hBHVK ZPms4B9H06tyXXmOmcdIiI4dCxSFrOY9gzhfMirfQ2NLNfqQ4Z1YsdcEiP90QVJCPVGlNVfpjb078X mnBUkkZ/aj1VekdF2M3zToVbjMh7WvhtNGJJFe/mpIeS8DsiL83GHgax4T1Q== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE The IRIS acceleration found in the SM8650 platforms uses the vpu33 hardware version, and requires a slighly different reset and power off sequences in order to properly get out of runtime suspend. Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/Makefile | 1 + drivers/media/platform/qcom/iris/iris_vpu33.c | 315 +++++++++++++++++= ++++ drivers/media/platform/qcom/iris/iris_vpu_common.h | 1 + 3 files changed, 317 insertions(+) diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/plat= form/qcom/iris/Makefile index 35390534534e93f4617c1036a05ca0921567ba1d..6b64c9988505afd9707c704449d= 60bb53209229f 100644 --- a/drivers/media/platform/qcom/iris/Makefile +++ b/drivers/media/platform/qcom/iris/Makefile @@ -21,6 +21,7 @@ qcom-iris-objs +=3D \ iris_vdec.o \ iris_vpu2.o \ iris_vpu3.o \ + iris_vpu33.o \ iris_vpu_buffer.o \ iris_vpu_common.o \ =20 diff --git a/drivers/media/platform/qcom/iris/iris_vpu33.c b/drivers/media/= platform/qcom/iris/iris_vpu33.c new file mode 100644 index 0000000000000000000000000000000000000000..128a050f206f99ec0d43b97ff99= 5fa50d5684150 --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_vpu33.c @@ -0,0 +1,315 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights res= erved. + */ + +#include +#include + +#include "iris_instance.h" +#include "iris_vpu_common.h" +#include "iris_vpu_register_defines.h" + +#define WRAPPER_TZ_BASE_OFFS 0x000C0000 +#define AON_BASE_OFFS 0x000E0000 +#define AON_MVP_NOC_RESET 0x0001F000 + +#define WRAPPER_DEBUG_BRIDGE_LPI_CONTROL (WRAPPER_BASE_OFFS + 0x54) +#define WRAPPER_DEBUG_BRIDGE_LPI_STATUS (WRAPPER_BASE_OFFS + 0x58) +#define WRAPPER_IRIS_CPU_NOC_LPI_CONTROL (WRAPPER_BASE_OFFS + 0x5C) +#define REQ_POWER_DOWN_PREP BIT(0) +#define WRAPPER_IRIS_CPU_NOC_LPI_STATUS (WRAPPER_BASE_OFFS + 0x60) +#define WRAPPER_CORE_CLOCK_CONFIG (WRAPPER_BASE_OFFS + 0x88) +#define CORE_CLK_RUN 0x0 + +#define WRAPPER_TZ_CTL_AXI_CLOCK_CONFIG (WRAPPER_TZ_BASE_OFFS + 0x14) +#define CTL_AXI_CLK_HALT BIT(0) +#define CTL_CLK_HALT BIT(1) + +#define WRAPPER_TZ_QNS4PDXFIFO_RESET (WRAPPER_TZ_BASE_OFFS + 0x18) +#define RESET_HIGH BIT(0) + +#define CPU_CS_AHB_BRIDGE_SYNC_RESET (CPU_CS_BASE_OFFS + 0x160) +#define CORE_BRIDGE_SW_RESET BIT(0) +#define CORE_BRIDGE_HW_RESET_DISABLE BIT(1) + +#define CPU_CS_X2RPMH (CPU_CS_BASE_OFFS + 0x168) +#define MSK_SIGNAL_FROM_TENSILICA BIT(0) +#define MSK_CORE_POWER_ON BIT(1) + +#define AON_WRAPPER_MVP_NOC_RESET_REQ (AON_MVP_NOC_RESET + 0x000) +#define VIDEO_NOC_RESET_REQ (BIT(0) | BIT(1)) + +#define AON_WRAPPER_MVP_NOC_RESET_ACK (AON_MVP_NOC_RESET + 0x004) + +#define VCODEC_SS_IDLE_STATUSN (VCODEC_BASE_OFFS + 0x70) + +#define AON_WRAPPER_MVP_NOC_LPI_CONTROL (AON_BASE_OFFS) +#define AON_WRAPPER_MVP_NOC_LPI_STATUS (AON_BASE_OFFS + 0x4) + +#define AON_WRAPPER_MVP_NOC_CORE_SW_RESET (AON_BASE_OFFS + 0x18) +#define SW_RESET BIT(0) +#define AON_WRAPPER_MVP_NOC_CORE_CLK_CONTROL (AON_BASE_OFFS + 0x20) +#define NOC_HALT BIT(0) +#define AON_WRAPPER_SPARE (AON_BASE_OFFS + 0x28) + +#define VCODEC_DMA_SPARE_3 0x87B8 + +static int reset_control_bulk_assert_id(int num_rstcs, + struct reset_control_bulk_data *rstcs, + char *id) +{ + int i; + + for (i =3D 0; i < num_rstcs; ++i) { + if (!strcmp(rstcs[i].id, id)) + return reset_control_assert(rstcs[i].rstc); + } + + return -ENODEV; +} + +static int reset_control_bulk_deassert_id(int num_rstcs, + struct reset_control_bulk_data *rstcs, + char *id) +{ + int i; + + for (i =3D 0; i < num_rstcs; ++i) { + if (!strcmp(rstcs[i].id, id)) + return reset_control_deassert(rstcs[i].rstc); + } + + return -ENODEV; +} + +static bool iris_vpu33_hw_power_collapsed(struct iris_core *core) +{ + u32 value, pwr_status; + + value =3D readl(core->reg_base + WRAPPER_CORE_POWER_STATUS); + pwr_status =3D value & BIT(1); + + return pwr_status ? false : true; +} + +static void iris_vpu33_power_off_hardware(struct iris_core *core) +{ + u32 reg_val =3D 0, value, i; + int ret; + int count =3D 0; + + if (iris_vpu33_hw_power_collapsed(core)) + goto disable_power; + + value =3D readl(core->reg_base + WRAPPER_CORE_CLOCK_CONFIG); + if (value) + writel(CORE_CLK_RUN, core->reg_base + WRAPPER_CORE_CLOCK_CONFIG); + + value =3D readl(core->reg_base + VCODEC_DMA_SPARE_3); + value |=3D BIT(0); + writel(value, core->reg_base + VCODEC_DMA_SPARE_3); + + for (i =3D 0; i < core->iris_platform_data->num_vpp_pipe; i++) { + ret =3D readl_poll_timeout(core->reg_base + VCODEC_SS_IDLE_STATUSN + 4 *= i, + reg_val, reg_val & 0x400000, 2000, 20000); + if (ret) + goto disable_power; + } + + /* set MNoC to low power, set PD_NOC_QREQ (bit 0) */ + value =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + value |=3D BIT(0); + writel(value, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + + value =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STATUS); + + while ((!(value & BIT(0))) && (value & BIT(1) || value & BIT(2))) { + value =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + value &=3D ~BIT(0); + writel(value, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + + usleep_range(10, 20); + + value =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + value |=3D BIT(0); + writel(value, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + + usleep_range(10, 20); + + value =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_STATUS); + + ++count; + if (count >=3D 1000) + break; + } + + if (count < 1000) { + value =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + value &=3D ~BIT(0); + writel(value, core->reg_base + AON_WRAPPER_MVP_NOC_LPI_CONTROL); + } + + writel(VIDEO_NOC_RESET_REQ, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_RE= Q); + + ret =3D readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_RESET_ACK, + reg_val, reg_val & 0x3, 200, 2000); + if (ret) + goto disable_power; + + writel(0x0, core->reg_base + AON_WRAPPER_MVP_NOC_RESET_REQ); + + ret =3D readl_poll_timeout(core->reg_base + AON_WRAPPER_MVP_NOC_RESET_ACK, + reg_val, !(reg_val & 0x3), 200, 2000); + if (ret) + goto disable_power; + + writel(CORE_BRIDGE_SW_RESET | CORE_BRIDGE_HW_RESET_DISABLE, + core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); + writel(CORE_BRIDGE_HW_RESET_DISABLE, core->reg_base + CPU_CS_AHB_BRIDGE_S= YNC_RESET); + writel(0x0, core->reg_base + CPU_CS_AHB_BRIDGE_SYNC_RESET); + +disable_power: + iris_vpu_power_off_hw(core); +} + +static int iris_vpu33_power_off_controller(struct iris_core *core) +{ + u32 rst_tbl_size =3D core->iris_platform_data->clk_rst_tbl_size; + u32 val =3D 0; + int ret; + + writel(MSK_SIGNAL_FROM_TENSILICA | MSK_CORE_POWER_ON, core->reg_base + CP= U_CS_X2RPMH); + + writel(REQ_POWER_DOWN_PREP, core->reg_base + WRAPPER_IRIS_CPU_NOC_LPI_CON= TROL); + + ret =3D readl_poll_timeout(core->reg_base + WRAPPER_IRIS_CPU_NOC_LPI_STAT= US, + val, val & BIT(0), 200, 2000); + if (ret) + goto disable_power; + + writel(0x0, core->reg_base + WRAPPER_DEBUG_BRIDGE_LPI_CONTROL); + + ret =3D readl_poll_timeout(core->reg_base + WRAPPER_DEBUG_BRIDGE_LPI_STAT= US, + val, val =3D=3D 0, 200, 2000); + if (ret) + goto disable_power; + + writel(CTL_AXI_CLK_HALT | CTL_CLK_HALT, + core->reg_base + WRAPPER_TZ_CTL_AXI_CLOCK_CONFIG); + writel(RESET_HIGH, core->reg_base + WRAPPER_TZ_QNS4PDXFIFO_RESET); + writel(0x0, core->reg_base + WRAPPER_TZ_QNS4PDXFIFO_RESET); + writel(0x0, core->reg_base + WRAPPER_TZ_CTL_AXI_CLOCK_CONFIG); + + reset_control_bulk_assert_id(rst_tbl_size, core->resets, "bus"); + reset_control_bulk_assert_id(rst_tbl_size, core->resets, "core"); + usleep_range(1000, 1100); + reset_control_bulk_deassert_id(rst_tbl_size, core->resets, "bus"); + reset_control_bulk_deassert_id(rst_tbl_size, core->resets, "core"); + + /* Disable MVP NoC clock */ + val =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_CORE_CLK_CONTROL); + val |=3D NOC_HALT; + writel(val, core->reg_base + AON_WRAPPER_MVP_NOC_CORE_CLK_CONTROL); + + /* enable MVP NoC reset */ + val =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_CORE_SW_RESET); + val |=3D SW_RESET; + writel(val, core->reg_base + AON_WRAPPER_MVP_NOC_CORE_SW_RESET); + + /* poll AON spare register bit0 to become zero with 50ms timeout */ + ret =3D readl_poll_timeout(core->reg_base + AON_WRAPPER_SPARE, + val, (val & BIT(0)) =3D=3D 0, 1000, 50000); + if (ret) + goto disable_power; + + /* enable bit(1) to avoid cvp noc xo reset */ + val =3D readl(core->reg_base + AON_WRAPPER_SPARE); + val |=3D BIT(1); + writel(val, core->reg_base + AON_WRAPPER_SPARE); + + reset_control_bulk_assert_id(rst_tbl_size, core->resets, "xo"); + + /* De-assert MVP NoC reset */ + val =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_CORE_SW_RESET); + val &=3D ~SW_RESET; + writel(val, core->reg_base + AON_WRAPPER_MVP_NOC_CORE_SW_RESET); + + usleep_range(80, 100); + reset_control_bulk_deassert_id(rst_tbl_size, core->resets, "xo"); + + /* reset AON spare register */ + writel(0, core->reg_base + AON_WRAPPER_SPARE); + + /* Enable MVP NoC clock */ + val =3D readl(core->reg_base + AON_WRAPPER_MVP_NOC_CORE_CLK_CONTROL); + val &=3D ~NOC_HALT; + writel(val, core->reg_base + AON_WRAPPER_MVP_NOC_CORE_CLK_CONTROL); + + iris_disable_unprepare_clock(core, IRIS_CTRL_CLK); + +disable_power: + iris_disable_power_domains(core, core->pmdomain_tbl->pd_devs[IRIS_CTRL_PO= WER_DOMAIN]); + iris_disable_unprepare_clock(core, IRIS_AXI_CLK); + + return 0; +} + +static u64 iris_vpu33_calculate_frequency(struct iris_inst *inst, size_t d= ata_size) +{ + struct platform_inst_caps *caps =3D inst->core->iris_platform_data->inst_= caps; + struct v4l2_format *inp_f =3D inst->fmt_src; + u32 height, width, mbs_per_second, mbpf; + u64 fw_cycles, fw_vpp_cycles; + u64 vsp_cycles, vpp_cycles; + u32 fps =3D DEFAULT_FPS; + + width =3D max(inp_f->fmt.pix_mp.width, inst->crop.width); + height =3D max(inp_f->fmt.pix_mp.height, inst->crop.height); + + mbpf =3D NUM_MBS_PER_FRAME(height, width); + mbs_per_second =3D mbpf * fps; + + fw_cycles =3D fps * caps->mb_cycles_fw; + fw_vpp_cycles =3D fps * caps->mb_cycles_fw_vpp; + + vpp_cycles =3D mult_frac(mbs_per_second, caps->mb_cycles_vpp, (u32)inst->= fw_caps[PIPE].value); + /* 21 / 20 is minimum overhead factor */ + vpp_cycles +=3D max(div_u64(vpp_cycles, 20), fw_vpp_cycles); + + /* 1.059 is multi-pipe overhead */ + if (inst->fw_caps[PIPE].value > 1) + vpp_cycles +=3D div_u64(vpp_cycles * 59, 1000); + + vsp_cycles =3D fps * data_size * 8; + vsp_cycles =3D div_u64(vsp_cycles, 2); + /* VSP FW overhead 1.05 */ + vsp_cycles =3D div_u64(vsp_cycles * 21, 20); + + if (inst->fw_caps[STAGE].value =3D=3D STAGE_1) + vsp_cycles =3D vsp_cycles * 3; + + return max3(vpp_cycles, vsp_cycles, fw_cycles); +} + +static int iris_vpu33_reset_controller(struct iris_core *core) +{ + u32 rst_tbl_size =3D core->iris_platform_data->clk_rst_tbl_size; + + reset_control_bulk_assert_id(rst_tbl_size, core->resets, "bus"); + reset_control_bulk_assert_id(rst_tbl_size, core->resets, "core"); + + usleep_range(1000, 1100); + + reset_control_bulk_deassert_id(rst_tbl_size, core->resets, "bus"); + reset_control_bulk_deassert_id(rst_tbl_size, core->resets, "core"); + + return 0; +} + +const struct vpu_ops iris_vpu33_ops =3D { + .reset_controller =3D iris_vpu33_reset_controller, + .power_off_hw =3D iris_vpu33_power_off_hardware, + .power_off_controller =3D iris_vpu33_power_off_controller, + .calc_freq =3D iris_vpu33_calculate_frequency, +}; diff --git a/drivers/media/platform/qcom/iris/iris_vpu_common.h b/drivers/m= edia/platform/qcom/iris/iris_vpu_common.h index c948d8b5aee87ccf1fd53c5518a27294232d8fb8..c4d02a3b884881eb033dc0342f9= 48848adae2819 100644 --- a/drivers/media/platform/qcom/iris/iris_vpu_common.h +++ b/drivers/media/platform/qcom/iris/iris_vpu_common.h @@ -10,6 +10,7 @@ struct iris_core; =20 extern const struct vpu_ops iris_vpu2_ops; extern const struct vpu_ops iris_vpu3_ops; +extern const struct vpu_ops iris_vpu33_ops; =20 struct vpu_ops { int (*reset_controller)(struct iris_core *core); --=20 2.34.1 From nobody Mon Feb 9 09:54:10 2026 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D742326658C for ; Tue, 25 Feb 2025 09:05:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740474325; cv=none; b=UJrVJQ34yy2ebfqY0zfxN8zUHyACebvP2pXbqwHHiMdD0t4mjWLC3GLs1dxW16aSc5MSae3sNO3cqvNIoJyaOgHi4+kkACwiFwJx3VPADOZFJBp6CqdpDbcMZi2GkBsOyITht6Gzn4efuPzBwzzDY8L+Patn6vrz2WJfG53EzAc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740474325; c=relaxed/simple; bh=v00FvgOpYb+n3FGLO6d0TWMNJxGJTCgKGQ6XpRBKpZQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=khaeTZ778XcLxcD0EY8PUNW4ws2fu2XWC39l9yyrM1bb2G39iCL4FmbUCWIgRGooGbLKNYL3z+NoZz0rOBar2UH/ue3pBkOoYaielEtqcp+FJhEJQGc4sHgXwAjIJDr706AlVHFxLmjaaXG7j4kuHpXqAW6jh+V2ZkwG3I8wvfM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=dNoRXEcN; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dNoRXEcN" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-38f3486062eso4518437f8f.0 for ; Tue, 25 Feb 2025 01:05:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740474321; x=1741079121; 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=MYmR6wYxHn+OrnAqeln0/aM1+4hC+I2kO2nIYcMMvmw=; b=dNoRXEcNpKTgyENRt2YKRnxuc7ju/CM3DuA82uiDarjV+d0xiIYrd9z+N8rV7GlB5O sJa3NJWhHJAMWX/S6ulxy00O0GbsTiSoCjNLUm2RUQI+WfuEtli+36acp+qidtPGA0tx d5W1pXZbuIjgVzEiKVoVAYUJHf0ShBs8cPISsQoZ8ssJGNtp6pAfkjGF4KjJ2U1lnfzA VF+SGucMWavbnJTPE4SF9a0cjF2SKrjLxf2l0FEzJmtvHnKvimNyUQ44YTae6xRhHaoX 6JfXpj6MB5J+6xfuL4VnLX7j1fW106wwqmiPTsaV/619A7PgIPJTEiFOi3JQaiGh9Jke zuMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740474321; x=1741079121; 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=MYmR6wYxHn+OrnAqeln0/aM1+4hC+I2kO2nIYcMMvmw=; b=MZr1SH6KN6qHiot0YgOiTqHnqzGhEO3ThhCQI61xy9d0gJOrJMUFFzV8oN7FZSsZb2 Nxz20L6ZhMVncMbasJz6k/Qi+OsA7hWV7ZprYjqj2SUS04y0culG0e78E+0eEBfasBme EoRfvTuCVQQ8cNGraSiEBB6sAEBhhItF61B+M3cD31jczlog3IR3zdRl/8UuZg8fYVmq d4ALry+HaY8J4Qh9cLbYnWiZK6LwpqFHI8q57z236CJ6EuSDAzDIRyU0ElTjrOhYokG1 7NxGPW4EOmJb7AtlvT/XeWYLrhE00Rr/gF9G8TW7kFtBnDekakHIwTvE2OUe6Dp0PCs9 uO3g== X-Forwarded-Encrypted: i=1; AJvYcCWwkPuibKzLS4ZqDdgavnFoOqm6In6OfssUYkG6dEBna0efCEViNQt4IivvAQGASXsNVrYbc8uVgbiQSo4=@vger.kernel.org X-Gm-Message-State: AOJu0YwAr8fXq0UbL5/1Ixlk01dar2wpyGZcR+y3oQirItxPlqxQtzil 15SilEqB0dL/7cniqSXXihcB5yG2oG/5LiOVcRvbGMMUYh6N6/FgqmnijXIe0/s= X-Gm-Gg: ASbGncuEResje6JiQnGInUHgXKb9I6dGTQZEqq+LMIBlHHebPGXhYbYKi4Fu5qv4Flb XAf0nwKEE3YNrYf2fLG2s3CSHhz3S+kXLwgGHe6KDDpl3Em5uVd42oFOFg5n2KoUmr0YA2UcVFl DtyuiKDMmf4qaH1uQQJ7AqBsRigzHQJCR/puOhrPDJ9LOUZgNQo+eLOVOclSb7tFqm9hi42YSqC AXaAYKkOxXgHzEIUk6fpPhuh3LvUR1JBCC9J1kSk0n29CGNPNDMxmL7FYSgC4dHjw3qSqVDULT3 6pcg/cfdz9M1VP31gQ+eCkeCn3uuPCD9uRl6UEUmkHUAYME= X-Google-Smtp-Source: AGHT+IGXsU7hwX2gAxEY6VM940MGo0A6mKVnjChXhYTPaOpxxIOzGvKpEQd12j49B57MKG7ir3Lmxw== X-Received: by 2002:a5d:588c:0:b0:38d:e584:81ea with SMTP id ffacd0b85a97d-38f6f0d1c8bmr14397863f8f.45.1740474320749; Tue, 25 Feb 2025 01:05:20 -0800 (PST) Received: from arrakeen.starnux.net ([2a01:e0a:982:cbb0:52eb:f6ff:feb3:451a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390cd86c93bsm1573540f8f.26.2025.02.25.01.05.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 01:05:20 -0800 (PST) From: Neil Armstrong Date: Tue, 25 Feb 2025 10:05:12 +0100 Subject: [PATCH 4/4] media: platform: qcom/iris: add sm8650 support Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250225-topic-sm8x50-iris-v10-v1-4-128ef05d9665@linaro.org> References: <20250225-topic-sm8x50-iris-v10-v1-0-128ef05d9665@linaro.org> In-Reply-To: <20250225-topic-sm8x50-iris-v10-v1-0-128ef05d9665@linaro.org> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel Cc: linux-arm-msm@vger.kernel.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Neil Armstrong X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=10895; i=neil.armstrong@linaro.org; h=from:subject:message-id; bh=v00FvgOpYb+n3FGLO6d0TWMNJxGJTCgKGQ6XpRBKpZQ=; b=owEBbQKS/ZANAwAKAXfc29rIyEnRAcsmYgBnvYfM2Pkodfx6ekVFlWwGC6OZlaJQwd1Zg59AtaMQ ll0ke2GJAjMEAAEKAB0WIQQ9U8YmyFYF/h30LIt33NvayMhJ0QUCZ72HzAAKCRB33NvayMhJ0fBPD/ 0ex0MrvnJ4VSu61N+p3fbe5XoMW7FsUtGQlHerBoFYV8dyvkXHnCZ2+ZaVec//9iZVqr9MpWFWxm1v jVGnzgby4nvCV4+oyMkt7P7lkRq9twRscWd9yk2OBrmGSsE7XXjpElGq1xUx9GJFuetiO5wfrn6e6z yhT9daI5GNFgV5Tgl8mwgDDqeH54iGELuw4VjEzJQwFsDW9MXVUUSdBeLhp77kCHOA+Ms1Pm8p8mQn AVf9v531WrAX2RuwVVd/IUOWRrE+g4OkGYdj9GzR39agzDkub9NnUbPV6vQLfgXyTDmJJJ8NuRie6i fMeGkFccjwbdrxwbHVU3kLQcmcYHgSfGd3Tn3ouAkNvUiws+S932ncBGB93O4nitGwN7JwLy/FM4Yv hBGx/S4W/qKccEm4YznMmOMochU57GmpWTlSGDVS5KKDTsjH9BHsFCovNCa/aaumrGKBYhUgPbWlTv hx7WoNhSxrbg/LTFTZBWCKOJJsYcDeq4XRtUcBeCEt1I3pbiI05spvY78B8on2PUPAmo0ml5XOfc5k 0rHcuWDcZoqNS6Gon7K0pa202zm6ThDhJ1Ql8MFOSviFH31j7UhhLjKbCIhfeDOKy3IyD3OOSqMBxD QaASEjQBc9otjwMmnuayINzAqi6vNWQBC+EshgWVc/YLsPz0wMyh55Qz7SCQ== X-Developer-Key: i=neil.armstrong@linaro.org; a=openpgp; fpr=89EC3D058446217450F22848169AB7B1A4CFF8AE Add support for the SM8650 platform by re-using the SM8550 definitions and using the vpu33 ops. The SM8650/vpu33 requires more reset lines, but the H.284 decoder capabilities are identical. Signed-off-by: Neil Armstrong --- drivers/media/platform/qcom/iris/Makefile | 1 + .../platform/qcom/iris/iris_platform_common.h | 1 + .../platform/qcom/iris/iris_platform_sm8650.c | 266 +++++++++++++++++= ++++ drivers/media/platform/qcom/iris/iris_probe.c | 4 + 4 files changed, 272 insertions(+) diff --git a/drivers/media/platform/qcom/iris/Makefile b/drivers/media/plat= form/qcom/iris/Makefile index 6b64c9988505afd9707c704449d60bb53209229f..4caba81a95b806b9fa4937d9c79= 73031dea43d0e 100644 --- a/drivers/media/platform/qcom/iris/Makefile +++ b/drivers/media/platform/qcom/iris/Makefile @@ -11,6 +11,7 @@ qcom-iris-objs +=3D \ iris_hfi_gen2_response.o \ iris_hfi_queue.o \ iris_platform_sm8550.o \ + iris_platform_sm8650.o \ iris_power.o \ iris_probe.o \ iris_resources.o \ diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index f6b15d2805fb2004699709bb12cd7ce9b052180c..75e266a6b718acb8518079c2125= dfb30435cbf2b 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -35,6 +35,7 @@ enum pipe_type { =20 extern struct iris_platform_data sm8250_data; extern struct iris_platform_data sm8550_data; +extern struct iris_platform_data sm8650_data; =20 enum platform_clk_type { IRIS_AXI_CLK, diff --git a/drivers/media/platform/qcom/iris/iris_platform_sm8650.c b/driv= ers/media/platform/qcom/iris/iris_platform_sm8650.c new file mode 100644 index 0000000000000000000000000000000000000000..823e349dead2606129e52d6d2d6= 74cb2550eaf17 --- /dev/null +++ b/drivers/media/platform/qcom/iris/iris_platform_sm8650.c @@ -0,0 +1,266 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights res= erved. + */ + +#include "iris_core.h" +#include "iris_ctrls.h" +#include "iris_hfi_gen2.h" +#include "iris_hfi_gen2_defines.h" +#include "iris_platform_common.h" +#include "iris_vpu_common.h" + +#define VIDEO_ARCH_LX 1 + +static struct platform_inst_fw_cap inst_fw_cap_sm8650[] =3D { + { + .cap_id =3D PROFILE, + .min =3D V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE, + .max =3D V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH, + .step_or_mask =3D BIT(V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE) | + BIT(V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE) | + BIT(V4L2_MPEG_VIDEO_H264_PROFILE_MAIN) | + BIT(V4L2_MPEG_VIDEO_H264_PROFILE_HIGH) | + BIT(V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH), + .value =3D V4L2_MPEG_VIDEO_H264_PROFILE_HIGH, + .hfi_id =3D HFI_PROP_PROFILE, + .flags =3D CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU, + .set =3D iris_set_u32_enum, + }, + { + .cap_id =3D LEVEL, + .min =3D V4L2_MPEG_VIDEO_H264_LEVEL_1_0, + .max =3D V4L2_MPEG_VIDEO_H264_LEVEL_6_2, + .step_or_mask =3D BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_0) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1B) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_1) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_2) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_1_3) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_2_0) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_2_1) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_2_2) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_3_0) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_3_1) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_3_2) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_0) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_1) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_4_2) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_5_0) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_5_1) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_5_2) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_6_0) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_6_1) | + BIT(V4L2_MPEG_VIDEO_H264_LEVEL_6_2), + .value =3D V4L2_MPEG_VIDEO_H264_LEVEL_6_1, + .hfi_id =3D HFI_PROP_LEVEL, + .flags =3D CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU, + .set =3D iris_set_u32_enum, + }, + { + .cap_id =3D INPUT_BUF_HOST_MAX_COUNT, + .min =3D DEFAULT_MAX_HOST_BUF_COUNT, + .max =3D DEFAULT_MAX_HOST_BURST_BUF_COUNT, + .step_or_mask =3D 1, + .value =3D DEFAULT_MAX_HOST_BUF_COUNT, + .hfi_id =3D HFI_PROP_BUFFER_HOST_MAX_COUNT, + .flags =3D CAP_FLAG_INPUT_PORT, + .set =3D iris_set_u32, + }, + { + .cap_id =3D STAGE, + .min =3D STAGE_1, + .max =3D STAGE_2, + .step_or_mask =3D 1, + .value =3D STAGE_2, + .hfi_id =3D HFI_PROP_STAGE, + .set =3D iris_set_stage, + }, + { + .cap_id =3D PIPE, + .min =3D PIPE_1, + .max =3D PIPE_4, + .step_or_mask =3D 1, + .value =3D PIPE_4, + .hfi_id =3D HFI_PROP_PIPE, + .set =3D iris_set_pipe, + }, + { + .cap_id =3D POC, + .min =3D 0, + .max =3D 2, + .step_or_mask =3D 1, + .value =3D 1, + .hfi_id =3D HFI_PROP_PIC_ORDER_CNT_TYPE, + }, + { + .cap_id =3D CODED_FRAMES, + .min =3D CODED_FRAMES_PROGRESSIVE, + .max =3D CODED_FRAMES_PROGRESSIVE, + .step_or_mask =3D 0, + .value =3D CODED_FRAMES_PROGRESSIVE, + .hfi_id =3D HFI_PROP_CODED_FRAMES, + }, + { + .cap_id =3D BIT_DEPTH, + .min =3D BIT_DEPTH_8, + .max =3D BIT_DEPTH_8, + .step_or_mask =3D 1, + .value =3D BIT_DEPTH_8, + .hfi_id =3D HFI_PROP_LUMA_CHROMA_BIT_DEPTH, + }, + { + .cap_id =3D RAP_FRAME, + .min =3D 0, + .max =3D 1, + .step_or_mask =3D 1, + .value =3D 1, + .hfi_id =3D HFI_PROP_DEC_START_FROM_RAP_FRAME, + .flags =3D CAP_FLAG_INPUT_PORT, + .set =3D iris_set_u32, + }, +}; + +static struct platform_inst_caps platform_inst_cap_sm8650 =3D { + .min_frame_width =3D 96, + .max_frame_width =3D 8192, + .min_frame_height =3D 96, + .max_frame_height =3D 8192, + .max_mbpf =3D (8192 * 4352) / 256, + .mb_cycles_vpp =3D 200, + .mb_cycles_fw =3D 489583, + .mb_cycles_fw_vpp =3D 66234, + .num_comv =3D 0, +}; + +static void iris_set_sm8650_preset_registers(struct iris_core *core) +{ + writel(0x0, core->reg_base + 0xB0088); +} + +static const struct icc_info sm8650_icc_table[] =3D { + { "cpu-cfg", 1000, 1000 }, + { "video-mem", 1000, 15000000 }, +}; + +static const char * const sm8650_clk_reset_table[] =3D { "bus", "xo", "cor= e" }; + +static const struct bw_info sm8650_bw_table_dec[] =3D { + { ((4096 * 2160) / 256) * 60, 1608000 }, + { ((4096 * 2160) / 256) * 30, 826000 }, + { ((1920 * 1080) / 256) * 60, 567000 }, + { ((1920 * 1080) / 256) * 30, 294000 }, +}; + +static const char * const sm8650_pmdomain_table[] =3D { "venus", "vcodec0"= }; + +static const char * const sm8650_opp_pd_table[] =3D { "mxc", "mmcx" }; + +static const struct platform_clk_data sm8650_clk_table[] =3D { + {IRIS_AXI_CLK, "iface" }, + {IRIS_CTRL_CLK, "core" }, + {IRIS_HW_CLK, "vcodec0_core" }, +}; + +static struct ubwc_config_data ubwc_config_sm8650 =3D { + .max_channels =3D 8, + .mal_length =3D 32, + .highest_bank_bit =3D 16, + .bank_swzl_level =3D 0, + .bank_swz2_level =3D 1, + .bank_swz3_level =3D 1, + .bank_spreading =3D 1, +}; + +static struct tz_cp_config tz_cp_config_sm8650 =3D { + .cp_start =3D 0, + .cp_size =3D 0x25800000, + .cp_nonpixel_start =3D 0x01000000, + .cp_nonpixel_size =3D 0x24800000, +}; + +static const u32 sm8650_vdec_input_config_params[] =3D { + HFI_PROP_BITSTREAM_RESOLUTION, + HFI_PROP_CROP_OFFSETS, + HFI_PROP_CODED_FRAMES, + HFI_PROP_BUFFER_FW_MIN_OUTPUT_COUNT, + HFI_PROP_PIC_ORDER_CNT_TYPE, + HFI_PROP_PROFILE, + HFI_PROP_LEVEL, + HFI_PROP_SIGNAL_COLOR_INFO, +}; + +static const u32 sm8650_vdec_output_config_params[] =3D { + HFI_PROP_COLOR_FORMAT, + HFI_PROP_LINEAR_STRIDE_SCANLINE, +}; + +static const u32 sm8650_vdec_subscribe_input_properties[] =3D { + HFI_PROP_NO_OUTPUT, +}; + +static const u32 sm8650_vdec_subscribe_output_properties[] =3D { + HFI_PROP_PICTURE_TYPE, + HFI_PROP_CABAC_SESSION, +}; + +static const u32 sm8650_dec_ip_int_buf_tbl[] =3D { + BUF_BIN, + BUF_COMV, + BUF_NON_COMV, + BUF_LINE, +}; + +static const u32 sm8650_dec_op_int_buf_tbl[] =3D { + BUF_DPB, +}; + +struct iris_platform_data sm8650_data =3D { + .get_instance =3D iris_hfi_gen2_get_instance, + .init_hfi_command_ops =3D iris_hfi_gen2_command_ops_init, + .init_hfi_response_ops =3D iris_hfi_gen2_response_ops_init, + .vpu_ops =3D &iris_vpu33_ops, + .set_preset_registers =3D iris_set_sm8650_preset_registers, + .icc_tbl =3D sm8650_icc_table, + .icc_tbl_size =3D ARRAY_SIZE(sm8650_icc_table), + .clk_rst_tbl =3D sm8650_clk_reset_table, + .clk_rst_tbl_size =3D ARRAY_SIZE(sm8650_clk_reset_table), + .bw_tbl_dec =3D sm8650_bw_table_dec, + .bw_tbl_dec_size =3D ARRAY_SIZE(sm8650_bw_table_dec), + .pmdomain_tbl =3D sm8650_pmdomain_table, + .pmdomain_tbl_size =3D ARRAY_SIZE(sm8650_pmdomain_table), + .opp_pd_tbl =3D sm8650_opp_pd_table, + .opp_pd_tbl_size =3D ARRAY_SIZE(sm8650_opp_pd_table), + .clk_tbl =3D sm8650_clk_table, + .clk_tbl_size =3D ARRAY_SIZE(sm8650_clk_table), + /* Upper bound of DMA address range */ + .dma_mask =3D 0xe0000000 - 1, + .fwname =3D "qcom/vpu/vpu33_p4.mbn", + .pas_id =3D IRIS_PAS_ID, + .inst_caps =3D &platform_inst_cap_sm8650, + .inst_fw_caps =3D inst_fw_cap_sm8650, + .inst_fw_caps_size =3D ARRAY_SIZE(inst_fw_cap_sm8650), + .tz_cp_config_data =3D &tz_cp_config_sm8650, + .core_arch =3D VIDEO_ARCH_LX, + .hw_response_timeout =3D HW_RESPONSE_TIMEOUT_VALUE, + .ubwc_config =3D &ubwc_config_sm8650, + .num_vpp_pipe =3D 4, + .max_session_count =3D 16, + .max_core_mbpf =3D ((8192 * 4352) / 256) * 2, + .input_config_params =3D + sm8650_vdec_input_config_params, + .input_config_params_size =3D + ARRAY_SIZE(sm8650_vdec_input_config_params), + .output_config_params =3D + sm8650_vdec_output_config_params, + .output_config_params_size =3D + ARRAY_SIZE(sm8650_vdec_output_config_params), + .dec_input_prop =3D sm8650_vdec_subscribe_input_properties, + .dec_input_prop_size =3D ARRAY_SIZE(sm8650_vdec_subscribe_input_propertie= s), + .dec_output_prop =3D sm8650_vdec_subscribe_output_properties, + .dec_output_prop_size =3D ARRAY_SIZE(sm8650_vdec_subscribe_output_propert= ies), + + .dec_ip_int_buf_tbl =3D sm8650_dec_ip_int_buf_tbl, + .dec_ip_int_buf_tbl_size =3D ARRAY_SIZE(sm8650_dec_ip_int_buf_tbl), + .dec_op_int_buf_tbl =3D sm8650_dec_op_int_buf_tbl, + .dec_op_int_buf_tbl_size =3D ARRAY_SIZE(sm8650_dec_op_int_buf_tbl), +}; diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index aca442dcc153830e6252d1dca87afb38c0b9eb8f..8e6cc1dc529608696e81f2764e9= 0ea3864030125 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -330,6 +330,10 @@ static const struct of_device_id iris_dt_match[] =3D { .data =3D &sm8250_data, }, #endif + { + .compatible =3D "qcom,sm8650-iris", + .data =3D &sm8650_data, + }, { }, }; MODULE_DEVICE_TABLE(of, iris_dt_match); --=20 2.34.1