252 Commits
Author SHA1 Message Date
Michał Żygowski 0b63e5ae1a Add project patch version to version info
Add project patch version to match Dasharo versioning scheme.

Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
2025-08-04 16:07:39 +02:00
Stanley Chang 9240705ab8 fix: [ADL] Refactor the UpdateResetReason #2442
This commit refines the UpdateResetReason for ADL with the following improvements:
1. Replacing IsRebootByWdt with WasBootCausedByTcoTimeout. Previously, ADL utilized
   IsRebootByWdt, which was incorrect and redundant. The incorrect aspect involved
   checking a non-existent bit field (TCO_STS_NO_REBOOT), while the redundancy lay
   in its functionality being identical to WasBootCausedByTcoTimeout(). Consequently,
   this commit removes IsRebootByWdt and substitutes IsRebootByWdt with
   WasBootCausedByTcoTimeout.

2. Prioritizing S3/S4 for RstCause assignment in UpdateResetReason. The original code
   assigned ResetWakeS3 or ResetWakeS4 or S3/S4 resume at the end of the check logic.
   However, ResetWakeS3 and ResetWakeS4 already imply a successful resume, allowing us
   to move these checks to the beginning of the function.

3. Setting ResetUnknown for MMIO failure.

4. Setting ResetUnknown for B_PMC_PWRM_GEN_PMCON_A_PWR_FLR. This should be an independent
   check, rather than an "else-if" check as in the original code.

5. Simplifying the check for ResetWarm and ResetCold, as both are held when
   B_PMC_PWRM_GEN_PMCON_A_HOST_RST_STS is set.

Additionally, the commit skips ResetWakeS4 for crash mode in GetCurrentBootOption.
Finally, it removes the UpdateResetReason from TGL and EHL as it is unused.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2025-05-20 10:36:20 -07:00
Sachin Kamat 93bde08c2c fix: [Common] Fix kernel panic issue
Recent Android support cleanup patch introduced a regression with
OsLoader. Kernel panic was seen while booting Ubuntu using
container. This was because, earlier the function used to return
after adding OS Mender boot info parameter for non-Android OS.
With the Android support removed, the dead code (for non-Android
cases) started getting executed causing regression. This patch
removes this code which never got executed earlier in non-Android
cases and fixes this regression.

Signed-off-by: Sachin Kamat <sachin.kamat@intel.com>
2025-03-20 10:34:35 -07:00
Bejean Mosher 7f169cb0a5 fix: PayloadMod stack base alignment in x64.
RSP must be 16 byte aligned in x64.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2025-02-18 18:56:50 -07:00
Sachin Kamat 71ebc9a812 fix: [Common] Remove Clear Linux support
Clear Linux support code is not used. Clean it up.

Signed-off-by: Sachin Kamat <sachin.kamat@intel.com>
2025-02-12 13:49:03 -07:00
Chirag Vijay Kolhe a41dc0aad4 fix: [Common] Remove IAS boot image support
IAS boot image format is deprecated; it is recommended to use container
boot image.

 - Removed references,files related to IAS image.
 - Replaced IAS image boot options with container type image.

Signed-off-by: Chirag Vijay Kolhe <chirag.vijay.kolhe@intel.com>
2025-02-11 13:45:09 -07:00
Sachin Kamat 268248986a fix: [Common] Remove Android OS support
Android OS support code is not used. Clean it up.

Signed-off-by: Sachin Kamat <sachin.kamat@intel.com>
2025-02-11 13:37:50 -07:00
Sachin Kamat 13997bd3f2 fix: [Common] Remove Trusty OS support
Trusty OS is not used. Clean up the code.

Signed-off-by: Sachin Kamat <sachin.kamat@intel.com>
2025-02-10 15:50:54 -07:00
Sachin Kamat 5beedb6ee6 fix: [Common] Remove ACRN support
ACRN is not used. Clean up the code.

Signed-off-by: Sachin Kamat <sachin.kamat@intel.com>
2025-02-06 10:13:26 -07:00
costel-ignat bdfaac2396 feat: [RPL-A] Deny the update of older microcode versions.
- According to the Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3A, Section 10.11.1 titled "Microcode Update",
   the microcode header does not include an SVN (Security Version Number) field.
   Additionally, the subsequent section does not reference the SVN either, it only mentions the update revision.
 - Added check to ensure UpdateRevision is not lower than the minimum required version.
 - If UpdateRevision is lower, an error is logged and appropriate action is taken.
 - This prevents unauthorized rollback to older, potentially insecure versions of microcode.

Signed-off-by: costel-ignat <costel.ignat@intel.com>
2024-12-16 09:51:54 -07:00
Antara Borwankar 94515f31c0 [MeFwUpdateLib] Updated the header files
Updated header files to add new csme error codes

