plat_secondary.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2015-2018, ARM Limited and Contributors. All rights reserved.
  3. * Copyright (c) 2020, NVIDIA Corporation. All rights reserved.
  4. *
  5. * SPDX-License-Identifier: BSD-3-Clause
  6. */
  7. #include <string.h>
  8. #include <arch_helpers.h>
  9. #include <common/debug.h>
  10. #include <lib/mmio.h>
  11. #include <mce.h>
  12. #include <tegra_def.h>
  13. #include <tegra_private.h>
  14. #define SCRATCH_SECURE_RSV1_SCRATCH_0 0x658U
  15. #define SCRATCH_SECURE_RSV1_SCRATCH_1 0x65CU
  16. #define CPU_RESET_MODE_AA64 1U
  17. /*******************************************************************************
  18. * Setup secondary CPU vectors
  19. ******************************************************************************/
  20. void plat_secondary_setup(void)
  21. {
  22. uint32_t addr_low, addr_high;
  23. INFO("Setting up secondary CPU boot\n");
  24. /* TZDRAM base will be used as the "resume" address */
  25. addr_low = (uintptr_t)&tegra_secure_entrypoint | CPU_RESET_MODE_AA64;
  26. addr_high = (uintptr_t)(((uintptr_t)&tegra_secure_entrypoint >> 32U) & 0x7ffU);
  27. /* save reset vector to be used during SYSTEM_SUSPEND exit */
  28. mmio_write_32(TEGRA_SCRATCH_BASE + SCRATCH_RESET_VECTOR_LO,
  29. addr_low);
  30. mmio_write_32(TEGRA_SCRATCH_BASE + SCRATCH_RESET_VECTOR_HI,
  31. addr_high);
  32. }