From patchwork Tue Nov 29 08:50:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 13058352 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 D5A99C4332F for ; Tue, 29 Nov 2022 08:53:19 +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=DJhIimY2Fe5qHXQ8jG2x1m10vrihRXYXk31Lk0SBFmw=; b=MQCXiLVH/X75Y4 wONLSn43mN96ZfbHo+ZDF1t5m4UW/QGknmJQ7ZlbsbENmnF7qzVKGtJSZUVFcet9t0aWY+J0K7iUu 1bIpjXEfTnjfARYbw6zMA5DLDel+oKvGgKw04UfrmxKKgkeX3F6aUcGoWbk8ubvwssynacNy3w2oo s+7LwTfqfBdqB9SsWp3rPu42RMGeIqsiVuA5VmPDaXUTs294+/D77HU2OpPkIeDFzbZdmW5WQknWE 2KADEhw4YMDOzNOUksoyFnGOJ0FSrJgJxKLrk4kf/YwTXcUfhcgqwbj8X3oWBlgdO2PkqadHwcXBw uwWAP+KlR05GxebSP1Vw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozwLg-007Y8I-QI; Tue, 29 Nov 2022 08:52:17 +0000 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozwKk-007Xjs-Vy; Tue, 29 Nov 2022 08:51:20 +0000 Received: by mail-ej1-x62f.google.com with SMTP id ho10so32078522ejc.1; Tue, 29 Nov 2022 00:51:18 -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=MLKh8cdNSHTwMWrctPe//cKfk2YeweD6IiOtOpNFWPtWaa3dGYSXQ26Iyy0Mvi06pd yMSzWB1UEZcPHAAwX1WWMDmhwQqDEqGG1nBUTIwI9V4U+Y+g8Y6DoWVC1HuTWRBvKfKe cxIemB5+vH6Zix9m8MwyiBZwMe0ZFGD/RQgbcc6gx0C5xzmmeavCh9ZQ7vDd2MjEQtbX +Dc2KlMUGvNvZLsPSwvSucKRtJTcD5bZMC39GPz74J6AZfG/LcQZxDENPNRDQUR1FCeL SOuDLtFty5plgee61eo1Y6vuKjgz1dsYpOrju8g/sKPkEhiA+p19wuIF6LzBAsW2qY2T iuSg== 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=v+rThPfVrW7FqYsemdGWJuRrTushXjgY9c6lFPqV4864ZDqxjrXlmyQcNuVTmz+ns/ kECEfFaPJagQzrlB2A9FbRX9yYIBRw7nXx3WLvNF5V6i2WmY9tTO4cvgDWnZZUCKgpGA CbjMLq5Fd5ld0/Ylcaj0Z+IeX3oO+wEa85ZfUFX/GdGmYRvmVddIkJbkgfokaZekMtr8 YxQVevO2+eIYAyWUkN1kqbkiy1pDhxciFzOXXqJpaYrPqTnhIStcdmtq23tuS55CYzg2 b92BMXQJQNhNoZx5neEqArGQGKtMTgCPzpq23ORJlL2cUbugleUVln7rXLiywmb9sUSp FdxQ== X-Gm-Message-State: ANoB5pmTnZYV17WTH/HOUVfFu6QNMtl5jUkXqHB3cTieqKoPfssyOE8g rdBWKLGlCnmcgM5LqEgP2iU= X-Google-Smtp-Source: AA0mqf6Up2siIcQWYStjGjAfESej3aO3xQCrXX+nSu+RfXB3dccz+c6R1c389wG2ryi43AZZ0MqZDQ== X-Received: by 2002:a17:906:9c8a:b0:7bf:6698:d444 with SMTP id fj10-20020a1709069c8a00b007bf6698d444mr8732658ejc.548.1669711876881; Tue, 29 Nov 2022 00:51:16 -0800 (PST) Received: from cizrna.home (cst-prg-44-69.cust.vodafone.cz. [46.135.44.69]) by smtp.gmail.com with ESMTPSA id kz1-20020a17090777c100b0078de26f66b9sm5873219ejc.114.2022.11.29.00.51.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 00:51:16 -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 v3 3/5] soc: amlogic: meson-pwrc: Add NNA power domain for A311D Date: Tue, 29 Nov 2022 09:50:43 +0100 Message-Id: <20221129085047.49813-4-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221129085047.49813-1-tomeu.vizoso@collabora.com> References: <20221129085047.49813-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-20221129_005119_064777_583A32DB X-CRM114-Status: GOOD ( 10.46 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Based on power initialization sequence in downstream driver. Signed-off-by: Tomeu Vizoso Reviewed-by: Neil Armstrong --- 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[] = {