diff options
author | Thomas Schmid <thomas.schmid@gmail.com> | 2013-10-24 09:32:35 -0600 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2013-10-29 22:51:33 +0000 |
commit | e3229bdfbbedeff548902c42bed31a23b99cc1d1 (patch) | |
tree | 63942d260c2d52fceb1408615446c75b8dd77f68 /src/flash/nor/at91sam4.c | |
parent | b16a7f9f6e3c7c417fa3d0d0bf042f032ee446f6 (diff) |
sam4s flash: fix PLLA frequency calculation if diva > 1
The code didn't address the case where diva is bigger than 1.
Change-Id: I15d8c47aa7b5cf80df1f29e067f30575f5d60a90
Signed-off-by: Thomas Schmid <thomas.schmid@gmail.com>
Reviewed-on: http://openocd.zylin.com/1765
Tested-by: jenkins
Reviewed-by: Mathias Küster <kesmtp@freenet.de>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/flash/nor/at91sam4.c')
-rw-r--r-- | src/flash/nor/at91sam4.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/flash/nor/at91sam4.c b/src/flash/nor/at91sam4.c index 2615c3d7..6c8b71e2 100644 --- a/src/flash/nor/at91sam4.c +++ b/src/flash/nor/at91sam4.c @@ -1246,8 +1246,8 @@ static void sam4_explain_ckgr_plla(struct sam4_chip *pChip) LOG_USER("\tPLLA Freq: (Disabled,mula = 0)"); else if (diva == 0) LOG_USER("\tPLLA Freq: (Disabled,diva = 0)"); - else if (diva == 1) { - pChip->cfg.plla_freq = (pChip->cfg.mainosc_freq * (mula + 1)); + else if (diva >= 1) { + pChip->cfg.plla_freq = (pChip->cfg.mainosc_freq * (mula + 1) / diva); LOG_USER("\tPLLA Freq: %3.03f MHz", _tomhz(pChip->cfg.plla_freq)); } |