From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/6] ARM: at91: clock: correct PRES offset for at91sam9x5
Date: Wed, 17 Aug 2016 09:13:24 +0200 [thread overview]
Message-ID: <1471418009-12660-3-git-send-email-hs@denx.de> (raw)
In-Reply-To: <1471418009-12660-1-git-send-email-hs@denx.de>
on at91sam9x5 PRES offset is 4 in the PMC master
clock register.
Signed-off-by: Heiko Schocher <hs@denx.de>
---
arch/arm/mach-at91/arm926ejs/clock.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm/mach-at91/arm926ejs/clock.c b/arch/arm/mach-at91/arm926ejs/clock.c
index c8d24ae..e3181fa 100644
--- a/arch/arm/mach-at91/arm926ejs/clock.c
+++ b/arch/arm/mach-at91/arm926ejs/clock.c
@@ -162,7 +162,13 @@ int at91_clock_init(unsigned long main_clock)
gd->arch.mck_rate_hz = at91_css_to_rate(mckr & AT91_PMC_MCKR_CSS_MASK);
freq = gd->arch.mck_rate_hz;
+#if defined(CONFIG_AT91SAM9X5)
+ /* different in prescale on at91sam9x5 */
+ freq /= (1 << ((mckr & AT91_PMC_MCKR_PRES_MASK) >> 4));
+#else
freq /= (1 << ((mckr & AT91_PMC_MCKR_PRES_MASK) >> 2)); /* prescale */
+#endif
+
#if defined(CONFIG_AT91SAM9G20)
/* mdiv ; (x >> 7) = ((x >> 8) * 2) */
gd->arch.mck_rate_hz = (mckr & AT91_PMC_MCKR_MDIV_MASK) ?
--
2.5.5
next prev parent reply other threads:[~2016-08-17 7:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-17 7:13 [U-Boot] [PATCH 0/6] at91: at91sam9g15 improvements Heiko Schocher
2016-08-17 7:13 ` [U-Boot] [PATCH 1/6] arm: at91: mpddrc: add missing MPDDRC_MD defines Heiko Schocher
2016-09-18 2:07 ` Wenyou.Yang at microchip.com
2016-10-06 21:07 ` Andreas Bießmann
2016-10-28 16:49 ` [U-Boot] [U-Boot, " Andreas Bießmann
2016-08-17 7:13 ` Heiko Schocher [this message]
2016-09-18 2:11 ` [U-Boot] [PATCH 2/6] ARM: at91: clock: correct PRES offset for at91sam9x5 Wenyou.Yang at microchip.com
2016-10-06 21:40 ` Andreas Bießmann
2016-10-28 9:47 ` [U-Boot] [U-Boot, " Andreas Bießmann
2016-10-28 16:49 ` Andreas Bießmann
2016-08-17 7:13 ` [U-Boot] [PATCH 3/6] arm, at91: add icache support Heiko Schocher
2016-08-18 3:45 ` Simon Glass
2016-10-06 21:58 ` Andreas Bießmann
2016-10-28 16:49 ` [U-Boot] [U-Boot,3/6] " Andreas Bießmann
2016-08-17 7:13 ` [U-Boot] [PATCH 4/6] arm, at91: add some missing fields in PIO struct Heiko Schocher
2016-09-18 2:09 ` Wenyou.Yang at microchip.com
2016-10-06 22:06 ` Andreas Bießmann
2016-08-17 7:13 ` [U-Boot] [PATCH 5/6] at91: add function to set IO drive Heiko Schocher
2016-09-18 2:05 ` Wenyou.Yang at microchip.com
2016-10-06 22:11 ` Andreas Bießmann
2016-08-17 7:13 ` [U-Boot] [PATCH 6/6] [RFC] at91: SPL clock fix for AT91SAM9G15 based boards Heiko Schocher
2016-09-18 2:19 ` Wenyou.Yang at microchip.com
2016-10-06 22:34 ` Andreas Bießmann
2016-09-30 5:14 ` [U-Boot] [PATCH 0/6] at91: at91sam9g15 improvements Heiko Schocher
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=1471418009-12660-3-git-send-email-hs@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox