|
@@ -350,6 +350,24 @@ alternative_endif
|
|
|
#endif
|
|
|
.endm
|
|
|
|
|
|
+/*
|
|
|
+ * tcr_compute_pa_size - set TCR.(I)PS to the highest supported
|
|
|
+ * ID_AA64MMFR0_EL1.PARange value
|
|
|
+ *
|
|
|
+ * tcr: register with the TCR_ELx value to be updated
|
|
|
+ * pos: PARange bitfield position
|
|
|
+ * tmp{0,1}: temporary registers
|
|
|
+ */
|
|
|
+ .macro tcr_compute_pa_size, tcr, pos, tmp0, tmp1
|
|
|
+ mrs \tmp0, ID_AA64MMFR0_EL1
|
|
|
+ // Narrow PARange to fit the PS field in TCR_ELx
|
|
|
+ ubfx \tmp0, \tmp0, #ID_AA64MMFR0_PARANGE_SHIFT, #3
|
|
|
+ mov \tmp1, #ID_AA64MMFR0_PARANGE_MAX
|
|
|
+ cmp \tmp0, \tmp1
|
|
|
+ csel \tmp0, \tmp1, \tmp0, hi
|
|
|
+ bfi \tcr, \tmp0, \pos, #3
|
|
|
+ .endm
|
|
|
+
|
|
|
/*
|
|
|
* Macro to perform a data cache maintenance for the interval
|
|
|
* [kaddr, kaddr + size)
|