-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 191939 b: refs/heads/master c: e561aac h: refs/heads/master i: 191937: 33766bc 191935: 011b7b0 v: v3
- Loading branch information
Ben Dooks
committed
May 10, 2010
1 parent
6c10880
commit 72d15b9
Showing
3 changed files
with
55 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 7cfdee9f6791fe9ec288e75ee746790ebf3b6c3b | ||
refs/heads/master: e561aacc70716ff59b9359ba8f010609ee757241 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* arch/arm/plat-samsung/include/plat/pll6553x.h | ||
* partially from arch/arm/mach-s3c64xx/include/mach/pll.h | ||
* | ||
* Copyright 2008 Openmoko, Inc. | ||
* Copyright 2008 Simtec Electronics | ||
* Ben Dooks <ben@simtec.co.uk> | ||
* http://armlinux.simtec.co.uk/ | ||
* | ||
* Samsung PLL6553x PLL code | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
/* S3C6400 and compatible (S3C2416, etc.) EPLL code */ | ||
|
||
#define PLL6553X_MDIV_MASK ((1 << (23-16)) - 1) | ||
#define PLL6553X_PDIV_MASK ((1 << (13-8)) - 1) | ||
#define PLL6553X_SDIV_MASK ((1 << (2-0)) - 1) | ||
#define PLL6553X_MDIV_SHIFT (16) | ||
#define PLL6553X_PDIV_SHIFT (8) | ||
#define PLL6553X_SDIV_SHIFT (0) | ||
#define PLL6553X_KDIV_MASK (0xffff) | ||
|
||
static inline unsigned long s3c_get_pll6553x(unsigned long baseclk, | ||
u32 pll0, u32 pll1) | ||
{ | ||
unsigned long result; | ||
u32 mdiv, pdiv, sdiv, kdiv; | ||
u64 tmp; | ||
|
||
mdiv = (pll0 >> PLL6553X_MDIV_SHIFT) & PLL6553X_MDIV_MASK; | ||
pdiv = (pll0 >> PLL6553X_PDIV_SHIFT) & PLL6553X_PDIV_MASK; | ||
sdiv = (pll0 >> PLL6553X_SDIV_SHIFT) & PLL6553X_SDIV_MASK; | ||
kdiv = pll1 & PLL6553X_KDIV_MASK; | ||
|
||
/* We need to multiple baseclk by mdiv (the integer part) and kdiv | ||
* which is in 2^16ths, so shift mdiv up (does not overflow) and | ||
* add kdiv before multiplying. The use of tmp is to avoid any | ||
* overflows before shifting bac down into result when multipling | ||
* by the mdiv and kdiv pair. | ||
*/ | ||
|
||
tmp = baseclk; | ||
tmp *= (mdiv << 16) + kdiv; | ||
do_div(tmp, (pdiv << sdiv)); | ||
result = tmp >> 16; | ||
|
||
return result; | ||
} |