Signed-off-by: Antara Borwankar <antara.borwankar@intel.com>
2024-09-17 12:52:15 -07:00
Jiaqing Zhao 33060efdc6 OsLoader: Handle module align flag for multiboot images in ELF format
There is a flag in both multiboot and multiboot2 image indicating
modules must be loaded to page boundaries. Currently this flag is not
handled when loading multiboot images in ELF format. Check this flag
and move the loaded modules if needed before SetupMultibootInfo().

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2024-06-24 06:54:21 -07:00
Biswas Arghya f8bfe71c06 feat:[Common] boot from an image from memory
Add a new entry in CfgData_BootOption.yaml to boot from memory. The boot
device must be 7 (MEMORY), and the address of the container boot image
(CONTAINER_BOOT_SIGNATURE) can be placed at an address specified by
LBA format (i.e., use HEX prefix. EX: #0x12345678).

Example entry of CfgData_BootOption.yaml:
!expand { BOOT_OPTION_TMPL : [ 0 , 0,  0,  7,   0 ,   0 ,   0xFF ,   1 , '#0x47A31000'] }

If the address is not predefined then it can be updated in run time from
SBL shell boot option table.

Validated by loading a container image to the memory by using 'fs load'
command in SBL shell and update the load image address in boot option table.

Signed-off-by: Biswas Arghya <arghya.biswas@intel.com>
2024-03-18 10:04:41 -07:00
Guo Dong 416f2d95da Sync edk2 basetool mdepkg (#2121)
* Sync BaseTools to align with edk2-stable202311

Keep the SBL specific change (e.g. Lz4).

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: Sync MdePkg from EDK2 edk2-stable202311 branch

Only sync required file without any changes to EDK2 files.

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: Update MdePkg for SBL after sync from EDK2

Signed-off-by: Guo Dong <guo.dong@intel.com>

* Update SBL after updating Basetool and MdePkg

After Sync BaseTool and MdePkg to edk2-stable202311,
Need update SBL code to align with this change.

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: rollback some changes after mdepkg sync

New change from MdePkg requires new NASM version.
To make sure NASM 2.14.02 still works, just rollback
few changes.

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: Update component size to fix build failure

After syncing BaseTool and MdePkg, some components would
have a little bigger size. So update the config to fix the
build failure.

Signed-off-by: Guo Dong <guo.dong@intel.com>

* feat: Remove unused asl code

Some ASL files don't exist but they are included in other asl files.
It would cause build failure with new build BaseTool. So just remove
them to fix the build failure.

Signed-off-by: Guo Dong <guo.dong@intel.com>

---------

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-03-08 13:43:46 -05:00
bejeanmo 16d855db39 fix: ASSERT on firmware update when capsule not found. (#2079)
Commit 74e12f7 introduced a case where FreePool could be called with an
unallocated pointer if no capsule image is found.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2023-11-30 13:38:56 -05:00
tsaikevin 1dd3da7cb7 fix: [Common] Fix coverity issue (#2064)
Fixed Assignment to Variable without Use(CWE 563)

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2023-10-26 11:23:20 -07:00
Guo Dong 1e38183d82 feat: Enhance firmware Update (#2062)
If the component in SPI flash could not be memory-mapped, it need access
using SPI library.
If the component is registered using memory address, it means it need use
SPI library to access. It would read required info using SPI library.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-10-23 13:41:26 -04:00
Guo Dong 7db779439b [ADL/RPL] Update reset reason
Add reset reason caused by S4.
Update ADL to set reset reason.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-09-26 09:18:00 -07:00
Guo Dong cf38997cca Fix windows build failure
Previous patch used GCC extension "attribute__((packed))" which
caused windows build failure. This patch fixes it by using
#pragma pack().

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-09-20 14:57:31 -07:00
Jiaqing Zhao 338ba840bf OsLoader: Print misc image info in Shell
Add support to print misc image info in shell. Misc image will only be
printed when BOOT_FLAGS_MISC is set.

Also fixes some minor bugs in 5968cfa919 ("OsLoader: Print all extra
images")

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-19 17:58:18 -07:00
jizhenlo 4e3cfe8eb9 AbSupportLib: Align with Android Boot Control Block 1.1
Boot Control Block (BCB) is stored at the "misc" partition which is
used for implementing A/B boot in bootloader. This patch updates
AB_SLOT_DATA and AB_BOOT_INFO struct to align it with Android[1] and
kernelflinger[2] of project celadon.

[1] https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/main/boot/1.1/default/boot_control/include/private/boot_control_definition.h
[2] https://github.com/projectceladon/kernelflinger/blob/master/avb/libavb_ab/avb_ab_flow.h

Signed-off-by: jizhenlo <zhenlong.z.ji@intel.com>
Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-19 17:58:18 -07:00
Jiaqing Zhao c65cd572d2 OsLoader: Print all extra images
Currently only PreOs and Extra0 image info is printed in boot options
list, this patch prints all of them.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-12 13:55:06 -07:00
Jiaqing Zhao 5968cfa919 OsLoader: Shell support for FILE_IMAGE_LOCATION
Support printing and modifying boot file info in FILE_IMAGE_LOCATION
struct in OsLoader shell.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-12 13:55:06 -07:00
Jiaqing Zhao c6ee0e7859 OsLoader: Add MULTIBOOT_MODULE container support
MULTIBOOT_MODULE container is handled in a similar way as modules in
MULTIBOOT container when loading and parsing. If the normal image is
multiboot/multiboot2 format, these modules in extra images will be
appended to it in SetupBootImages().

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-12 13:55:06 -07:00
Jiaqing Zhao fe9d1a195a OsLoader: Add A/B support for GetBootImageFromFs()
Adds A/B support for GetBootImageFromFs(), the behavior is the same as
GetBootImageFromRawPartition(). When loading from B partition, it will
load the container file at the sampe path from next SwPart.

Signed-off-by: Jiaqing Zhao <jiaqing.zhao@intel.com>
2023-09-12 13:55:06 -07:00