Received: by 10.223.176.5 with SMTP id f5csp474725wra; Wed, 7 Feb 2018 02:24:13 -0800 (PST) X-Google-Smtp-Source: AH8x225EeCDOdU7EOs4P/ERBjj9adksoYoL7zZcLGrtKp2mLVtYB9zwhSbjjwMxQbns1m5Kg7a7B X-Received: by 10.99.61.205 with SMTP id k196mr4592048pga.370.1517999053253; Wed, 07 Feb 2018 02:24:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517999053; cv=none; d=google.com; s=arc-20160816; b=EdERC5MvFmS08GbHkkSEKAzHQc+OQc3VmjedyvhA/Id+/+lpiHa9fCDWAwpAmKoG6F zXxemP+dqTOFm8UVhavFzm1HQ6Wkfnstn+B++YP2dtg+yd4s1ri8VrA6y3rdf8Zutk/O wyVPELZUCmfvPQfFWPxURSg1zQpT86vHhnDF5dTvJYLY7TvQdV7utxlXRt6kY0dzMZr/ 6EDOCpxgQnCtRDiOfxCa1hfYQ/1y3nmMmhlxHI7sr00UNqjY2DqY9wDS7pm5UnsHKDsF rbtYBHNvt10FNjHvDBbahkhEoWWS62FXEXf+rlM4CsCZQk27SZRNLXITPPs1Ejmp4qiM 2MpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=GX0nJewBj/MjUS8XOl1S85A09o5ryi7aRAc/ODz6yig=; b=NoLIEnbVcsEO0/aZHfv0iP+OqWXjM7OcG7ZTGuOnsLeaONBTZOyxPEHH3haHOTc6N9 3sj7geoDxO9o5bW9nYI0BlZVOUsLPT7AHamrfsLjGc62uDkC8Hh6Fp/uSeiFowQPPfa8 gkYokrWdTeSS/fTv4sh3jBLpZR8c1gGw/ZN0BAoR1V74wUczukQ7dmK8uD2RIrfUFtN6 2AGd1g1P4qzdGfEEXBH9wxDuOP6jkUX+TaV/gVbv8RmM1gRTMbMmWqBicFi4Tb/PqhUu CBqpjOM1yuoONnKV8jbl9G/PtCErqPYtynFfiN7BmYNSdmLwGXhIhuOAEsrnHhncreBe yfdw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e33-v6si868049pld.628.2018.02.07.02.23.59; Wed, 07 Feb 2018 02:24:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753876AbeBGKXE (ORCPT + 99 others); Wed, 7 Feb 2018 05:23:04 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:42233 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1753834AbeBGKXA (ORCPT ); Wed, 7 Feb 2018 05:23:00 -0500 X-UUID: f47336e5a34f45d58a6b6acdc4261eb9-20180207 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 607817491; Wed, 07 Feb 2018 18:22:55 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 7 Feb 2018 18:22:53 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Wed, 7 Feb 2018 18:22:53 +0800 From: To: , , , CC: , , , , , , Sean Wang Subject: [PATCH v2 4/4] soc: mediatek: add SCPSYS power domain driver for MediaTek MT7623A SoC Date: Wed, 7 Feb 2018 18:22:50 +0800 Message-ID: <7a90721d7327c90c2716394dc1fd88233fb07256.1517998367.git.sean.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang Add SCPSYS power domain driver for MT7623A SoC. The MT7623A's power domains are the subset of MT7623 SoC's ones. As MT7623 SoC has full features whereas MT7623A is being designed just for router applications. Thus, MT7623A doesn't include those power domains multimedia function belongs to. In order to avoid certain errors undoubtedly happening at registering those power domains on MT7623A SoC using the existing MT7623 SCPSYS driver, it's required to define another setup specifically for MT7623A SoC. Signed-off-by: Sean Wang --- drivers/soc/mediatek/mtk-scpsys.c | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c index 5346f33..fc55faa 100644 --- a/drivers/soc/mediatek/mtk-scpsys.c +++ b/drivers/soc/mediatek/mtk-scpsys.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #define SPM_VDE_PWR_CON 0x0210 @@ -795,6 +796,47 @@ static const struct scp_domain_data scp_domain_data_mt7622[] = { }; /* + * MT7623A power domain support + */ + +static const struct scp_domain_data scp_domain_data_mt7623a[] = { + [MT7623A_POWER_DOMAIN_CONN] = { + .name = "conn", + .sta_mask = PWR_STATUS_CONN, + .ctl_offs = SPM_CONN_PWR_CON, + .bus_prot_mask = MT2701_TOP_AXI_PROT_EN_CONN_M | + MT2701_TOP_AXI_PROT_EN_CONN_S, + .clk_id = {CLK_NONE}, + .active_wakeup = true, + }, + [MT7623A_POWER_DOMAIN_ETH] = { + .name = "eth", + .sta_mask = PWR_STATUS_ETH, + .ctl_offs = SPM_ETH_PWR_CON, + .sram_pdn_bits = GENMASK(11, 8), + .sram_pdn_ack_bits = GENMASK(15, 12), + .clk_id = {CLK_ETHIF}, + .active_wakeup = true, + }, + [MT7623A_POWER_DOMAIN_HIF] = { + .name = "hif", + .sta_mask = PWR_STATUS_HIF, + .ctl_offs = SPM_HIF_PWR_CON, + .sram_pdn_bits = GENMASK(11, 8), + .sram_pdn_ack_bits = GENMASK(15, 12), + .clk_id = {CLK_ETHIF}, + .active_wakeup = true, + }, + [MT7623A_POWER_DOMAIN_IFR_MSC] = { + .name = "ifr_msc", + .sta_mask = PWR_STATUS_IFR_MSC, + .ctl_offs = SPM_IFR_MSC_PWR_CON, + .clk_id = {CLK_NONE}, + .active_wakeup = true, + }, +}; + +/* * MT8173 power domain support */ @@ -935,6 +977,16 @@ static const struct scp_soc_data mt7622_data = { .bus_prot_reg_update = true, }; +static const struct scp_soc_data mt7623a_data = { + .domains = scp_domain_data_mt7623a, + .num_domains = ARRAY_SIZE(scp_domain_data_mt7623a), + .regs = { + .pwr_sta_offs = SPM_PWR_STATUS, + .pwr_sta2nd_offs = SPM_PWR_STATUS_2ND + }, + .bus_prot_reg_update = true, +}; + static const struct scp_soc_data mt8173_data = { .domains = scp_domain_data_mt8173, .num_domains = ARRAY_SIZE(scp_domain_data_mt8173), @@ -965,6 +1017,9 @@ static const struct of_device_id of_scpsys_match_tbl[] = { .compatible = "mediatek,mt7622-scpsys", .data = &mt7622_data, }, { + .compatible = "mediatek,mt7623a-scpsys", + .data = &mt7623a_data, + }, { .compatible = "mediatek,mt8173-scpsys", .data = &mt8173_data, }, { -- 2.7.4