Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
232eaf7f
Commit
232eaf7f
authored
Jan 16, 2010
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ARM: ICST: indirect s2div and idx2s arrays via icst_params
Signed-off-by:
Russell King
<
rmk+kernel@arm.linux.org.uk
>
parent
e73a46a3
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
42 additions
and
14 deletions
+42
-14
arch/arm/common/icst307.c
arch/arm/common/icst307.c
+11
-7
arch/arm/common/icst525.c
arch/arm/common/icst525.c
+11
-7
arch/arm/include/asm/hardware/icst.h
arch/arm/include/asm/hardware/icst.h
+2
-0
arch/arm/include/asm/hardware/icst307.h
arch/arm/include/asm/hardware/icst307.h
+3
-0
arch/arm/include/asm/hardware/icst525.h
arch/arm/include/asm/hardware/icst525.h
+3
-0
arch/arm/mach-integrator/cpu.c
arch/arm/mach-integrator/cpu.c
+4
-0
arch/arm/mach-integrator/impd1.c
arch/arm/mach-integrator/impd1.c
+2
-0
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-integrator/integrator_cp.c
+2
-0
arch/arm/mach-realview/core.c
arch/arm/mach-realview/core.c
+2
-0
arch/arm/mach-versatile/core.c
arch/arm/mach-versatile/core.c
+2
-0
No files found.
arch/arm/common/icst307.c
View file @
232eaf7f
...
@@ -22,11 +22,13 @@
...
@@ -22,11 +22,13 @@
/*
/*
* Divisors for each OD setting.
* Divisors for each OD setting.
*/
*/
static
unsigned
char
s2div
[
8
]
=
{
10
,
2
,
8
,
4
,
5
,
7
,
3
,
6
};
const
unsigned
char
icst307_s2div
[
8
]
=
{
10
,
2
,
8
,
4
,
5
,
7
,
3
,
6
};
EXPORT_SYMBOL
(
icst307_s2div
);
unsigned
long
icst307_hz
(
const
struct
icst_params
*
p
,
struct
icst_vco
vco
)
unsigned
long
icst307_hz
(
const
struct
icst_params
*
p
,
struct
icst_vco
vco
)
{
{
return
p
->
ref
*
2
*
(
vco
.
v
+
8
)
/
((
vco
.
r
+
2
)
*
s2div
[
vco
.
s
]);
return
p
->
ref
*
2
*
(
vco
.
v
+
8
)
/
((
vco
.
r
+
2
)
*
p
->
s2div
[
vco
.
s
]);
}
}
EXPORT_SYMBOL
(
icst307_hz
);
EXPORT_SYMBOL
(
icst307_hz
);
...
@@ -34,7 +36,9 @@ EXPORT_SYMBOL(icst307_hz);
...
@@ -34,7 +36,9 @@ EXPORT_SYMBOL(icst307_hz);
/*
/*
* Ascending divisor S values.
* Ascending divisor S values.
*/
*/
static
unsigned
char
idx2s
[
8
]
=
{
1
,
6
,
3
,
4
,
7
,
5
,
2
,
0
};
const
unsigned
char
icst307_idx2s
[
8
]
=
{
1
,
6
,
3
,
4
,
7
,
5
,
2
,
0
};
EXPORT_SYMBOL
(
icst307_idx2s
);
struct
icst_vco
struct
icst_vco
icst307_hz_to_vco
(
const
struct
icst_params
*
p
,
unsigned
long
freq
)
icst307_hz_to_vco
(
const
struct
icst_params
*
p
,
unsigned
long
freq
)
...
@@ -48,19 +52,19 @@ icst307_hz_to_vco(const struct icst_params *p, unsigned long freq)
...
@@ -48,19 +52,19 @@ icst307_hz_to_vco(const struct icst_params *p, unsigned long freq)
* that the PLL output is within spec.
* that the PLL output is within spec.
*/
*/
do
{
do
{
f
=
freq
*
s2div
[
idx2s
[
i
]];
f
=
freq
*
p
->
s2div
[
p
->
idx2s
[
i
]];
/*
/*
* f must be between 6MHz and 200MHz (3.3 or 5V)
* f must be between 6MHz and 200MHz (3.3 or 5V)
*/
*/
if
(
f
>
p
->
vco_min
&&
f
<=
p
->
vco_max
)
if
(
f
>
p
->
vco_min
&&
f
<=
p
->
vco_max
)
break
;
break
;
}
while
(
i
<
ARRAY_SIZE
(
idx2s
)
);
}
while
(
i
<
8
);
if
(
i
>=
ARRAY_SIZE
(
idx2s
)
)
if
(
i
>=
8
)
return
vco
;
return
vco
;
vco
.
s
=
idx2s
[
i
];
vco
.
s
=
p
->
idx2s
[
i
];
/*
/*
* Now find the closest divisor combination
* Now find the closest divisor combination
...
...
arch/arm/common/icst525.c
View file @
232eaf7f
...
@@ -19,11 +19,13 @@
...
@@ -19,11 +19,13 @@
/*
/*
* Divisors for each OD setting.
* Divisors for each OD setting.
*/
*/
static
unsigned
char
s2div
[
8
]
=
{
10
,
2
,
8
,
4
,
5
,
7
,
9
,
6
};
const
unsigned
char
icst525_s2div
[
8
]
=
{
10
,
2
,
8
,
4
,
5
,
7
,
9
,
6
};
EXPORT_SYMBOL
(
icst525_s2div
);
unsigned
long
icst525_hz
(
const
struct
icst_params
*
p
,
struct
icst_vco
vco
)
unsigned
long
icst525_hz
(
const
struct
icst_params
*
p
,
struct
icst_vco
vco
)
{
{
return
p
->
ref
*
2
*
(
vco
.
v
+
8
)
/
((
vco
.
r
+
2
)
*
s2div
[
vco
.
s
]);
return
p
->
ref
*
2
*
(
vco
.
v
+
8
)
/
((
vco
.
r
+
2
)
*
p
->
s2div
[
vco
.
s
]);
}
}
EXPORT_SYMBOL
(
icst525_hz
);
EXPORT_SYMBOL
(
icst525_hz
);
...
@@ -31,7 +33,9 @@ EXPORT_SYMBOL(icst525_hz);
...
@@ -31,7 +33,9 @@ EXPORT_SYMBOL(icst525_hz);
/*
/*
* Ascending divisor S values.
* Ascending divisor S values.
*/
*/
static
unsigned
char
idx2s
[]
=
{
1
,
3
,
4
,
7
,
5
,
2
,
6
,
0
};
const
unsigned
char
icst525_idx2s
[
8
]
=
{
1
,
3
,
4
,
7
,
5
,
2
,
6
,
0
};
EXPORT_SYMBOL
(
icst525_idx2s
);
struct
icst_vco
struct
icst_vco
icst525_hz_to_vco
(
const
struct
icst_params
*
p
,
unsigned
long
freq
)
icst525_hz_to_vco
(
const
struct
icst_params
*
p
,
unsigned
long
freq
)
...
@@ -45,7 +49,7 @@ icst525_hz_to_vco(const struct icst_params *p, unsigned long freq)
...
@@ -45,7 +49,7 @@ icst525_hz_to_vco(const struct icst_params *p, unsigned long freq)
* that the PLL output is within spec.
* that the PLL output is within spec.
*/
*/
do
{
do
{
f
=
freq
*
s2div
[
idx2s
[
i
]];
f
=
freq
*
p
->
s2div
[
p
->
idx2s
[
i
]];
/*
/*
* f must be between 10MHz and
* f must be between 10MHz and
...
@@ -53,12 +57,12 @@ icst525_hz_to_vco(const struct icst_params *p, unsigned long freq)
...
@@ -53,12 +57,12 @@ icst525_hz_to_vco(const struct icst_params *p, unsigned long freq)
*/
*/
if
(
f
>
p
->
vco_min
&&
f
<=
p
->
vco_max
)
if
(
f
>
p
->
vco_min
&&
f
<=
p
->
vco_max
)
break
;
break
;
}
while
(
i
<
ARRAY_SIZE
(
idx2s
)
);
}
while
(
i
<
8
);
if
(
i
>=
ARRAY_SIZE
(
idx2s
)
)
if
(
i
>=
8
)
return
vco
;
return
vco
;
vco
.
s
=
idx2s
[
i
];
vco
.
s
=
p
->
idx2s
[
i
];
/*
/*
* Now find the closest divisor combination
* Now find the closest divisor combination
...
...
arch/arm/include/asm/hardware/icst.h
View file @
232eaf7f
...
@@ -22,6 +22,8 @@ struct icst_params {
...
@@ -22,6 +22,8 @@ struct icst_params {
unsigned
short
vd_max
;
/* inclusive */
unsigned
short
vd_max
;
/* inclusive */
unsigned
char
rd_min
;
/* inclusive */
unsigned
char
rd_min
;
/* inclusive */
unsigned
char
rd_max
;
/* inclusive */
unsigned
char
rd_max
;
/* inclusive */
const
unsigned
char
*
s2div
;
/* chip specific s2div array */
const
unsigned
char
*
idx2s
;
/* chip specific idx2s array */
};
};
struct
icst_vco
{
struct
icst_vco
{
...
...
arch/arm/include/asm/hardware/icst307.h
View file @
232eaf7f
...
@@ -28,4 +28,7 @@ struct icst_vco icst307_hz_to_vco(const struct icst_params *p, unsigned long fre
...
@@ -28,4 +28,7 @@ struct icst_vco icst307_hz_to_vco(const struct icst_params *p, unsigned long fre
#define ICST307_VCO_MIN 6000000
#define ICST307_VCO_MIN 6000000
#define ICST307_VCO_MAX 200000000
#define ICST307_VCO_MAX 200000000
extern
const
unsigned
char
icst307_s2div
[];
extern
const
unsigned
char
icst307_idx2s
[];
#endif
#endif
arch/arm/include/asm/hardware/icst525.h
View file @
232eaf7f
...
@@ -27,4 +27,7 @@ struct icst_vco icst525_hz_to_vco(const struct icst_params *p, unsigned long fre
...
@@ -27,4 +27,7 @@ struct icst_vco icst525_hz_to_vco(const struct icst_params *p, unsigned long fre
#define ICST525_VCO_MAX_3V 200000000
#define ICST525_VCO_MAX_3V 200000000
#define ICST525_VCO_MAX_5V 320000000
#define ICST525_VCO_MAX_5V 320000000
extern
const
unsigned
char
icst525_s2div
[];
extern
const
unsigned
char
icst525_idx2s
[];
#endif
#endif
arch/arm/mach-integrator/cpu.c
View file @
232eaf7f
...
@@ -39,6 +39,8 @@ static const struct icst_params lclk_params = {
...
@@ -39,6 +39,8 @@ static const struct icst_params lclk_params = {
.
vd_max
=
132
,
.
vd_max
=
132
,
.
rd_min
=
24
,
.
rd_min
=
24
,
.
rd_max
=
24
,
.
rd_max
=
24
,
.
s2div
=
icst525_s2div
,
.
idx2s
=
icst525_idx2s
,
};
};
static
const
struct
icst_params
cclk_params
=
{
static
const
struct
icst_params
cclk_params
=
{
...
@@ -49,6 +51,8 @@ static const struct icst_params cclk_params = {
...
@@ -49,6 +51,8 @@ static const struct icst_params cclk_params = {
.
vd_max
=
160
,
.
vd_max
=
160
,
.
rd_min
=
24
,
.
rd_min
=
24
,
.
rd_max
=
24
,
.
rd_max
=
24
,
.
s2div
=
icst525_s2div
,
.
idx2s
=
icst525_idx2s
,
};
};
/*
/*
...
...
arch/arm/mach-integrator/impd1.c
View file @
232eaf7f
...
@@ -48,6 +48,8 @@ static const struct icst_params impd1_vco_params = {
...
@@ -48,6 +48,8 @@ static const struct icst_params impd1_vco_params = {
.
vd_max
=
519
,
.
vd_max
=
519
,
.
rd_min
=
3
,
.
rd_min
=
3
,
.
rd_max
=
120
,
.
rd_max
=
120
,
.
s2div
=
icst525_s2div
,
.
idx2s
=
icst525_idx2s
,
};
};
static
void
impd1_setvco
(
struct
clk
*
clk
,
struct
icst_vco
vco
)
static
void
impd1_setvco
(
struct
clk
*
clk
,
struct
icst_vco
vco
)
...
...
arch/arm/mach-integrator/integrator_cp.c
View file @
232eaf7f
...
@@ -276,6 +276,8 @@ static const struct icst_params cp_auxvco_params = {
...
@@ -276,6 +276,8 @@ static const struct icst_params cp_auxvco_params = {
.
vd_max
=
263
,
.
vd_max
=
263
,
.
rd_min
=
3
,
.
rd_min
=
3
,
.
rd_max
=
65
,
.
rd_max
=
65
,
.
s2div
=
icst525_s2div
,
.
idx2s
=
icst525_idx2s
,
};
};
static
void
cp_auxvco_set
(
struct
clk
*
clk
,
struct
icst_vco
vco
)
static
void
cp_auxvco_set
(
struct
clk
*
clk
,
struct
icst_vco
vco
)
...
...
arch/arm/mach-realview/core.c
View file @
232eaf7f
...
@@ -281,6 +281,8 @@ static const struct icst_params realview_oscvco_params = {
...
@@ -281,6 +281,8 @@ static const struct icst_params realview_oscvco_params = {
.
vd_max
=
511
+
8
,
.
vd_max
=
511
+
8
,
.
rd_min
=
1
+
2
,
.
rd_min
=
1
+
2
,
.
rd_max
=
127
+
2
,
.
rd_max
=
127
+
2
,
.
s2div
=
icst307_s2div
,
.
idx2s
=
icst307_idx2s
,
};
};
static
void
realview_oscvco_set
(
struct
clk
*
clk
,
struct
icst_vco
vco
)
static
void
realview_oscvco_set
(
struct
clk
*
clk
,
struct
icst_vco
vco
)
...
...
arch/arm/mach-versatile/core.c
View file @
232eaf7f
...
@@ -387,6 +387,8 @@ static const struct icst_params versatile_oscvco_params = {
...
@@ -387,6 +387,8 @@ static const struct icst_params versatile_oscvco_params = {
.
vd_max
=
511
+
8
,
.
vd_max
=
511
+
8
,
.
rd_min
=
1
+
2
,
.
rd_min
=
1
+
2
,
.
rd_max
=
127
+
2
,
.
rd_max
=
127
+
2
,
.
s2div
=
icst307_s2div
,
.
idx2s
=
icst307_idx2s
,
};
};
static
void
versatile_oscvco_set
(
struct
clk
*
clk
,
struct
icst_vco
vco
)
static
void
versatile_oscvco_set
(
struct
clk
*
clk
,
struct
icst_vco
vco
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment