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/lib/Makefile.inc | 36 ----------------------------------- 1 file changed, 36 deletions(-) delete mode 100644 src/arch/arm64/armv8/lib/Makefile.inc (limited to 'src/arch/arm64/armv8/lib/Makefile.inc') diff --git a/src/arch/arm64/armv8/lib/Makefile.inc b/src/arch/arm64/armv8/lib/Makefile.inc deleted file mode 100644 index 8fc44de5b6..0000000000 --- a/src/arch/arm64/armv8/lib/Makefile.inc +++ /dev/null @@ -1,36 +0,0 @@ -################################################################################ -## This file is part of the coreboot project. -## -## Copyright (C) 2014 Google Inc -## -## This program is free software; you can redistribute it and/or -## modify it under the terms of the GNU General Public License as -## published by the Free Software Foundation; version 2 of -## the License. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -################################################################################ - -lib_access = pstate.c sysctrl.c cache.c tlb.c - -ifeq ($(CONFIG_ARCH_BOOTBLOCK_ARMV8_64),y) -decompressor-y += $(lib_access) -bootblock-y += $(lib_access) -endif - -ifeq ($(CONFIG_ARCH_VERSTAGE_ARMV8_64),y) -verstage-y += $(lib_access) -endif - -ifeq ($(CONFIG_ARCH_ROMSTAGE_ARMV8_64),y) -romstage-y += $(lib_access) -endif - -ifeq ($(CONFIG_ARCH_RAMSTAGE_ARMV8_64),y) -ramstage-y += $(lib_access) - -endif -- cgit v1.2.3