Refactor ARMv8.3 Pointer Authentication support code
[project/bcm63xx/atf.git] / bl2 / aarch64 / bl2_entrypoint.S
index 5e5b83b1d55616abe462100608ee72d22fb76362..a021e424a8025d480ccc339ad7fc2555a2d4a9fa 100644 (file)
@@ -117,22 +117,13 @@ func bl2_entrypoint
        mov     x3, x23
        bl      bl2_setup
 
-       /* ---------------------------------------------
-        * Enable pointer authentication
-        * ---------------------------------------------
-        */
 #if ENABLE_PAUTH
-       mrs     x0, sctlr_el1
-       orr     x0, x0, #SCTLR_EnIA_BIT
-#if ENABLE_BTI
        /* ---------------------------------------------
-        * Enable PAC branch type compatibility
+        * Program APIAKey_EL1
+        * and enable pointer authentication.
         * ---------------------------------------------
         */
-       bic     x0, x0, #(SCTLR_BT0_BIT | SCTLR_BT1_BIT)
-#endif /* ENABLE_BTI */
-       msr     sctlr_el1, x0
-       isb
+       bl      pauth_init_enable_el1
 #endif /* ENABLE_PAUTH */
 
        /* ---------------------------------------------