ls1046a_helpers.S 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * Copyright 2018-2022 NXP
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #include <arch.h>
  8. #include <asm_macros.S>
  9. #include <platform_def.h>
  10. .globl plat_secondary_cold_boot_setup
  11. .globl plat_is_my_cpu_primary
  12. .globl plat_reset_handler
  13. .globl platform_mem_init
  14. func platform_mem1_init
  15. ret
  16. endfunc platform_mem1_init
  17. func platform_mem_init
  18. ret
  19. endfunc platform_mem_init
  20. func l2_mem_init
  21. /* Initialize the L2 RAM latency */
  22. mrs x1, S3_1_c11_c0_2
  23. mov x0, #0x1C7
  24. /* Clear L2 Tag RAM latency and L2 Data RAM latency */
  25. bic x1, x1, x0
  26. /* Set L2 data ram latency bits [2:0] */
  27. orr x1, x1, #0x2
  28. /* set L2 tag ram latency bits [8:6] */
  29. orr x1, x1, #0x80
  30. msr S3_1_c11_c0_2, x1
  31. isb
  32. ret
  33. endfunc l2_mem_init
  34. func apply_platform_errata
  35. ret
  36. endfunc apply_platform_errata
  37. func plat_reset_handler
  38. mov x29, x30
  39. #if (defined(IMAGE_BL2) && RESET_TO_BL2)
  40. bl l2_mem_init
  41. #endif
  42. bl apply_platform_errata
  43. #if defined(IMAGE_BL31)
  44. ldr x0, =POLICY_SMMU_PAGESZ_64K
  45. cbz x0, 1f
  46. /* Set the SMMU page size in the SACR register */
  47. bl _set_smmu_pagesz_64
  48. #endif
  49. 1:
  50. /*
  51. * May be cntfrq_el0 needs to be assigned
  52. * the value COUNTER_FREQUENCY
  53. */
  54. mov x30, x29
  55. ret
  56. endfunc plat_reset_handler
  57. /*
  58. * void plat_secondary_cold_boot_setup (void);
  59. *
  60. * This function performs any platform specific actions
  61. * needed for a secondary cpu after a cold reset e.g
  62. * mark the cpu's presence, mechanism to place it in a
  63. * holding pen etc.
  64. */
  65. func plat_secondary_cold_boot_setup
  66. /* ls1046a does not do cold boot for secondary CPU */
  67. cb_panic:
  68. b cb_panic
  69. endfunc plat_secondary_cold_boot_setup
  70. /*
  71. * unsigned int plat_is_my_cpu_primary (void);
  72. *
  73. * Find out whether the current cpu is the primary cpu.
  74. */
  75. func plat_is_my_cpu_primary
  76. mrs x0, mpidr_el1
  77. and x0, x0, #(MPIDR_CLUSTER_MASK | MPIDR_CPU_MASK)
  78. cmp x0, 0x0
  79. cset w0, eq
  80. ret
  81. endfunc plat_is_my_cpu_primary