Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
omapconf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
packages
omapconf
Commits
834422c4
Commit
834422c4
authored
Jul 15, 2016
by
Matthijs van Duin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
omap5: allow inexact frequency matching
parent
45aa7cf5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
16 deletions
+27
-16
arch/arm/mach-omap/omap5/opp54xx.c
arch/arm/mach-omap/omap5/opp54xx.c
+4
-4
common/opp.c
common/opp.c
+23
-12
No files found.
arch/arm/mach-omap/omap5/opp54xx.c
View file @
834422c4
...
...
@@ -457,14 +457,14 @@ const char *opp54xx_by_rate_get(voltdm54xx_id vdd_id)
__func__
,
voltdm54xx_name_get
(
vdd_id
),
opp
.
name
,
rate_gpu_por
);
if
(((
int
)
rate
=
=
(
int
)
rate_por
)
&&
((
int
)
rate_dsp
=
=
(
int
)
rate_dsp_por
)
&&
((
int
)
rate_gpu
=
=
(
int
)
rate_gpu_por
))
{
if
(((
int
)
rate
<
=
(
int
)
rate_por
)
&&
((
int
)
rate_dsp
<
=
(
int
)
rate_dsp_por
)
&&
((
int
)
rate_gpu
<
=
(
int
)
rate_gpu_por
))
{
opp_name
=
opp
.
name
;
goto
opp54xx_by_rate_get_end
;
}
}
else
{
if
((
int
)
rate
=
=
(
int
)
rate_por
)
{
if
((
int
)
rate
<
=
(
int
)
rate_por
)
{
opp_name
=
opp
.
name
;
goto
opp54xx_by_rate_get_end
;
}
...
...
common/opp.c
View file @
834422c4
...
...
@@ -43,6 +43,7 @@
*/
#include <stdbool.h>
#include <opp.h>
#include <cpuinfo.h>
#include <lib.h>
...
...
@@ -535,6 +536,16 @@ static void print_rate(char table[TABLE_MAX_ROW][TABLE_MAX_COL][TABLE_MAX_ELT_LE
}
static
bool
is_approx
(
int
a
,
int
b
)
{
if
(
a
==
b
)
return
true
;
if
(
a
<
100
||
b
<
100
)
return
false
;
int
d
=
a
<
b
?
b
-
a
:
a
-
b
;
return
d
/
((
a
+
b
)
/
50
)
==
0
;
}
/* ------------------------------------------------------------------------*//**
* @FUNCTION opp_show
* @BRIEF show current operating voltages and key clock rates.
...
...
@@ -815,38 +826,38 @@ int opp_show(FILE *stream)
dprintf
(
" Voltage (2): %dV
\n
"
,
volt2
);
if
(
strcmp
(
voltdm
.
name
,
VDD_MPU
)
==
0
)
{
found
=
(
((
rate_mpu
/
1000
)
==
(
rate_mpu_por
/
1000
)
)
&&
found
=
(
is_approx
(
rate_mpu
,
rate_mpu_por
)
&&
(
strcmp
(
opp_s
,
opp_s2
)
==
0
)
&&
(
volt
==
volt2
));
}
else
if
(
cpu_is_dra7xx
()
&&
(
strcmp
(
voltdm
.
name
,
VDD_IVA
)
==
0
))
{
found
=
((
strcmp
(
opp_s
,
opp_s2
)
==
0
)
&&
(
volt
==
volt2
)
&&
((
rate_iva
/
1000
)
==
(
rate_iva_por
/
1000
)
));
is_approx
(
rate_iva
,
rate_iva_por
));
}
else
if
(
strcmp
(
voltdm
.
name
,
VDD_IVA
)
==
0
)
{
found
=
((
strcmp
(
opp_s
,
opp_s2
)
==
0
)
&&
(
volt
==
volt2
)
&&
(
((
rate_dsp
/
1000
)
==
(
rate_dsp_por
/
1000
)
)
||
((
rate_iva
/
1000
)
==
(
rate_iva_por
/
1000
)
)
||
((
rate_aess
/
1000
)
==
(
rate_aess_por
/
1000
)
)));
(
is_approx
(
rate_dsp
,
rate_dsp_por
)
||
is_approx
(
rate_iva
,
rate_iva_por
)
||
is_approx
(
rate_aess
,
rate_aess_por
)));
}
else
if
(
strcmp
(
voltdm
.
name
,
VDD_MM
)
==
0
)
{
found
=
((
strcmp
(
opp_s
,
opp_s2
)
==
0
)
&&
(
volt
==
volt2
)
&&
(
((
rate_dsp
/
1000
)
==
(
rate_dsp_por
/
1000
)
)
||
((
rate_iva
/
1000
)
==
(
rate_iva_por
/
1000
)
)
||
((
rate_gpu
/
1000
)
==
(
rate_gpu_por
/
1000
)
)));
(
is_approx
(
rate_dsp
,
rate_dsp_por
)
||
is_approx
(
rate_iva
,
rate_iva_por
)
||
is_approx
(
rate_gpu
,
rate_gpu_por
)));
}
else
if
(
strcmp
(
voltdm
.
name
,
VDD_CORE
)
==
0
)
{
found
=
((
strcmp
(
opp_s
,
opp_s2
)
==
0
)
&&
(
volt
==
volt2
)
&&
((
rate_l3
/
1000
)
==
(
rate_l3_por
/
1000
)
));
is_approx
(
rate_l3
,
rate_l3_por
));
}
else
if
(
strcmp
(
voltdm
.
name
,
VDD_GPU
)
==
0
)
{
found
=
((
strcmp
(
opp_s
,
opp_s2
)
==
0
)
&&
(
volt
==
volt2
)
&&
((
rate_gpu
/
1000
)
==
(
rate_gpu_por
/
1000
)
));
is_approx
(
rate_gpu
,
rate_gpu_por
));
}
else
if
(
strcmp
(
voltdm
.
name
,
VDD_DSPEVE
)
==
0
)
{
found
=
((
strcmp
(
opp_s
,
opp_s2
)
==
0
)
&&
(
volt
==
volt2
)
&&
(
((
rate_dsp
/
1000
)
==
(
rate_dsp_por
/
1000
)
)
||
((
rate_eve
/
1000
)
==
(
rate_eve_por
/
1000
)
)));
(
is_approx
(
rate_dsp
,
rate_dsp_por
)
||
is_approx
(
rate_eve
,
rate_eve_por
)));
}
dprintf
(
" found=%u
\n
"
,
found
);
...
...
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