Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
d69f9981
Commit
d69f9981
authored
5 years ago
by
Alexei Fedorov
Committed by
TrustedFirmware Code Review
5 years ago
Browse files
Options
Download
Plain Diff
Merge "SMMUv3:Changed retry loop to delay timer(GENFW-3329)" into integration
parents
1d2b4161
620dd58b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/arm/smmu/smmu_v3.c
+8
-4
drivers/arm/smmu/smmu_v3.c
with
8 additions
and
4 deletions
+8
-4
drivers/arm/smmu/smmu_v3.c
View file @
d69f9981
...
@@ -7,23 +7,27 @@
...
@@ -7,23 +7,27 @@
#include <common/debug.h>
#include <common/debug.h>
#include <cdefs.h>
#include <cdefs.h>
#include <drivers/arm/smmu_v3.h>
#include <drivers/arm/smmu_v3.h>
#include <drivers/delay_timer.h>
#include <lib/mmio.h>
#include <lib/mmio.h>
/* SMMU poll number of retries */
/* SMMU poll number of retries */
#define SMMU_POLL_
RETRY
1000
000
#define SMMU_POLL_
TIMEOUT_US U(
1000
)
static
int
__init
smmuv3_poll
(
uintptr_t
smmu_reg
,
uint32_t
mask
,
static
int
__init
smmuv3_poll
(
uintptr_t
smmu_reg
,
uint32_t
mask
,
uint32_t
value
)
uint32_t
value
)
{
{
uint32_t
reg_val
,
retries
=
SMMU_POLL_RETRY
;
uint32_t
reg_val
;
uint64_t
timeout
;
/* Set 1ms timeout value */
timeout
=
timeout_init_us
(
SMMU_POLL_TIMEOUT_US
);
do
{
do
{
reg_val
=
mmio_read_32
(
smmu_reg
);
reg_val
=
mmio_read_32
(
smmu_reg
);
if
((
reg_val
&
mask
)
==
value
)
if
((
reg_val
&
mask
)
==
value
)
return
0
;
return
0
;
}
while
(
--
retries
!=
0U
);
}
while
(
!
timeout_elapsed
(
timeout
)
);
ERROR
(
"
Failed to
poll SMMUv3 register @%p
\n
"
,
(
void
*
)
smmu_reg
);
ERROR
(
"
Timeout
poll
ing
SMMUv3 register @%p
\n
"
,
(
void
*
)
smmu_reg
);
ERROR
(
"Read value 0x%x, expected 0x%x
\n
"
,
reg_val
,
ERROR
(
"Read value 0x%x, expected 0x%x
\n
"
,
reg_val
,
value
==
0U
?
reg_val
&
~
mask
:
reg_val
|
mask
);
value
==
0U
?
reg_val
&
~
mask
:
reg_val
|
mask
);
return
-
1
;
return
-
1
;
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help