All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Fan <peng.fan@nxp.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 13/16] clk: gate: support sandbox
Date: Tue, 23 Jul 2019 03:15:44 +0000	[thread overview]
Message-ID: <20190723033031.12404-13-peng.fan@nxp.com> (raw)
In-Reply-To: <20190723033031.12404-1-peng.fan@nxp.com>

Introduce io_gate_val for sandbox clk gate test usage

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/clk/clk-gate.c       | 11 +++++++++++
 include/linux/clk-provider.h |  3 +++
 2 files changed, 14 insertions(+)

diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c
index a3a1fdd3b2..70b8794554 100644
--- a/drivers/clk/clk-gate.c
+++ b/drivers/clk/clk-gate.c
@@ -55,7 +55,11 @@ static void clk_gate_endisable(struct clk *clk, int enable)
 		if (set)
 			reg |= BIT(gate->bit_idx);
 	} else {
+#if CONFIG_IS_ENABLED(SANDBOX_CLK_CCF)
+		reg = gate->io_gate_val;
+#else
 		reg = readl(gate->reg);
+#endif
 
 		if (set)
 			reg |= BIT(gate->bit_idx);
@@ -86,7 +90,11 @@ int clk_gate_is_enabled(struct clk *clk)
 			dev_get_clk_ptr(clk->dev) : clk);
 	u32 reg;
 
+#if CONFIG_IS_ENABLED(SANDBOX_CLK_CCF)
+	reg = gate->io_gate_val;
+#else
 	reg = readl(gate->reg);
+#endif
 
 	/* if a set bit disables this clk, flip it before masking */
 	if (gate->flags & CLK_GATE_SET_TO_DISABLE)
@@ -128,6 +136,9 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
 	gate->reg = reg;
 	gate->bit_idx = bit_idx;
 	gate->flags = clk_gate_flags;
+#if CONFIG_IS_ENABLED(SANDBOX_CLK_CCF)
+	gate->io_gate_val = *(u32 *)reg;
+#endif
 
 	clk = &gate->clk;
 
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 32a777d86c..1e8183207d 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -75,6 +75,9 @@ struct clk_gate {
 	void __iomem	*reg;
 	u8		bit_idx;
 	u8		flags;
+#if CONFIG_IS_ENABLED(SANDBOX_CLK_CCF)
+	u32		io_gate_val;
+#endif
 };
 
 #define to_clk_gate(_clk) container_of(_clk, struct clk_gate, clk)
-- 
2.16.4

  parent reply	other threads:[~2019-07-23  3:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23  3:15 [U-Boot] [PATCH 01/16] clk: introduce clk_dev_binded Peng Fan
2019-07-23  3:15 ` [U-Boot] [PATCH 02/16] clk: use clk_dev_binded Peng Fan
2019-07-23  3:15 ` [U-Boot] [PATCH 03/16] clk: mux: add set parent support Peng Fan
2019-07-23  3:15 ` [U-Boot] [PATCH 04/16] clk: export mux/divider ops Peng Fan
2019-07-23  3:15 ` [U-Boot] [PATCH 05/16] clk: add clk-gate support Peng Fan
2019-07-23  3:15 ` [U-Boot] [PATCH 06/16] clk: divider set rate supporrt Peng Fan
2019-07-23  3:15 ` [U-Boot] [PATCH 07/16] clk: fixed_rate: export clk_fixed_rate Peng Fan
2019-07-23  3:15 ` [U-Boot] [PATCH 08/16] clk: imx: import clk heplers Peng Fan
2019-07-23  3:15 ` [U-Boot] [PATCH 09/16] clk: imx: gate2 add set rate Peng Fan
2019-07-23  3:15 ` [U-Boot] [PATCH 10/16] dm: clk: ignore default settings when node not valid Peng Fan
2019-07-23  3:15 ` [U-Boot] [PATCH 11/16] clk: add composite clk support Peng Fan
2019-07-23  3:15 ` [U-Boot] [PATCH 12/16] clk-provider: include clk-uclass.h Peng Fan
2019-07-23  3:15 ` Peng Fan [this message]
2019-07-23  3:15 ` [U-Boot] [PATCH 14/16] clk: sandbox: add composite clk Peng Fan
2019-07-23  3:15 ` [U-Boot] [PATCH 15/16] test: dm: clk_ccf: test " Peng Fan
2019-07-23  3:15 ` [U-Boot] [PATCH 16/16] configs: sandbox: Enable " Peng Fan
2019-07-29  8:31 ` [U-Boot] [PATCH 01/16] clk: introduce clk_dev_binded Peng Fan
2019-07-29  8:57   ` Lukasz Majewski
2019-07-29  8:59     ` Peng Fan
2019-07-30  6:58     ` Lukasz Majewski
2019-07-30  7:01       ` Peng Fan
2019-07-30  7:54         ` Peng Fan

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=20190723033031.12404-13-peng.fan@nxp.com \
    --to=peng.fan@nxp.com \
    --cc=u-boot@lists.denx.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.