From c7e2b6d140225dd0c76a38060b7ed8fb4ef10e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Tue, 16 Jun 2020 11:25:01 +0300 Subject: lib/reg_script: Add guards for MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Header and implementation only present for ARCH_X86 stages. Change-Id: I4b28e666a8a60bd0365cda8d7affa1eb063c4690 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/42416 Reviewed-by: Aaron Durbin Reviewed-by: Furquan Shaikh Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/lib/reg_script.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/reg_script.c b/src/lib/reg_script.c index 51ef689ac9..e0ae68cd0e 100644 --- a/src/lib/reg_script.c +++ b/src/lib/reg_script.c @@ -1,6 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#include #include #include #include @@ -15,6 +14,13 @@ #include #endif +#if ENV_X86 +#include +#define HAS_ARCH_IO 1 +#else +#define HAS_ARCH_IO 0 +#endif + #define HAS_IOSF (CONFIG(SOC_INTEL_BAYTRAIL)) #if HAS_IOSF @@ -104,6 +110,7 @@ static void reg_script_write_pci(struct reg_script_context *ctx) } } +#if HAS_ARCH_IO static uint32_t reg_script_read_io(struct reg_script_context *ctx) { const struct reg_script *step = reg_script_get_step(ctx); @@ -135,6 +142,7 @@ static void reg_script_write_io(struct reg_script_context *ctx) break; } } +#endif static uint32_t reg_script_read_mmio(struct reg_script_context *ctx) { @@ -441,10 +449,12 @@ static uint64_t reg_script_read(struct reg_script_context *ctx) ctx->display_prefix = "PCI"; value = reg_script_read_pci(ctx); break; +#if HAS_ARCH_IO case REG_SCRIPT_TYPE_IO: ctx->display_prefix = "IO"; value = reg_script_read_io(ctx); break; +#endif case REG_SCRIPT_TYPE_MMIO: ctx->display_prefix = "MMIO"; value = reg_script_read_mmio(ctx); @@ -495,10 +505,12 @@ static void reg_script_write(struct reg_script_context *ctx) ctx->display_prefix = "PCI"; reg_script_write_pci(ctx); break; +#if HAS_ARCH_IO case REG_SCRIPT_TYPE_IO: ctx->display_prefix = "IO"; reg_script_write_io(ctx); break; +#endif case REG_SCRIPT_TYPE_MMIO: ctx->display_prefix = "MMIO"; reg_script_write_mmio(ctx); -- cgit v1.2.3