sunxi: video: Fix lvds panel support for sun6i+
[oweals/u-boot.git] / arch / arm / include / asm / macro.h
index 3b3146ab2239929544784c8bf3944ab0d8d60ba8..9bb0efa5ff04e41a345ebc8446ab509dd2c22ae3 100644 (file)
@@ -73,6 +73,28 @@ lr   .req    x30
        b.eq    \el1_label
 .endm
 
+/*
+ * Branch if current processor is a Cortex-A57 core.
+ */
+.macro branch_if_a57_core, xreg, a57_label
+       mrs     \xreg, midr_el1
+       lsr     \xreg, \xreg, #4
+       and     \xreg, \xreg, #0x00000FFF
+       cmp     \xreg, #0xD07           /* Cortex-A57 MPCore processor. */
+       b.eq    \a57_label
+.endm
+
+/*
+ * Branch if current processor is a Cortex-A53 core.
+ */
+.macro branch_if_a53_core, xreg, a53_label
+       mrs     \xreg, midr_el1
+       lsr     \xreg, \xreg, #4
+       and     \xreg, \xreg, #0x00000FFF
+       cmp     \xreg, #0xD03           /* Cortex-A53 MPCore processor. */
+       b.eq    \a53_label
+.endm
+
 /*
  * Branch if current processor is a slave,
  * choose processor with all zero affinity value as the master.
@@ -121,6 +143,9 @@ lr  .req    x30
        mov     \xreg1, #0x33ff
        msr     cptr_el2, \xreg1        /* Disable coprocessor traps to EL2 */
 
+       /* Initialize Generic Timers */
+       msr     cntvoff_el2, xzr
+
        /* Initialize SCTLR_EL2
         *
         * setting RES1 bits (29,28,23,22,18,16,11,5,4) to 1