From patchwork Thu Dec 1 10:30:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 13061160 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CBA51C43217 for ; Thu, 1 Dec 2022 10:31:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+iCtPgIGwbz45YSsTw5QPUFuvyvTXOCZkrwj3iBFQLc=; b=0piYfRqJCeRSre UZwxKhlg2BIIJgANHeao9V/MakakGdwCNm5zI2B9OguLQWICOEn8CpHl4L/zVmaIryqUeywA4eKkj qoCloS0vMAcu4Zww6gopa9M5pj++p1NOwerGYXlcD1DaZfQGtWlGxEuzKkNU2DNz1Z71dH19q4IIE mTrsFIY/e4F7KQ9Jbinui4NPAGr9vS3AM2Owgh++txFqTuWc9yP1A4bEX5cepLqGo2//9zZLinzyN DNAMBTVdhV4Ht4N+LBJuKWbdvdjF9Pon5xYJGRJ/jJpGAilk0cri48XVaqpDoXGCgQDJXu4vlXtxj JAdmiB/NIePXhtcdDk9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0gr3-006jFr-CA; Thu, 01 Dec 2022 10:31:45 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p0gqL-006irq-Uo; Thu, 01 Dec 2022 10:31:03 +0000 Received: by mail-ej1-x62d.google.com with SMTP id n20so3212831ejh.0; Thu, 01 Dec 2022 02:31:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Cw/am3froU3IMTWG9BB3ZSyfplgImMW6lCXqrhZP2N0=; b=e7Jr/dlq1iZJ6Vo0Akrf19zQZbdAlnYG76TZ3VqHzc/Frne5jgMv02/d3ohwY/cNGA 3vUCDNQ3DjJUemDIIgFQ5A2FjLb+EVY83KHHEgVf0B82hJ5wahK3LWkITJ/OAZMosNLV 3170pgufD8Cc1rzpSJUNWXLIbe+eIKgufCl4yyRa5kn076vdBuaiqhj8K87ogf7R2lXa RC/YSnNNXEzTtlp3yft1iMdt7Sa6gdRK+jrTdpU/eVPXNhmwLZMFBnYMWbT6XXWePszu snUuU5mMGRPpXygAzvxKBfp9yRDHeNclakNBZ5ELeNNBbSAhDdJjy7M9JjhiNZP1h+5u pRaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Cw/am3froU3IMTWG9BB3ZSyfplgImMW6lCXqrhZP2N0=; b=12uVuTYc4AaWPXADVYKOV//qoq1+5UX+4Pp7PE1MMZHuJaBoHvfNLqZOJRTOThRMlm qWd89FdMJYYLfMdQoXE1SoU3OZp2QSLbm8NBfhzgrqQ5XJikhmXsg1iS4kiuy4tAKNWc ZR+QQxHGx+Vkg6kJ19AXc0O04ChSpkOGfQFHHyXDV4cEJd/EBhflF0NwshXm+DfdMM9q XWBHFHi4r+TrgA5pEEVgHup8Y+iwi6p34wnd/LWbWFXul2FCOXG37ZJRBWQwL6CrjPwZ VNcOaBeDCozaSEJcBqrD/w8b7GukL040XUTKQhLZ24v4TS5oWEiV+1Bt0MNX3GsqaLfn b6+g== X-Gm-Message-State: ANoB5pm/ebTFULvMER8oPe6SqFzo3NQYeJlO0nLuAu3dl6FRvlEk8P5O SSy9Ptl4ojjPgAi0kxjf3rApLCiTHKzJ2w== X-Google-Smtp-Source: AA0mqf7i+oWScBiNNrMmVVDu/b9xnYG5kkQHeaCBG48ZkrilJoVuy+tSPb3PjaBDDCtMo8/nVgfNCQ== X-Received: by 2002:a17:906:4e4e:b0:7ae:e6ac:2427 with SMTP id g14-20020a1709064e4e00b007aee6ac2427mr55294186ejw.345.1669890658781; Thu, 01 Dec 2022 02:30:58 -0800 (PST) Received: from cizrna.home (cst-prg-44-69.cust.vodafone.cz. [46.135.44.69]) by smtp.gmail.com with ESMTPSA id g1-20020a17090604c100b007c07b23a79bsm1592400eja.213.2022.12.01.02.30.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 02:30:58 -0800 (PST) From: Tomeu Vizoso To: Cc: italonicola@collabora.com, Tomeu Vizoso , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , linux-arm-kernel@lists.infradead.org (moderated list:ARM/Amlogic Meson SoC support), linux-amlogic@lists.infradead.org (open list:ARM/Amlogic Meson SoC support), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v5 3/7] soc: amlogic: meson-pwrc: Add NNA power domain for A311D Date: Thu, 1 Dec 2022 11:30:19 +0100 Message-Id: <20221201103026.53234-4-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221201103026.53234-1-tomeu.vizoso@collabora.com> References: <20221201103026.53234-1-tomeu.vizoso@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221201_023102_025859_C52CB8FE X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Based on power initialization sequence in downstream driver. Signed-off-by: Tomeu Vizoso Reviewed-by: Neil Armstrong Reviewed-by: Martin Blumenstingl --- drivers/soc/amlogic/meson-ee-pwrc.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/soc/amlogic/meson-ee-pwrc.c b/drivers/soc/amlogic/meson-ee-pwrc.c index dd5f2a13ceb5..dfbf0b1c7d29 100644 --- a/drivers/soc/amlogic/meson-ee-pwrc.c +++ b/drivers/soc/amlogic/meson-ee-pwrc.c @@ -46,6 +46,9 @@ #define HHI_NANOQ_MEM_PD_REG1 (0x47 << 2) #define HHI_VPU_MEM_PD_REG2 (0x4d << 2) +#define G12A_HHI_NANOQ_MEM_PD_REG0 (0x43 << 2) +#define G12A_HHI_NANOQ_MEM_PD_REG1 (0x44 << 2) + struct meson_ee_pwrc; struct meson_ee_pwrc_domain; @@ -106,6 +109,13 @@ static struct meson_ee_pwrc_top_domain sm1_pwrc_usb = SM1_EE_PD(17); static struct meson_ee_pwrc_top_domain sm1_pwrc_pci = SM1_EE_PD(18); static struct meson_ee_pwrc_top_domain sm1_pwrc_ge2d = SM1_EE_PD(19); +static struct meson_ee_pwrc_top_domain g12a_pwrc_nna = { \ + .sleep_reg = GX_AO_RTI_GEN_PWR_SLEEP0, \ + .sleep_mask = BIT(16) | BIT(17), \ + .iso_reg = GX_AO_RTI_GEN_PWR_ISO0, \ + .iso_mask = BIT(16) | BIT(17), \ + }; + /* Memory PD Domains */ #define VPU_MEMPD(__reg) \ @@ -217,6 +227,11 @@ static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_audio[] = { { HHI_AUDIO_MEM_PD_REG0, GENMASK(27, 26) }, }; +static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_nna[] = { + { G12A_HHI_NANOQ_MEM_PD_REG0, GENMASK(31, 0) }, + { G12A_HHI_NANOQ_MEM_PD_REG1, GENMASK(23, 0) }, +}; + #define VPU_PD(__name, __top_pd, __mem, __is_pwr_off, __resets, __clks) \ { \ .name = __name, \ @@ -253,6 +268,8 @@ static struct meson_ee_pwrc_domain_desc g12a_pwrc_domains[] = { [PWRC_G12A_VPU_ID] = VPU_PD("VPU", &gx_pwrc_vpu, g12a_pwrc_mem_vpu, pwrc_ee_is_powered_off, 11, 2), [PWRC_G12A_ETH_ID] = MEM_PD("ETH", meson_pwrc_mem_eth), + [PWRC_G12A_NNA_ID] = TOP_PD("NNA", &g12a_pwrc_nna, g12a_pwrc_mem_nna, + pwrc_ee_is_powered_off), }; static struct meson_ee_pwrc_domain_desc gxbb_pwrc_domains[] = {