Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp906687ybz; Fri, 17 Apr 2020 12:11:01 -0700 (PDT) X-Google-Smtp-Source: APiQypJ/yUkCNDN8CgY1JcH2ABlAE7ujlL+UtYhjsUB8bijga/2rA1lImIuEfvk6ab3iTzyoyrLP X-Received: by 2002:a05:6402:12c6:: with SMTP id k6mr4523626edx.33.1587150661447; Fri, 17 Apr 2020 12:11:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587150661; cv=none; d=google.com; s=arc-20160816; b=yVWzbRQWTy36M/IUAwAzng2BmgjA6x3WppKZtwwBR/aOPyN8vkCuRcIHwuQh6WYSIo OABiKcV6pfwgpq8Cl1Uvchcfx/ci7UfN1rmepTcwU0soLMvmI5qMQxzKqFOM3XDJ8v/y tSDgPY5wvE+IsEjpWZ1/ZvI99kjvKc2B9/jsoyYlWEJbNN9gIpYXgqNi/nuyya8AqVmx VgJl1bU4UxEZoYK3S2v6U5obIEu1lixe961yXCsb+BOeDVeq03z/E1RRwRZLyUWjDQUu gJr2o8YvPvqbGjVUz7F7Tkr9X9bSmJ5eA6vwFCC35+It4M5hMHnj9+5eGlvdb+xfuN6G U5dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6W8grtyB7pbKtLO6nZYSpUXrUqbnBG7Y9G7Qj2TNYYc=; b=GPlRQekSIPDLXhCb7bvASLbiakgTyzQmpfBLEV10K3ozJdeOs++uIY4HV/5anaAw+a yt05t+HUn3LDMb9ZJRxvQpef5Z2petv8TAZWFVj6fstbrxZtXX59js0ue8Hkp1lLsefo gaxwHnYaD3N1nrcOxDhk3zA7tzyMdP380bM/Zy5cYY/a7IQalEJlrFlp+u/8HSYhW3P4 HekfCLWzULYJPkugTRG0Xsfw+hrwg1egxxQD0aHfwO37RqH6DdLvEhwVJHM9WRxENKI/ SzGcG0psoC8XpgnNEW9QZ0s6lwXDO97GrJyjRgqONY/CTVp/OhAiNYr6YGzwgVNvRg6Z 37ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b="eohS/Pgm"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oz2si13108921ejb.90.2020.04.17.12.10.38; Fri, 17 Apr 2020 12:11:01 -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=@googlemail.com header.s=20161025 header.b="eohS/Pgm"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728591AbgDQTI4 (ORCPT + 99 others); Fri, 17 Apr 2020 15:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729765AbgDQTIr (ORCPT ); Fri, 17 Apr 2020 15:08:47 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E009BC061A0C; Fri, 17 Apr 2020 12:08:46 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id t14so4234925wrw.12; Fri, 17 Apr 2020 12:08:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6W8grtyB7pbKtLO6nZYSpUXrUqbnBG7Y9G7Qj2TNYYc=; b=eohS/PgmixifbU4OP9qQXJdkkkFkvnj2zGyIiM+8j+RuemBqtPhzU9GuDwm66czYQ+ i1YhLAVCQFHqn4XlfLKAob3MWZv7PxMT40D80jRRe8gEO3T3Jg9DvohBJRz32LLhvNUl vBntwB/NJF9web2wrX4R6LzzIqoeWQbKcIxQ1c22a6vmEvCGDl6M5WCdFGs88agO3IMN r+7vfSTVUn4JFtHIBK0PmRanq9XpckRa3UFVckfod8hEPasvoe1WjWbK4pwfj2FC8Zhl V5J6/p2/og5MOLQEZ21CisSqHRYcfkVKeUWWS3qnyizvgcUjbhelr4mtf+AyhR2mWHVK DleQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6W8grtyB7pbKtLO6nZYSpUXrUqbnBG7Y9G7Qj2TNYYc=; b=Kfa7rj27RdSRbTfFdHZVmG2BgM88Xmm/tTHnrjz349jiVPLaoEU4T1WwXrXl5U2Wrg /J/13DZ34FT37hNg/Rc+FfMbSviA3Gnv+1Gs/QUHnOfGmqgfmxBpWHrnuhSDG/CRKpNf 8s1V1d5+BnjmTh/yEFjIn9fjY2sgHYFRvI6R6Qfj5ASSzf6AK1d5ZgjhDMVwhoRyNfOB jb2Q0z0wSrCL5gtWqsTb0OFtUjMbhdz72p1RAZY/gATcjGQyABu4BCNGXOu6JA3iCEUn 7ESQGeNAwZ4JHUb9GO8F5JRlQXQ/u9YUgCky3EO7feXUAaPMFOzJ53LskS71zhZAxWVL f3Rw== X-Gm-Message-State: AGi0PuYFkFOwMtRSm1gloeaZxpc8cJ8aqft/E0Yxr5HubDSZQuVjvLgn 3N3FLkKJgn/u6aPHwRkj5JU= X-Received: by 2002:adf:c109:: with SMTP id r9mr5403450wre.265.1587150525549; Fri, 17 Apr 2020 12:08:45 -0700 (PDT) Received: from localhost.localdomain (p200300F137142E00428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:f1:3714:2e00:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id q17sm8722220wmj.45.2020.04.17.12.08.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2020 12:08:44 -0700 (PDT) From: Martin Blumenstingl To: robh+dt@kernel.org, khilman@baylibre.com, narmstrong@baylibre.com, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [PATCH v2 4/4] soc: amlogic: meson-ee-pwrc: add support for the Meson GX SoCs Date: Fri, 17 Apr 2020 21:08:25 +0200 Message-Id: <20200417190825.1363345-5-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200417190825.1363345-1-martin.blumenstingl@googlemail.com> References: <20200417190825.1363345-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for the Meson GX SoCs to the meson-ee-pwrc driver. The power domains on the GX SoCs are very similar to G12A. The only known differences so far are: - The GX SoCs do not have the HHI_VPU_MEM_PD_REG2 register (for the VPU power-domain) - The GX SoCs have an additional reset line called "dvin" Signed-off-by: Martin Blumenstingl --- drivers/soc/amlogic/meson-ee-pwrc.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/soc/amlogic/meson-ee-pwrc.c b/drivers/soc/amlogic/meson-ee-pwrc.c index b30868da456a..a90572cb9c82 100644 --- a/drivers/soc/amlogic/meson-ee-pwrc.c +++ b/drivers/soc/amlogic/meson-ee-pwrc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include /* AO Offsets */ @@ -73,7 +74,7 @@ struct meson_ee_pwrc_domain_data { /* TOP Power Domains */ -static struct meson_ee_pwrc_top_domain g12a_pwrc_vpu = { +static struct meson_ee_pwrc_top_domain gxbb_pwrc_vpu = { .sleep_reg = AO_RTI_GEN_PWR_SLEEP0, .sleep_mask = BIT(8), .iso_reg = AO_RTI_GEN_PWR_SLEEP0, @@ -138,6 +139,12 @@ static struct meson_ee_pwrc_mem_domain g12a_pwrc_mem_vpu[] = { VPU_HHI_MEMPD(HHI_MEM_PD_REG0), }; +static struct meson_ee_pwrc_mem_domain gxbb_pwrc_mem_vpu[] = { + VPU_MEMPD(HHI_VPU_MEM_PD_REG0), + VPU_MEMPD(HHI_VPU_MEM_PD_REG1), + VPU_HHI_MEMPD(HHI_MEM_PD_REG0), +}; + static struct meson_ee_pwrc_mem_domain meson8_pwrc_mem_eth[] = { { HHI_MEM_PD_REG0, GENMASK(3, 2) }, }; @@ -223,11 +230,17 @@ static struct meson_ee_pwrc_mem_domain sm1_pwrc_mem_audio[] = { static bool pwrc_ee_get_power(struct meson_ee_pwrc_domain *pwrc_domain); static struct meson_ee_pwrc_domain_desc g12a_pwrc_domains[] = { - [PWRC_G12A_VPU_ID] = VPU_PD("VPU", &g12a_pwrc_vpu, g12a_pwrc_mem_vpu, + [PWRC_G12A_VPU_ID] = VPU_PD("VPU", &gxbb_pwrc_vpu, g12a_pwrc_mem_vpu, pwrc_ee_get_power, 11, 2), [PWRC_G12A_ETH_ID] = MEM_PD("ETH", meson8_pwrc_mem_eth), }; +static struct meson_ee_pwrc_domain_desc gxbb_pwrc_domains[] = { + [PWRC_GXBB_VPU_ID] = VPU_PD("VPU", &gxbb_pwrc_vpu, gxbb_pwrc_mem_vpu, + pwrc_ee_get_power, 12, 2), + [PWRC_GXBB_ETHERNET_MEM_ID] = MEM_PD("ETH", meson8_pwrc_mem_eth), +}; + static struct meson_ee_pwrc_domain_desc meson8_pwrc_domains[] = { [PWRC_MESON8_VPU_ID] = VPU_PD("VPU", &meson8_pwrc_vpu, meson8_pwrc_mem_vpu, pwrc_ee_get_power, @@ -514,6 +527,11 @@ static struct meson_ee_pwrc_domain_data meson_ee_g12a_pwrc_data = { .domains = g12a_pwrc_domains, }; +static struct meson_ee_pwrc_domain_data meson_ee_gxbb_pwrc_data = { + .count = ARRAY_SIZE(gxbb_pwrc_domains), + .domains = gxbb_pwrc_domains, +}; + static struct meson_ee_pwrc_domain_data meson_ee_m8_pwrc_data = { .count = ARRAY_SIZE(meson8_pwrc_domains), .domains = meson8_pwrc_domains, @@ -542,6 +560,10 @@ static const struct of_device_id meson_ee_pwrc_match_table[] = { .compatible = "amlogic,meson8m2-pwrc", .data = &meson_ee_m8b_pwrc_data, }, + { + .compatible = "amlogic,meson-gxbb-pwrc", + .data = &meson_ee_gxbb_pwrc_data, + }, { .compatible = "amlogic,meson-g12a-pwrc", .data = &meson_ee_g12a_pwrc_data, -- 2.26.1