Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1461081 > unrolled thread

[PATCH 0/3] Refactor Loongson1 clock

Started byKeguang Zhang <keguang.zhang@gmail.com>
First post2016-08-12 13:00 +0200
Last post2016-08-19 03:30 +0200
Articles 5 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] Refactor Loongson1 clock Keguang Zhang <keguang.zhang@gmail.com> - 2016-08-12 13:00 +0200
    [PATCH 3/3] clk: Loongson1: Make use of GENMASK Keguang Zhang <keguang.zhang@gmail.com> - 2016-08-12 13:00 +0200
      Re: [PATCH 3/3] clk: Loongson1: Make use of GENMASK Stephen Boyd <sboyd@codeaurora.org> - 2016-08-19 03:30 +0200
    [PATCH 2/3] clk: Loongson1: Update clocks of Loongson1B Keguang Zhang <keguang.zhang@gmail.com> - 2016-08-12 13:00 +0200
      Re: [PATCH 2/3] clk: Loongson1: Update clocks of Loongson1B Stephen Boyd <sboyd@codeaurora.org> - 2016-08-19 03:30 +0200

#1461081 — [PATCH 0/3] Refactor Loongson1 clock

FromKeguang Zhang <keguang.zhang@gmail.com>
Date2016-08-12 13:00 +0200
Subject[PATCH 0/3] Refactor Loongson1 clock
Message-ID<s5ilY-yH-5@gated-at.bofh.it>
From: Keguang Zhang <keguang.zhang@spreadtrum.com>

This patchset is to refactor Loongson1 clock,
and update Loongson1B clocks.

This applies on top of clk-next.

Thanks!

Kelvin Cheung (3):
  clk: Loongson1: Refactor Loongson1 clock
  clk: Loongson1: Update clocks of Loongson1B
  clk: Loongson1: Make use of GENMASK

 drivers/clk/Makefile                               |  2 +-
 drivers/clk/loongson1/Makefile                     |  2 +
 .../clk/{clk-ls1x.c => loongson1/clk-loongson1b.c} | 71 ++++++----------------
 drivers/clk/loongson1/clk.c                        | 52 ++++++++++++++++
 drivers/clk/loongson1/clk.h                        | 21 +++++++
 5 files changed, 93 insertions(+), 55 deletions(-)
 create mode 100644 drivers/clk/loongson1/Makefile
 rename drivers/clk/{clk-ls1x.c => loongson1/clk-loongson1b.c} (68%)
 create mode 100644 drivers/clk/loongson1/clk.c
 create mode 100644 drivers/clk/loongson1/clk.h

-- 
1.9.1

[toc] | [next] | [standalone]


#1461082 — [PATCH 3/3] clk: Loongson1: Make use of GENMASK

FromKeguang Zhang <keguang.zhang@gmail.com>
Date2016-08-12 13:00 +0200
Subject[PATCH 3/3] clk: Loongson1: Make use of GENMASK
Message-ID<s5ilY-yH-17@gated-at.bofh.it>
In reply to#1461081
From: Kelvin Cheung <keguang.zhang@gmail.com>

Make use of GENMASK instead of open coding the equivalent operation,
and update the PLL formula.

Signed-off-by: Kelvin Cheung <keguang.zhang@gmail.com>
---
 drivers/clk/loongson1/clk-loongson1b.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/loongson1/clk-loongson1b.c b/drivers/clk/loongson1/clk-loongson1b.c
