aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Brand <chris.brand@cypress.com>2019-10-10 14:30:24 -0700
committerChris Brand <chris.brand@cypress.com>2019-10-16 10:15:04 -0700
commitc1808d8891d9e98cd7cf8808f18c1260758c3740 (patch)
treebc7d1f852190e97e73ac70e7d9749d1577416ff0
parent44b887157501a51ad7db56a234add2adc2067e0d (diff)
downloadtrusted-firmware-m-c1808d8891d9e98cd7cf8808f18c1260758c3740.tar.gz
plat: Re-apply changes to new PDL code (psoc64)
Re-apply changes as needed from commit 0c937fa4968a83a3bcd4017c77df92a75f498ae1 ("plat: PSoC6 platform modifications") Change-Id: I1e05231ec39b8ed682c56a4b171402790275ed9d Signed-off-by: Chris Brand <chris.brand@cypress.com>
-rw-r--r--platform/ext/target/psoc64/Device/Source/system_psoc6_cm0plus.c6
-rw-r--r--platform/ext/target/psoc64/Device/Source/system_psoc6_cm4.c16
2 files changed, 17 insertions, 5 deletions
diff --git a/platform/ext/target/psoc64/Device/Source/system_psoc6_cm0plus.c b/platform/ext/target/psoc64/Device/Source/system_psoc6_cm0plus.c
index 9164b15dd6..d31cd824e0 100644
--- a/platform/ext/target/psoc64/Device/Source/system_psoc6_cm0plus.c
+++ b/platform/ext/target/psoc64/Device/Source/system_psoc6_cm0plus.c
@@ -164,14 +164,16 @@ uint32_t cy_delay32kMs = CY_DELAY_MS_OVERFLOW_THRESHOLD *
* Initializes the system:
* - Restores FLL registers to the default state.
* - Unlocks and disables WDT.
-* - Calls Cy_PDL_Init() function to define the driver library.
* - Calls the Cy_SystemInit() function, if compiled from PSoC Creator.
* - Calls \ref SystemCoreClockUpdate().
*
*******************************************************************************/
void SystemInit(void)
{
- Cy_PDL_Init(CY_DEVICE_CFG);
+#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
+ extern const cy_israddress __Vectors[]; /* Vector Table in flash */;
+ SCB->VTOR = (uint32_t) &__Vectors;
+#endif
/* Restore FLL registers to the default state as they are not restored by the ROM code */
uint32_t copy = SRSS->CLK_FLL_CONFIG;
diff --git a/platform/ext/target/psoc64/Device/Source/system_psoc6_cm4.c b/platform/ext/target/psoc64/Device/Source/system_psoc6_cm4.c
index 0a18f50a4d..1000ff44aa 100644
--- a/platform/ext/target/psoc64/Device/Source/system_psoc6_cm4.c
+++ b/platform/ext/target/psoc64/Device/Source/system_psoc6_cm4.c
@@ -28,7 +28,7 @@
#include "cy_device_headers.h"
#include "cy_syslib.h"
#include "cy_wdt.h"
-
+#include "cycfg.h"
#if !defined(CY_IPC_DEFAULT_CFG_DISABLE)
#include "cy_ipc_sema.h"
#include "cy_ipc_pipe.h"
@@ -158,14 +158,24 @@ uint32_t cy_delay32kMs = CY_DELAY_MS_OVERFLOW_THRESHOLD *
* Initializes the system:
* - Restores FLL registers to the default state for single core devices.
* - Unlocks and disables WDT.
-* - Calls Cy_PDL_Init() function to define the driver library.
* - Calls the Cy_SystemInit() function, if compiled from PSoC Creator.
* - Calls \ref SystemCoreClockUpdate().
* \endcond
*******************************************************************************/
void SystemInit(void)
{
- Cy_PDL_Init(CY_DEVICE_CFG);
+#if defined (__VTOR_PRESENT) && (__VTOR_PRESENT == 1U)
+ extern const cy_israddress __Vectors[]; /* Vector Table in flash */
+ SCB->VTOR = (uint32_t) &__Vectors;
+#endif
+
+ /*
+ * FIXME:
+ * Even if __FPU_USED is undefined or cleared, FP registers are still
+ * accessed inside armclang library. Not sure about why armclang doesn't
+ * care about the __FPU_USED.
+ */
+ SCB->CPACR |= SCB_CPACR_CP10_CP11_ENABLE;
#ifdef __CM0P_PRESENT
#if (__CM0P_PRESENT == 0)