From patchwork Tue May 25 15:22:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 447475 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA147C47086 for ; Tue, 25 May 2021 15:22:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A68E86141C for ; Tue, 25 May 2021 15:22:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232046AbhEYPYY (ORCPT ); Tue, 25 May 2021 11:24:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231419AbhEYPYX (ORCPT ); Tue, 25 May 2021 11:24:23 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8961C06138A; Tue, 25 May 2021 08:22:52 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id c20so48019462ejm.3; Tue, 25 May 2021 08:22:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+0RnuC0ooSmKbb5ieKew3Le7GefbjO/yixv4+FcIHvM=; b=cxIjQV0zVUw5vf1js/4y83zt1j+6OvDreHZ8pb3YEbmQnA15xZ1ZTT4czXaZqudf4K XR8yP1lZj+JTgWvccj1EzxFyfUOVKkb/lTBMEZ7iK/T4aXBRoDxTL2hvqOylzzXIFCDe qa1WJj64FbTeKjVt2Z9H4GuA+j2oKQrpGlHueLuJ+DePLBaO3EnCLV3JS/jEMac+CXip L52EpI37JtI6i/SumSYQM7+n0rvd9Z1e2VhPkc9eIpexE+Jl+71jVbFEx1kmTwRzZAJT vWKSc0rxiKazkohVWGXDTULu1Q7qQ0WlwA+uFE486o1qqPou30cuLQTJyqnJCckSzjvL UFBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+0RnuC0ooSmKbb5ieKew3Le7GefbjO/yixv4+FcIHvM=; b=g2bMRmTAK7/JMVDq18xRV5LOOLPFHzc0unFrCtdSUwp8+wvSfMqDnNFc23L5bl9Xoc R5FR6s8Cp67UryBFgXygqcVO5M16YQyMcPF96cnn5AMZIbKjWobOLRq75IRIeX6iaXGI PmNZAA6e0JoikWRJ+zi6rXTwzPmIoft5S2cEWFQX3zB99HkTtdBtFEoIAT3bnmHR3wUX vuhASZkGWJIvRz/dDpl46JAi1AJnl2Bqy6pXOv/vELi4PXMonkzYo4OxD+qe9s1UJ6tR 1EhunQ3vUKa47d4LV9UsgMAADdR5yT5RT6tuytT9ks6rcJoHhWEFEYobBseIBA8mhoo8 9GvA== X-Gm-Message-State: AOAM531JmvL0nCeEl/8W7GkfrIodmfiEAYhd7oKfAxqRsBK6uUk3bB2k 1KuGPRF9DUaBkJPRTJx1eg== X-Google-Smtp-Source: ABdhPJyzY6ziOl4Z+B6Ig9qAMCAompJ0AbXRnqU9cfG8nRRbiIhL9veqPe0Mx+fa0rpCIP7b8jRWUw== X-Received: by 2002:a17:906:c0c6:: with SMTP id bn6mr28208995ejb.436.1621956171343; Tue, 25 May 2021 08:22:51 -0700 (PDT) Received: from localhost.localdomain ([2a02:810b:f40:e00:b55:da44:4fe2:2760]) by smtp.googlemail.com with ESMTPSA id e23sm11212945eds.2.2021.05.25.08.22.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 08:22:51 -0700 (PDT) From: Alex Bee To: Ezequiel Garcia , Mauro Carvalho Chehab , Rob Herring , Heiko Stuebner , Philipp Zabel , Lee Jones , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org Cc: Alex Bee , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 02/10] ARM: dts: rockchip: add power controller for RK3036 Date: Tue, 25 May 2021 17:22:17 +0200 Message-Id: <20210525152225.154302-3-knaerzche@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210525152225.154302-1-knaerzche@gmail.com> References: <20210525152225.154302-1-knaerzche@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add the power controller node and the correspondending qos nodes for RK3036. Also add the power-domain property to the nodes that are already present. Note: Since the regiser offsets of the axi interconnect QoS are missing in the TRM (RK3036 TRM V1.0), they have been taken from vendor kernel. Signed-off-by: Alex Bee --- arch/arm/boot/dts/rk3036.dtsi | 51 +++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/arch/arm/boot/dts/rk3036.dtsi b/arch/arm/boot/dts/rk3036.dtsi index 9ccefa8282ba..370dd03939c0 100644 --- a/arch/arm/boot/dts/rk3036.dtsi +++ b/arch/arm/boot/dts/rk3036.dtsi @@ -6,6 +6,7 @@ #include #include #include +#include / { #address-cells = <1>; @@ -111,6 +112,7 @@ gpu: gpu@10090000 { assigned-clock-rates = <100000000>; clocks = <&cru SCLK_GPU>, <&cru SCLK_GPU>; clock-names = "bus", "core"; + power-domains = <&power RK3036_PD_GPU>; resets = <&cru SRST_GPU>; status = "disabled"; }; @@ -121,6 +123,7 @@ vop: vop@10118000 { interrupts = ; clocks = <&cru ACLK_LCDC>, <&cru SCLK_LCDC>, <&cru HCLK_LCDC>; clock-names = "aclk_vop", "dclk_vop", "hclk_vop"; + power-domains = <&power RK3036_PD_VIO>; resets = <&cru SRST_LCDC1_A>, <&cru SRST_LCDC1_H>, <&cru SRST_LCDC1_D>; reset-names = "axi", "ahb", "dclk"; iommus = <&vop_mmu>; @@ -142,10 +145,26 @@ vop_mmu: iommu@10118300 { interrupts = ; clocks = <&cru ACLK_LCDC>, <&cru HCLK_LCDC>; clock-names = "aclk", "iface"; + power-domains = <&power RK3036_PD_VIO>; #iommu-cells = <0>; status = "disabled"; }; + qos_gpu: qos@1012d000 { + compatible = "rockchip,rk3036-qos", "syscon"; + reg = <0x1012d000 0x20>; + }; + + qos_vpu: qos@1012e000 { + compatible = "rockchip,rk3036-qos", "syscon"; + reg = <0x1012e000 0x20>; + }; + + qos_vio: qos@1012f000 { + compatible = "rockchip,rk3036-qos", "syscon"; + reg = <0x1012f000 0x20>; + }; + gic: interrupt-controller@10139000 { compatible = "arm,gic-400"; interrupt-controller; @@ -301,6 +320,38 @@ grf: syscon@20008000 { compatible = "rockchip,rk3036-grf", "syscon", "simple-mfd"; reg = <0x20008000 0x1000>; + power: power-controller { + compatible = "rockchip,rk3036-power-controller"; + #power-domain-cells = <1>; + #address-cells = <1>; + #size-cells = <0>; + + power-domain@RK3036_PD_VIO { + reg = ; + clocks = <&cru ACLK_LCDC>, + <&cru HCLK_LCDC>, + <&cru SCLK_LCDC>; + pm_qos = <&qos_vio>; + #power-domain-cells = <0>; + }; + + power-domain@RK3036_PD_VPU { + reg = ; + clocks = <&cru ACLK_VCODEC>, + <&cru HCLK_VCODEC>; + pm_qos = <&qos_vpu>; + #power-domain-cells = <0>; + }; + + power-domain@RK3036_PD_GPU { + reg = ; + clocks = <&cru SCLK_GPU>; + pm_qos = <&qos_gpu>; + #power-domain-cells = <0>; + }; + + }; + reboot-mode { compatible = "syscon-reboot-mode"; offset = <0x1d8>; From patchwork Tue May 25 15:22:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 447474 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72036C47088 for ; Tue, 25 May 2021 15:22:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 57C8C61429 for ; Tue, 25 May 2021 15:22:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230240AbhEYPYZ (ORCPT ); Tue, 25 May 2021 11:24:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231365AbhEYPYY (ORCPT ); Tue, 25 May 2021 11:24:24 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A18D9C061574; Tue, 25 May 2021 08:22:53 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id lz27so47955918ejb.11; Tue, 25 May 2021 08:22:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZLkyDyqWj1CZiuS0iYizljfWHH1n3/to3p6LvPj6158=; b=jw7y4JYPCW8W44lrRsqYaEQnU5CeQlrs+LImSYZnPS5yhxAuFDdy+siVIp7F3Frdnz ka66/Zqdm+626O2jPve1O1Y0jlu+siGG7E3mckiLIXAbUdRtZbPjjqZ1G75MkybmazY1 rP24AQIJxWx2c/4sUeFtX9jK+4bbYzxIeZhMyjCjMjcudjGCGcohjCCvWQvu1ZAvToVP QpOAbuV+lRgu9lyxRgTVBePi6Q0QzxM5XNCaxmSDOgm7Yet77o9/nHlAgWy1bcBc6CNA +5uLy4icLvrerIvsk/3f+ZdHPJBjWZJmC1lKj+hwsV9nlbWjRxT/JxNy856e5apEvgcV atpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZLkyDyqWj1CZiuS0iYizljfWHH1n3/to3p6LvPj6158=; b=mALO6RWdDFscXHDC9zedEgQFGu1oUyt72WLovMV6hvzZt2c8F+McWsCz3AyC2flVy6 19l4kutyWcSrKoluhidn3kaia4mSQczrcDNtvv2cy53O4wnmSEGSUfV5EWmLOg8I4D3u 7A8pIZk6DBmaxiumw+PqBny5S6b3OxzqZp9o3EabNjQvPAlwr/0I8leCGKZohAMjtLDu xSFWjuqVVkaDvy4js40SoCzkYptC97Md7ojyFuolDzWsgUBiS5beWr99qgJcAdBdCG6V ZPXPBm6wp0dBP+Lh3/h0rlxNSnLNPengo81SwuK23fxYiEN2xGrttAdVZr1gS0wg+9m+ yQOQ== X-Gm-Message-State: AOAM533S/TixvzPNU+RwsYmCEiN4N2IMbCIO5RdknevkcvoWI8OGXBx4 11j8FjbHy/YMS6jcBgaeOg== X-Google-Smtp-Source: ABdhPJwzCu+InKX5nF/IaZU2v8nNyrs5B4uj83Sq8mWbpWSrBmmQZ1nLC3SWyNJew3TsZfv2s4xGAA== X-Received: by 2002:a17:907:927:: with SMTP id au7mr30004348ejc.267.1621956172296; Tue, 25 May 2021 08:22:52 -0700 (PDT) Received: from localhost.localdomain ([2a02:810b:f40:e00:b55:da44:4fe2:2760]) by smtp.googlemail.com with ESMTPSA id e23sm11212945eds.2.2021.05.25.08.22.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 08:22:52 -0700 (PDT) From: Alex Bee To: Ezequiel Garcia , Mauro Carvalho Chehab , Rob Herring , Heiko Stuebner , Philipp Zabel , Lee Jones , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org Cc: Alex Bee , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 03/10] dt-bindings: mfd: syscon: add Rockchip RK3036/RK3228 qos compatibles Date: Tue, 25 May 2021 17:22:18 +0200 Message-Id: <20210525152225.154302-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210525152225.154302-1-knaerzche@gmail.com> References: <20210525152225.154302-1-knaerzche@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Checked with: make ARCH=arm dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/mfd/syscon.yaml Signed-off-by: Alex Bee --- Documentation/devicetree/bindings/mfd/syscon.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml index f14ae6da0068..ad1121620e15 100644 --- a/Documentation/devicetree/bindings/mfd/syscon.yaml +++ b/Documentation/devicetree/bindings/mfd/syscon.yaml @@ -45,7 +45,9 @@ properties: - microchip,sparx5-cpu-syscon - mstar,msc313-pmsleep - rockchip,px30-qos + - rockchip,rk3036-qos - rockchip,rk3066-qos + - rockchip,rk3228-qos - rockchip,rk3288-qos - rockchip,rk3399-qos - samsung,exynos3-sysreg From patchwork Tue May 25 15:22:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 447473 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_NONE, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0268C47084 for ; Tue, 25 May 2021 15:23:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C63C66141D for ; Tue, 25 May 2021 15:23:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232679AbhEYPYf (ORCPT ); Tue, 25 May 2021 11:24:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232327AbhEYPY2 (ORCPT ); Tue, 25 May 2021 11:24:28 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79283C06138A; Tue, 25 May 2021 08:22:56 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id j10so19157398edw.8; Tue, 25 May 2021 08:22:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jnFLOy9hjOHw4JROlHPDAo4HEdlEJqV6yVCmx9E7WOE=; b=oa9lM0axOA6a8j8/i3nk3fXMoTXlmmiLWvhNkLN+nYIK5YQjn61rpphcXQdThsYdVj ngLYS5BOVGnxCQgI4Yz/RwDC6w02DdFipoQSoM45ahKa0pRIpOzRCE08dDL8aWoF+S6P bIzPuS7LCVu2j++NKqGzzVHaTYsc0lfQgiXxNnmHWsAGNi9Affh05Bq9BhpgeaQrDRmV VBXUzVBIn1tJDILupIL4RGPLtf+Xw0nGOg8AW3bvSbNdYeYla91BnLy3ZXs/b5ke15SJ 3N+D02V872xzNju3cVNgyf9OPJrR9GPn4XJ6eVqLEyZDJf1j+eGAZTG3qnwaTqaSMfVN FHeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jnFLOy9hjOHw4JROlHPDAo4HEdlEJqV6yVCmx9E7WOE=; b=f+VMEWuseSYf+iKA35vK+i4k6kGj2P5tGTV7N+DJiKcg/m19hNU7v8Ysqf8SO7p/Tp sJ3Zp0/Be2fi6TcRyX3jeGIaQJ9dXrFCo6F2m3NLrpnGib1CTmb4FpkYPSZznAhratON 6Rvuay9OdDFk6iVZvXcGB0+HSSZckzuYoykcgvbB0wuh5WDISao2N2YFaSUkEjdFA80z NYkQaEGfBLBpdxUJBqJN6aFLssN4gA9U1u+M4HrXjMp51hingn2Nyp7Bubh+bDDXy4sz AF5YOLscyM4D+DMkebmICR9gpsZH0C5oGKYvgcDVC9mXznkgMTX9ThZ6D06XlwSEfHkR AfWw== X-Gm-Message-State: AOAM531eTutxZ6Lfc1e69pc20BvYJMrfcY/nahYge2UZEgAF4QjnjpAi mayMvwllFQxYPkOG/0cLxg== X-Google-Smtp-Source: ABdhPJzDbtN0x4SCapimaWgBqEVuQDZAoY1t1mav7kl1qZ2LhBOHzWEBRnS37VTdBle6YLSXA3xCdA== X-Received: by 2002:a05:6402:281:: with SMTP id l1mr32126552edv.58.1621956174713; Tue, 25 May 2021 08:22:54 -0700 (PDT) Received: from localhost.localdomain ([2a02:810b:f40:e00:b55:da44:4fe2:2760]) by smtp.googlemail.com with ESMTPSA id e23sm11212945eds.2.2021.05.25.08.22.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 08:22:54 -0700 (PDT) From: Alex Bee To: Ezequiel Garcia , Mauro Carvalho Chehab , Rob Herring , Heiko Stuebner , Philipp Zabel , Lee Jones , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org Cc: Alex Bee , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 05/10] media: hantro: add support for Rockchip RK3036 Date: Tue, 25 May 2021 17:22:20 +0200 Message-Id: <20210525152225.154302-6-knaerzche@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210525152225.154302-1-knaerzche@gmail.com> References: <20210525152225.154302-1-knaerzche@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org RK3036's VPU IP block is the same as RK3288 has, except that it doesn't have an encoder, decoding is supported up to 1920x1088 only and the axi clock can be set to 300 MHz max. Add a new RK3036 variant which reflect this differences. Signed-off-by: Alex Bee --- drivers/staging/media/hantro/hantro_drv.c | 1 + drivers/staging/media/hantro/hantro_hw.h | 1 + drivers/staging/media/hantro/rk3288_vpu_hw.c | 49 ++++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c index 38ea7b24036e..4f3c08e85bb8 100644 --- a/drivers/staging/media/hantro/hantro_drv.c +++ b/drivers/staging/media/hantro/hantro_drv.c @@ -490,6 +490,7 @@ static const struct of_device_id of_hantro_match[] = { { .compatible = "rockchip,rk3328-vpu", .data = &rk3328_vpu_variant, }, { .compatible = "rockchip,rk3288-vpu", .data = &rk3288_vpu_variant, }, { .compatible = "rockchip,rk3066-vpu", .data = &rk3066_vpu_variant, }, + { .compatible = "rockchip,rk3036-vpu", .data = &rk3036_vpu_variant, }, #endif #ifdef CONFIG_VIDEO_HANTRO_IMX8M { .compatible = "nxp,imx8mq-vpu", .data = &imx8mq_vpu_variant, }, diff --git a/drivers/staging/media/hantro/hantro_hw.h b/drivers/staging/media/hantro/hantro_hw.h index de2bc367a15a..d8d6b0d3c3b3 100644 --- a/drivers/staging/media/hantro/hantro_hw.h +++ b/drivers/staging/media/hantro/hantro_hw.h @@ -164,6 +164,7 @@ extern const struct hantro_variant rk3399_vpu_variant; extern const struct hantro_variant rk3328_vpu_variant; extern const struct hantro_variant rk3288_vpu_variant; extern const struct hantro_variant rk3066_vpu_variant; +extern const struct hantro_variant rk3036_vpu_variant; extern const struct hantro_variant imx8mq_vpu_variant; extern const struct hantro_variant sama5d4_vdec_variant; diff --git a/drivers/staging/media/hantro/rk3288_vpu_hw.c b/drivers/staging/media/hantro/rk3288_vpu_hw.c index 29805c4bd92f..c4684df4e012 100644 --- a/drivers/staging/media/hantro/rk3288_vpu_hw.c +++ b/drivers/staging/media/hantro/rk3288_vpu_hw.c @@ -174,6 +174,13 @@ static irqreturn_t rk3288_vepu_irq(int irq, void *dev_id) return IRQ_HANDLED; } +static int rk3036_vpu_hw_init(struct hantro_dev *vpu) +{ + /* Bump ACLKs to max. possible freq. to improve performance. */ + clk_set_rate(vpu->clocks[0].clk, RK3066_ACLK_MAX_FREQ); + return 0; +} + static int rk3066_vpu_hw_init(struct hantro_dev *vpu) { /* Bump ACLKs to max. possible freq. to improve performance. */ @@ -209,6 +216,27 @@ static void rk3288_vpu_enc_reset(struct hantro_ctx *ctx) /* * Supported codec ops. */ +static const struct hantro_codec_ops rk3036_vpu_codec_ops[] = { + [HANTRO_MODE_H264_DEC] = { + .run = hantro_g1_h264_dec_run, + .reset = hantro_g1_reset, + .init = hantro_h264_dec_init, + .exit = hantro_h264_dec_exit, + }, + [HANTRO_MODE_MPEG2_DEC] = { + .run = hantro_g1_mpeg2_dec_run, + .reset = hantro_g1_reset, + .init = hantro_mpeg2_dec_init, + .exit = hantro_mpeg2_dec_exit, + }, + [HANTRO_MODE_VP8_DEC] = { + .run = hantro_g1_vp8_dec_run, + .reset = hantro_g1_reset, + .init = hantro_vp8_dec_init, + .exit = hantro_vp8_dec_exit, + }, +}; + static const struct hantro_codec_ops rk3066_vpu_codec_ops[] = { [HANTRO_MODE_JPEG_ENC] = { .run = hantro_h1_jpeg_enc_run, @@ -269,6 +297,10 @@ static const struct hantro_codec_ops rk3288_vpu_codec_ops[] = { * VPU variant. */ +static const struct hantro_irq rk3036_irqs[] = { + { "vdpu", hantro_g1_irq }, +}; + static const struct hantro_irq rk3288_irqs[] = { { "vepu", rk3288_vepu_irq }, { "vdpu", hantro_g1_irq }, @@ -283,6 +315,23 @@ static const char * const rk3288_clk_names[] = { "aclk", "hclk" }; +const struct hantro_variant rk3036_vpu_variant = { + .dec_offset = 0x400, + .dec_fmts = rk3066_vpu_dec_fmts, + .num_dec_fmts = ARRAY_SIZE(rk3066_vpu_dec_fmts), + .postproc_fmts = rk3288_vpu_postproc_fmts, + .num_postproc_fmts = ARRAY_SIZE(rk3288_vpu_postproc_fmts), + .postproc_regs = &hantro_g1_postproc_regs, + .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER | + HANTRO_H264_DECODER, + .codec_ops = rk3036_vpu_codec_ops, + .irqs = rk3036_irqs, + .num_irqs = ARRAY_SIZE(rk3036_irqs), + .init = rk3036_vpu_hw_init, + .clk_names = rk3288_clk_names, + .num_clocks = ARRAY_SIZE(rk3288_clk_names) +}; + const struct hantro_variant rk3066_vpu_variant = { .enc_offset = 0x0, .enc_fmts = rk3288_vpu_enc_fmts, From patchwork Mon Jun 14 21:32:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 459981 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_NONE, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DBCAAC2B9F4 for ; Mon, 14 Jun 2021 21:34:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BE64061209 for ; Mon, 14 Jun 2021 21:34:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232752AbhFNVgc (ORCPT ); Mon, 14 Jun 2021 17:36:32 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:45732 "EHLO mail-wr1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230081AbhFNVgb (ORCPT ); Mon, 14 Jun 2021 17:36:31 -0400 Received: by mail-wr1-f46.google.com with SMTP id z8so15999221wrp.12; Mon, 14 Jun 2021 14:34:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O9ExEfI8smsY8pVgfSWlbEFVVdj0jjSRoSg8s9hKtvk=; b=tG+4H7tXI41JWsmLa497HX1A4+INNIzuHIu1RhC2v5dj4CuQmaQFVOrTF4AVU1/Fqy g84438Zb1aJZp9pkF/saIlcFjCj8ERu4R21BVagEmmqmsmGG+4LgrWCfZ6qzQVUxsKhr 8DbBIZCmJ67qOe+I8Cf02mhtpIzSbrTKFv01R8HqII28L1fNdQad34gN7ty24/tFotex OEhwX6IIexKS2S62mfwsJG2nQl7pkatU67CSkbM01BY8DBChc2wTmpnqZHiiZIoYFmVV kuMzf8+cmhduqO3DxtZ8mXm38E5taLhtlt1HReTo/5fHSMjqGXsVm9esWGXcdrSZWES+ bo+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O9ExEfI8smsY8pVgfSWlbEFVVdj0jjSRoSg8s9hKtvk=; b=hFGWrHA9OtOuT5KFYeUD90jwFcFyU27YvGCQ43DqQnF6RnVGEfJ0woWHrtBIZO1scH iGhOQwwMcq9yW93EiXrXK/aLKUuYe97mFAizeDQhGvP6qa/Oov+Z9R8Wk9RrCGe5s6AW VHgBhUjbEyNwWcyEprw0/5FKeZwmglVfvybD4ydQpfLbPc+OKyA4jlQ5RaHGxOdazh97 xJZ1cY5EYgHJ6yVH3QM/bVPnvKSrb5n4+Nq5ACShuVPpMOrzcgx9SKb9NqLbLHJ6xKbE p21Rwn03lUceEtdRXmqj6h1ymSoTjT5YAJDu2bLS46eVzwftFRXv/nT4aZmjjGIPpi8w 9RHA== X-Gm-Message-State: AOAM531sqEfO0ydaGkJOS3oYBStnDdm0p6RJtL0u78GfKE+EfuPxFuO9 1m1DcO9ciTHwu/mJw8h7e7G7wJShAA== X-Google-Smtp-Source: ABdhPJyG/RKWAmir0AONi40wwGGCi5zze6Jpy3mkSnZJxvYvTK7ygDVhLwgJ7QdHqeEd01Zb7BcBew== X-Received: by 2002:adf:f3c1:: with SMTP id g1mr1323477wrp.252.1623706407550; Mon, 14 Jun 2021 14:33:27 -0700 (PDT) Received: from localhost.localdomain ([91.67.75.139]) by smtp.googlemail.com with ESMTPSA id g23sm989525wmk.3.2021.06.14.14.33.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 14:33:27 -0700 (PDT) From: Alex Bee To: Ezequiel Garcia , Mauro Carvalho Chehab , Rob Herring , Heiko Stuebner , Philipp Zabel , Lee Jones , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org Cc: Alex Bee , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/6] media: hantro: add support for Rockchip RK3036 Date: Mon, 14 Jun 2021 23:32:15 +0200 Message-Id: <20210614213215.99389-7-knaerzche@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210614213215.99389-1-knaerzche@gmail.com> References: <20210525152225.154302-1-knaerzche@gmail.com> <20210614213215.99389-1-knaerzche@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org RK3036's VPU IP block is the same as RK3288 has, except that it doesn't have an encoder, decoding is supported up to 1920x1088 only and the axi clock can be set to 300 MHz max. Add a new RK3036 variant which reflects these differences. Signed-off-by: Alex Bee Reviewed-by: Ezequiel Garcia --- Changes in v3: - collect Reviewed-tag Changes in v2: - rename rk3036_irqs -> rockchip_vdpu1_irqs - fix spelling error drivers/staging/media/hantro/hantro_drv.c | 1 + drivers/staging/media/hantro/hantro_hw.h | 1 + .../staging/media/hantro/rockchip_vpu_hw.c | 49 +++++++++++++++++++ 3 files changed, 51 insertions(+) diff --git a/drivers/staging/media/hantro/hantro_drv.c b/drivers/staging/media/hantro/hantro_drv.c index aaef66c4c795..31d8449ca1d2 100644 --- a/drivers/staging/media/hantro/hantro_drv.c +++ b/drivers/staging/media/hantro/hantro_drv.c @@ -582,6 +582,7 @@ static const struct v4l2_file_operations hantro_fops = { static const struct of_device_id of_hantro_match[] = { #ifdef CONFIG_VIDEO_HANTRO_ROCKCHIP + { .compatible = "rockchip,rk3036-vpu", .data = &rk3036_vpu_variant, }, { .compatible = "rockchip,rk3066-vpu", .data = &rk3066_vpu_variant, }, { .compatible = "rockchip,rk3288-vpu", .data = &rk3288_vpu_variant, }, { .compatible = "rockchip,rk3328-vpu", .data = &rk3328_vpu_variant, }, diff --git a/drivers/staging/media/hantro/hantro_hw.h b/drivers/staging/media/hantro/hantro_hw.h index 77df0eba4e6f..5dcf65805396 100644 --- a/drivers/staging/media/hantro/hantro_hw.h +++ b/drivers/staging/media/hantro/hantro_hw.h @@ -205,6 +205,7 @@ enum hantro_enc_fmt { extern const struct hantro_variant imx8mq_vpu_g2_variant; extern const struct hantro_variant imx8mq_vpu_variant; +extern const struct hantro_variant rk3036_vpu_variant; extern const struct hantro_variant rk3066_vpu_variant; extern const struct hantro_variant rk3288_vpu_variant; extern const struct hantro_variant rk3328_vpu_variant; diff --git a/drivers/staging/media/hantro/rockchip_vpu_hw.c b/drivers/staging/media/hantro/rockchip_vpu_hw.c index b370b5e802fa..3ccc16413f42 100644 --- a/drivers/staging/media/hantro/rockchip_vpu_hw.c +++ b/drivers/staging/media/hantro/rockchip_vpu_hw.c @@ -244,6 +244,13 @@ static irqreturn_t rockchip_vpu2_vepu_irq(int irq, void *dev_id) return IRQ_HANDLED; } +static int rk3036_vpu_hw_init(struct hantro_dev *vpu) +{ + /* Bump ACLK to max. possible freq. to improve performance. */ + clk_set_rate(vpu->clocks[0].clk, RK3066_ACLK_MAX_FREQ); + return 0; +} + static int rk3066_vpu_hw_init(struct hantro_dev *vpu) { /* Bump ACLKs to max. possible freq. to improve performance. */ @@ -297,6 +304,27 @@ static void rockchip_vpu2_enc_reset(struct hantro_ctx *ctx) /* * Supported codec ops. */ +static const struct hantro_codec_ops rk3036_vpu_codec_ops[] = { + [HANTRO_MODE_H264_DEC] = { + .run = hantro_g1_h264_dec_run, + .reset = hantro_g1_reset, + .init = hantro_h264_dec_init, + .exit = hantro_h264_dec_exit, + }, + [HANTRO_MODE_MPEG2_DEC] = { + .run = hantro_g1_mpeg2_dec_run, + .reset = hantro_g1_reset, + .init = hantro_mpeg2_dec_init, + .exit = hantro_mpeg2_dec_exit, + }, + [HANTRO_MODE_VP8_DEC] = { + .run = hantro_g1_vp8_dec_run, + .reset = hantro_g1_reset, + .init = hantro_vp8_dec_init, + .exit = hantro_vp8_dec_exit, + }, +}; + static const struct hantro_codec_ops rk3066_vpu_codec_ops[] = { [HANTRO_MODE_JPEG_ENC] = { .run = hantro_h1_jpeg_enc_run, @@ -378,6 +406,10 @@ static const struct hantro_codec_ops rk3399_vpu_codec_ops[] = { * VPU variant. */ +static const struct hantro_irq rockchip_vdpu1_irqs[] = { + { "vdpu", hantro_g1_irq }, +}; + static const struct hantro_irq rockchip_vpu1_irqs[] = { { "vepu", rockchip_vpu1_vepu_irq }, { "vdpu", hantro_g1_irq }, @@ -401,6 +433,23 @@ static const char * const rockchip_vpu_clk_names[] = { "aclk", "hclk" }; +const struct hantro_variant rk3036_vpu_variant = { + .dec_offset = 0x400, + .dec_fmts = rk3066_vpu_dec_fmts, + .num_dec_fmts = ARRAY_SIZE(rk3066_vpu_dec_fmts), + .postproc_fmts = rockchip_vpu1_postproc_fmts, + .num_postproc_fmts = ARRAY_SIZE(rockchip_vpu1_postproc_fmts), + .postproc_regs = &hantro_g1_postproc_regs, + .codec = HANTRO_MPEG2_DECODER | HANTRO_VP8_DECODER | + HANTRO_H264_DECODER, + .codec_ops = rk3036_vpu_codec_ops, + .irqs = rockchip_vdpu1_irqs, + .num_irqs = ARRAY_SIZE(rockchip_vdpu1_irqs), + .init = rk3036_vpu_hw_init, + .clk_names = rockchip_vpu_clk_names, + .num_clocks = ARRAY_SIZE(rockchip_vpu_clk_names) +}; + /* * Despite this variant has separate clocks for decoder and encoder, * it's still required to enable all four of them for either decoding From patchwork Tue May 25 15:22:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 447472 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8062BC4707F for ; Tue, 25 May 2021 15:23:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60F3E61159 for ; Tue, 25 May 2021 15:23:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234270AbhEYPZI (ORCPT ); Tue, 25 May 2021 11:25:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232625AbhEYPYe (ORCPT ); Tue, 25 May 2021 11:24:34 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B371CC061346; Tue, 25 May 2021 08:22:59 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id p24so46716230ejb.1; Tue, 25 May 2021 08:22:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uUSm89YnVYY5m++JvqU0akupn8UYyGqAiLVhpP+aRLo=; b=cgFhgV1aSQl0X2NElaBOt8i+dOhwIWsRHzkWlleoW7PinBuOKGPhYddsJddOhFcsff +AdMNPK7kwJ6W9DlUsEEh1LrD4kyovlSEMUZokol8/B+UUiAuFHF/j2kJFLlDtkc0tXt TgfEtSYhegH2dTpYcTRwE1EM4dSOifVXdsscwnRB5tHExaM4ffNJopKBJ14yRWr+zFuq 9kFtDtp9eqwS8RnIYqTYjTYlHhNo8MP8l/5CNm6JpHzjjWEp7QhOua5o1T0z//NRA3I2 1MIOM1uGqJeH4GD8yyCPdKNmJ6Y9CZsu5xjmWndXdo39YmesTx8KM0EXT/8zOgTmxHGy loNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uUSm89YnVYY5m++JvqU0akupn8UYyGqAiLVhpP+aRLo=; b=Vm2clQc6ZthBer6MM7Hb/En3/kVnbIzE/spGWMIy0+5cb4vhiRyHLc3fvauckadssx x3BO/gIQJqaXt7ZZ8YqH7XjlaFQCB/28DCzmYMnHlEUXOgv4EpnIeoB7gk3yKGkVVREq XZB8EJVJSVM76HGSvsiJJofkP87cdJ0LyAsteKhI9R09fHWYkkukyZLTTHKywHwXwJt1 b2zRnNjWz4kwfrXhM9Ucwr5lZEa5O27QuuQdaAklZ3di5xRTSvaZ9sJSo8iAdKCYezQm eN73Tc2dH2sg1YnmHXUC6Ab5KmGSMPp4JEeYyEgqGU3ztlt2lrudTECKGiSUBZnpWzF7 YqpQ== X-Gm-Message-State: AOAM530viXsrD7Bp5CZy+loJuJT4jpYTXZmjKLg5i5FcLqkAtsm/v19q 139Atd3reS1oMdcSYFT30Q== X-Google-Smtp-Source: ABdhPJwA172I/k9A3874kTnCJ0KUPtLokMXnEWzh6Nxw5MSf8VbsUDIQJlCNDQ1BRqaD5Y+/MP1+UA== X-Received: by 2002:a17:906:fa90:: with SMTP id lt16mr28818447ejb.411.1621956178206; Tue, 25 May 2021 08:22:58 -0700 (PDT) Received: from localhost.localdomain ([2a02:810b:f40:e00:b55:da44:4fe2:2760]) by smtp.googlemail.com with ESMTPSA id e23sm11212945eds.2.2021.05.25.08.22.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 08:22:57 -0700 (PDT) From: Alex Bee To: Ezequiel Garcia , Mauro Carvalho Chehab , Rob Herring , Heiko Stuebner , Philipp Zabel , Lee Jones , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org Cc: Alex Bee , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 07/10] ARM: dts: rockchip: add vpu node for RK322x Date: Tue, 25 May 2021 17:22:22 +0200 Message-Id: <20210525152225.154302-8-knaerzche@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210525152225.154302-1-knaerzche@gmail.com> References: <20210525152225.154302-1-knaerzche@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The VPU IP block of RK322x is the same as RK3399 has and the driver can be used as-is. Add the respective nodes to the device tree. Signed-off-by: Alex Bee --- arch/arm/boot/dts/rk322x.dtsi | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi index c8095ede7d7a..62d1113b7804 100644 --- a/arch/arm/boot/dts/rk322x.dtsi +++ b/arch/arm/boot/dts/rk322x.dtsi @@ -611,6 +611,18 @@ gpu: gpu@20000000 { status = "disabled"; }; + vpu: video-codec@20020000 { + compatible = "rockchip,rk3228-vpu", "rockchip,rk3399-vpu"; + reg = <0x20020000 0x800>; + interrupts = , + ; + interrupt-names = "vepu", "vdpu"; + clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>; + clock-names = "aclk", "hclk"; + power-domains = <&power RK3228_PD_VPU>; + iommus = <&vpu_mmu>; + }; + vpu_mmu: iommu@20020800 { compatible = "rockchip,iommu"; reg = <0x20020800 0x100>; @@ -619,7 +631,6 @@ vpu_mmu: iommu@20020800 { clock-names = "aclk", "iface"; power-domains = <&power RK3228_PD_VPU>; #iommu-cells = <0>; - status = "disabled"; }; vdec_mmu: iommu@20030480 { From patchwork Tue May 25 15:22:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 447471 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2ACF5C2B9F8 for ; Tue, 25 May 2021 15:24:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 04BD1613AD for ; Tue, 25 May 2021 15:24:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232077AbhEYPZZ (ORCPT ); Tue, 25 May 2021 11:25:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231667AbhEYPYk (ORCPT ); Tue, 25 May 2021 11:24:40 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AC8FC06134B; Tue, 25 May 2021 08:23:02 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id w12so28942837edx.1; Tue, 25 May 2021 08:23:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6Q58oNfdPoNizxHxGHMRtWsl8A7XLb0YSPcOPFqG+RU=; b=Z3B7VRrHXX2mPOIGKlrTfuADjdkWuDL93jq4HIGaHP5DTpqDuGHhRikQHgdzS6pWIQ km7HQMDDDA9DPk4ihKVcJ21N501vok9fkw+XU4fvZa7Mo4mnZjPoTlYGgWMygeK7W1/E vkGVV1/rneQ7S14fybK2Ce5HtK1oD7v8KDyC8H8pOSqZUolYWSHdQ7jhZV/sVw3RNdGy b/AgQqWij6rMVptGIYTehULp8sxawF68dJyNk9AGdfWHkVkgaV3ZI3V2eA4BTLE6TDgj gqcFscCMHvR8xDv1jJc6iwMfiu3EITI/K6VRDhWa5pNQPW+cG09wAHRMbb4yJ+q8s3KJ FOdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6Q58oNfdPoNizxHxGHMRtWsl8A7XLb0YSPcOPFqG+RU=; b=hwnIT2KxxUWnGVeOmBAzGYw7SEBznj1XHesFLQpgcCoJ5527JKxCW5n01MwuN+YZWa 3HpyOPxonYA++xgtwDy68qHlVq31Y/dTs3WJjEBnlmxlWHaM1oI78ornWBRQwHONRsUU 8CR+Si0gW3FKFWGqPiFy/5X+3tY56VXq8vxt6Kvdneqa/C9WXSmAEO7JE25mAzl5NjYp i3TAndQ4BXMFWwXc2b6OKAQmyMmzGVFlYq0ZLikvYAe+Pf50QSB5VkTZbQM+x4Yq9Hnp lPueR9vJvGr4tR+LGI7VUR7Ony0zUQSNZj6Za9UPSyfrYsKcUr7bbp/MSgzC4u+cQRxx a2zw== X-Gm-Message-State: AOAM531zxDNIAJNyFHWv/rj/G4tHdVL+pTP1J7x4olc/WNiuHqFJErTt w5XAe/U60IlyMKhWHZ2S0g== X-Google-Smtp-Source: ABdhPJxZWLnVQUmpO6P76M2RNI2+XO5GK4VruLUNs1Rnt//H4UHP+sfpl8w/hcaCbSZKi2vZ5B35xA== X-Received: by 2002:a05:6402:176b:: with SMTP id da11mr32119743edb.234.1621956180881; Tue, 25 May 2021 08:23:00 -0700 (PDT) Received: from localhost.localdomain ([2a02:810b:f40:e00:b55:da44:4fe2:2760]) by smtp.googlemail.com with ESMTPSA id e23sm11212945eds.2.2021.05.25.08.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 May 2021 08:23:00 -0700 (PDT) From: Alex Bee To: Ezequiel Garcia , Mauro Carvalho Chehab , Rob Herring , Heiko Stuebner , Philipp Zabel , Lee Jones , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org Cc: Alex Bee , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 09/10] ARM: dts: rockchip: add vdec node for RK322x Date: Tue, 25 May 2021 17:22:24 +0200 Message-Id: <20210525152225.154302-10-knaerzche@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210525152225.154302-1-knaerzche@gmail.com> References: <20210525152225.154302-1-knaerzche@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The vdec IP block of RK322x is the same as RK3399 has and the driver can be used as-is. Add the respective node to the device tree. Note: core and cabac clock need to be set to a specific rate which is done by using "assigned-clocks" / "assigned-clock-rates" properties (axi clock rate is currently set in the driver). Signed-off-by: Alex Bee --- arch/arm/boot/dts/rk322x.dtsi | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi index 62d1113b7804..13c2f92ac013 100644 --- a/arch/arm/boot/dts/rk322x.dtsi +++ b/arch/arm/boot/dts/rk322x.dtsi @@ -633,6 +633,19 @@ vpu_mmu: iommu@20020800 { #iommu-cells = <0>; }; + vdec: video-codec@20030000 { + compatible = "rockchip,rk3228-vdec", "rockchip,rk3399-vdec"; + reg = <0x20030000 0x480>; + interrupts = ; + clocks = <&cru ACLK_RKVDEC>, <&cru HCLK_RKVDEC>, + <&cru SCLK_VDEC_CABAC>, <&cru SCLK_VDEC_CORE>; + clock-names = "axi", "ahb", "cabac", "core"; + assigned-clocks = <&cru SCLK_VDEC_CABAC>, <&cru SCLK_VDEC_CORE>; + assigned-clock-rates = <300000000>, <300000000>; + power-domains = <&power RK3228_PD_RKVDEC>; + iommus = <&vdec_mmu>; + }; + vdec_mmu: iommu@20030480 { compatible = "rockchip,iommu"; reg = <0x20030480 0x40>, <0x200304c0 0x40>; @@ -641,7 +654,6 @@ vdec_mmu: iommu@20030480 { clock-names = "aclk", "iface"; power-domains = <&power RK3228_PD_RKVDEC>; #iommu-cells = <0>; - status = "disabled"; }; vop: vop@20050000 { From patchwork Thu May 27 15:44:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 448978 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39DDEC47089 for ; Thu, 27 May 2021 15:45:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 278FE613C0 for ; Thu, 27 May 2021 15:45:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236934AbhE0PrN (ORCPT ); Thu, 27 May 2021 11:47:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236171AbhE0PrI (ORCPT ); Thu, 27 May 2021 11:47:08 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B241C061763; Thu, 27 May 2021 08:45:29 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id gb17so804894ejc.8; Thu, 27 May 2021 08:45:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9kGg6mgXV7FtlTslQDxVXLeRt/Pl+NMx0FiHr4993Xw=; b=SJSq5gDc9cJqzrtBIeoHUABqAbJXF1WgqcFwRqccTMI885ta1aFLGfTZwXfb2KJ7O3 nJqDnUY5RqpDAUXTrkLnTkMRTLAGhLcqdzN/JgjJndnfKxdj2ZcSGjM1860ItjSIcu32 2yce1vMAuXjAxhBpZNF8BpavC+JvUO+HL1TdURtRu48DIkAdPAfjIesACyBShvSDmUv3 as7bLCSxEXLZMG/dbmVWmRIQ3DOna1tdcr8hC6c/YXylhLTzk9p6Hj9X6fXJthMyTski +Ypv3neMpHtoxutXKbJ3sJ0YMnV6bDbdH8BGnf0uSOMisaJXSGhLWynn5pDimCeBB1OS NtEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9kGg6mgXV7FtlTslQDxVXLeRt/Pl+NMx0FiHr4993Xw=; b=mjsRb6L03702u9EEYcH1fTojQeof/Fr+ONn1ekczGOiIoa3GIl+S67hyRm2OUcXao/ K1v/PCYN0zZNzXlhJeoYaindRujEzIedrlh5/tCq3B1IYrAq+uuqnnf61TbhjTbeXuPJ ZdulUxIH2IvJ9DMDHtO+kWs9cphttJWYL41cJVDx0376NhDzLtcQnhfllIuA9W7d3Ipo 3mgorzpy6PTDVJijHl4fX2u2+934b7Zej1E2LF9QAgIA8Km7ecxCErOoV3s57LEBGu/7 WjiR+2v/IeN1u2dHwiMw7vNe0DZHXty3WUXqU9/jNOgNkLWHpcEypQYH51p1Ypy6Wqm1 x14Q== X-Gm-Message-State: AOAM532ylDrJ7+MiQKrX9hBeBxpzCbxBEoP2p+1uPBAwwAxRPiRMFS1F Vy2onFB5DyCvTmeeeFwC+A== X-Google-Smtp-Source: ABdhPJzl5JDhEkcjJ1OIMd8jUhx4sOX++iKQ4claQLkF+8FKKTYfKLs16MMzLfV41QKc9wia1n4MoQ== X-Received: by 2002:a17:907:961e:: with SMTP id gb30mr4643145ejc.58.1622130328207; Thu, 27 May 2021 08:45:28 -0700 (PDT) Received: from localhost.localdomain ([2a02:810b:f40:e00:fefd:4d98:c981:7f97]) by smtp.googlemail.com with ESMTPSA id u6sm1178826ejr.55.2021.05.27.08.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 08:45:27 -0700 (PDT) From: Alex Bee To: Ezequiel Garcia , Mauro Carvalho Chehab , Rob Herring , Heiko Stuebner , Philipp Zabel , Lee Jones , Greg Kroah-Hartman , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, devicetree@vger.kernel.org Cc: Alex Bee , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 11/12] ARM: dts: rockchip: add vpu nodes for RK3066 and RK3188 Date: Thu, 27 May 2021 17:44:54 +0200 Message-Id: <20210527154455.358869-12-knaerzche@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210527154455.358869-1-knaerzche@gmail.com> References: <20210525152225.154302-1-knaerzche@gmail.com> <20210527154455.358869-1-knaerzche@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Add the vpu node to the common rk3xxx.dtsi and only the powerdomain property to the SoC specific device trees. Signed-off-by: Alex Bee --- (no changes since v1) arch/arm/boot/dts/rk3066a.dtsi | 4 ++++ arch/arm/boot/dts/rk3188.dtsi | 5 +++++ arch/arm/boot/dts/rk3xxx.dtsi | 12 ++++++++++++ 3 files changed, 21 insertions(+) diff --git a/arch/arm/boot/dts/rk3066a.dtsi b/arch/arm/boot/dts/rk3066a.dtsi index 30dcf557ec33..67d54d88fe53 100644 --- a/arch/arm/boot/dts/rk3066a.dtsi +++ b/arch/arm/boot/dts/rk3066a.dtsi @@ -869,6 +869,10 @@ &uart3 { pinctrl-0 = <&uart3_xfer>; }; +&vpu { + power-domains = <&power RK3066_PD_VIDEO>; +}; + &wdt { compatible = "rockchip,rk3066-wdt", "snps,dw-wdt"; }; diff --git a/arch/arm/boot/dts/rk3188.dtsi b/arch/arm/boot/dts/rk3188.dtsi index 3a0c50026b07..9d982bc0170e 100644 --- a/arch/arm/boot/dts/rk3188.dtsi +++ b/arch/arm/boot/dts/rk3188.dtsi @@ -802,6 +802,11 @@ &uart3 { pinctrl-0 = <&uart3_xfer>; }; +&vpu { + compatible = "rockchip,rk3188-vpu", "rockchip,rk3066-vpu"; + power-domains = <&power RK3188_PD_VIDEO>; +}; + &wdt { compatible = "rockchip,rk3188-wdt", "snps,dw-wdt"; }; diff --git a/arch/arm/boot/dts/rk3xxx.dtsi b/arch/arm/boot/dts/rk3xxx.dtsi index d473552e8547..e974b49cff1e 100644 --- a/arch/arm/boot/dts/rk3xxx.dtsi +++ b/arch/arm/boot/dts/rk3xxx.dtsi @@ -50,6 +50,18 @@ gpu: gpu@10090000 { status = "disabled"; }; + vpu: video-codec@10104000 { + compatible = "rockchip,rk3066-vpu"; + reg = <0x10104000 0x800>; + interrupts = , + ; + interrupt-names = "vepu", "vdpu"; + clocks = <&cru ACLK_VDPU>, <&cru HCLK_VDPU>, + <&cru ACLK_VEPU>, <&cru HCLK_VEPU>; + clock-names = "aclk_vdpu", "hclk_vdpu", + "aclk_vepu", "hclk_vepu"; + }; + L2: cache-controller@10138000 { compatible = "arm,pl310-cache"; reg = <0x10138000 0x1000>;