From mboxrd@z Thu Jan 1 00:00:00 1970 From: hl Date: Fri, 23 Oct 2015 08:56:21 +0800 Subject: [U-Boot] [PATCH v1 05/12] rockchip: rk3036: Add clock driver In-Reply-To: References: <1445395048-3703-1-git-send-email-hl@rock-chips.com> <1445395048-3703-6-git-send-email-hl@rock-chips.com> Message-ID: <562985B5.2030909@rock-chips.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Simon, On 22/10/15 22:07, Simon Glass wrote: > Hi Lin, > > On 20 October 2015 at 20:37, Lin Huang wrote: >> Add a driver for setting up and modifying the various PLLs, peripheral >> clocks and mmc clocks on RK3036 >> >> Signed-off-by: Lin Huang >> --- >> Changes in v1: >> - clean copyright announcement >> >> arch/arm/include/asm/arch-rockchip/cru_rk3036.h | 53 +++ >> drivers/clk/Makefile | 1 + >> drivers/clk/clk_rk3036.c | 522 ++++++++++++++++++++++++ >> 3 files changed, 576 insertions(+) >> create mode 100644 arch/arm/include/asm/arch-rockchip/cru_rk3036.h >> create mode 100644 drivers/clk/clk_rk3036.c >> > Acked-by: Simon Glass > > Please see nit below. > >> +static int rkclk_set_pll(struct rk3036_cru *cru, enum rk_clk_id clk_id, >> + const struct pll_div *div) >> +{ >> + int pll_id = rk_pll_id(clk_id); >> + struct rk3036_pll *pll = &cru->pll[pll_id]; >> + >> + /* All PLLs have same VCO and output frequency range restrictions. */ >> + uint vco_hz = OSC_HZ / 1000 * div->fbdiv / div->refdiv * 1000; >> + uint output_hz = vco_hz / div->postdiv1 / div->postdiv2; >> + >> + debug("PLL at %p: fbdiv=%d, refdiv=%d, postdiv1=%d, postdiv2=%d,\ >> + vco=%u Hz, output=%u Hz\n", >> + pll, div->fbdiv, div->refdiv, div->postdiv1, >> + div->postdiv2, vco_hz, output_hz); >> + assert(vco_hz >= VCO_MIN_HZ && vco_hz <= VCO_MAX_HZ && >> + output_hz >= OUTPUT_MIN_HZ && output_hz <= OUTPUT_MAX_HZ); >> + >> + /* use interger mode */ > Should that be integer? What does it mean? In the rk3036 TRM, you can see: > > > -- Lin Huang -------------- next part -------------- A non-text attachment was scrubbed... Name: cfdecfjf.png Type: image/png Size: 64226 bytes Desc: not available URL: