From e819c857607bb4a1c2911e2073aa588f74789ee1 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Mon, 6 Aug 2018 13:50:38 -0700 Subject: arm64: Turn architectural register accessors into inline functions Accesses to architectural registers should be really fast -- they're just registers, after all. In fact, the arm64 architecture uses them for some timing-senstive uses like the architectural timer. A read should be: one instruction, no data dependencies, done. However, our current coreboot framework wraps each of these accesses into a separate function. Suddenly you have to spill registers on a stack, make a function call, move your stack pointer, etc. When running without MMU this adds a significant enough delay to cause timing problems when bitbanging a UART on SDM845. This patch replaces all those existing functions with static inline definitions in the header so they will get reduced to a single instruction as they should be. Also use some macros to condense the code a little since they're all so regular, which should make it easier to add more in the future. This patch also expands all the data types to uint64_t since that's what the actual assembly instruction accesses, even if the register itself only has 32 bits (the others will be ignored by the processor and set to 0 on read). Arm regularly expands registers as they add new bit fields to them with newer iterations of the architecture anyway, so this just prepares us for the inevitable. Change-Id: I2c41cc3ce49ee26bf12cd34e3d0509d8e61ffc63 Signed-off-by: Julius Werner Reviewed-on: https://review.coreboot.org/27881 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Patrick Rudolph Reviewed-by: Aaron Durbin --- src/arch/arm64/armv8/Makefile.inc | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/arch/arm64/armv8/Makefile.inc') diff --git a/src/arch/arm64/armv8/Makefile.inc b/src/arch/arm64/armv8/Makefile.inc index db7bd33793..44ebdef815 100644 --- a/src/arch/arm64/armv8/Makefile.inc +++ b/src/arch/arm64/armv8/Makefile.inc @@ -15,8 +15,6 @@ ## ################################################################################ -subdirs-y += lib/ - ifeq ($(CONFIG_ARCH_ARMV8_EXTENSION),0) march = armv8-a else -- cgit v1.2.3