mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
From: martin.blumenstingl@googlemail.com (Martin Blumenstingl)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH 2/2] clk: meson: meson8b: add the CPU_DIV16 clock
Date: Sat, 21 Jul 2018 19:25:37 +0200	[thread overview]
Message-ID: <20180721172537.15639-3-martin.blumenstingl@googlemail.com> (raw)
In-Reply-To: <20180721172537.15639-1-martin.blumenstingl@googlemail.com>

The TWD (timer and watchdog) of the Cortex-A9 (on Meson8 and Meson8m2)
and Cortex-A9 (on Meson8b) cores is clocked by the CPU clock divided by
16. Add this new clock so the TWD timer can be added.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/clk/meson/meson8b.c | 12 ++++++++++++
 drivers/clk/meson/meson8b.h |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c
index 7447d96a265f..17f56f600e09 100644
--- a/drivers/clk/meson/meson8b.c
+++ b/drivers/clk/meson/meson8b.c
@@ -633,6 +633,17 @@ static struct clk_regmap meson8b_cpu_clk = {
 	},
 };
 
+static struct clk_fixed_factor meson8b_cpu_div16_div = {
+	.mult = 1,
+	.div = 16,
+	.hw.init = &(struct clk_init_data){
+		.name = "cpu_div16_div",
+		.ops = &clk_fixed_factor_ops,
+		.parent_names = (const char *[]){ "cpu_clk" },
+		.num_parents = 1,
+	},
+};
+
 static struct clk_regmap meson8b_nand_clk_sel = {
 	.data = &(struct clk_regmap_mux_data){
 		.offset = HHI_NAND_CLK_CNTL,
@@ -879,6 +890,7 @@ static struct clk_hw_onecell_data meson8b_hw_onecell_data = {
 		[CLKID_NAND_SEL]	    = &meson8b_nand_clk_sel.hw,
 		[CLKID_NAND_DIV]	    = &meson8b_nand_clk_div.hw,
 		[CLKID_NAND_CLK]	    = &meson8b_nand_clk_gate.hw,
+		[CLKID_CPU_DIV16]	    = &meson8b_cpu_div16_div.hw,
 		[CLK_NR_CLKS]		    = NULL,
 	},
 	.num = CLK_NR_CLKS,
diff --git a/drivers/clk/meson/meson8b.h b/drivers/clk/meson/meson8b.h
index 5d09412b5084..d790991d5055 100644
--- a/drivers/clk/meson/meson8b.h
+++ b/drivers/clk/meson/meson8b.h
@@ -76,7 +76,7 @@
 #define CLKID_NAND_SEL		110
 #define CLKID_NAND_DIV		111
 
-#define CLK_NR_CLKS		113
+#define CLK_NR_CLKS		114
 
 /*
  * include the CLKID and RESETID that have
-- 
2.18.0

  parent reply	other threads:[~2018-07-21 17:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-21 17:25 [PATCH 0/2] meson8b: add the CPU_DIV16 clock for the ARM TWD Martin Blumenstingl
2018-07-21 17:25 ` [PATCH 1/2] dt-bindings: clock: meson8b: export the CPU_DIV16 clock Martin Blumenstingl
2018-07-21 17:25 ` Martin Blumenstingl [this message]
2018-07-23  9:11 ` [PATCH 0/2] meson8b: add the CPU_DIV16 clock for the ARM TWD Jerome Brunet
2018-09-26  9:56   ` Martin Blumenstingl
2018-09-26  9:59     ` Jerome Brunet

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=20180721172537.15639-3-martin.blumenstingl@googlemail.com \
    --to=martin.blumenstingl@googlemail.com \
    --cc=linus-amlogic@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®