diff options
author | isiora <none@example.com> | 2018-01-10 22:42:49 +0000 |
---|---|---|
committer | isiora <none@example.com> | 2018-01-10 22:42:49 +0000 |
commit | 4fb646059d3ad81d462bba8becf025e1e44ca2de (patch) | |
tree | 498cb6c2df2a3bb5023ac1741cbc8a1201d6415b | |
parent | 2fb47b79c1dff37d654ce179089dabf539bcca17 (diff) | |
download | ChibiOS-4fb646059d3ad81d462bba8becf025e1e44ca2de.tar.gz ChibiOS-4fb646059d3ad81d462bba8becf025e1e44ca2de.tar.bz2 ChibiOS-4fb646059d3ad81d462bba8becf025e1e44ca2de.zip |
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
-rw-r--r-- | os/hal/ports/SAMA/SAMA5D2x/hal_lld.c | 5 |
1 files changed, 3 insertions, 2 deletions
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();
|