Skip to content

Commit

Permalink
plat-sam: set sram0 as secure
Browse files Browse the repository at this point in the history
We are going to use the first 64K of SRAM0 to put the suspend code.
This is mandatory because SDRAM will be put in self refresh mode and
thus won't be accessible. at91bootstrap already sets this zone as
secure but we better enforce it to avoid anybody reading or writing
it.

Acked-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jerome Forissier <jerome@forissier.org>
Signed-off-by: Clément Léger <clement.leger@bootlin.com>
  • Loading branch information
clementleger authored and jforissier committed Jan 31, 2022
1 parent 5060464 commit 5ad3006
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions core/arch/arm/plat-sam/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,16 +163,18 @@ static void matrix_configure_slave_h64mx(void)
ssr_setting);
}

/* 10: Internal SRAM 128K: Non-Secure */
/*
* 10: Internal SRAM 128K:
* - First 64K are reserved for suspend code in Secure World
* - Last 64K are for Non-Secure world (used by CAN)
*/
srtop_setting = MATRIX_SRTOP(0, MATRIX_SRTOP_VALUE_128K);
sasplit_setting = MATRIX_SASPLIT(0, MATRIX_SASPLIT_VALUE_128K);
ssr_setting = (MATRIX_LANSECH_NS(0)
| MATRIX_RDNSECH_NS(0)
| MATRIX_WRNSECH_NS(0));
sasplit_setting = MATRIX_SASPLIT(0, MATRIX_SRTOP_VALUE_64K);
ssr_setting = (MATRIX_LANSECH_S(0) | MATRIX_RDNSECH_S(0) |
MATRIX_WRNSECH_S(0));
matrix_configure_slave_security(matrix64_base(),
H64MX_SLAVE_INTERNAL_SRAM,
srtop_setting,
sasplit_setting,
srtop_setting, sasplit_setting,
ssr_setting);

/* 11: Internal SRAM 128K (Cache L2): Default */
Expand Down

0 comments on commit 5ad3006

Please sign in to comment.