Init PMC and Matrix only if SAMA_HAL_IS_SECURE is true.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11259 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
isiora 2018-01-10 22:42:49 +00:00
parent 2fb47b79c1
commit 4fb646059d
1 changed files with 3 additions and 2 deletions

View File

@ -60,15 +60,16 @@
*/
void hal_lld_init(void) {
#if (SAMA_HAL_IS_SECURE == TRUE) /* The Matrix is PAS and PMC is always configured secure */
/* Disabling PMC write protection. */
pmcDisableWP();
/* Enabling matrix clock */
pmcEnableH32MX();
pmcEnableH64MX();
/* Enabling write protection. */
pmcEnableWP();
#endif
#if defined(SAMA_DMA_REQUIRED)
dmaInit();
@ -85,7 +86,7 @@ void hal_lld_init(void) {
* @special
*/
void sama_clock_init(void) {
#if !SAMA_NO_INIT
#if (!SAMA_NO_INIT && SAMA_HAL_IS_SECURE == TRUE)
uint32_t mor, pllar, mckr, mainf;
/* Disabling PMC write protection. */
pmcDisableWP();