Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2973211lqt; Tue, 23 Apr 2024 07:13:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUDPG9R0sZHCy/BDbvUrIbH6aYK64qMP5f+1vvJ12D6GuDxvo1XVVxSdJkt/IA6CDzeFZpCrdEPf6WpdvzWMUezUfn/Sj4pAOld7lDmoQ== X-Google-Smtp-Source: AGHT+IEQaqrkpvWr4Ur7g4mB5u78ONs0Sx8oyZnXIhAg9e+oHNvMnuIcSwxPEg8pOcvCgo40hBC8 X-Received: by 2002:a17:902:ecc6:b0:1e0:c3b5:196 with SMTP id a6-20020a170902ecc600b001e0c3b50196mr3878989plh.20.1713881608978; Tue, 23 Apr 2024 07:13:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713881608; cv=pass; d=google.com; s=arc-20160816; b=ii0gf0ABU/ilpUsiXvyPRl3GWb13qgTTCaaXTt2ZkYKOaJ3P83LxeM/S3SlaKY9hso XtOdDII13qeNRsSPDxYQEBY38TjGtPGE1FP9SVnwqj3RGGJIiE1MKmMrcG2K3B2A/ZS/ W490S1ymowbVcekc6PfTB+8Kl/HopVMIFm0xnN8mPa7/jMwyl+GCoS9KX6i3l2k/aNeC VVtgxXSTaMCflGSKcQLynkFY0SOfleHFwek5MC4uwzPjait3edP3f0GEkmJCcwY6Ag/k N7qrUHc+V+kuORz43mMHPcpjdGFXlq23Adw2MVVI18CNC5cfvwCZhGr0pX9ZiQy+cjIp h9+Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=k1N7C9y6FANsDWlj/dSgm/X0vOo9KMVHsfxdkeCTUls=; fh=O/J/mreM5hhvnB8kfqX7r51A1ghOfVluQ4hjE62cfy4=; b=p/E6sLSsb0Fik0GGCIqiTXMxYl2NTUHVHekNa42jEZMtTRTb9lRep5AUH+PbpkFI+S R4QBakWugBndI/LX0shNp6h0nUeRtDLEXSkZorQhFhs1SmzCC1rbbnp1bBHw3F8i3D12 yIFXCP35RrPu88VhlOR3ArVOHOfJmxWuK6q8VkIewERWuo8K7+FVhNqtAQaM6lx60S9m dUoG9NQIpoxf+1yduYtoimEE/aPoxCuElA4RNSEB4h/QjT7e77yyozhZiue4ewTqEmc4 kpkHdS0w7bj1SIHcCLi+gzFJDFEbKgFU0b4HvuD7zKuu3e/giqJI0l5SyPw4rlsd8ZRJ gG6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=nLEbod0l; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-153248-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153248-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b17-20020a170902e95100b001e60ab1cbe8si9747949pll.527.2024.04.23.07.13.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 07:13:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153248-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@tuxon.dev header.s=google header.b=nLEbod0l; arc=pass (i=1 spf=pass spfdomain=tuxon.dev dkim=pass dkdomain=tuxon.dev); spf=pass (google.com: domain of linux-kernel+bounces-153248-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153248-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 1772B283E34 for ; Mon, 22 Apr 2024 10:56:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CBC1C14F13D; Mon, 22 Apr 2024 10:54:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b="nLEbod0l" Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B04114F10E for ; Mon, 22 Apr 2024 10:54:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713783256; cv=none; b=VrD+vDdKaJuNsODE/8Ibge0/+oHf5OOB3HYR59RifO7CWm5GR67MilFXXgj77vaCsl9pfXqObrtnja08CrguRafchW2WXTvMjbJ94kQjLaMSN31cYL29ZdsT/rEmIJRDkY4Yq6BWo3z55MYSqyiFpySzzpXFOF1hAFTgxZCbsvY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713783256; c=relaxed/simple; bh=sdehE+zn1RQvIdReWR+XY+nVCRWOxX0wiMQ32N7tCn4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jU/qtmkq04fbZdp7alLYqM37Tu0ZiFeE+OZTJicEKlWvvUg6j2c3XUJqkWHM8pJbftHGY68I8lsmcC0bTzd2i/dM8MSgGgaBOieKWNlLRQrn2kC1ZkASxPkEP9vtx5/SJTYD9s88uMljym2Up+L55szfnjO7s7hmm+Kr+53oaAo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev; spf=pass smtp.mailfrom=tuxon.dev; dkim=pass (2048-bit key) header.d=tuxon.dev header.i=@tuxon.dev header.b=nLEbod0l; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=tuxon.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=tuxon.dev Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-41a5b68ed85so4201535e9.1 for ; Mon, 22 Apr 2024 03:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tuxon.dev; s=google; t=1713783253; x=1714388053; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=k1N7C9y6FANsDWlj/dSgm/X0vOo9KMVHsfxdkeCTUls=; b=nLEbod0lXZ92+d0VG1rK4TelU0qV1ZOkB3G487b5EbCdYNezO+NSUl6SdpkRac87Zp pBg52h6CzlrTu0eAx0bcKx85AiUU6yqjsQJmAlUGmheEICyuvQTfwIZaGxOgOEZdwRWc Vc97Wu54wkU3KNumaFEeBJqwMTjRsYqhgOlSg8lUHAk5P5y3H2MpLrhbTvtHgNQz8mgS ZIznqhsKWPDaITcQqrYdk6k6zUdVCDpK61O/36r5pw9A/eoCgUqhWyLfYXFN9hbABJ+v 83fVqxobxgw3O3CFYAhdV/ELm64zzWec74+x1Ciet2jDQ7G2h/nd1umAMDj7Y7GtPHdL uzwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713783253; x=1714388053; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=k1N7C9y6FANsDWlj/dSgm/X0vOo9KMVHsfxdkeCTUls=; b=NcDngjtpHDpJdoc2hDUIpU+1xNQWVfNabQBsYPY0HRI/uyuK48UswBKxRtP/K9wAO2 9MxUofC69D17WjRZQ77PVUqMfzcLMZ20gqhT9OTMYy+PkYrov9PpSFNbljRxNR+oaIfT aKfS81r92A0focMB/dVvAN2jX2Wrzle27AOKg/YE6clBGXhY81ds6exWuzpp+vzaAHPd CH0oQeIWwJNoMBXiWbJ99s3PixUXbDDOVD3+EteNrGDSWWG2XGWfhcP1/t/H8MQWFdE6 1VOSwmxKPX/kmiSPq86I22BBudDLo/4GlCnRw6sjRlE6gX53MFg/5WQ0gwMg/Q1q9D3w so5A== X-Forwarded-Encrypted: i=1; AJvYcCW5Ur5f6HpXx8m88vDBKFyPQUksKH0NFUuJsZKF7coUDrqoZROtT1DMMdOO7ivmyMG8QwN7UjFA8L8Xz1XK1H+J0mIagRys/26MWq1G X-Gm-Message-State: AOJu0Yw8D+9sYhY+UecrUApyDVY5oqkN2sv/aI1/uqhNkNwFC8Jk65R6 bs+dJNxPV7Ea8bKSZp2KpgbvuSooW6WQPL892OChEunNKo/ezYcyYGH6GTg9qvw= X-Received: by 2002:a05:600c:358b:b0:418:2ab6:7123 with SMTP id p11-20020a05600c358b00b004182ab67123mr6892154wmq.10.1713783252902; Mon, 22 Apr 2024 03:54:12 -0700 (PDT) Received: from claudiu-X670E-Pro-RS.. ([82.78.167.53]) by smtp.gmail.com with ESMTPSA id v13-20020a05600c444d00b0041a3f700ccesm4321037wmn.40.2024.04.22.03.54.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 03:54:12 -0700 (PDT) From: Claudiu X-Google-Original-From: Claudiu To: geert+renesas@glider.be, mturquette@baylibre.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, magnus.damm@gmail.com, ulf.hansson@linaro.org Cc: linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, claudiu.beznea@tuxon.dev, Claudiu Beznea Subject: [PATCH v4 7/8] clk: renesas: r9a08g045: Add support for power domains Date: Mon, 22 Apr 2024 13:53:54 +0300 Message-Id: <20240422105355.1622177-8-claudiu.beznea.uj@bp.renesas.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240422105355.1622177-1-claudiu.beznea.uj@bp.renesas.com> References: <20240422105355.1622177-1-claudiu.beznea.uj@bp.renesas.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Claudiu Beznea Instantiate power domains for the currently enabled IPs of R9A08G045 SoC. Signed-off-by: Claudiu Beznea --- Changes in v4: - dropped DEF_REG_CONF() specific to pwrdn functionality - dropped ddr, tzcddr, oftde_ddr domains as these were there due to the pwrdn functionality - added wdt0 domain; this will not impact currently integrated watchdog support - @Geert: I dropped your previous Rb tag due to the changes in v4 Changes in v3: - collected tags Change in v2: - used DEF_REG_CONF() to describe register offests and bits - updated MSTOP bitmask for ddr domain - updated MSTOP config for oftde_ddr - kept the same description for gic as the CPG_BUS_ACPU_MSTOP register documentation in the latest HW manual version is wrong and it will be fixed; proper description for GIC is located in "Registers for Module Standby Mode" table - haven't added watchdog domain (was missing in v1, too, by mistake) as the watchdog restart handler will fail w/o patch [1]; with this pm domain support the watchdog will fail to probe; not sure what is the best option until [1] will be integrated [1] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20240228083253.2640997-10-claudiu.beznea.uj@bp.renesas.com drivers/clk/renesas/r9a08g045-cpg.c | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/drivers/clk/renesas/r9a08g045-cpg.c b/drivers/clk/renesas/r9a08g045-cpg.c index c3e6da2de197..b068733b145f 100644 --- a/drivers/clk/renesas/r9a08g045-cpg.c +++ b/drivers/clk/renesas/r9a08g045-cpg.c @@ -240,6 +240,43 @@ static const unsigned int r9a08g045_crit_mod_clks[] __initconst = { MOD_CLK_BASE + R9A08G045_DMAC_ACLK, }; +static const struct rzg2l_cpg_pm_domain_init_data r9a08g045_pm_domains[] = { + /* Keep always-on domain on the first position for proper domains registration. */ + DEF_PD("always-on", R9A08G045_PD_ALWAYS_ON, + DEF_REG_CONF(0, 0), + RZG2L_PD_F_ALWAYS_ON), + DEF_PD("gic", R9A08G045_PD_GIC, + DEF_REG_CONF(CPG_BUS_ACPU_MSTOP, BIT(3)), + RZG2L_PD_F_ALWAYS_ON), + DEF_PD("ia55", R9A08G045_PD_IA55, + DEF_REG_CONF(CPG_BUS_PERI_CPU_MSTOP, BIT(13)), + RZG2L_PD_F_ALWAYS_ON), + DEF_PD("dmac", R9A08G045_PD_DMAC, + DEF_REG_CONF(CPG_BUS_REG1_MSTOP, GENMASK(3, 0)), + RZG2L_PD_F_ALWAYS_ON), + DEF_PD("wdt0", R9A08G045_PD_WDT0, + DEF_REG_CONF(CPG_BUS_REG0_MSTOP, BIT(0)), + RZG2L_PD_F_NONE), + DEF_PD("sdhi0", R9A08G045_PD_SDHI0, + DEF_REG_CONF(CPG_BUS_PERI_COM_MSTOP, BIT(0)), + RZG2L_PD_F_NONE), + DEF_PD("sdhi1", R9A08G045_PD_SDHI1, + DEF_REG_CONF(CPG_BUS_PERI_COM_MSTOP, BIT(1)), + RZG2L_PD_F_NONE), + DEF_PD("sdhi2", R9A08G045_PD_SDHI2, + DEF_REG_CONF(CPG_BUS_PERI_COM_MSTOP, BIT(11)), + RZG2L_PD_F_NONE), + DEF_PD("eth0", R9A08G045_PD_ETHER0, + DEF_REG_CONF(CPG_BUS_PERI_COM_MSTOP, BIT(2)), + RZG2L_PD_F_NONE), + DEF_PD("eth1", R9A08G045_PD_ETHER1, + DEF_REG_CONF(CPG_BUS_PERI_COM_MSTOP, BIT(3)), + RZG2L_PD_F_NONE), + DEF_PD("scif0", R9A08G045_PD_SCIF0, + DEF_REG_CONF(CPG_BUS_MCPU2_MSTOP, BIT(1)), + RZG2L_PD_F_NONE), +}; + const struct rzg2l_cpg_info r9a08g045_cpg_info = { /* Core Clocks */ .core_clks = r9a08g045_core_clks, @@ -260,5 +297,9 @@ const struct rzg2l_cpg_info r9a08g045_cpg_info = { .resets = r9a08g045_resets, .num_resets = R9A08G045_VBAT_BRESETN + 1, /* Last reset ID + 1 */ + /* Power domains */ + .pm_domains = r9a08g045_pm_domains, + .num_pm_domains = ARRAY_SIZE(r9a08g045_pm_domains), + .has_clk_mon_regs = true, }; -- 2.39.2