index 2302ee5..5cedb28 100644
--- a/drivers/clk/loongson1/clk-loongson1b.c
+++ b/drivers/clk/loongson1/clk-loongson1b.c
@@ -26,7 +26,7 @@ static unsigned long ls1x_pll_recalc_rate(struct clk_hw *hw,
 	u32 pll, rate;
 
 	pll = __raw_readl(LS1X_CLK_PLL_FREQ);
-	rate = 12 + (pll & 0x3f) + (((pll >> 8) & 0x3ff) >> 10);
+	rate = 12 + (pll & GENMASK(5, 0));
 	rate *= OSC;
 	rate >>= 1;
 
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1465791 — Re: [PATCH 3/3] clk: Loongson1: Make use of GENMASK

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-08-19 03:30 +0200
SubjectRe: [PATCH 3/3] clk: Loongson1: Make use of GENMASK
Message-ID<s7GNc-7nF-37@gated-at.bofh.it>
In reply to#1461082
On 08/12, Keguang Zhang wrote:
> From: Kelvin Cheung <keguang.zhang@gmail.com>
> 
> Make use of GENMASK instead of open coding the equivalent operation,
> and update the PLL formula.

Was the old formula broken? I would expect a bug fix like this to
be first in the series and be backported to any affected stable
trees.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [next] | [standalone]


#1461083 — [PATCH 2/3] clk: Loongson1: Update clocks of Loongson1B

FromKeguang Zhang <keguang.zhang@gmail.com>
Date2016-08-12 13:00 +0200
Subject[PATCH 2/3] clk: Loongson1: Update clocks of Loongson1B
Message-ID<s5ilY-yH-19@gated-at.bofh.it>
In reply to#1461081
From: Kelvin Cheung <keguang.zhang@gmail.com>

This patch updates some clock names of Loongson1B,
and adds AC97, DMA and NAND clock.

Signed-off-by: Kelvin Cheung <keguang.zhang@gmail.com>
---
 drivers/clk/loongson1/clk-loongson1b.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/clk/loongson1/clk-loongson1b.c b/drivers/clk/loongson1/clk-loongson1b.c
index 336ff95..2302ee5 100644
--- a/drivers/clk/loongson1/clk-loongson1b.c
+++ b/drivers/clk/loongson1/clk-loongson1b.c
@@ -39,19 +39,19 @@ static const struct clk_ops ls1x_pll_clk_ops = {
 	.recalc_rate = ls1x_pll_recalc_rate,
 };
 
-static const char * const cpu_parents[] = { "cpu_clk_div", "osc_33m_clk", };
-static const char * const ahb_parents[] = { "ahb_clk_div", "osc_33m_clk", };
-static const char * const dc_parents[] = { "dc_clk_div", "osc_33m_clk", };
+static const char *const cpu_parents[] = { "cpu_clk_div", "osc_clk", };
+static const char *const ahb_parents[] = { "ahb_clk_div", "osc_clk", };
+static const char *const dc_parents[] = { "dc_clk_div", "osc_clk", };
 
 void __init ls1x_clk_init(void)
 {
 	struct clk *clk;
 
-	clk = clk_register_fixed_rate(NULL, "osc_33m_clk", NULL, 0, OSC);
-	clk_register_clkdev(clk, "osc_33m_clk", NULL);
+	clk = clk_register_fixed_rate(NULL, "osc_clk", NULL, 0, OSC);
+	clk_register_clkdev(clk, "osc_clk", NULL);
 
 	/* clock derived from 33 MHz OSC clk */
-	clk = clk_register_pll(NULL, "pll_clk", "osc_33m_clk",
+	clk = clk_register_pll(NULL, "pll_clk", "osc_clk",
 			       &ls1x_pll_clk_ops, 0);
 	clk_register_clkdev(clk, "pll_clk", NULL);
 
@@ -106,6 +106,7 @@ void __init ls1x_clk_init(void)
 			       CLK_SET_RATE_NO_REPARENT, LS1X_CLK_PLL_DIV,
 			       BYPASS_DDR_SHIFT, BYPASS_DDR_WIDTH, 0, &_lock);
 	clk_register_clkdev(clk, "ahb_clk", NULL);
+	clk_register_clkdev(clk, "ls1x-dma", NULL);
 	clk_register_clkdev(clk, "stmmaceth", NULL);
 
 	/* clock derived from AHB clk */
@@ -113,9 +114,11 @@ void __init ls1x_clk_init(void)
 	clk = clk_register_fixed_factor(NULL, "apb_clk", "ahb_clk", 0, 1,
 					DIV_APB);
 	clk_register_clkdev(clk, "apb_clk", NULL);
-	clk_register_clkdev(clk, "ls1x_i2c", NULL);
-	clk_register_clkdev(clk, "ls1x_pwmtimer", NULL);
-	clk_register_clkdev(clk, "ls1x_spi", NULL);
-	clk_register_clkdev(clk, "ls1x_wdt", NULL);
+	clk_register_clkdev(clk, "ls1x-ac97", NULL);
+	clk_register_clkdev(clk, "ls1x-i2c", NULL);
+	clk_register_clkdev(clk, "ls1x-nand", NULL);
+	clk_register_clkdev(clk, "ls1x-pwmtimer", NULL);
+	clk_register_clkdev(clk, "ls1x-spi", NULL);
+	clk_register_clkdev(clk, "ls1x-wdt", NULL);
 	clk_register_clkdev(clk, "serial8250", NULL);
 }
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1465790 — Re: [PATCH 2/3] clk: Loongson1: Update clocks of Loongson1B

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-08-19 03:30 +0200
SubjectRe: [PATCH 2/3] clk: Loongson1: Update clocks of Loongson1B
Message-ID<s7GNd-7nF-51@gated-at.bofh.it>
In reply to#1461083
On 08/12, Keguang Zhang wrote:
> From: Kelvin Cheung <keguang.zhang@gmail.com>
> 
> This patch updates some clock names of Loongson1B,
> and adds AC97, DMA and NAND clock.
> 
> Signed-off-by: Kelvin Cheung <keguang.zhang@gmail.com>

Ah here's the rewrite of the name. We should squash the other
patch into this one so that we don't break bisection.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web