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
e422f991
Commit
e422f991
authored
8 years ago
by
davidcunado-arm
Committed by
GitHub
8 years ago
Browse files
Options
Download
Plain Diff
Merge pull request #880 from Summer-ARM/sq/tcr-memory-attribution
Add support to change xlat_tables to non-cacheable
parents
ab139902
5d21b037
master
v2.5
v2.5-rc1
v2.5-rc0
v2.4
v2.4-rc2
v2.4-rc1
v2.4-rc0
v2.3
v2.3-rc2
v2.3-rc1
v2.3-rc0
v2.2
v2.2-rc2
v2.2-rc1
v2.2-rc0
v2.1
v2.1-rc1
v2.1-rc0
v2.0
v2.0-rc0
v1.6
v1.6-rc1
v1.6-rc0
v1.5
v1.5-rc3
v1.5-rc2
v1.5-rc1
v1.5-rc0
v1.4
v1.4-rc0
arm_cca_v0.2
arm_cca_v0.1
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
include/lib/xlat_tables/xlat_tables_defs.h
+6
-0
include/lib/xlat_tables/xlat_tables_defs.h
lib/xlat_tables/aarch32/xlat_tables.c
+14
-6
lib/xlat_tables/aarch32/xlat_tables.c
lib/xlat_tables/aarch64/xlat_tables.c
+12
-5
lib/xlat_tables/aarch64/xlat_tables.c
lib/xlat_tables_v2/aarch32/xlat_tables_arch.c
+14
-6
lib/xlat_tables_v2/aarch32/xlat_tables_arch.c
lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
+11
-4
lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
with
57 additions
and
21 deletions
+57
-21
include/lib/xlat_tables/xlat_tables_defs.h
View file @
e422f991
...
...
@@ -135,4 +135,10 @@
*/
#define DISABLE_DCACHE (1 << 0)
/*
* This flag marks the translation tables are Non-cacheable for MMU accesses.
* If the flag is not specified, by default the tables are cacheable.
*/
#define XLAT_TABLE_NC (1 << 1)
#endif
/* __XLAT_TABLES_DEFS_H__ */
This diff is collapsed.
Click to expand it.
lib/xlat_tables/aarch32/xlat_tables.c
View file @
e422f991
...
...
@@ -130,13 +130,21 @@ void enable_mmu_secure(unsigned int flags)
tlbiall
();
/*
* Set TTBCR bits as well. Set TTBR0 table properties as Inner
* & outer WBWA & shareable. Disable TTBR1.
* Set TTBCR bits as well. Set TTBR0 table properties. Disable TTBR1.
*/
ttbcr
=
TTBCR_EAE_BIT
|
TTBCR_SH0_INNER_SHAREABLE
|
TTBCR_RGN0_OUTER_WBA
|
TTBCR_RGN0_INNER_WBA
|
(
32
-
__builtin_ctzl
((
uintptr_t
)
PLAT_VIRT_ADDR_SPACE_SIZE
));
if
(
flags
&
XLAT_TABLE_NC
)
{
/* Inner & outer non-cacheable non-shareable. */
ttbcr
=
TTBCR_EAE_BIT
|
TTBCR_SH0_NON_SHAREABLE
|
TTBCR_RGN0_OUTER_NC
|
TTBCR_RGN0_INNER_NC
|
(
32
-
__builtin_ctzl
((
uintptr_t
)
PLAT_VIRT_ADDR_SPACE_SIZE
));
}
else
{
/* Inner & outer WBWA & shareable. */
ttbcr
=
TTBCR_EAE_BIT
|
TTBCR_SH0_INNER_SHAREABLE
|
TTBCR_RGN0_OUTER_WBA
|
TTBCR_RGN0_INNER_WBA
|
(
32
-
__builtin_ctzl
((
uintptr_t
)
PLAT_VIRT_ADDR_SPACE_SIZE
));
}
ttbcr
|=
TTBCR_EPD1_BIT
;
write_ttbcr
(
ttbcr
);
...
...
This diff is collapsed.
Click to expand it.
lib/xlat_tables/aarch64/xlat_tables.c
View file @
e422f991
/*
* Copyright (c) 2014-201
6
, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2014-201
7
, ARM Limited and Contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
...
...
@@ -192,11 +192,18 @@ void init_xlat_tables(void)
_tlbi_fct(); \
\
/* Set TCR bits as well. */
\
/* Inner & outer WBWA & shareable. */
\
/* Set T0SZ to (64 - width of virtual address space) */
\
tcr = TCR_SH_INNER_SHAREABLE | TCR_RGN_OUTER_WBA | \
TCR_RGN_INNER_WBA | \
(64 - __builtin_ctzl(PLAT_VIRT_ADDR_SPACE_SIZE));\
if (flags & XLAT_TABLE_NC) { \
/* Inner & outer non-cacheable non-shareable. */
\
tcr = TCR_SH_NON_SHAREABLE | \
TCR_RGN_OUTER_NC | TCR_RGN_INNER_NC | \
(64 - __builtin_ctzl(PLAT_VIRT_ADDR_SPACE_SIZE));\
} else { \
/* Inner & outer WBWA & shareable. */
\
tcr = TCR_SH_INNER_SHAREABLE | \
TCR_RGN_OUTER_WBA | TCR_RGN_INNER_WBA | \
(64 - __builtin_ctzl(PLAT_VIRT_ADDR_SPACE_SIZE));\
} \
tcr |= _tcr_extra; \
write_tcr_el##_el(tcr); \
\
...
...
This diff is collapsed.
Click to expand it.
lib/xlat_tables_v2/aarch32/xlat_tables_arch.c
View file @
e422f991
...
...
@@ -122,13 +122,21 @@ void enable_mmu_internal_secure(unsigned int flags, uint64_t *base_table)
write_mair0
(
mair0
);
/*
* Set TTBCR bits as well. Set TTBR0 table properties as Inner
* & outer WBWA & shareable. Disable TTBR1.
* Set TTBCR bits as well. Set TTBR0 table properties. Disable TTBR1.
*/
ttbcr
=
TTBCR_EAE_BIT
|
TTBCR_SH0_INNER_SHAREABLE
|
TTBCR_RGN0_OUTER_WBA
|
TTBCR_RGN0_INNER_WBA
|
(
32
-
__builtin_ctzl
((
uintptr_t
)
PLAT_VIRT_ADDR_SPACE_SIZE
));
if
(
flags
&
XLAT_TABLE_NC
)
{
/* Inner & outer non-cacheable non-shareable. */
ttbcr
=
TTBCR_EAE_BIT
|
TTBCR_SH0_NON_SHAREABLE
|
TTBCR_RGN0_OUTER_NC
|
TTBCR_RGN0_INNER_NC
|
(
32
-
__builtin_ctzl
((
uintptr_t
)
PLAT_VIRT_ADDR_SPACE_SIZE
));
}
else
{
/* Inner & outer WBWA & shareable. */
ttbcr
=
TTBCR_EAE_BIT
|
TTBCR_SH0_INNER_SHAREABLE
|
TTBCR_RGN0_OUTER_WBA
|
TTBCR_RGN0_INNER_WBA
|
(
32
-
__builtin_ctzl
((
uintptr_t
)
PLAT_VIRT_ADDR_SPACE_SIZE
));
}
ttbcr
|=
TTBCR_EPD1_BIT
;
write_ttbcr
(
ttbcr
);
...
...
This diff is collapsed.
Click to expand it.
lib/xlat_tables_v2/aarch64/xlat_tables_arch.c
View file @
e422f991
...
...
@@ -201,11 +201,18 @@ void init_xlat_tables_arch(unsigned long long max_pa)
write_mair_el##_el(mair); \
\
/* Set TCR bits as well. */
\
/* Inner & outer WBWA & shareable. */
\
/* Set T0SZ to (64 - width of virtual address space) */
\
tcr = TCR_SH_INNER_SHAREABLE | TCR_RGN_OUTER_WBA | \
TCR_RGN_INNER_WBA | \
(64 - __builtin_ctzl(PLAT_VIRT_ADDR_SPACE_SIZE));\
if (flags & XLAT_TABLE_NC) { \
/* Inner & outer non-cacheable non-shareable. */
\
tcr = TCR_SH_NON_SHAREABLE | \
TCR_RGN_OUTER_NC | TCR_RGN_INNER_NC | \
(64 - __builtin_ctzl(PLAT_VIRT_ADDR_SPACE_SIZE));\
} else { \
/* Inner & outer WBWA & shareable. */
\
tcr = TCR_SH_INNER_SHAREABLE | \
TCR_RGN_OUTER_WBA | TCR_RGN_INNER_WBA | \
(64 - __builtin_ctzl(PLAT_VIRT_ADDR_SPACE_SIZE));\
} \
tcr |= _tcr_extra; \
write_tcr_el##_el(tcr); \
\
...
...
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