summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorLee Leahy <leroy.p.leahy@intel.com>2016-04-29 15:07:19 -0700
committerLeroy P Leahy <leroy.p.leahy@intel.com>2016-05-04 19:21:40 +0200
commit564dc9c7c89a94ff1b7803ef9937ca4f0dd95809 (patch)
tree93b3d344c243d8a0c48bdd8f7b23d0e8a45cfdc5 /src/include
parentd3fccfbc41988b110d6861f53ee3b8908e90e422 (diff)
lib/reg_script: Add display support
Add the ability to enable the display of the script: * Added REG_SCRIPT_COMMAND_DISPLAY to enable and disable display output * Added context values to manage display support * display_state - Updated by the command to enable or disable display * display_features - May be updated by step routine to control what the step displays for register and value * display_prefix - Prefix to display before register data * Added REG_SCRIPT_DISPLAY_ON and REG_SCRIPT_DISPLAY_OFF macros to control the display from the register script * Added REG_SCRIPT_DISPLAY_REGISTER and REG_SCRIPT_DISPLAY_VALUE as two features of the common display. With these features enabled the following is output: * Write: <optional prefix> register <-- value * Read: <optional prefix> register --> value TEST=Build and run on Galileo Gen2 Change-Id: If0d4d61ed8ef48ec20082b327f358fd1987e3fb9 Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com> Reviewed-on: https://review.coreboot.org/14553 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/reg_script.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/include/reg_script.h b/src/include/reg_script.h
index da01481c3f..d7ed326af3 100644
--- a/src/include/reg_script.h
+++ b/src/include/reg_script.h
@@ -47,6 +47,10 @@ enum {
REG_SCRIPT_COMMAND_POLL,
REG_SCRIPT_COMMAND_SET_DEV,
REG_SCRIPT_COMMAND_NEXT,
+ REG_SCRIPT_COMMAND_DISPLAY,
+
+ /* Insert new types above this comment */
+
REG_SCRIPT_COMMAND_END,
};
@@ -92,6 +96,9 @@ struct reg_script_context {
device_t dev;
struct resource *res;
const struct reg_script *step;
+ uint8_t display_state; /* Only modified by reg_script_run_step */
+ uint8_t display_features; /* Step routine modifies to control display */
+ const char *display_prefix; /* Prefix tag to display */
};
struct reg_script_bus_entry {
@@ -132,6 +139,21 @@ struct reg_script_bus_entry {
.res_index = res_index_, \
}
+/* Display control */
+#define REG_SCRIPT_DISPLAY_ALL 0xff
+#define REG_SCRIPT_DISPLAY_REGISTER 0x02
+#define REG_SCRIPT_DISPLAY_VALUE 0x01
+#define REG_SCRIPT_DISPLAY_NOTHING 0
+
+#define REG_SCRIPT_DISPLAY_OFF \
+ { .command = REG_SCRIPT_COMMAND_DISPLAY, \
+ .value = REG_SCRIPT_DISPLAY_NOTHING, \
+ }
+#define REG_SCRIPT_DISPLAY_ON \
+ { .command = REG_SCRIPT_COMMAND_DISPLAY, \
+ .value = REG_SCRIPT_DISPLAY_ALL, \
+ }
+
/*
* PCI
*/