Commit Graph

6478 Commits

Author SHA1 Message Date
Sergii Dmytruk 2b93ded2ef DasharoPayloadPkg: enable "immediate" on-disk capsules
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2026-01-08 01:05:28 +02:00
Sergii Dmytruk b828f7bf3e MdeModulePkg: support "immediate" on-disk capsules
That is loading and processing on-disk capsules during the same boot
without relocating the capsules to a dedicated non-volatile storage on
ESP or loading them as in-RAM capsules and then rebooting.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2026-01-08 01:05:01 +02:00
Sergii Dmytruk b3020f6aef MdeModulePkg/DxeCapsuleLibFmp/CapsuleOnDisk.c: fix leaks in RelocateCapsuleToRam()
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2026-01-06 20:04:21 +02:00
Sergii Dmytruk aca5c960db MdeModulePkg/DxeCapsuleLibFmp/CapsuleOnDisk.c: extract functions for freeing file info
For deduplication and to make adding future code that needs to do the
same easier.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2026-01-06 20:04:20 +02:00
Sergii Dmytruk b22c226091 MdeModulePkg/DxeCapsuleLibFmp/CapsuleOnDisk.c: fix typos/wording/formats
The typos got in the way of grepping for output lines and reporting
errors as numbers is not very helpful.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2026-01-06 20:04:18 +02:00
Michał Żygowski 1cb64d6bde MdeModulePkg/Library/FileExplorerLib: Change text field to subtitle
The text field between the list of files and option to create files or
directories was a selectable empty string with no functionality. When
moving through the menu one had to press the arrow one extra time to
navigate to the files. As it is confusing, change the text field to
subtitle so it is not selectable anymore.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2025-07-07 16:46:16 +03:00
Michał Żygowski 4fdc0917b6 MdeModulePkg/Universal/DisplayEngineDxe: Do not highlight empty strings
Hightlighting empty strings or strings containing a single SPACE character
resulted in drawing a confusing single-character-wide black rectangle.

Skip highlighting those mepty strings. it may be useful in forms where
no entry should be highlighted by default. It can be done by defining
a text field with empty prompt and help string as first menu entry.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2025-07-07 16:46:05 +03:00
Michał Żygowski 0961f9f31f Add PCDs to control quiet and fast boot in the project
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2025-03-10 20:16:34 +02:00
Michał Żygowski 3ff728ca15 MdeModulePkg/Bus/Isa/Ps2KeyboardDxe: Reduce PS/2 KBD init to minimum
For NVC laptops it is required to issue KBEN command only to get
the keyboard working on coldboot paths with Windows. This commmit
will be squashed with previous commits once it is verified to work
on MSI desktops.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2025-03-10 20:16:33 +02:00
Michał Żygowski e9697ba87b MdeModulePkg/Bus/Isa/Ps2KeyboardDxe: Issue KBEN command after KBC init
After the minimal KBC initialization is	done on	fast boot path,	we still
need to	issue KBEN command. This is a workaround for NVC EC implementation
of KBC which enables keyboard scanning on KBEN command. It has been
verified that Windows does not issue this command, os it is required to get
the keyboard working on	cold boot paths	on NovaCustom laptops. Verfied that
this command did not need to be issued on MSI desktops.

TEST=Boot NovaCustom V560TNX after shutdown from Windows without AC
connected and confirm the internal keyboard still works.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2025-03-10 20:16:33 +02:00
Michał Żygowski e1cab3dc1c MdeModulePkg/Bus/Isa/Ps2KeyboardDxe: Lower the PS/2 KBD detection timeout
One seconds seems a bit too excessive to detect the keyboard. Lower the
detection timeout to half a second.

TEST=Verify PS/2 keyboard is initialized properly on MSI Z690-A DDR4 with
Media-Tech MT122K PS/2 keyboard and NovaCustom V540TND.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2025-03-10 20:16:33 +02:00
Michał Żygowski e9a661c3a9 MdeModulePkg/Bus/Isa/Ps2KeyboardDxe: Perform minimal i8042 controller init
On fast boot path the i8042 controller was not being initialized at all if
Windows was being booted. This resulted in the keyboard not working after
shutdown and even after reset from Windows. It only worked when the keyboard
was initialized earlier properly and no shutdown occurred. On Linux boot
path, GRUB was calling ReadKeyStroke which triggered connecting consoles and
performing a full PS/2 initialization.

On fast boot path, add minimal i8042 controller initialization without
actual keyboard initialization and extended verification. It is sufficient
for both Linux and Windows to set up the PS/2 keyboard properly.

