CFR: Add min/max/step values and hex display flag for number options

This commit adds support for minimum/maximum limit values as well as
step sizes for CFR number options. Additionally, add a new flag that
specifies the option should be displayed in hexadecimal notation instead
of decimal.

Change-Id: I2e70f1430fb1911f1ad974832f8abfe76f928ac3
Signed-off-by: Filip Brozovic <fbrozovic@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86039
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Filip Brozovic 2025-01-21 12:02:10 +01:00 committed by Matt DeVillier
commit 3a6481aeb2
3 changed files with 30 additions and 6 deletions

View file

@ -121,6 +121,15 @@ struct __packed lb_cfr_enum_value {
*/
};
/*
* The optional flags describe how a numeric option is to be displayed.
* CFR_NUM_OPT_DISPFLAG_HEX:
* Displays a NUMBER option in hexadecimal instead of decimal notation.
*/
enum cfr_numeric_option_display_flags {
CFR_NUM_OPT_DISPFLAG_HEX = 1 << 0,
};
/* Supports multiple option types: ENUM, NUMBER, BOOL */
struct __packed lb_cfr_numeric_option {
uint32_t tag; /*
@ -134,6 +143,11 @@ struct __packed lb_cfr_numeric_option {
*/
uint32_t flags; /* enum cfr_option_flags */
uint32_t default_value;
uint32_t min;
uint32_t max;
uint32_t step;
uint32_t display_flags; /* enum cfr_numeric_option_display_flags */
/*
* struct lb_cfr_varbinary opt_name
* struct lb_cfr_varbinary ui_name