diff options
author | Werner Zeh <werner.zeh@siemens.com> | 2016-02-19 10:02:49 +0100 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2016-02-22 19:25:28 +0100 |
commit | 9d0215363d710f7a3303724ad7a369e4a2dd2d36 (patch) | |
tree | c4e4ad0e13a14c14e460631ff2f3d1f9d1066053 /src/lib | |
parent | a05d03322607fd04f996050c267f01a6c3cc0c1b (diff) |
fsp_baytrail: Add full support for iosf access in reg_script
Add all needed functions to fsp_baytrail so that reg_script can
do full iosf access. To keep it simple, this patch synchronises
iosf access between baytrail and fsp_baytrail.
Change-Id: Ic7f52d7d90c0fe3560fa5a5d96f7fc15062d66d1
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/13742
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/reg_script.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/lib/reg_script.c b/src/lib/reg_script.c index bcfb6c5fbe..7f8200006e 100644 --- a/src/lib/reg_script.c +++ b/src/lib/reg_script.c @@ -26,7 +26,10 @@ #include <cpu/x86/msr.h> #endif -#if CONFIG_SOC_INTEL_BAYTRAIL +#define HAS_IOSF (IS_ENABLED(CONFIG_SOC_INTEL_BAYTRAIL) || \ + IS_ENABLED(CONFIG_SOC_INTEL_FSP_BAYTRAIL)) + +#if HAS_IOSF #include <soc/iosf.h> /* TODO: wrap in <soc/reg_script.h, remove #ifdef? */ #endif @@ -233,7 +236,7 @@ static void reg_script_write_res(struct reg_script_context *ctx) reg_script_set_step(ctx, step); } -#if CONFIG_SOC_INTEL_BAYTRAIL +#if HAS_IOSF static uint32_t reg_script_read_iosf(struct reg_script_context *ctx) { const struct reg_script *step = reg_script_get_step(ctx); @@ -363,7 +366,7 @@ static void reg_script_write_iosf(struct reg_script_context *ctx) break; } } -#endif +#endif /* HAS_IOSF */ static uint64_t reg_script_read_msr(struct reg_script_context *ctx) @@ -435,10 +438,10 @@ static uint64_t reg_script_read(struct reg_script_context *ctx) return reg_script_read_res(ctx); case REG_SCRIPT_TYPE_MSR: return reg_script_read_msr(ctx); -#if CONFIG_SOC_INTEL_BAYTRAIL +#if HAS_IOSF case REG_SCRIPT_TYPE_IOSF: return reg_script_read_iosf(ctx); -#endif +#endif /* HAS_IOSF */ default: #ifndef __PRE_RAM__ { @@ -478,11 +481,11 @@ static void reg_script_write(struct reg_script_context *ctx) case REG_SCRIPT_TYPE_MSR: reg_script_write_msr(ctx); break; -#if CONFIG_SOC_INTEL_BAYTRAIL +#if HAS_IOSF case REG_SCRIPT_TYPE_IOSF: reg_script_write_iosf(ctx); break; -#endif +#endif /* HAS_IOSF */ default: #ifndef __PRE_RAM__ { |