lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 16 Dec 2013 11:34:38 +0100
From:	Daniel Lezcano <daniel.lezcano@...aro.org>
To:	Tim Kryger <tim.kryger@...aro.org>,
	Christian Daudt <bcm@...thebug.org>,
	Rob Herring <rob.herring@...xeda.com>,
	Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Stephen Warren <swarren@...dotorg.org>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Thomas Gleixner <tglx@...utronix.de>,
	Chris Ball <cjb@...top.org>, Axel Lin <axel.lin@...ics.com>
CC:	Device Tree List <devicetree@...r.kernel.org>,
	Linux ARM Kernel List <linux-arm-kernel@...ts.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Linux MMC List <linux-mmc@...r.kernel.org>,
	Linaro Patches List <patches@...aro.org>
Subject: Re: [PATCH v4 7/8] clocksource: kona: Add basic use of external clock

On 12/05/2013 08:20 PM, Tim Kryger wrote:
> When an clock is specified in the device tree, enable it and use it to
> determine the external clock frequency.
>
> Signed-off-by: Tim Kryger <tim.kryger@...aro.org>
> Reviewed-by: Markus Mayer <markus.mayer@...aro.org>
> Reviewed-by: Matt Porter <matt.porter@...aro.org>

Acked-by: Daniel Lezcano <daniel.lezcano@...aro.org>

> ---
>   drivers/clocksource/bcm_kona_timer.c | 14 +++++++++++---
>   1 file changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/clocksource/bcm_kona_timer.c b/drivers/clocksource/bcm_kona_timer.c
> index 0d7d8c3..8a4ab36 100644
> --- a/drivers/clocksource/bcm_kona_timer.c
> +++ b/drivers/clocksource/bcm_kona_timer.c
> @@ -17,6 +17,7 @@
>   #include <linux/jiffies.h>
>   #include <linux/clockchips.h>
>   #include <linux/types.h>
> +#include <linux/clk.h>
>
>   #include <linux/io.h>
>   #include <asm/mach/time.h>
> @@ -107,11 +108,18 @@ static const struct of_device_id bcm_timer_ids[] __initconst = {
>   static void __init kona_timers_init(struct device_node *node)
>   {
>   	u32 freq;
> +	struct clk *external_clk;
>
> -	if (!of_property_read_u32(node, "clock-frequency", &freq))
> +	external_clk = of_clk_get_by_name(node, NULL);
> +
> +	if (!IS_ERR(external_clk)) {
> +		arch_timer_rate = clk_get_rate(external_clk);
> +		clk_prepare_enable(external_clk);
> +	} else if (!of_property_read_u32(node, "clock-frequency", &freq)) {
>   		arch_timer_rate = freq;
> -	else
> -		panic("clock-frequency not set in the .dts file");
> +	} else {
> +		panic("unable to determine clock-frequency");
> +	}
>
>   	/* Setup IRQ numbers */
>   	timers.tmr_irq = irq_of_parse_and_map(node, 0);
>


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