Also move setting the FastPs2Detection PCD to the Ps2KeyboardDxe, as it
caused most of the i8042 controller initialization to be skipped. Once the
controller is initialized on module start, the extra initialization may be
skipped later on fast boot path.

TEST=PS/2 keyboard works in both Ubuntu Linux and Windows after shutdown and
restart on NovaCustom V540TND.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2025-03-10 20:16:33 +02:00
Michał Żygowski 983f91c9be MdeModulePkg/Bus/Isa/Ps2KeyboardDxe: Don't do extended verification on fast boot
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2025-03-10 20:16:32 +02:00
Michał Żygowski 2bec454154 Handle quiet and fast boot
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2025-03-10 20:16:32 +02:00
Michał Żygowski 86228b6242 MdeModulePkg/BootMaintenanceManagerUiLib: Add quiet and fast boot options
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2025-03-10 20:16:32 +02:00
Sergii Dmytruk 8a1112b2c2 MdeModulePkg/Logo: fallback to builtin logo on error
Returning an error from this function can disable useful functionality
like capsule updates because progress bar treats such errors as fatal...

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2025-03-10 20:16:31 +02:00
Sergii Dmytruk 96a094d553 MdeModulePkg/Universal/CapsuleRuntimeDxe: Reject capsules unless ME is HAP-disabled
HAP-disabled ME doesn't do anything, including writing to system flash,
which is what we need for a firmware update that relies on a warm reset.
coreboot assumes that HECI/soft-disabled state of ME isn't as good as
HMRFPO and switches to HMRFPO doing a global reset which loses in-RAM
capsules.

Checking variable's value should be enough, if somebody manually set it to
an invalid value, the update there will be a reboot without a capsule
update.  A more reliable solution would be to pass this information from
coreboot.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2025-03-10 20:16:31 +02:00
Sergii Dmytruk fadd1de95a MdeModulePkg/Universal/CapsuleRuntimeDxe: Enable FUM on reset for capsule update
This should ensure that various protection mechanisms are off and won't
get in the way of firmware flashing.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2025-03-10 20:16:30 +02:00
Sergii Dmytruk 2893daee26 MdeModulePkg: Add PcdCapsuleFmpSupport to set EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED
Don't know why EDK never sets this bit (there is only definition with no
uses), maybe nothing actually checks its value.  Whatever the reason is,
it seems like a good idea to make setting it possible.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2025-03-10 20:16:30 +02:00
Michał Żygowski 7f99c84f07 MdeModulePkg/Library/BootLogoLib/BootLogoLib.c: draw progress bar without spaces
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2025-03-10 20:16:29 +02:00
Michał Kopeć 0b4ea12070 DasharoPayloadPkg: Load bootlogo bitmap from CBMEM
Signed-off-by: Michał Kopeć <michal.kopec@3mdeb.com>
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2025-03-10 20:16:28 +02:00
Michał Żygowski cb41aca5bc MdeModulePkg/RuntimeDxeReportStatusCodeLib: do nothing after ExitBootServices()
Prevent debugging on serial port (whether physical or cbmem console) at
runtime by not doing anything after boot services are exited. It will
stop calling SerialPortWrite if EFI switches to runtime and avoid access
to cbmem CONSOLE buffer which is neither marked as runtime code nor data.

If serial debugging will be necessary, actually mark coreboot's CONSOLE
buffer as runtime data (it's location and size are known).

Solves the issue with Xen backtrace on EFI reset system runtime service:
https://github.com/Dasharo/dasharo-issues/issues/488#issuecomment-1772758851

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2025-03-10 20:16:28 +02:00
Benjamin Doron ea1748b4e4 [DNM] MdeModulePkg: PciBusDxe: Drop RemoveRejectedPciDevices()
There is an assumption in `IsPciDeviceRejected()` (at least for I/O)
that a BAR with all read-write bits set is invalid. However, this is not
the case: when a resource is size-aligned down from the top, this may
also be the case.

This code causes the rejection of the iGPU (and therefore, display) in
some cases with the DasharoPayloadPkg, when the coreboot
ESOURCE_ALLOCATION_TOP_DOWN config is enabled. It remains to be seen
whether this code addresses some other issue.

Signed-off-by: Benjamin Doron <benjamin.doron@9elements.com>
2025-03-10 20:16:28 +02:00
Sergii Dmytruk 6866e23aa2 MdeModulePkg/Application/UiApp/FrontPage.c: get memory from Table 17
As a fallback if Table 19 is missing.

Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
2025-03-10 20:16:25 +02:00
Michał Żygowski 58654c3ff0 MdeModulePkg/Library/BootMaintenanceManagerUiLib: Handle timeout statically
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2025-03-10 20:16:25 +02:00