From patchwork Wed May 23 06:53:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elaine Zhang X-Patchwork-Id: 10420385 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E8C8E60224 for ; Wed, 23 May 2018 06:54:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D536228EC5 for ; Wed, 23 May 2018 06:54:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C93E828F96; Wed, 23 May 2018 06:54:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_SORBS_WEB autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 61B6828EC5 for ; Wed, 23 May 2018 06:54:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=RcfLlvMRMXc+hnoWP/yiUMyXV8MlBwLoISN22WRSKBU=; b=D/mCVOxEQSjBiBIa4kYXZchEY+ 4a7CiADZzAfYrPlgR4JPRpV9knkyY5TG+Alxhwstj6KpdEvf1PINh5zkNwOlcwIfWhgUi7LTIhJSA 41oq0396UYfCzbyWGZo/GX7XRwKRG03QYTlmVx9i6lFKn17Z9NSHmjd02hAL7iyj38bnpNQXHyf+Y irCpqmXmh8q4PmfEJvm32Nyjh3nLP73S8Z6NK70wyAb6CTvhTCd4rH5/13OkOtpajIrlW0Xgi86ZR 5dgKtgKeUvqfpoOcozbgWB6ep/cA80Hc92jPXRSFCmnHkPwJpENMohnX0bO+HaTD28fALZlXxbR7L WLryAmUg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLNfX-0002Sm-Ta; Wed, 23 May 2018 06:54:43 +0000 Received: from regular1.263xmail.com ([211.150.99.141]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fLNZU-0008Jb-Fj; Wed, 23 May 2018 06:48:59 +0000 Received: from zhangqing?rock-chips.com (unknown [192.168.167.12]) by regular1.263xmail.com (Postfix) with ESMTP id DDB2296; Wed, 23 May 2018 14:48:15 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 014933E4; Wed, 23 May 2018 14:47:57 +0800 (CST) X-IP-DOMAINF: 1 X-RL-SENDER: zhangqing@rock-chips.com X-FST-TO: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: zhangqing@rock-chips.com X-UNIQUE-TAG: <2371f9afa7c296d6ada6c6e02afa3279> X-ATTACHMENT-NUM: 0 X-SENDER: zhangqing@rock-chips.com X-DNS-TYPE: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 103735ECX3P; Wed, 23 May 2018 14:48:03 +0800 (CST) From: Elaine Zhang To: heiko@sntech.de, robh+dt@kernel.org, mark.rutland@arm.com Subject: [PATCH v3 13/13] soc: rockchip: power-domain: add power domain support for px30 Date: Wed, 23 May 2018 14:53:32 +0800 Message-Id: <1527058412-10754-1-git-send-email-zhangqing@rock-chips.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1527058129-10260-1-git-send-email-zhangqing@rock-chips.com> References: <1527058129-10260-1-git-send-email-zhangqing@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180522_234828_934190_86239785 X-CRM114-Status: GOOD ( 12.31 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: huangtao@rock-chips.com, devicetree@vger.kernel.org, ulf.hansson@linaro.org, Elaine Zhang , linux-pm@vger.kernel.org, xxx@rock-chips.com, khilman@kernel.org, rjw@rjwysocki.net, linux-kernel@vger.kernel.org, xf@rock-chips.com, linux-rockchip@lists.infradead.org, Finley Xiao , linux-arm-kernel@lists.infradead.org, wxt@rock-chips.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Finley Xiao This driver is modified to support PX30 SoC. Signed-off-by: Finley Xiao Signed-off-by: Elaine Zhang --- drivers/soc/rockchip/pm_domains.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c index 90dcd5e21ae6..d0c5615132e3 100644 --- a/drivers/soc/rockchip/pm_domains.c +++ b/drivers/soc/rockchip/pm_domains.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -114,6 +115,9 @@ struct rockchip_pmu { .active_wakeup = wakeup, \ } +#define DOMAIN_PX30(pwr, status, req, wakeup) \ + DOMAIN_M(pwr, status, req, (req) + 16, req, wakeup) + #define DOMAIN_RK3288(pwr, status, req, wakeup) \ DOMAIN(pwr, status, req, req, (req) + 16, wakeup) @@ -712,6 +716,17 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) return error; } +static const struct rockchip_domain_info px30_pm_domains[] = { + [PX30_PD_USB] = DOMAIN_PX30(5, 5, 10, false), + [PX30_PD_SDCARD] = DOMAIN_PX30(8, 8, 9, false), + [PX30_PD_GMAC] = DOMAIN_PX30(10, 10, 6, false), + [PX30_PD_MMC_NAND] = DOMAIN_PX30(11, 11, 5, false), + [PX30_PD_VPU] = DOMAIN_PX30(12, 12, 14, false), + [PX30_PD_VO] = DOMAIN_PX30(13, 13, 7, false), + [PX30_PD_VI] = DOMAIN_PX30(14, 14, 8, false), + [PX30_PD_GPU] = DOMAIN_PX30(15, 15, 2, false), +}; + static const struct rockchip_domain_info rk3036_pm_domains[] = { [RK3036_PD_MSCH] = DOMAIN_RK3036(14, 23, 30, true), [RK3036_PD_CORE] = DOMAIN_RK3036(13, 17, 24, false), @@ -811,6 +826,17 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) [RK3399_PD_SDIOAUDIO] = DOMAIN_RK3399(31, 31, 29, true), }; +static const struct rockchip_pmu_info px30_pmu = { + .pwr_offset = 0x18, + .status_offset = 0x20, + .req_offset = 0x64, + .idle_offset = 0x6c, + .ack_offset = 0x6c, + + .num_domains = ARRAY_SIZE(px30_pm_domains), + .domain_info = px30_pm_domains, +}; + static const struct rockchip_pmu_info rk3036_pmu = { .req_offset = 0x148, .idle_offset = 0x14c, @@ -915,6 +941,10 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev) static const struct of_device_id rockchip_pm_domain_dt_match[] = { { + .compatible = "rockchip,px30-power-controller", + .data = (void *)&px30_pmu, + }, + { .compatible = "rockchip,rk3036-power-controller", .data = (void *)&rk3036_pmu, },