Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp337978pxf; Thu, 1 Apr 2021 02:27:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrvvATXyBUMktYe3Anc5tZ/o9xp08DNKnoP+OzB41B9mpyntfltlli3AEKd5sSF4J9Jv9G X-Received: by 2002:a05:6402:2ce:: with SMTP id b14mr8732727edx.13.1617269276340; Thu, 01 Apr 2021 02:27:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617269276; cv=none; d=google.com; s=arc-20160816; b=YKgR60Fw5MgW1YOLSpx9GoocO2imLZkcMZNiZURc0uri/ElDlycRptTtlRPYfMia/P 0bMGSzI7nHCyi0BR9JmX1WuZF9OaBf3UDhibpBAV3xnzOUiExBjUXV7uha7h21gZ5qIa CfL8Ez3eSdskPNQG+lAfPY2pRpZ+ANy0xY8C5hOLhIpe+tH03QjpeA1QAQCrlXUY1K1u C2EAs7Hlj85r5h+WrSxqJnkmRbi3zoQyCCZH87Ex/N9G9fgH4pqq4JTKGpxXvjrMs0mN 9ongdIrwGGyMYPXHpR2P94IRvHvzWNmvBplcJJhBB7qGKHGV+c0O629ObCkDieUcCyo3 9opw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=QOZ406BEEbEWHKFv25vOlBMps7sISsv3QFK8sS1MwtA=; b=gIqWfBuQyl5ecieYktvjwYR2g8zMUquNMF1Qht7V9UtGrE0kd9IRIZO1tDs8Iu49il 1yebWSLFXa5PpQeFY4SY5Dm0XB9obJ1qMWldqgl1nQJ8NqcKxUrGBggc+ZuWAUU50TAV bcmWvwL64l6UItZICthtjKVhCySvNRJnlu7v8whzIBB7M61VPaC5S4x4qWTZnjjyNFC2 W0hCixajC3Ze96c6FowSfBMOL1Z+Wp5BccvX5YY4ymOj5n0qpUO2WMORJlpUL3Z7CvWt Ew5NU4lkK+Jbm9c5MZsR23gsIltz8TlVSu0XLm1aJ4jDEsfEbH736Ia5EFz13Lx6G3Dq 7fRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SWab0PZ7; 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 z13si4093366edc.6.2021.04.01.02.27.34; Thu, 01 Apr 2021 02:27:56 -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=SWab0PZ7; 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 S233930AbhDAJYh (ORCPT + 99 others); Thu, 1 Apr 2021 05:24:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233865AbhDAJYc (ORCPT ); Thu, 1 Apr 2021 05:24:32 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6B18C0613E6; Thu, 1 Apr 2021 02:24:31 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id x16so1097937wrn.4; Thu, 01 Apr 2021 02:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=QOZ406BEEbEWHKFv25vOlBMps7sISsv3QFK8sS1MwtA=; b=SWab0PZ7BrG7ikUp/9BfwfF65yALwYpjPDfYWda+cCXfJR8UIxbUA30Clh6LoSKHVx qp2BJ4aXaiyYw5IhnZJRGrt0OqFJ79M8GEKybnzBLjwTNDwjgF04Z1Nxp+R8b5r24yvv hr3HMXaR0L29Ok2nRkRdD9vC/8Ek/07WsG14e95CrGFthD7V8OdD3GGsU+//2CW4B1vG qsZs9jKpKm99reBy4uCkCtjeoJOS7p7c5RiwJyn3mDNobGyPikADdAU4JEy5Xj7AtVCU 64qLTbqH4DY1QJgnb5sDmU1DSzngtMlXbHwBhWSh0WWDHCTw3+qaUiPne1I5sOwU0a86 aV5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=QOZ406BEEbEWHKFv25vOlBMps7sISsv3QFK8sS1MwtA=; b=N5UeKVSISAH3v57h4SPNFYIWlSwTsLA5qVnLyNjLAd2R+w9u8uVTsCz9Hn9ehzWr5O GAcuqzKM+lgWBWaBvq2sQ2/KgArvd+TiH6DrwXZLbH9/BMd1/4pJBHoZTPF9+9+jXykj gb5Kz/bczmw4/eYG7sOzl4NS00skqhfK7MT6Bfm93XMEiLlJczYWys12gYFhkbahzBYq ynrWS8M7McQIxpqkNjcWTTbh0hZxnsg1yTuAWmczrG1k6LvxeLOqDg0FnVHwlGrG+wwb J8+xjAGlUUJ/cjPFh496I2NpQV7qFnnPyutZTUW1kytlHmaPdQ8v01qN0WDOMeMYhbrz hAxg== X-Gm-Message-State: AOAM531jczrxFWzE5TGrunQ5w/JwShT6zkaKO9SjlGAGNOzyspcJL6IT MIlMSkcZ7oK1SfY1EimL+Ac= X-Received: by 2002:adf:f851:: with SMTP id d17mr8396821wrq.267.1617269070552; Thu, 01 Apr 2021 02:24:30 -0700 (PDT) Received: from ziggy.stardust ([213.195.126.134]) by smtp.gmail.com with ESMTPSA id s9sm8153450wmh.31.2021.04.01.02.24.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Apr 2021 02:24:29 -0700 (PDT) Subject: Re: [PATCH v10 2/4] soc: mediatek: add MT6765 scpsys and subdomain support To: Macpaul Lin , Rob Herring , Mark Rutland , Catalin Marinas , Will Deacon , Michael Turquette , Stephen Boyd , Wendell Lin , Fabien Parent , Weiyi Lu , Mars Cheng , Sean Wang , Owen Chen , Evan Green , Yong.Wu@mediatek.com, Joerg Roedel , Shawn Guo , Marc Zyngier , Ryder Lee , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-clk@vger.kernel.org Cc: Ainge Hsu , Eddie Hung , Mediatek WSD Upstream , Macpaul Lin , CC Hwang , Loda Chou References: <1615291538-9799-1-git-send-email-macpaul.lin@mediatek.com> <1615358218-6540-1-git-send-email-macpaul.lin@mediatek.com> <1615358218-6540-3-git-send-email-macpaul.lin@mediatek.com> From: Matthias Brugger Message-ID: Date: Thu, 1 Apr 2021 11:24:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <1615358218-6540-3-git-send-email-macpaul.lin@mediatek.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Macpaul, On 10/03/2021 07:36, Macpaul Lin wrote: > From: Mars Cheng > > This adds scpsys support for MT6765 > Add subdomain support for MT6765: > isp, mm, connsys, mfg, and cam. > > Signed-off-by: Mars Cheng > Signed-off-by: Owen Chen > Signed-off-by: Macpaul Lin > --- > drivers/soc/mediatek/mtk-scpsys.c | 91 +++++++++++++++++++++++++++++++ > 1 file changed, 91 insertions(+) > > diff --git a/drivers/soc/mediatek/mtk-scpsys.c b/drivers/soc/mediatek/mtk-scpsys.c the mtk-scpsys is the old version of the driver. Please port your code to the new driver: mtk-pm-domains.c The biggest difference for you will be to describe the power domain hierarchy in DT instead as in the driver. Regards, Matthias > index ca75b14931ec..fc8d3858f1b4 100644 > --- a/drivers/soc/mediatek/mtk-scpsys.c > +++ b/drivers/soc/mediatek/mtk-scpsys.c > @@ -15,6 +15,7 @@ > > #include > #include > +#include > #include > #include > #include > @@ -750,6 +751,81 @@ static const struct scp_subdomain scp_subdomain_mt2712[] = { > {MT2712_POWER_DOMAIN_MFG_SC2, MT2712_POWER_DOMAIN_MFG_SC3}, > }; > > +/* > + * MT6765 power domain support > + */ > +#define SPM_PWR_STATUS_MT6765 0x0180 > +#define SPM_PWR_STATUS_2ND_MT6765 0x0184 > + > +static const struct scp_domain_data scp_domain_data_mt6765[] = { > + [MT6765_POWER_DOMAIN_VCODEC] = { > + .name = "vcodec", > + .sta_mask = BIT(26), > + .ctl_offs = 0x300, > + .sram_pdn_bits = GENMASK(8, 8), > + .sram_pdn_ack_bits = GENMASK(12, 12), > + }, > + [MT6765_POWER_DOMAIN_ISP] = { > + .name = "isp", > + .sta_mask = BIT(5), > + .ctl_offs = 0x308, > + .sram_pdn_bits = GENMASK(8, 8), > + .sram_pdn_ack_bits = GENMASK(12, 12), > + }, > + [MT6765_POWER_DOMAIN_MM] = { > + .name = "mm", > + .sta_mask = BIT(3), > + .ctl_offs = 0x30C, > + .sram_pdn_bits = GENMASK(8, 8), > + .sram_pdn_ack_bits = GENMASK(12, 12), > + .clk_id = {CLK_MM}, > + }, > + [MT6765_POWER_DOMAIN_CONN] = { > + .name = "conn", > + .sta_mask = BIT(1), > + .ctl_offs = 0x32C, > + .sram_pdn_bits = 0, > + .sram_pdn_ack_bits = 0, > + }, > + [MT6765_POWER_DOMAIN_MFG_ASYNC] = { > + .name = "mfg_async", > + .sta_mask = BIT(23), > + .ctl_offs = 0x334, > + .sram_pdn_bits = 0, > + .sram_pdn_ack_bits = 0, > + .clk_id = {CLK_MFG}, > + }, > + [MT6765_POWER_DOMAIN_MFG] = { > + .name = "mfg", > + .sta_mask = BIT(4), > + .ctl_offs = 0x338, > + .sram_pdn_bits = GENMASK(8, 8), > + .sram_pdn_ack_bits = GENMASK(12, 12), > + }, > + [MT6765_POWER_DOMAIN_CAM] = { > + .name = "cam", > + .sta_mask = BIT(25), > + .ctl_offs = 0x344, > + .sram_pdn_bits = GENMASK(9, 8), > + .sram_pdn_ack_bits = GENMASK(13, 12), > + }, > + [MT6765_POWER_DOMAIN_MFG_CORE0] = { > + .name = "mfg_core0", > + .sta_mask = BIT(7), > + .ctl_offs = 0x34C, > + .sram_pdn_bits = GENMASK(8, 8), > + .sram_pdn_ack_bits = GENMASK(12, 12), > + }, > +}; > + > +static const struct scp_subdomain scp_subdomain_mt6765[] = { > + {MT6765_POWER_DOMAIN_MM, MT6765_POWER_DOMAIN_CAM}, > + {MT6765_POWER_DOMAIN_MM, MT6765_POWER_DOMAIN_ISP}, > + {MT6765_POWER_DOMAIN_MM, MT6765_POWER_DOMAIN_VCODEC}, > + {MT6765_POWER_DOMAIN_MFG_ASYNC, MT6765_POWER_DOMAIN_MFG}, > + {MT6765_POWER_DOMAIN_MFG, MT6765_POWER_DOMAIN_MFG_CORE0}, > +}; > + > /* > * MT6797 power domain support > */ > @@ -1033,6 +1109,18 @@ static const struct scp_soc_data mt2712_data = { > .bus_prot_reg_update = false, > }; > > +static const struct scp_soc_data mt6765_data = { > + .domains = scp_domain_data_mt6765, > + .num_domains = ARRAY_SIZE(scp_domain_data_mt6765), > + .subdomains = scp_subdomain_mt6765, > + .num_subdomains = ARRAY_SIZE(scp_subdomain_mt6765), > + .regs = { > + .pwr_sta_offs = SPM_PWR_STATUS_MT6765, > + .pwr_sta2nd_offs = SPM_PWR_STATUS_2ND_MT6765, > + }, > + .bus_prot_reg_update = true, > +}; > + > static const struct scp_soc_data mt6797_data = { > .domains = scp_domain_data_mt6797, > .num_domains = ARRAY_SIZE(scp_domain_data_mt6797), > @@ -1088,6 +1176,9 @@ static const struct of_device_id of_scpsys_match_tbl[] = { > }, { > .compatible = "mediatek,mt2712-scpsys", > .data = &mt2712_data, > + }, { > + .compatible = "mediatek,mt6765-scpsys", > + .data = &mt6765_data, > }, { > .compatible = "mediatek,mt6797-scpsys", > .data = &mt6797_data, >