Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd5f6dc3 authored by Jingoo Han's avatar Jingoo Han Committed by Catalin Marinas
Browse files

arm64: mm: use ubfm for dcache_line_size



Use 'ubfm' for the bitfield move instruction; thus, single
instruction can be used instead of two instructions, when
getting the minimum D-cache line size from CTR_EL0 register.

Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Acked-by: default avatarWill Deacon <will.deacon@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 883c0573
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -38,8 +38,7 @@
 */
 */
	.macro	dcache_line_size, reg, tmp
	.macro	dcache_line_size, reg, tmp
	mrs	\tmp, ctr_el0			// read CTR
	mrs	\tmp, ctr_el0			// read CTR
	lsr	\tmp, \tmp, #16
	ubfm	\tmp, \tmp, #16, #19		// cache line size encoding
	and	\tmp, \tmp, #0xf		// cache line size encoding
	mov	\reg, #4			// bytes per word
	mov	\reg, #4			// bytes per word
	lsl	\reg, \reg, \tmp		// actual cache line size
	lsl	\reg, \reg, \tmp		// actual cache line size
	.endm
	.endm