All of lore.kernel.org
 help / color / mirror / Atom feed
From: pavel@ucw.cz (Pavel Machek)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] ARM: mmp/mmp2: dt: enable the clock
Date: Sat, 3 Nov 2018 20:17:04 +0100	[thread overview]
Message-ID: <20181103191703.GJ31179@amd> (raw)
In-Reply-To: <20180918205455.25464-5-lkundrak@v3.sk>

On Tue 2018-09-18 22:54:55, Lubomir Rintel wrote:
> The device-tree booted MMP2 needs to enable the timer clock, otherwise
> the it would stop ticking when the boot finishes.

"the it" -> "it"

> It can also use the clock rate from the clk, the non-DT boards need to
> keep using the hardcoded rates.
> 
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>

Acked-by: Pavel Machek <pavel@ucw.cz>

> +	clk = of_clk_get(np, 0);
> +	if (!IS_ERR(clk)) {
> +		ret = clk_prepare_enable(clk);
> +		if (ret)
> +			goto out;
> +		rate = clk_get_rate(clk) / 2;
> +	} else if (cpu_is_pj4 ()) {

extra space.

> +		rate = 6500000;
> +	} else {
> +		rate = 3250000;
> +	}
> +
>  	irq = irq_of_parse_and_map(np, 0);
>  	if (!irq) {
>  		ret = -EINVAL;
> @@ -231,7 +239,7 @@ void __init mmp_dt_init_timer(void)
>  		ret = -ENOMEM;
>  		goto out;
>  	}
> -	timer_init(irq);
> +	timer_init(irq, rate);
>  	return;
>  out:
>  	pr_err("Failed to get timer from device tree with error:%d\n", ret);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20181103/a5f27dd5/attachment.sig>

WARNING: multiple messages have this Message-ID (diff)
From: Pavel Machek <pavel@ucw.cz>
To: Lubomir Rintel <lkundrak@v3.sk>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Eric Miao <eric.y.miao@gmail.com>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Russell King <linux@armlinux.org.uk>
Subject: Re: [PATCH 4/4] ARM: mmp/mmp2: dt: enable the clock
Date: Sat, 3 Nov 2018 20:17:04 +0100	[thread overview]
Message-ID: <20181103191703.GJ31179@amd> (raw)
In-Reply-To: <20180918205455.25464-5-lkundrak@v3.sk>

[-- Attachment #1: Type: text/plain, Size: 1155 bytes --]

On Tue 2018-09-18 22:54:55, Lubomir Rintel wrote:
> The device-tree booted MMP2 needs to enable the timer clock, otherwise
> the it would stop ticking when the boot finishes.

"the it" -> "it"

> It can also use the clock rate from the clk, the non-DT boards need to
> keep using the hardcoded rates.
> 
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>

Acked-by: Pavel Machek <pavel@ucw.cz>

> +	clk = of_clk_get(np, 0);
> +	if (!IS_ERR(clk)) {
> +		ret = clk_prepare_enable(clk);
> +		if (ret)
> +			goto out;
> +		rate = clk_get_rate(clk) / 2;
> +	} else if (cpu_is_pj4 ()) {

extra space.

> +		rate = 6500000;
> +	} else {
> +		rate = 3250000;
> +	}
> +
>  	irq = irq_of_parse_and_map(np, 0);
>  	if (!irq) {
>  		ret = -EINVAL;
> @@ -231,7 +239,7 @@ void __init mmp_dt_init_timer(void)
>  		ret = -ENOMEM;
>  		goto out;
>  	}
> -	timer_init(irq);
> +	timer_init(irq, rate);
>  	return;
>  out:
>  	pr_err("Failed to get timer from device tree with error:%d\n", ret);

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2018-11-03 19:17 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18 20:54 [PATCH v2 0/4] Enable the timer clock on DT MMP2 Lubomir Rintel
2018-09-18 20:54 ` Lubomir Rintel
2018-09-18 20:54 ` [PATCH v2 1/4] dt-bindings: mrvl,mmp-timer: add clock Lubomir Rintel
2018-09-18 20:54   ` Lubomir Rintel
2018-09-26 22:51   ` Rob Herring
2018-09-26 22:51     ` Rob Herring
2018-09-26 22:51     ` Rob Herring
2018-11-03 19:14   ` Pavel Machek
2018-11-03 19:14     ` Pavel Machek
2018-09-18 20:54 ` [PATCH v2 2/4] DT: marvell,mmp2: add clock to the timer Lubomir Rintel
2018-09-18 20:54   ` Lubomir Rintel
2018-11-03 19:15   ` Pavel Machek
2018-11-03 19:15     ` Pavel Machek
2018-09-18 20:54 ` [PATCH v2 3/4] ARM: mmp2: initialize clocks before " Lubomir Rintel
2018-09-18 20:54   ` Lubomir Rintel
2018-11-03 19:15   ` Pavel Machek
2018-11-03 19:15     ` Pavel Machek
2018-09-18 20:54 ` [PATCH 4/4] ARM: mmp/mmp2: dt: enable the clock Lubomir Rintel
2018-09-18 20:54   ` Lubomir Rintel
2018-11-03 19:17   ` Pavel Machek [this message]
2018-11-03 19:17     ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2018-09-10 11:30 [PATCH 0/4] Enable the timer clock on DT MMP2 Lubomir Rintel
2018-09-10 11:30 ` [PATCH 4/4] ARM: mmp/mmp2: dt: enable the clock Lubomir Rintel
2018-09-10 11:30   ` Lubomir Rintel

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=20181103191703.GJ31179@amd \
    --to=pavel@ucw.cz \
    --cc=linux-arm-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.