From patchwork Sat Apr 17 11:29:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Jonker X-Patchwork-Id: 423507 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, 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 E4EE2C43462 for ; Sat, 17 Apr 2021 11:30:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC227610A6 for ; Sat, 17 Apr 2021 11:30:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236312AbhDQLbD (ORCPT ); Sat, 17 Apr 2021 07:31:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236257AbhDQLat (ORCPT ); Sat, 17 Apr 2021 07:30:49 -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 0316DC061763; Sat, 17 Apr 2021 04:30:23 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id n2so45809354ejy.7; Sat, 17 Apr 2021 04:30:22 -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=hMr4AxpAFNK+6N84CkCy4jW6GMuOTMfblWrRNCpyYV9BFvSaUU651f3LTBm02owzXB EqXTL0QopVNGRcXYEklM+n/1uNHCnV2KyFO6gvM7ig6VMA0waIDg2qSDZvFVqTNWyavD HqbgIneM1MHpkMLKnnojLdnjNF6hLFQ5yCpBYre48nbuS4nApizXKvFH/9O/6EuDXfOg Sb117HUJFcoggVkWQ/hVYUIc1Z/ED9suoUcRYVFEs+sWnNHmuYspPpytk/5DYHgE3SMk pJmI/QdT6HGWsWmGo0TRgHrNdK3SqwI9/L9i/T+He+yDxD4rBaC3T7XW5QWss62SZvnz R8XA== 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=V+s5aXakODCI6Ub68jXC0xh6RczK1ETgYzGd+4gYO4XWX/J3xeg8XsaoTCIdFU1kPr bXqeaeC7Avw0NcfErtygR4LDyxglLbmnTrfKRtLyua4EI89K2TqETgaiAR7CXcR4NEN5 VeA9kK6X7smr3iISAXi1oVzPBgLlw+x03FVkPYG2loHObZqhGOisqeBeh0rXbAPWQD3Z kj++fCHPJOE+23k7lIHa6K0/XfARAR6avmmHA7VPbM8Tdsdcfq9sKhaJtZHpjAHi8kYt J3urq9BkRETOkLJhT0lgHnnRuW6G8XF3Txv2hRK04BtnZHk2c2Eg2JskjkJY5FlFJP+7 NhEQ== X-Gm-Message-State: AOAM533vA6VGD2FZzVLgeqRgj870rnUKbkXhJjjW/XJC4WyO8kD3RdCH amWwFeO6GcxBeeYb0uuf2o4= X-Google-Smtp-Source: ABdhPJyNc2Lf5+PGfk6oCE1OJo3pCYalWi5A17T1LC2oyX4ai8KBSx8cDLm3XOOudtglBBfWhOok1A== X-Received: by 2002:a17:906:d110:: with SMTP id b16mr12752555ejz.146.1618659021800; Sat, 17 Apr 2021 04:30:21 -0700 (PDT) Received: from debian.home (81-204-249-205.fixed.kpn.net. [81.204.249.205]) by smtp.gmail.com with ESMTPSA id f20sm3022875ejw.36.2021.04.17.04.30.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Apr 2021 04:30:21 -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 v9 15/15] soc: rockchip: power-domain: add rk3568 powerdomains Date: Sat, 17 Apr 2021 13:29:52 +0200 Message-Id: <20210417112952.8516-16-jbx6244@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210417112952.8516-1-jbx6244@gmail.com> References: <20210417112952.8516-1-jbx6244@gmail.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@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 */ }, };