SPM: Fix Musca_B1 Regression Test Issue

The 'TFM_SP_CORE_TEST' declares FPGA IO, while Musca_B1 doesn't
have such a peripheral. Therefore Musca_B1 defines a dummy NULL
peripheral instance for this peripheral, but HAL API does not
accept a NULL peripheral instance and it triggers a panic.

Skip init a NULL peripheral instance at current. Eventually,
this 'TFM_SP_CORE_TEST' should be bound to the platform.

Change-Id: I8160830a5d56c950e19dbb8c68aed8cc84fa43fd
Signed-off-by: Ken Liu <Ken.Liu@arm.com>
diff --git a/secure_fw/spm/cmsis_psa/spm_ipc.c b/secure_fw/spm/cmsis_psa/spm_ipc.c
index b3fd61c..1642626 100644
--- a/secure_fw/spm/cmsis_psa/spm_ipc.c
+++ b/secure_fw/spm/cmsis_psa/spm_ipc.c
@@ -761,6 +761,21 @@
 
             platform_data_p = POSITION_TO_PTR(p_asset_load[i].dev.addr_ref,
                                               struct platform_data_t *);
+
+            /*
+             * TODO: some partitions declare MMIO not exist on specific
+             * platforms, and the platform defines a dummy NULL reference
+             * for these MMIO items, which cause 'nassets' to contain several
+             * NULL items. Skip these NULL items initialization temporarily to
+             * avoid HAL API panic.
+             * Eventually, these platform-specific partitions need to be moved
+             * into a platform-specific folder. Then this workaround can be
+             * removed.
+             */
+            if (!platform_data_p) {
+                continue;
+            }
+
 #ifdef TFM_FIH_PROFILE_ON
             FIH_CALL(tfm_spm_hal_configure_default_isolation, fih_rc, part_idx,
                      platform_data_p);