All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ulrich Hecht <uli+renesas@fpond.eu>
To: linux-renesas-soc@vger.kernel.org
Cc: wsa@the-dreams.de, geert@linux-m68k.org,
	fabrizio.castro@bp.renesas.com,
	ramesh.shanmugasundaram@bp.renesas.com, magnus.damm@gmail.com,
	Ulrich Hecht <uli+renesas@fpond.eu>
Subject: [PATCH 01/11] clk: renesas: cpg-mssr: add support for ignore-unused clocks
Date: Wed, 26 Feb 2020 21:28:07 +0100	[thread overview]
Message-ID: <1582748897-17374-2-git-send-email-uli+renesas@fpond.eu> (raw)
In-Reply-To: <1582748897-17374-1-git-send-email-uli+renesas@fpond.eu>

This adds facilities to mark clocks as "ignore used", i.e. never to be
turned off. The primary application is the RWDT clock, which needs to
remain on throughout the boot process if enabled by the bootloader.

Signed-off-by: Ulrich Hecht <uli+renesas@fpond.eu>
---
 drivers/clk/renesas/renesas-cpg-mssr.c | 7 +++++++
 drivers/clk/renesas/renesas-cpg-mssr.h | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/drivers/clk/renesas/renesas-cpg-mssr.c b/drivers/clk/renesas/renesas-cpg-mssr.c
index a2663fb..31115c7 100644
--- a/drivers/clk/renesas/renesas-cpg-mssr.c
+++ b/drivers/clk/renesas/renesas-cpg-mssr.c
@@ -423,6 +423,13 @@ static void __init cpg_mssr_register_mod_clk(const struct mssr_mod_clk *mod,
 			init.flags |= CLK_IS_CRITICAL;
 			break;
 		}
+	for (i = 0; i < info->num_used_mod_clks; i++)
+		if (id == info->used_mod_clks[i]) {
+			dev_dbg(dev, "MSTP %s setting CLK_IGNORE_UNUSED\n",
+				mod->name);
+			init.flags |= CLK_IGNORE_UNUSED;
+			break;
+		}
 
 	parent_name = __clk_get_name(parent);
 	init.parent_names = &parent_name;
diff --git a/drivers/clk/renesas/renesas-cpg-mssr.h b/drivers/clk/renesas/renesas-cpg-mssr.h
index 3b852ba..c76335c 100644
--- a/drivers/clk/renesas/renesas-cpg-mssr.h
+++ b/drivers/clk/renesas/renesas-cpg-mssr.h
@@ -105,6 +105,9 @@ struct device_node;
      * @crit_mod_clks: Array with Module Clock IDs of critical clocks that
      *                 should not be disabled without a knowledgeable driver
      * @num_crit_mod_clks: Number of entries in crit_mod_clks[]
+     * @used_mod_clks: Array with Module Clock IDs of clocks that should not
+     *                 be disabled even if they seem to be unused
+     * @num_used_mod_clks: Number of entries in used_mod_clks[]
      *
      * @core_pm_clks: Array with IDs of Core Clocks that are suitable for Power
      *                Management, in addition to Module Clocks
@@ -141,6 +144,10 @@ struct cpg_mssr_info {
 	const unsigned int *crit_mod_clks;
 	unsigned int num_crit_mod_clks;
 
+	/* Module Clocks that should not be disabled even if unused */
+	const unsigned int *used_mod_clks;
+	unsigned int num_used_mod_clks;
+
 	/* Core Clocks suitable for PM, in addition to the Module Clocks */
 	const unsigned int *core_pm_clks;
 	unsigned int num_core_pm_clks;
-- 
2.7.4


  reply	other threads:[~2020-02-26 20:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 20:28 [PATCH 00/11] clk: renesas: cpg-mssr: add ignore-unused option Ulrich Hecht
2020-02-26 20:28 ` Ulrich Hecht [this message]
2020-03-03 16:13   ` [PATCH 01/11] clk: renesas: cpg-mssr: add support for ignore-unused clocks Wolfram Sang
2020-02-26 20:28 ` [PATCH 02/11] clk: renesas: r8a7796: mark RWDT clock as ignore-unused Ulrich Hecht
2020-02-26 20:28 ` [PATCH 03/11] clk: renesas: r8a7795: " Ulrich Hecht
2020-02-26 20:28 ` [PATCH 04/11] clk: renesas: r8a77970: " Ulrich Hecht
2020-02-26 20:28 ` [PATCH 05/11] clk: renesas: r8a77980: " Ulrich Hecht
2020-02-26 20:28 ` [PATCH 06/11] clk: renesas: r8a77995: " Ulrich Hecht
2020-02-26 20:28 ` [PATCH 07/11] clk: renesas: r8a774a1: " Ulrich Hecht
2020-02-26 20:28 ` [PATCH 08/11] clk: renesas: r8a774b1: " Ulrich Hecht
2020-02-26 20:28 ` [PATCH 09/11] clk: renesas: r8a774c0: " Ulrich Hecht
2020-02-26 20:28 ` [PATCH 10/11] clk: renesas: r8a77965: " Ulrich Hecht
2020-02-26 20:28 ` [PATCH 11/11] clk: renesas: r8a77990: " Ulrich Hecht
2020-02-27 14:29 ` [PATCH 00/11] clk: renesas: cpg-mssr: add ignore-unused option Geert Uytterhoeven
2020-03-03 16:05 ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1582748897-17374-2-git-send-email-uli+renesas@fpond.eu \
    --to=uli+renesas@fpond.eu \
    --cc=fabrizio.castro@bp.renesas.com \
    --cc=geert@linux-m68k.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=ramesh.shanmugasundaram@bp.renesas.com \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.