cmn_plat_util.h 962 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2015 - 2020, Broadcom
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef CMN_PLAT_UTIL_H
  7. #define CMN_PLAT_UTIL_H
  8. #include <lib/mmio.h>
  9. /* BOOT source */
  10. #define BOOT_SOURCE_MASK 7
  11. #define BOOT_SOURCE_QSPI 0
  12. #define BOOT_SOURCE_NAND 1
  13. #define BOOT_SOURCE_SPI_NAND 2
  14. #define BOOT_SOURCE_UART 3
  15. #define BOOT_SOURCE_RES4 4
  16. #define BOOT_SOURCE_EMMC 5
  17. #define BOOT_SOURCE_ATE 6
  18. #define BOOT_SOURCE_USB 7
  19. #define BOOT_SOURCE_MAX 8
  20. #define BOOT_SOURCE_UNKNOWN (-1)
  21. #define KHMAC_SHA256_KEY_SIZE 32
  22. #define SOFT_PWR_UP_RESET_L0 0
  23. #define SOFT_SYS_RESET_L1 1
  24. #define SOFT_RESET_L3 0x3
  25. #define BOOT_SOURCE_SOFT_DATA_OFFSET 8
  26. #define BOOT_SOURCE_SOFT_ENABLE_OFFSET 14
  27. #define BOOT_SOURCE_SOFT_ENABLE_MASK BIT(BOOT_SOURCE_SOFT_ENABLE_OFFSET)
  28. typedef struct _key {
  29. uint8_t hmac_sha256[KHMAC_SHA256_KEY_SIZE];
  30. } cmn_key_t;
  31. uint32_t boot_source_get(void);
  32. void bl1_platform_wait_events(void);
  33. void plat_soft_reset(uint32_t reset);
  34. #endif