[coreboot-gerrit] New patch to review for coreboot: soc/intel/quark: Add script time delay support

Leroy P Leahy (leroy.p.leahy@intel.com) gerrit at coreboot.org
Sat Apr 30 02:57:13 CEST 2016


Leroy P Leahy (leroy.p.leahy at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14555

-gerrit

commit dcf9a366e47ca1856035d79b55d496a45a2db815
Author: Lee Leahy <leroy.p.leahy at intel.com>
Date:   Fri Apr 29 16:36:02 2016 -0700

    soc/intel/quark: Add script time delay support
    
    Add time delay support to the scripts.
    
    TEST=Build and run on Galileo Gen2
    
    Change-Id: I2c87977e2a2547e00769e59e1ee81fbbb5dff33f
    Signed-off-by: Lee Leahy <leroy.p.leahy at intel.com>
---
 src/soc/intel/quark/include/soc/reg_access.h | 6 ++++++
 src/soc/intel/quark/reg_access.c             | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/src/soc/intel/quark/include/soc/reg_access.h b/src/soc/intel/quark/include/soc/reg_access.h
index 90dea35..b9872f3 100644
--- a/src/soc/intel/quark/include/soc/reg_access.h
+++ b/src/soc/intel/quark/include/soc/reg_access.h
@@ -16,6 +16,7 @@
 #ifndef _QUARK_REG_ACCESS_H_
 #define _QUARK_REG_ACCESS_H_
 
+#include <delay.h>
 #include <fsp/util.h>
 #include <reg_script.h>
 #include <soc/IntelQNCConfig.h>
@@ -25,6 +26,7 @@ enum {
 	USB_PHY_REGS = 1,
 	SOC_UNIT_REGS,
 	RMU_TEMP_REGS,
+	TIME_DELAY,
 };
 
 #if ENV_RAMSTAGE
@@ -79,6 +81,10 @@ enum {
 #define REG_SOC_UNIT_XOR(reg_, value_) \
 	REG_SOC_UNIT_RXW(reg_, 0xffffffff, value_)
 
+/* Time delays */
+#define TIME_DELAY_USEC(value_)   \
+	SOC_ACCESS(WRITE, 0, REG_SCRIPT_SIZE_32, 0, value_, 0, TIME_DELAY)
+
 /* USB register access macros */
 #define REG_USB_ACCESS(cmd_, reg_, mask_, value_, timeout_) \
 	SOC_ACCESS(cmd_, reg_, REG_SCRIPT_SIZE_32, mask_, value_, timeout_, \
diff --git a/src/soc/intel/quark/reg_access.c b/src/soc/intel/quark/reg_access.c
index e304a6d..c044cc1 100644
--- a/src/soc/intel/quark/reg_access.c
+++ b/src/soc/intel/quark/reg_access.c
@@ -156,6 +156,14 @@ static void reg_write(struct reg_script_context *ctx)
 		reg_soc_unit_write(step->reg, (uint32_t)step->value);
 		break;
 
+	case TIME_DELAY:
+		if (reg_script_display) {
+			printk(BIOS_INFO, "Delay %lld uSec\n", step->value);
+			reg_script_display = 0;
+		}
+		udelay(step->value);
+		break;
+
 	case USB_PHY_REGS:
 		if (reg_script_display)
 			printk(BIOS_INFO, "USB PHY: ");



More information about the coreboot-gerrit mailing list