diff options
author | Julius Werner <jwerner@chromium.org> | 2018-08-06 13:50:38 -0700 |
---|---|---|
committer | Julius Werner <jwerner@chromium.org> | 2018-08-10 04:16:46 +0000 |
commit | e819c857607bb4a1c2911e2073aa588f74789ee1 (patch) | |
tree | 6344dcc7f78397ad89bcc0ae59cdfc0e139cc5c5 /src/arch/arm64/armv8/lib/Makefile.inc | |
parent | 0c5f61a01c3ebaa1c19f9a20d20d4b1353648d7c (diff) |
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 <jwerner@chromium.org>
Reviewed-on: https://review.coreboot.org/27881
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/arch/arm64/armv8/lib/Makefile.inc')
-rw-r--r-- | src/arch/arm64/armv8/lib/Makefile.inc | 36 |
1 files changed, 0 insertions, 36 deletions
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 |