cpus_on_fixed_addr.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Copyright (c) 2019, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef __CPU_ON_FIXED_ADDR_H__
  7. #define __CPU_ON_FIXED_ADDR_H__
  8. /*****************************************************************************
  9. * define data offset in struct psram_data
  10. *****************************************************************************/
  11. #define PSRAM_DT_SP 0x0
  12. #define PSRAM_DT_DDR_FUNC 0x8
  13. #define PSRAM_DT_DDR_DATA 0x10
  14. #define PSRAM_DT_DDRFLAG 0x18
  15. #define PSRAM_DT_MPIDR 0x1c
  16. #define PSRAM_DT_PM_FLAG 0x20
  17. #define PSRAM_DT_END 0x24
  18. /* reserve 4 byte */
  19. #define PSRAM_DT_END_RES4 (PSRAM_DT_END + 4)
  20. #define PSRAM_DT_SIZE_WORDS (PSRAM_DT_END_RES4 / 4)
  21. #define PM_WARM_BOOT_SHT 0
  22. #define PM_WARM_BOOT_BIT (1 << PM_WARM_BOOT_SHT)
  23. #ifndef __ASSEMBLER__
  24. struct psram_data_t {
  25. uint64_t sp;
  26. uint64_t ddr_func;
  27. uint64_t ddr_data;
  28. uint32_t ddr_flag;
  29. uint32_t boot_mpidr;
  30. uint32_t pm_flag;
  31. };
  32. CASSERT(__builtin_offsetof(struct psram_data_t, sp) == PSRAM_DT_SP,
  33. assert_psram_dt_sp_offset_mistmatch);
  34. CASSERT(__builtin_offsetof(struct psram_data_t, ddr_func) == PSRAM_DT_DDR_FUNC,
  35. assert_psram_dt_ddr_func_offset_mistmatch);
  36. CASSERT(__builtin_offsetof(struct psram_data_t, ddr_data) == PSRAM_DT_DDR_DATA,
  37. assert_psram_dt_ddr_data_offset_mistmatch);
  38. CASSERT(__builtin_offsetof(struct psram_data_t, ddr_flag) == PSRAM_DT_DDRFLAG,
  39. assert_psram_dt_ddr_flag_offset_mistmatch);
  40. CASSERT(__builtin_offsetof(struct psram_data_t, boot_mpidr) == PSRAM_DT_MPIDR,
  41. assert_psram_dt_mpidr_offset_mistmatch);
  42. extern struct psram_data_t sys_sleep_flag_sram;
  43. #endif /* __ASSEMBLER__ */
  44. #endif