Merge pull request #1176 from wjliang/zynqmp-ipi-mb-svc

plat: xilinx: Add ZynqMP IPI mailbox service [v4]
diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk
index e1bfbbe..a4fbc5a 100644
--- a/make_helpers/build_macros.mk
+++ b/make_helpers/build_macros.mk
@@ -101,7 +101,7 @@
 # FIP_ADD_PAYLOAD appends the command line arguments required by fiptool
 # to package a new payload. Optionally, it adds the dependency on this payload
 #   $(1) = payload filename (i.e. bl31.bin)
-#   $(2) = command line option for the specified payload (i.e. --bl31)
+#   $(2) = command line option for the specified payload (i.e. --soc-fw)
 #   $(3) = fip target dependency (optional) (i.e. bl31)
 define FIP_ADD_PAYLOAD
     $(eval FIP_ARGS += $(2) $(1))
@@ -121,14 +121,15 @@
 # using a build option. It also adds a dependency on the image file, aborting
 # the build if the file does not exist.
 #   $(1) = build option to specify the image filename (SCP_BL2, BL33, etc)
-#   $(2) = command line option for fiptool (scp_bl2, bl33, etc)
+#   $(2) = command line option for fiptool (--scp-fw, --nt-fw, etc)
 # Example:
-#   $(eval $(call FIP_ADD_IMG,BL33,--bl33))
+#   $(eval $(call FIP_ADD_IMG,BL33,--nt-fw))
 define FIP_ADD_IMG
     CRT_DEPS += check_$(1)
     FIP_DEPS += check_$(1)
     $(call FIP_ADD_PAYLOAD,$(value $(1)),$(2))
 
+.PHONY: check_$(1)
 check_$(1):
 	$$(if $(value $(1)),,$$(error "Platform '${PLAT}' requires $(1). Please set $(1) to point to the right file"))
 endef
@@ -154,14 +155,15 @@
 
 # FWU_FIP_ADD_IMG allows the platform to pack a binary image in the FWU FIP
 #   $(1) build option to specify the image filename (BL2U, NS_BL2U, etc)
-#   $(2) command line option for fiptool (bl2u, ns_bl2u, etc)
+#   $(2) command line option for fiptool (--ap-fwu-cfg, --fwu, etc)
 # Example:
-#   $(eval $(call FWU_FIP_ADD_IMG,BL2U,--bl2u))
+#   $(eval $(call FWU_FIP_ADD_IMG,BL2U,--ap-fwu-cfg))
 define FWU_FIP_ADD_IMG
     FWU_CRT_DEPS += check_$(1)
     FWU_FIP_DEPS += check_$(1)
     $(call FWU_FIP_ADD_PAYLOAD,$(value $(1)),$(2))
 
+.PHONY: check_$(1)
 check_$(1):
 	$$(if $(value $(1)),,$$(error "Platform '${PLAT}' requires $(1). Please set $(1) to point to the right file"))
 endef
diff --git a/plat/hisilicon/hikey/platform.mk b/plat/hisilicon/hikey/platform.mk
index 18b5e15..524fa6a 100644
--- a/plat/hisilicon/hikey/platform.mk
+++ b/plat/hisilicon/hikey/platform.mk
@@ -120,3 +120,5 @@
 ERRATA_A53_836870		:=	1
 ERRATA_A53_843419		:=	1
 ERRATA_A53_855873		:=	1
+
+FIP_ALIGN			:=	512
diff --git a/plat/hisilicon/hikey960/hikey960_bl1_setup.c b/plat/hisilicon/hikey960/hikey960_bl1_setup.c
index 6dfada7..ae33bd2 100644
--- a/plat/hisilicon/hikey960/hikey960_bl1_setup.c
+++ b/plat/hisilicon/hikey960/hikey960_bl1_setup.c
@@ -519,6 +519,11 @@
 	set_audio_power_up();
 	set_pcie_power_up();
 	set_isp_srt_power_up();
+
+	/* set ISP_CORE_CTRL_S to unsecure mode */
+	mmio_write_32(0xe8583800, 0x7);
+	/* set ISP_SUB_CTRL_S to unsecure mode */
+	mmio_write_32(0xe8583804, 0xf);
 }
 
 static void hikey960_ufs_reset(void)
diff --git a/plat/hisilicon/hikey960/platform.mk b/plat/hisilicon/hikey960/platform.mk
index 695f092..cb97deb 100644
--- a/plat/hisilicon/hikey960/platform.mk
+++ b/plat/hisilicon/hikey960/platform.mk
@@ -101,3 +101,5 @@
 ERRATA_A53_836870		:=	1
 ERRATA_A53_843419		:=	1
 ERRATA_A53_855873		:=	1
+
+FIP_ALIGN			:=	512