103 Commits

Author SHA1 Message Date
Michał Żygowski
f9dc3ce784 DasharoSystemFeaturesUiLib,DasharoVariablesLib: Use FixedPcdGetBool
Use FixedPcdGetBool to emphasize the use of immutable FixedAtBuild PCD.
It will also prevent changing the PCD type later and possibly alter the
behavior of the menu by other modules if something was to change the
PCD type.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2024-06-26 10:53:13 +02:00
Michał Żygowski
539d52fdc5 Library/DasharoSystemFeaturesUiLib: Use disableif for options
Use disableif, which is more convenient for turning off the options
entirely, as it will disable the IFR logic for everything nested under
the disableif. Unlike supressif, disableif is evaluated only once. It
saves time for the processing and will prevent some undesired behavior
from occurring, such as a default value not correctly set for the
hidden option and causing an IFR logic to fail in bounds check, etc.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2024-06-26 10:50:07 +02:00
Michał Żygowski
49f52026fa Library/DasharoSystemFeaturesUiLib: Write variables only for enabled options
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2024-06-26 10:49:24 +02:00
Michał Żygowski
1a488a4da5 Rework the CPU throttling variables and setup UI management
The CPU throttling used an excessive number of variables. The allowed
range of values should be fixed at build, saving it as a NV variable
makes no sense.

Simplify the logic of the CPU throttling range, gaining a better UX
than some error popups. Instead of setting the temperature, set the
offset which has a fixed allowed range. Display the current threshold
temperatue as grayed out fields instead.

Also add PCD to control the default value of the throttling offset.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2024-06-20 14:38:26 +02:00
Michał Żygowski
56fdb7be4e DasharoSystemFeaturesUiLib: Add options for downcoring and HT
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2024-06-18 14:07:00 +02:00
Michał Żygowski
613d290179 Library/DasharoSystemFeaturesUiLib: Change serial port option prompts
Use the IBM PC serial port naming in the option prompts.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2024-06-14 17:02:45 +02:00
Sergii Dmytruk
df259adcbe DasharoSystemFeaturesUiLib: fix watchdog not being reset to default
Combination of `RESET_REQUIRED` flag and set `questionid` isn't enough
to get callback call, `INTERACTIVE` flag is required as well.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2024-06-11 00:11:19 +03:00
Sergii Dmytruk
658985549b DasharoSystemFeaturesUiLib: reduce boilerplate in RouteConfig
The code is highly repetitive, use a macro to shorten it by a lot.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2024-06-11 00:11:19 +03:00
Sergii Dmytruk
84ee5859f9 DasharoModulePkg: reset to defaults maintained by DasharoVariablesLib
From now on default values are maintained only in DasharoVariablesLib
and can be queried from it to avoid code duplication and bugs which
arise from it.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2024-06-11 00:11:19 +03:00
Sergii Dmytruk
6d3f57218c DasharoSystemFeaturesUiLib: reduce boilerplate in constructor
Use a macro to get rid of repeated code for loading data from variables.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2024-06-11 00:11:17 +03:00
Sergii Dmytruk
8ecc6874ad DasharoModulePkg: move variable creation to DasharoVariablesLib
Create a separate library for managing values of variables and create
them in the constructor of the new library.  This gets rid of the
defaults in Library/DasharoSystemFeaturesUiLib/DasharoSystemFeatures.c

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2024-06-10 19:52:46 +03:00
Sergii Dmytruk
6caa9c0b20 DasharoSystemFeaturesUiLib: fix initializing SleepType
PcdSleepTypeDefaultS3 wasn't taken into account.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2024-06-10 19:44:54 +03:00
Sergii Dmytruk
8b763c5888 DasharoSystemFeaturesUiLib/DasharoSystemFeaturesHii.h: cleanup
1. Remove excessive indentation from some fields of
   DASHARO_FEATURES_DATA.
2. Add a comment explaining question IDs.
3. Drop gDasharoSystemFeaturesGuid declaration which should be provided
   by build system.
4. Fix formatting of WATCHDOG_ENABLE_QUESTION_ID.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2024-06-10 19:44:51 +03:00
Sergii Dmytruk
1acd95498b DasharoModulePkg: move more declarations to DasharoOptions.h
To have all of them collected in one place and have no need to reach
into HII-related header from unrelated parts of the code.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2024-06-10 19:44:25 +03:00
Sergii Dmytruk
b646ad16e8 DasharoModulePkg: #define variable names and use consistently
This is somewhat then using string literals as making a typo in a macro
name will cause a compilation error.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2024-06-10 19:42:51 +03:00
Michał Kopeć
6e30d147a2 Library/DasharoSystemFeaturesUiLib/DasharoSystemFeatures.c: remove unused EFI vars
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
2024-06-05 12:08:08 +02:00
Filip Lewiński
4f702c25a2 Add CPU throttling threshold option support
Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
2024-05-28 18:54:13 +02:00
Michał Kopeć
ccc1e2ebff Decouple watchdog enablement and visibility from each other
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
2024-03-15 17:08:39 +01:00
Michał Kopeć
df9eeb2e75 Library/DasharoSystemFeaturesUiLib/DasharoSystemFeaturesStrings.uni: fix incorrect min timeout in helptext
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
2024-03-14 18:39:38 +01:00
Michał Żygowski
45f767f0dd Add support for second serial port
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2024-02-19 18:52:58 +01:00
Michał Żygowski
c86ef41489 Handle default sleep type override
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2024-02-19 13:16:32 +01:00
Michał Żygowski
07635364cf Add more switches to hide features
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2024-02-19 13:16:30 +01:00
Sergii Dmytruk
a1b3ebfb14 DasharoSystemFeaturesUiLib: add help note on power failulre definition
Related to https://github.com/Dasharo/dasharo-issues/issues/557

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2023-11-17 17:11:41 +02:00
Michał Kopeć
0e9956b4eb Add S3 experimental disclaimer PCD
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
2023-11-17 12:22:46 +01:00
Michał Żygowski
a3a12cbd14 Add logic to set ME to default disabled and hide HAP
Add new PCDs which control the visibility of HAP bit, in case the
underlying coreboot code does not support HAP yet, and the default
state of ME, if the platform should boot automatically in ME disabled
mode. Protectli platform need to boot with ME disabled per customer
policy.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2023-10-13 12:48:56 +02:00