From 4fb646059d3ad81d462bba8becf025e1e44ca2de Mon Sep 17 00:00:00 2001 From: isiora Date: Wed, 10 Jan 2018 22:42:49 +0000 Subject: 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 --- os/hal/ports/SAMA/SAMA5D2x/hal_lld.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'os/hal/ports/SAMA/SAMA5D2x/hal_lld.c') diff --git a/os/hal/ports/SAMA/SAMA5D2x/hal_lld.c b/os/hal/ports/SAMA/SAMA5D2x/hal_lld.c index c23de6eff..4750e34c5 100644 --- a/os/hal/ports/SAMA/SAMA5D2x/hal_lld.c +++ b/os/hal/ports/SAMA/SAMA5D2x/hal_lld.c @@ -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(); -- cgit v1.2.3