Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp360147pxb; Wed, 14 Apr 2021 17:49:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyH8hUoFrg3DmuctiztY+xzfO0vOAMpkK5lMYOWtJFUnEsZc4L1UOBzbOgz0difDRfrC6RG X-Received: by 2002:a63:e64b:: with SMTP id p11mr1006321pgj.10.1618447748704; Wed, 14 Apr 2021 17:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618447748; cv=none; d=google.com; s=arc-20160816; b=psa6elCaOvqPYnLrqgLfaQSTaFhrkmyZ8ur1/lVOhtGmQNgysGMXrf9+t3faKCEYXE Sde4XIHXm3SsGKwSkDOow0lAEVBiAzeXNCQo22Nyoz/cWcazLrp30QXetnHXADGnoX1g IHVdvKEzN/i32QfPzmqAnAjSGCVE/3iwuwMk57TZIIigyS1MaLlUM076NX4l6YS02Ibb J4pDx1hIMJmh1rO2L7VtQMd6L3LNKtaM0VdmG3gLgaawve1CFrU8cgFAXiKLkaiPImRg ekBwBKtC+eI1tvlT8NukoG6QbJi4LMToCVcS24k9m+aOoypPce/s2cQxVsP29wKKpDcu QzJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=/8ue3C3/vuHzsBzvGcphBwhbaDZVSjtTH0PvrnAwtIQ=; b=MisbVfB/+Jd8rmzfOLpyNXT1693vGoNl9P/puDEFW1xG3Pmg1lOZ9Fm8Td+nJVVeYE LzDMXxchhLtXE4umgudPeyRIkUef7UCkJsq1dJkuuFqjsKTfOfbinGccI+6akQCzKNhh 87JxWCFOFwcNPXpe6iPLkyNWMG0KUuv2CmGu+xEr8al9Mi/h3lo983RQWJV6xTIWgHDc HP4Lpdn5ZDrI0a/iCT5DsMU6MsAunvEQgSbuLa9lwl1Ig9CF9+Er9y+ZQUUF0dce4Dc+ F0pBEBYXC8QyUrdjL/Uo5/wsK4A233pO9RoSlv8XgEaf2rRd8862sL+cyfC4FcMmFjC5 JBtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RAkpedgi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 1si1073010pfy.340.2021.04.14.17.48.56; Wed, 14 Apr 2021 17:49:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RAkpedgi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232512AbhDNVUN (ORCPT + 99 others); Wed, 14 Apr 2021 17:20:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232234AbhDNVTk (ORCPT ); Wed, 14 Apr 2021 17:19:40 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FFAEC061761; Wed, 14 Apr 2021 14:19:18 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id w3so33609221ejc.4; Wed, 14 Apr 2021 14:19:18 -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; bh=/8ue3C3/vuHzsBzvGcphBwhbaDZVSjtTH0PvrnAwtIQ=; b=RAkpedgieo6Ep13Sekr7CIB6n2IGq56zyrXBeiWUrr2oaya8aJkAKWfASE4K5bS00H DWRn9AUmEhtk5eME+Qz7CaqMUtTx1Xh7ril0pwoO0rlrCn/hllD4+MR4ZQcSozMhpmzB uulq8AT0pEMugzmHuD3KpNnsJFzobZT6ZaqH1iM2E1SFXbYiMbuhjPT8PynnbFtE/0rI 9CUjU+K6t9b6K9UZsT5nN/HwMEcHVOMk0+/UydcQX3kXBbJzwvbEWuYAY6jIiZ8J+7VQ fVNRtaMMS0ZsmeCBbH+C+k83s+kg9EU4nZc6LrfIdzMB2Ty5aGTK2HfuK0mUUPeqwzge E1Gg== 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; bh=/8ue3C3/vuHzsBzvGcphBwhbaDZVSjtTH0PvrnAwtIQ=; b=FSr1fyEtrTfrYXmElATTb5GjuGCq8yDk05aLSpvD2Bu0sHNDeRTPvgnupb5zGKEKXX YmEueyrrewsa+8h7IJkwJkKS7YtkEjN23pgiWMQuKuVWxeTXSypp0bvs2WY+5fJ0B/Gj haEDemDSyASbXD2dq52vU/f7LU8rDFFyhvh6QqeA8jvsuXPJDIlB3Pwo/YfczPePA9ji MBHLR/FylofWQI5H3caSZ+7/XFRPtSzzmQl59MWG8MBDwtEQXbwkqaxCIO90U57Z5Sc+ AlHxzQJZi8cnFcQQ7fUYaZtYcSp/SiAq7MHkqpsRiZ6CcKYMa1t63R+B7r9U0nuxcnx0 rI5w== X-Gm-Message-State: AOAM533n7xtUJrFLWKONRvyZIqgAwddCORfXP1Qt1PzcXfJPOZViiqKC VsmV83WNQwl/RopSwN5QY3M= X-Received: by 2002:a17:906:b2cf:: with SMTP id cf15mr60523ejb.233.1618435157199; Wed, 14 Apr 2021 14:19:17 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id v5sm568222edx.87.2021.04.14.14.19.16 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Apr 2021 14:19:16 -0700 (PDT) From: Johan Jonker To: heiko@sntech.de Cc: robh+dt@kernel.org, zhangqing@rock-chips.com, enric.balletbo@collabora.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v7 11/11] soc: rockchip: power-domain: add rk3568 powerdomains Date: Wed, 14 Apr 2021 23:18:56 +0200 Message-Id: <20210414211856.12104-12-jbx6244@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210414211856.12104-1-jbx6244@gmail.com> References: <20210414211856.12104-1-jbx6244@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Elaine Zhang Add power-domains found on rk3568 socs. Signed-off-by: Elaine Zhang Signed-off-by: Johan Jonker --- Changed V7: Fix alignment --- drivers/soc/rockchip/pm_domains.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c index 1d1b06672..0868b7d40 100644 --- a/drivers/soc/rockchip/pm_domains.c +++ b/drivers/soc/rockchip/pm_domains.c @@ -27,6 +27,7 @@ #include #include #include +#include struct rockchip_domain_info { const char *name; @@ -135,6 +136,9 @@ struct rockchip_pmu { #define DOMAIN_RK3399(name, pwr, status, req, wakeup) \ DOMAIN(name, pwr, status, req, req, req, wakeup) +#define DOMAIN_RK3568(name, pwr, req, wakeup) \ + DOMAIN_M(name, pwr, pwr, req, req, req, wakeup) + static bool rockchip_pmu_domain_is_idle(struct rockchip_pm_domain *pd) { struct rockchip_pmu *pmu = pd->pmu; @@ -848,6 +852,18 @@ static const struct rockchip_domain_info rk3399_pm_domains[] = { [RK3399_PD_SDIOAUDIO] = DOMAIN_RK3399("sdioaudio", BIT(31), BIT(31), BIT(29), true), }; +static const struct rockchip_domain_info rk3568_pm_domains[] = { + [RK3568_PD_NPU] = DOMAIN_RK3568("npu", BIT(1), BIT(2), false), + [RK3568_PD_GPU] = DOMAIN_RK3568("gpu", BIT(0), BIT(1), false), + [RK3568_PD_VI] = DOMAIN_RK3568("vi", BIT(6), BIT(3), false), + [RK3568_PD_VO] = DOMAIN_RK3568("vo", BIT(7), BIT(4), false), + [RK3568_PD_RGA] = DOMAIN_RK3568("rga", BIT(5), BIT(5), false), + [RK3568_PD_VPU] = DOMAIN_RK3568("vpu", BIT(2), BIT(6), false), + [RK3568_PD_RKVDEC] = DOMAIN_RK3568("vdec", BIT(4), BIT(8), false), + [RK3568_PD_RKVENC] = DOMAIN_RK3568("venc", BIT(3), BIT(7), false), + [RK3568_PD_PIPE] = DOMAIN_RK3568("pipe", BIT(8), BIT(11), false), +}; + static const struct rockchip_pmu_info px30_pmu = { .pwr_offset = 0x18, .status_offset = 0x20, @@ -983,6 +999,17 @@ static const struct rockchip_pmu_info rk3399_pmu = { .domain_info = rk3399_pm_domains, }; +static const struct rockchip_pmu_info rk3568_pmu = { + .pwr_offset = 0xa0, + .status_offset = 0x98, + .req_offset = 0x50, + .idle_offset = 0x68, + .ack_offset = 0x60, + + .num_domains = ARRAY_SIZE(rk3568_pm_domains), + .domain_info = rk3568_pm_domains, +}; + static const struct of_device_id rockchip_pm_domain_dt_match[] = { { .compatible = "rockchip,px30-power-controller", @@ -1028,6 +1055,10 @@ static const struct of_device_id rockchip_pm_domain_dt_match[] = { .compatible = "rockchip,rk3399-power-controller", .data = (void *)&rk3399_pmu, }, + { + .compatible = "rockchip,rk3568-power-controller", + .data = (void *)&rk3568_pmu, + }, { /* sentinel */ }, }; -- 2.11.0