summaryrefslogtreecommitdiff
path: root/plat/arm/css
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2015-04-13 11:47:48 +0100
committerDan Handley <dan.handley@arm.com>2015-04-28 19:50:57 +0100
commit556b966fa2e58f6a468d3406f85344ece79e27cd (patch)
treee44c9d7bff73d9b3575e7865820199f475cffbfd /plat/arm/css
parente234ba038b0b997bd4325dad384deab5863babdd (diff)
Detect SCP version incompatibility
There has been a breaking change in the communication protocols used between the AP cores and the SCP on CSS based platforms like Juno. This means both the AP Trusted Firmware and SCP firmware must be updated at the same time. In case the user forgets to update the SCP ROM firmware, this patch detects when it still uses the previous version of the communication protocol. It will then output a comprehensive error message that helps trouble-shoot the issue. Change-Id: I7baf8f05ec0b7d8df25e0ee53df61fe7be0207c2
Diffstat (limited to 'plat/arm/css')
-rw-r--r--plat/arm/css/common/css_common.mk8
-rw-r--r--plat/arm/css/common/css_scp_bootloader.c18
2 files changed, 26 insertions, 0 deletions
diff --git a/plat/arm/css/common/css_common.mk b/plat/arm/css/common/css_common.mk
index edbfe1e4..1b0404b7 100644
--- a/plat/arm/css/common/css_common.mk
+++ b/plat/arm/css/common/css_common.mk
@@ -53,3 +53,11 @@ ifneq (${RESET_TO_BL31},0)
endif
NEED_BL30 := yes
+
+# Enable option to detect whether the SCP ROM firmware in use predates version
+# 1.7.0 and therefore, is incompatible.
+CSS_DETECT_PRE_1_7_0_SCP := 1
+
+# Process CSS_DETECT_PRE_1_7_0_SCP flag
+$(eval $(call assert_boolean,CSS_DETECT_PRE_1_7_0_SCP))
+$(eval $(call add_define,CSS_DETECT_PRE_1_7_0_SCP))
diff --git a/plat/arm/css/common/css_scp_bootloader.c b/plat/arm/css/common/css_scp_bootloader.c
index c6d63f29..6cf1667c 100644
--- a/plat/arm/css/common/css_scp_bootloader.c
+++ b/plat/arm/css/common/css_scp_bootloader.c
@@ -148,6 +148,24 @@ int scp_bootloader_transfer(void *image, unsigned int image_size)
cmd_info_payload->checksum = checksum;
scp_boot_message_send(sizeof(*cmd_info_payload));
+#if CSS_DETECT_PRE_1_7_0_SCP
+ {
+ const uint32_t deprecated_scp_nack_cmd = 0x404;
+ uint32_t mhu_status;
+
+ VERBOSE("Detecting SCP version incompatibility\n");
+
+ mhu_status = mhu_secure_message_wait();
+ if (mhu_status == deprecated_scp_nack_cmd) {
+ ERROR("Detected an incompatible version of the SCP firmware.\n");
+ ERROR("Only versions from v1.7.0 onwards are supported.\n");
+ ERROR("Please update the SCP firmware.\n");
+ return -1;
+ }
+
+ VERBOSE("SCP version looks OK\n");
+ }
+#endif /* CSS_DETECT_PRE_1_7_0_SCP */
response = scp_boot_message_wait(sizeof(response));
scp_boot_message_end();