Skip to content
GitLab
Menu
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
82842004
Unverified
Commit
82842004
authored
Mar 01, 2019
by
Antonio Niño Díaz
Committed by
GitHub
Mar 01, 2019
Browse files
Merge pull request #1846 from loumay-arm/lm/mpam
MPAM: enable MPAM EL2 traps
parents
dbd0bcfe
537fa859
Changes
2
Show whitespace changes
Inline
Side-by-side
include/arch/aarch64/arch.h
View file @
82842004
...
@@ -783,6 +783,10 @@
...
@@ -783,6 +783,10 @@
/* MPAM register definitions */
/* MPAM register definitions */
#define MPAM3_EL3_MPAMEN_BIT (ULL(1) << 63)
#define MPAM3_EL3_MPAMEN_BIT (ULL(1) << 63)
#define MPAMHCR_EL2_TRAP_MPAMIDR_EL1 (ULL(1) << 31)
#define MPAM2_EL2_TRAPMPAM0EL1 (ULL(1) << 49)
#define MPAM2_EL2_TRAPMPAM1EL1 (ULL(1) << 48)
#define MPAMIDR_HAS_HCR_BIT (ULL(1) << 17)
#define MPAMIDR_HAS_HCR_BIT (ULL(1) << 17)
...
...
lib/extensions/mpam/mpam.c
View file @
82842004
...
@@ -31,11 +31,19 @@ void mpam_enable(bool el2_unused)
...
@@ -31,11 +31,19 @@ void mpam_enable(bool el2_unused)
/*
/*
* If EL2 is implemented but unused, disable trapping to EL2 when lower
* If EL2 is implemented but unused, disable trapping to EL2 when lower
* ELs access their own MPAM registers.
* ELs access their own MPAM registers.
* If EL2 is implemented and used, enable trapping to EL2.
*/
*/
if
(
el2_unused
)
{
if
(
el2_unused
)
{
write_mpam2_el2
(
0
);
write_mpam2_el2
(
0
);
if
((
read_mpamidr_el1
()
&
MPAMIDR_HAS_HCR_BIT
)
!=
0U
)
if
((
read_mpamidr_el1
()
&
MPAMIDR_HAS_HCR_BIT
)
!=
0U
)
write_mpamhcr_el2
(
0
);
write_mpamhcr_el2
(
0
);
}
else
{
write_mpam2_el2
(
MPAM2_EL2_TRAPMPAM0EL1
|
MPAM2_EL2_TRAPMPAM1EL1
);
if
((
read_mpamidr_el1
()
&
MPAMIDR_HAS_HCR_BIT
)
!=
0U
)
{
write_mpamhcr_el2
(
MPAMHCR_EL2_TRAP_MPAMIDR_EL1
);
}
}
}
}
}
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