summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/fw_config.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/include/fw_config.h b/src/include/fw_config.h
index 7a8ad30482..04fdf98921 100644
--- a/src/include/fw_config.h
+++ b/src/include/fw_config.h
@@ -24,6 +24,11 @@ struct fw_config {
uint64_t value;
};
+struct fw_config_field {
+ const char *field_name;
+ uint64_t mask;
+};
+
/* Generate a pointer to a compound literal of the fw_config structure. */
#define FW_CONFIG(__field, __option) (&(const struct fw_config) { \
.field_name = FW_CONFIG_FIELD_##__field##_NAME, \
@@ -32,6 +37,11 @@ struct fw_config {
.value = FW_CONFIG_FIELD_##__field##_OPTION_##__option##_VALUE \
})
+#define FW_CONFIG_FIELD(__field) (&(const struct fw_config_field) { \
+ .field_name = FW_CONFIG_FIELD_##__field##_NAME, \
+ .mask = FW_CONFIG_FIELD_##__field##_MASK, \
+})
+
/**
* fw_config_get() - Provide firmware configuration value.
*
@@ -42,6 +52,16 @@ uint64_t fw_config_get(void);
#if CONFIG(FW_CONFIG)
/**
+ * fw_config_get_field() - Provide firmware configuration field value.
+ * @field: Structure containing field name and mask
+ *
+ * Return 64bit firmware configuration value determined for the system.
+ * Will return UNDEFINED_FW_CONFIG if unprovisioned, caller should treat
+ * as error value for the case.
+ */
+uint64_t fw_config_get_field(const struct fw_config_field *field);
+
+/**
* fw_config_probe() - Check if field and option matches.
* @match: Structure containing field and option to probe.
*