plat_secondary.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <common/debug.h>
  7. #include <lib/mmio.h>
  8. #include <pmc.h>
  9. #include <tegra_def.h>
  10. #define SB_CSR 0x0
  11. #define SB_CSR_NS_RST_VEC_WR_DIS (1 << 1)
  12. /* CPU reset vector */
  13. #define SB_AA64_RESET_LOW 0x30 /* width = 31:0 */
  14. #define SB_AA64_RESET_HI 0x34 /* width = 11:0 */
  15. extern void tegra_secure_entrypoint(void);
  16. /*******************************************************************************
  17. * Setup secondary CPU vectors
  18. ******************************************************************************/
  19. void plat_secondary_setup(void)
  20. {
  21. uint32_t val;
  22. uint64_t reset_addr = (uint64_t)tegra_secure_entrypoint;
  23. INFO("Setting up secondary CPU boot\n");
  24. /* setup secondary CPU vector */
  25. mmio_write_32(TEGRA_SB_BASE + SB_AA64_RESET_LOW,
  26. (reset_addr & 0xFFFFFFFF) | 1);
  27. val = reset_addr >> 32;
  28. mmio_write_32(TEGRA_SB_BASE + SB_AA64_RESET_HI, val & 0x7FF);
  29. /* configure PMC */
  30. tegra_pmc_cpu_setup(reset_addr);
  31. tegra_pmc_lock_cpu_vectors();
  32. }