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>
This commit is contained in:
Werner Zeh
2016-02-19 10:02:49 +01:00
committed by Martin Roth
parent a05d033226
commit 9d0215363d
4 changed files with 349 additions and 9 deletions

View File

@ -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__
{