ethosn_npu.mk 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #
  2. # Copyright (c) 2023, Arm Limited. All rights reserved.
  3. #
  4. # SPDX-License-Identifier: BSD-3-Clause
  5. #
  6. # Arm(R) Ethos(TM)-N NPU SiP service
  7. ETHOSN_NPU_DRIVER := 0
  8. $(eval $(call assert_boolean,ETHOSN_NPU_DRIVER))
  9. $(eval $(call add_define,ETHOSN_NPU_DRIVER))
  10. #Ethos-N NPU TZMP1
  11. ETHOSN_NPU_TZMP1 := 0
  12. $(eval $(call assert_boolean,ETHOSN_NPU_TZMP1))
  13. $(eval $(call add_define,ETHOSN_NPU_TZMP1))
  14. ifeq (${ETHOSN_NPU_TZMP1},1)
  15. ifeq (${ETHOSN_NPU_DRIVER},0)
  16. $(error "ETHOSN_NPU_TZMP1 is only available if ETHOSN_NPU_DRIVER=1)
  17. endif
  18. ifeq (${PLAT},juno)
  19. $(eval $(call add_define,JUNO_ETHOSN_TZMP1))
  20. else
  21. $(error "ETHOSN_NPU_TZMP1 only supported on Juno platform, not ", ${PLAT})
  22. endif
  23. ifeq (${TRUSTED_BOARD_BOOT},0)
  24. # We rely on TRUSTED_BOARD_BOOT to prevent the firmware code from being
  25. # tampered with, which is required to protect the confidentiality of protected
  26. # inference data.
  27. $(error "ETHOSN_NPU_TZMP1 is only available if TRUSTED_BOARD_BOOT is enabled)
  28. endif
  29. # We need the FW certificate and key certificate
  30. $(eval $(call TOOL_ADD_PAYLOAD,${BUILD_PLAT}/npu_fw_key.crt,--npu-fw-key-cert))
  31. $(eval $(call TOOL_ADD_PAYLOAD,${BUILD_PLAT}/npu_fw_content.crt,--npu-fw-cert))
  32. # We need the firmware to be built into the FIP
  33. $(eval $(call TOOL_ADD_IMG,ETHOSN_NPU_FW,--npu-fw))
  34. # Needed for our OIDs to be available in tbbr_cot_bl2.c
  35. $(eval $(call add_define, PLAT_DEF_OID))
  36. # Needed so that UUIDs from the FIP are available in BL2
  37. $(eval $(call add_define,PLAT_DEF_FIP_UUID))
  38. PLAT_INCLUDES += -I${PLAT_DIR}certificate/include
  39. PLAT_INCLUDES += -Iinclude/drivers/arm/
  40. PLAT_INCLUDES += -I${PLAT_DIR}fip
  41. endif