From 9d0215363d710f7a3303724ad7a369e4a2dd2d36 Mon Sep 17 00:00:00 2001 From: Werner Zeh Date: Fri, 19 Feb 2016 10:02:49 +0100 Subject: 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 Reviewed-on: https://review.coreboot.org/13742 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/include/reg_script.h | 5 +- src/lib/reg_script.c | 17 ++- src/soc/intel/fsp_baytrail/include/soc/iosf.h | 155 ++++++++++++++++++++++ src/soc/intel/fsp_baytrail/iosf.c | 181 ++++++++++++++++++++++++++ 4 files changed, 349 insertions(+), 9 deletions(-) diff --git a/src/include/reg_script.h b/src/include/reg_script.h index 691c82cc2c..60b1188b6c 100644 --- a/src/include/reg_script.h +++ b/src/include/reg_script.h @@ -290,7 +290,8 @@ const struct reg_script_bus_entry *platform_bus_table(size_t *table_entries); REG_SCRIPT_RES(POLL, 32, bar_, reg_, mask_, value_, timeout_) -#if CONFIG_SOC_INTEL_BAYTRAIL +#if IS_ENABLED(CONFIG_SOC_INTEL_BAYTRAIL) || \ +IS_ENABLED(CONFIG_SOC_INTEL_FSP_BAYTRAIL) /* * IO Sideband Function */ @@ -310,7 +311,7 @@ const struct reg_script_bus_entry *platform_bus_table(size_t *table_entries); REG_IOSF_RMW(unit_, reg_, 0xffffffff, value_) #define REG_IOSF_POLL(unit_, reg_, mask_, value_, timeout_) \ REG_SCRIPT_IOSF(POLL, unit_, reg_, mask_, value_, timeout_) -#endif /* CONFIG_SOC_INTEL_BAYTRAIL */ +#endif /* CONFIG_SOC_INTEL_BAYTRAIL || CONFIG_SOC_INTEL_FSP_BAYTRAIL*/ /* * CPU Model Specific Register 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 #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 /* TODO: wrap in