Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp127997pxb; Fri, 16 Apr 2021 01:12:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyu9CnASuXhrgniHOIGbS+DVych4wQsGJ260zEmnIjOFO34f51CIeVQuxPNWa/CS+EuMK3H X-Received: by 2002:a17:90a:d48a:: with SMTP id s10mr8227950pju.184.1618560766703; Fri, 16 Apr 2021 01:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618560766; cv=none; d=google.com; s=arc-20160816; b=u6TrewIiskI6qu6dU3tlrbTnFAQS7qeh2CaQhsrZkXnv+2v80gqIihLf5PLHAoz49Z Ff+6j/i5pRoICx9uXbooA1l/nhnqZLF/fopP/aDvFa6olUJkdlj5NK51IOeWNFobHYGF 7VYE7ppLJ94FGbCmSRluCMubSln5QyjsyX0latCPDp7rL2DhsogttP9VHxPCarbgReD5 1FKP0xr8yH0C4IRX0vcewvEVLjmVEZBEU+z59skQ0SekwIrMxsdnJhXFXkfzsJMJuZ8E rYYiTgYLdM+tirnU0s5lq2/jXSwSKAncFykaettwaShAjJEfU55T77nAvYLR5H8ezqmA rc0w== 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=IdnIJXwQfVZ8r04s6vBQ8F3hw5pX8Eao/KZTDeq4S8aheYW+8SrFNF5KRYruT76s5p umPY7p7l/3Ua7bR7CBfV9iTaeubctktRJHwT2C/U0m/2Ni3P+C0f1HpwiRtxTB4VItmP bnxDzMPViw5Rsdf+imBMJ4oKqAS9rj8hNtMsTuljKSzl09O5r5TduuO/YhKcoYcV6yPl guBgzAT2FKm9oJvr8D4ZsTSuzbjDtjxsvETaZB5bDAisffFqapqEcCnMyyboaCtHr7Ni 7kWkREqwkpUxlYz+pL2EnzGAvKGczxFSHH0DP4F+cA6Z+nUawVSWRooDDH5k4eQoPBAh EJhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GJxNTmKC; 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 h12si5880183pgq.171.2021.04.16.01.12.34; Fri, 16 Apr 2021 01:12:46 -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=GJxNTmKC; 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 S240324AbhDPIJY (ORCPT + 99 others); Fri, 16 Apr 2021 04:09:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240296AbhDPIJQ (ORCPT ); Fri, 16 Apr 2021 04:09:16 -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 7A568C061574; Fri, 16 Apr 2021 01:08:51 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id g5so34140028ejx.0; Fri, 16 Apr 2021 01:08:51 -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=GJxNTmKCDg7Z923XplEfpvDRQSeRcE3jGB9BGTMk3H0R3ozQa6JIQtaSbC52d/VxFp 5p6V9SyCrg4w0utuHtDRsUOn5I4VXrGPrrvNuzeLA3t+yj0obMMQ11aiJNWy7Lmt+QF2 9Y0lHdolqDF4Zag/DBme2LJUnzxTJHLxkVRBP9u1bW23vss9A0dQi3eXoxtlyqE2g2rv Qid55Sf9EgMsDCM+8u8MBwrs0AUnha4EXZmkKbYUmeg2ICWHA46bx204EPqR2By0v/z8 Yuhg5ZDbTeOCfod+hsG2Akt0lai3XFpAQPW1HY7ayIJApJ49mZUnXL3ua5fQMGM9f6Dj hOuQ== 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=ey7RQSHcilPfebUY1MiXlxxpzOS6dsf7M+1dPa67AJyxYz+AKoWSexfePpiUGQK0Jf MQDoZymZr/bYMpy5zvMrzqsLnASHKBV+fQjoSOLxOTfFhc0X4fQLsN7bD/P+TA+a3bQr FZV7LWVHisC8gdQTTWLEdkJ+5oa0AdQ8F9Fm0fyMJA16qWFkDCwqetTw9wJ7jsSYmn7l m9guQTYRIles8BcAnUpQ0vjr8fQEwq4m06bJmOOL74uougHTo071VNU/ffLQ1FMc2vNd 38bSpy3vzieTByTZ4gJ5D2nYiLxE6JPitwaNQTsPlUTz5RGEGCdlNOh9lBN1wzMGxzkS MaQA== X-Gm-Message-State: AOAM531t1J8BynGhYdBaTx8QX6z5t1hxtF+6A7yGzd2U/xQub7bfmOt+ O6/wQ387YXTHxBSgWlrZ/mTwwnRyG2SF4xE/ X-Received: by 2002:a17:907:76c5:: with SMTP id kf5mr7033982ejc.526.1618560530253; Fri, 16 Apr 2021 01:08:50 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id q16sm4672303edv.61.2021.04.16.01.08.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Apr 2021 01:08:50 -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 v8 15/15] soc: rockchip: power-domain: add rk3568 powerdomains Date: Fri, 16 Apr 2021 10:03:42 +0200 Message-Id: <20210416080342.18614-16-jbx6244@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210416080342.18614-1-jbx6244@gmail.com> References: <20210416080342.18614-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