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


Groups > linux.kernel > #1363508

Re: [PATCH v2 03/11] ARM: davinci: da850: use clk->set_parent for async3

From Sekhar Nori <nsekhar@ti.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 03/11] ARM: davinci: da850: use clk->set_parent for async3
Date 2016-03-23 17:00 +0100
Message-ID <rfTmq-5As-3@gated-at.bofh.it> (permalink)
References <rdwWZ-1LR-3@gated-at.bofh.it> <rdx6H-1Ps-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thursday 17 March 2016 07:56 AM, David Lechner wrote:
> The da850 family of processors has an async3 clock domain that can be
> muxed to either pll0_sysclk2 or pll1_sysclk2. Now that the davinci clocks
> have a set_parent callback, we can use this to control the async3 mux
> instead of a stand-alone function.
> 
> This adds a new async3_clk and sets the appropriate child clocks. The
> default is use to pll1_sysclk2 since it is not affected by processor
> frequency scaling.
> 
> Signed-off-by: David Lechner <david@lechnology.com>
> ---

> +static int da850_async3_set_parent(struct clk *clk, struct clk *parent)
> +{
> +	u32 __iomem *cfgchip3;
> +	u32 val;
> +
> +	/*
> +	 * Can't use DA8XX_SYSCFG0_VIRT() here since this can be called before
> +	 * da8xx_syscfg0_base is initialized.
> +	 */
> +	cfgchip3 = ioremap(DA8XX_SYSCFG0_BASE + DA8XX_CFGCHIP3_REG, 4);

Is this just a theoretical possibility or have you seen this happen? I
would like to see if there are ways of avoiding this rather than throw
away usage of DA8XX_SYSCFG0_VIRT()

> +	val = readl(cfgchip3);
> +
> +	/* Set the USB 1.1 PHY clock mux based on the parent clock. */

Comment is wrong (copy-paste error?)

> +	if (parent == &pll0_sysclk2)
> +		val &= ~CFGCHIP3_ASYNC3_CLKSRC;
> +	else if (parent == &pll1_sysclk2)
> +		val |= CFGCHIP3_ASYNC3_CLKSRC;
> +	else {
> +		pr_err("Bad parent on async3 clock mux.\n");
> +		return -EINVAL;
> +	}
> +
> +	writel(val, cfgchip3);
> +
> +	return 0;
> +}

Thanks,
Sekhar

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 03/11] ARM: davinci: da850: use clk->set_parent for  async3 Sekhar Nori <nsekhar@ti.com> - 2016-03-23 17:00 +0100
  Re: [PATCH v2 03/11] ARM: davinci: da850: use clk->set_parent for  async3 David Lechner <david@lechnology.com> - 2016-03-23 18:30 +0100
    Re: [PATCH v2 03/11] ARM: davinci: da850: use clk->set_parent for  async3 Sekhar Nori <nsekhar@ti.com> - 2016-03-23 18:40 +0100
      Re: [PATCH v2 03/11] ARM: davinci: da850: use clk->set_parent for  async3 David Lechner <david@lechnology.com> - 2016-03-23 19:40 +0100
        Re: [PATCH v2 03/11] ARM: davinci: da850: use clk->set_parent for  async3 Sekhar Nori <nsekhar@ti.com> - 2016-03-24 14:50 +0100

csiph-web