summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2023-01-18 18:05:15 +0100
committerJoanna Farley <joanna.farley@arm.com>2023-04-04 11:37:06 +0200
commita2cdbb1df088cde410aea1d5989dfc500aaf7939 (patch)
tree7c711b682846b80219b622cbf0574909430d1235 /drivers
parent33bcaed1211ab27968433b546979687bc1182630 (diff)
downloadarm-trusted-firmware-a2cdbb1df088cde410aea1d5989dfc500aaf7939.tar.gz
feat(ethos-n): add check for NPU in SiP setup
The SiP service in the Arm(R) Ethos(TM)-N NPU driver requires that there is at least one NPU available. If there is no NPU available, the driver is either used incorrectly or the HW config is incorrect. To ensure that the SiP service is not incorrectly used, a setup handler has been added to the service that will validate that there is at least one NPU available. Signed-off-by: Mikael Olsson <mikael.olsson@arm.com> Change-Id: I8139a652f265cfc0db4a37464f39f1fb92868e10
Diffstat (limited to 'drivers')
-rw-r--r--drivers/arm/ethosn/ethosn_smc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/arm/ethosn/ethosn_smc.c b/drivers/arm/ethosn/ethosn_smc.c
index cf3491055..6b1ab85dc 100644
--- a/drivers/arm/ethosn/ethosn_smc.c
+++ b/drivers/arm/ethosn/ethosn_smc.c
@@ -286,3 +286,13 @@ uintptr_t ethosn_smc_handler(uint32_t smc_fid,
SMC_RET1(handle, SMC_UNK);
}
}
+
+int ethosn_smc_setup(void)
+{
+ if (ETHOSN_NUM_DEVICES == 0U) {
+ ERROR("ETHOSN: No NPU found\n");
+ return ETHOSN_FAILURE;
+ }
+
+ return 0;
+}