Build: Added support for IAR toolchain to psoc64

- Added conditional compilation of subnormal float tests for M0+
  with IAR, as the IAR toolchain does not handle this for these
  targets.

- Successfully runs the supported regression tests, but fails the NaN
  QCBOR tests due to the tests not following the Arm ABI.

- Verified on psoc64

Change-Id: I483507ad2843b6745e3c1c845c939c80d90aa19d
Signed-off-by: TTornblom <thomas.tornblom@iar.com>
diff --git a/platform/ext/psoc64.cmake b/platform/ext/psoc64.cmake
index 5bb8c72..d349079 100644
--- a/platform/ext/psoc64.cmake
+++ b/platform/ext/psoc64.cmake
@@ -59,6 +59,14 @@
       # [libRTX_CM3.a should be used for CM4 without FPU]
       set (RTX_LIB_PATH "${CMSIS_5_DIR}/CMSIS/RTOS2/RTX/Library/GCC/libRTX_CM3.a")
     endif()
+elseif(COMPILER STREQUAL "IARARM")
+    set (S_SCATTER_FILE_NAME   "${PLATFORM_DIR}/common/iar/tfm_common_s.icf")
+    set (NS_SCATTER_FILE_NAME  "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/iar/psoc6_ns.icf")
+    if (DEFINED CMSIS_5_DIR)
+      # not all project defines CMSIS_5_DIR, only the ones that use it.
+      # [RTX_CM3.a should be used for CM4 without FPU]
+      set (RTX_LIB_PATH "${CMSIS_5_DIR}/CMSIS/RTOS2/RTX/Library/IAR/RTX_CM3.a")
+    endif()
 else()
     message(FATAL_ERROR "No startup file is available for compiler '${CMAKE_C_COMPILER_ID}'.")
 endif()
@@ -151,6 +159,8 @@
 	  list(APPEND ALL_SRC_ASM "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/armclang/cy_syslib_mdk.s")
   elseif(CMAKE_C_COMPILER_ID STREQUAL "GNUARM")
 	  list(APPEND ALL_SRC_ASM "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/gcc/cy_syslib_gcc.S")
+  elseif(CMAKE_C_COMPILER_ID STREQUAL "IARARM")
+	  list(APPEND ALL_SRC_ASM "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/iar/cy_syslib_iar.c")
   else()
     message(FATAL_ERROR "No cy_syslib is available for compiler '${CMAKE_C_COMPILER_ID}'.")
   endif()
@@ -172,6 +182,9 @@
     list(APPEND ALL_SRC_ASM_NS "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/gcc/startup_psoc64_ns.S")
     set_property(SOURCE "${ALL_SRC_ASM_S}" "${ALL_SRC_ASM_NS}" APPEND
       PROPERTY COMPILE_DEFINITIONS "__STARTUP_CLEAR_BSS_MULTIPLE" "__STARTUP_COPY_MULTIPLE")
+  elseif(CMAKE_C_COMPILER_ID STREQUAL "IARARM")
+    list(APPEND ALL_SRC_ASM_S "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/iar/startup_psoc64_s.s")
+    list(APPEND ALL_SRC_ASM_NS "${PLATFORM_DIR}/target/cypress/psoc64/Device/Source/iar/startup_psoc64_ns.s")
   else()
     message(FATAL_ERROR "No startup file is available for compiler '${CMAKE_C_COMPILER_ID}'.")
   endif()