Coder Social home page Coder Social logo

edk2-nvidia's Introduction

UEFI for NVIDIA Platforms

This repository contains sources necessary to build UEFI for NVIDIA Platforms. UEFI for NVIDIA Platforms is based on EDK2.

See the wiki for more information, including build and flash instructions.

Build

To build this platform, please refer to the instructions.

edk2-nvidia's People

Contributors

abmainkar avatar ashishsingha avatar awong-gh avatar blakets avatar bobekjan avatar bobm21 avatar bwicaksononv avatar crvux avatar dwalkes avatar gmahadevan avatar harshal03patil avatar jbrasen avatar jeshuasmith avatar jgarver avatar jmbaur avatar jonhunter avatar jrahn-nvidia avatar kkyarlagadda avatar markz-zhang avatar nicklela avatar nicolinc avatar niehaokang avatar nramire avatar nvidia-dmach avatar pnewman-cti avatar praithatha avatar sachinjadhav86 avatar swatisrik avatar thejaputta avatar wangsim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

edk2-nvidia's Issues

CapsuleApp.efi fails on Jetson platforms

CapsuleApp uses the QueryCapsuleCapabilities UEFI RT service to detect the maximum supported capsule size which is currently set to 10MB. Current T194 and T234 capsules are over 11MB, so CapsuleApp fails with a capsule size error.

USB support for Orin

USB driver support did not make the rel-34 release. The attached pull requests add support for this feature

How can I disable OP-TEE in the bootloader?

I was looking through this source code for a way to disable OP-TEE but wasn't able to find one. Is there a way I can disable OP-TEE so that no physical address range is reserved for OP-TEE? If this isn't possible, is there a way to find the physical address range that has been reserved for OP-TEE?

Logic error in FwPackageGetImageIndex

While working on this pull request:

OE4T/meta-tegra#1285

I discovered what appears to be a bug in the logic that is attempting to find a match to either the compatibility or full TnSpec. I think the simple fix is to add a break here:

https://github.com/NVIDIA/edk2-nvidia/blob/main/Silicon/NVIDIA/Library/FwPackageLib/FwPackageLib.c#L267

The bug was exposed due to meta-tegra having additional bup specs that differed from the L4T 35.3.1 release (which was resolved in the PR). I was able to recreate it using the L4T release by simply adding this spec:

'boardid=3668;fab=200;boardsku=0001;boardrev=;fuselevel_s=1;chiprev=2;board=jetson-xavier-nx-devkit-emmc;rootdev=mmcblk0p1'

to the jetson-xavier-nx-devkit-emmc board of the t19x_spec in jetson_board_spec.cfg and then rebuilding the capsule per here. With the additional spec present the code will fail to break out of the loop and will match on the next entry, but since Found is now TRUE it will fall into the else clause that returns EFI_UNSUPPORTED.

How to optimize boot time?

Hi, the boot time of UEFI firmware costs a lot of time. I have changed PcdPlatformBootTimeOut from 5 to 0, but it still took about 16 seconds.

I noticed a large gap before booting the kernel in the log, so I wanted to ask if there is any way to shorten the startup time.

Thank you.

FMP capsule update may fail on Xavier NX platforms

On Xavier NX platforms where some _b FW partitions are on an eMMC device, FMP capsule update may fail with write protect errors when updating boot chain B FW, E.g.

Overwriting active adsp-fw partition not allowed
Error writing adsp-fw, Offset=0: Write Protected
Failed to write image=adsp-fw: Write Protected

This is caused by the FwImageDxe driver loading before the FwPartitionBlockIoDxe driver which makes the _b partitions unavailable during the capsule update. A fix to the FwImageDxe Depex is being developed to ensure that the drivers load in the correct order.

UEFI variables for platform spec values may not be null-terminated

The TegraPlatformSpec and TegraPlatformCompatSpec UEFI variables read by FmpDeviceLib are not written with null termination bytes. UEFI shoud ensure its copies of these variables are null-terminated passing them to functions that require null-terminated strings.

failing boot retry count requires hard flash

Hello,

I've been updating our xavier platform to use the 35.1 using an AGX Xavier devkit and the new uefi bootloader. We are running a yocto meta-tegra kirkstone image, which by default does not come with a recovery partition. The head of kirkstone on meta-tegra right now also does not run nvbootctrl verify on boot and I ran into the following issue:

Once the retry count for slot A reached 0 the platform will no longer boot. Since there is no recovery partition it drops to the UEFI Shell. There does not appear to be any way from UEFI shell to reset the retry count, nor to force the platform to boot from slot A anyway, nor to place the device in forced-recovery mode to allow flashing over USB.

The only way I am aware of to get out of this state is to have someone physically present place the device into forced recovery mode, after which USB-C flashing works fine. This is very inconvenient for remote developers though.

Things I have tried:

Manually setting the retry count on the RootfsInfo variable

Shell> setvar RootfsInfo -guid 781E084C-A330-417C-B678-38E696380CB9 -bs -rt -nv
781E084C-A330-417C-B678-38E696380CB9 - RootfsInfo - 0004 Bytes
0C C3 00 00

Shell> setvar RootfsInfo -guid 781E084C-A330-417C-B678-38E696380CB9 -bs -rt -nv
=0x0030C30C

Shell> setvar RootfsInfo -guid 781E084C-A330-417C-B678-38E696380CB9 -bs -rt -nv
781E084C-A330-417C-B678-38E696380CB9 - RootfsInfo - 0004 Bytes
0C C3 30 00

Manually writing to the Tegra Rootfs Status Register Address T194

Shell> mm 0x0C39041C -w 4 -n
MEM  0x000000000C39041C : 0x000CFACE
Shell> mm 0x0C39041C -w 4 -n =0x003CFACE
MEM  0x000000000C39041C : 0x003CFACE
Shell> mm 0x0C39041C -w 4 -n
MEM  0x000000000C39041C : 0x003CFACE

neither reset -c nor reset -w following either of the above changes had any effect.

Attempting to boot always results in

Jetson UEFI firmware (version 1.0-d7fb19b built on 2022-08-10T20:18:13-07:00)
Press ESCAPE for boot options **  WARNING: Test Key is used.  **
......
      L4TLauncher: Attempting Recovery Boot
Header not seen at either offset 0 or offset 0x1000
Failed to boot recovery:0 partition
...
Press ESC in 1 seconds to skip startup.nsh or any other key to continue.
Shell> 

Based on my understanding of nvidia's documentation, these are what the reboot logic should be basing the decision to not boot to slot A on.

trying to find a way to enter forced-recovery RCM mode

based on how "forced-recovery" reboots are handled by drivers/soc/tegra/pmc.c I tried to read 0xc362000 with the intention of setting the PCM_SCRATCH0_MODE_RCM bit, but this resulted in an exception and reset of the bootloader:

Shell> mm 0xC362000 -w 4 -n
MEM

Synchronous Exception at 0x0000000857C88874


Synchronous Exception at 0x0000000857C88874
ASSERT [ArmCpuDxe] /dvs/git/dirty/git-master_linux/out/nvidia/bootloader/uefi/Jetson_RELEASE/edk2/ArmPkg/Library/DefaultExceptionHandlerLib/AArch64/DefaultExceptionHandler.c(333): ((BOOLEAN)(0==1))

Resetting the system in 5 seconds.

Build Error

When I build edk2 - nvidia/Platform/nvidia/Jetson/build. Sh, there will be such a mistake.

Traceback (most recent call last):
File "edk2/BaseTools/Edk2ToolsBuild.py", line 177, in
main()
File "edk2/BaseTools/Edk2ToolsBuild.py", line 173, in main
Edk2ToolsBuild().Invoke()
File "/home/user/Jetson_UEFI/nvidia-uefi/venv/lib/python3.8/site-packages/edk2toolext/base_abstract_invocable.py", line 146, in Invoke
retcode = self.Go()
File "edk2/BaseTools/Edk2ToolsBuild.py", line 148, in Go
raise Exception("Failed to build.")
Exception: Failed to build.

AttributeError: 'Edk2Update' object has no attribute 'PlatformModule'

Hi,
When following the docs to build UEFI without docker(https://github.com/NVIDIA/edk2-nvidia/wiki/Build-without-docker)
Encountered below error with
[main]$ edk2-nvidia/Platform/NVIDIA/Jetson/build.sh

nvidia: building from workspace rooted at: /home/fadhelh/project/octo_v1/uefistrap/nvidia-uefi
nvidia: found command: python3.
nvidia: found command: virtualenv.
nvidia: found command: mono.
nvidia: found command: aarch64-linux-gnu-gcc.
nvidia: found Python 3.9 or later.
nvidia: Activating Python virtual environment.
nvidia: Updating build environment (edk2-nvidia/Platform/NVIDIA/Jetson/PlatformBuild.py).
Unable to use edk2-nvidia/Platform/NVIDIA/Jetson/PlatformBuild.py as a UpdateSettingsManager
Did you mean to use a different kind of invocable?
Traceback (most recent call last):
File "/home/fadhelh/.local/lib/python3.8/site-packages/edk2toolext/edk2_invocable.py", line 355, in ParseCommandLineOptions
self.PlatformModule = import_module_by_file_name(os.path.abspath(settingsArg.platform_module))
File "/home/fadhelh/.local/lib/python3.8/site-packages/edk2toollib/utility_functions.py", line 347, in import_module_by_file_name
spec.loader.exec_module(ImportedModule)
File "", line 848, in exec_module
File "", line 219, in _call_with_frames_removed
File "/home/fadhelh/project/octo_v1/uefistrap/nvidia-uefi/edk2-nvidia/Platform/NVIDIA/Jetson/PlatformBuild.py", line 10, in
from edk2nv.stuart import NVIDIASettingsManager, NVIDIAPlatformBuilder
File "/home/fadhelh/project/octo_v1/uefistrap/nvidia-uefi/edk2-nvidia/Silicon/NVIDIA/edk2nv/stuart/init.py", line 10, in
from .builder import * # noqa
File "/home/fadhelh/project/octo_v1/uefistrap/nvidia-uefi/edk2-nvidia/Silicon/NVIDIA/edk2nv/stuart/builder.py", line 12, in
from edk2toolext.environment.uefi_build import UefiBuilder
File "/home/fadhelh/.local/lib/python3.8/site-packages/edk2toolext/environment/uefi_build.py", line 24, in
from edk2toollib.uefi.edk2.parsers.dsc_parser import DscParser
File "/home/fadhelh/.local/lib/python3.8/site-packages/edk2toollib/uefi/edk2/parsers/dsc_parser.py", line 13, in
from edk2toollib.uefi.edk2.parsers.base_parser import HashFileParser
File "/home/fadhelh/.local/lib/python3.8/site-packages/edk2toollib/uefi/edk2/parsers/base_parser.py", line 13, in
from edk2toollib.uefi.edk2 import path_utilities
File "/home/fadhelh/.local/lib/python3.8/site-packages/edk2toollib/uefi/edk2/path_utilities.py", line 21, in
class Edk2Path(object):
File "/home/fadhelh/.local/lib/python3.8/site-packages/edk2toollib/uefi/edk2/path_utilities.py", line 329, in Edk2Path
def GetContainingModules(self, input_path: str) -> list[str]:
TypeError: 'type' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/fadhelh/.local/bin/stuart_update", line 8, in
sys.exit(main())
File "/home/fadhelh/.local/lib/python3.8/site-packages/edk2toolext/invocables/edk2_update.py", line 120, in main
Edk2Update().Invoke()
File "/home/fadhelh/.local/lib/python3.8/site-packages/edk2toolext/base_abstract_invocable.py", line 200, in Invoke
self.ParseCommandLineOptions()
File "/home/fadhelh/.local/lib/python3.8/site-packages/edk2toolext/edk2_invocable.py", line 367, in ParseCommandLineOptions
Module = self.PlatformModule
AttributeError: 'Edk2Update' object has no attribute 'PlatformModule'

Please comment
Regards

console settings not saved

Changed console settings under Boot Menu => Boot Maintenance Manager => Console Options => Console [Input|Output|Standard Error] Device Select do not persist through a device reboot.

I2C timeout on jetson-agx-orin-devkit

Issues

  • Timeout error occurs while issuing TegraI2cStartRequest
  • How can I skip initializing I2C if it is not mandatory for edk2 on AGX Orin developer kit?
[2023-10-24 16:38:22] Invalid EFI_I2C_DEVICE reported by I2c Enumerate protocol.
[2023-10-24 16:38:22] Invalid EFI_I2C_DEVICE reported by I2c Enumerate protocol.
[2023-10-24 16:38:22] Invalid EFI_I2C_DEVICE reported by I2c Enumerate protocol.
[2023-10-24 16:38:22] Invalid EFI_I2C_DEVICE reported by I2c Enumerate protocol.
[2023-10-24 16:38:22] Invalid EFI_I2C_DEVICE reported by I2c Enumerate protocol.
[2023-10-24 16:38:23] Installed Fat filesystem on 8221EE398
[2023-10-24 16:38:23] [ext4] Needs journal recovery, mounting read-only
[2023-10-24 16:38:25] TegraI2cStartRequest: Timeout waiting for Packet Complete
[2023-10-24 16:38:25] TegraI2cStartRequest: Timeout waiting for Packet Complete
[2023-10-24 16:38:25] TegraI2cStartRequest: Timeout waiting for Packet Complete
[2023-10-24 16:38:25] TegraI2cStartRequest: Timeout waiting for Packet Complete
[2023-10-24 16:38:26] TegraI2cStartRequest: Timeout waiting for Packet Complete
[2023-10-24 16:38:26] PrintBootOrder: Current BootOrder:
[2023-10-24 16:38:26] PrintBootOrder: BootOrder[0] = 0x0008 = UEFI I-O DATA USB Flash Disk 1242609221250144
[2023-10-24 16:38:26] PrintBootOrder: BootOrder[1] = 0x0001 = UEFI eMMC Device

Environment

Background

It's important boot time on some embedded scene. so, We investigate how many seconds spent each compornent. We found the above time out messages.

Compile error when switch branch

Hi, now when i switch branch main to r35.3.1-updates, it compiled failed

ERROR - Invalid file path: ('DynamicTablesPkg/Library/Acpi/Arm/AcpiSlitLibArm/AcpiSlitLibArm.inf',)

ERROR - Build.py #000 from /home/ultwcz/work/prj/nx/nvidia-uefi-test/edk2-nvidia/Platform/NVIDIA/Jetson/Jetson.dsc(941): File/directory not found in workspace

What should i do?

Thank you.

Remove BootLogo for Boottime optimization

Hi,
We are working on Nvidia Orin platform.
We observed the a longer boot time and need to optimize it.

Please show us how to disable BootLogo,

UEFI branch: R35.4.1

Regards

capsule update single image name limitation

As I was reading through the code I noticed that

FwPackageCopyImageName (PkgName, PkgImageInfo, FW_IMAGE_NAME_LENGTH);
probably was meant to be:

  FwPackageCopyImageName (PkgName, PkgImageInfo, sizeof (PkgName));

instead of the current:

  FwPackageCopyImageName (PkgName, PkgImageInfo, FW_IMAGE_NAME_LENGTH);

as the length is in terms of bytes, and not CHAR16s from my reading of the function's description, and other usages of it in this file.

Stuck booting after installation new 2TB SSD.

Hi,

I am using leetop agx xavier which installed 250GB SSD, Samsung SSD 980 series. but, it is stuck and do not disappeared booting logo end of progress bar after I installed 2TB SSD the same brand. After some seconds, it try to reboot and repeat over and again.
I could only see message from UEFI.

Jetson UEFI firmware (version 2.1-32413640 built on 2023-01-24T23:12:27+00:00)
ESC   to enter Setup.
F11   to enter Boot Manager Menu.
Enter to continue boot.
**  WARNING: Test Key is used.  **
......L4TLauncher: Attempting Recovery Boot
EFI stub: Booting Linux Kernel...
EFI stub: Using DTB from configuration table
EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
EFI stub: Exiting boot services and installing virtual address map...

Is there any way to debug this issue?

BR,
Mark

Micron NVMe Drive failure to create Completion/Submission Queues

I recently opened a forum post about this issue. In diagnosing I added logs around why the nvme was failing to be recognized and found that the NvmExpress Driver was failing to create a second queue for the Completion and Submission queues.

As a simple test I hardcoded the NvmeCreateIoCompletionQueues and NvmeCreateIoSubmissionQueues functions to stop after the first queue which did work to get the system to boot from my NVMe drive, but I know it is not a valid long term solution that would work for all drives.

FMP capsule update fails on Xavier NX SD platforms

On Xavier NX SD platforms where some _b FW partitions are on an SD device, FMP capsule update will fail with write protect errors when updating boot chain B FW, E.g.

Overwriting active adsp-fw partition not allowed
Error writing adsp-fw, Offset=0: Write Protected
Failed to write image=adsp-fw: Write Protected

This is caused by the FwPartitionBlockIoDxe driver excluding SD partitions based on device path which makes those _b partitions unavailable during the capsule update.

Line Endings of Source Files are CRLF in repository on clone

Add a .gitattributes for the binary assets; check in source files in a manner that line endings are not CRLF but utilize the best practices for source modules being checked into a repository having their line endings as LF. This is controlled by a client using the git config setting core.autocrlf on Windows set to something other than false.

.gitattributes example:

  • text=auto
    *.bmp binary

This shows up when attempting to apply patches from a machine running Linux using bitbake as a build system.

Possible command to utilize:

find . -type f ! -path './.git/' ! -path '.bmp' -print | xargs -L 1 dos2unix

4K display support for Orin

Jetson Linux 34.1 suffers from an issue where booting Orin with a 4K display attached results in a framebuffer overrun and a boot failure. This has been tracked as known bootloader issue 3581719.

Pull request #3 corrects the framebuffer size computation, fixing this issue.

Error: [Errno 13] Permission denied: ../build/nvidia-uefi'

Hi,
When following steps https://github.com/NVIDIA/edk2-nvidia/wiki/Build-with-docker

I'm seeing permission denied when giving
$ edk2_docker edkrepo clone nvidia-uefi NVIDIA-Platforms main
Syncing the global manifest repository: /home/fadhelh/.edkrepo/edk2-edkrepo-manifest-main
Syncing the global manifest repository: /home/fadhelh/.edkrepo/nvidia
Error: [Errno 13] Permission denied: '/home/fadhelh/project/octo_v1/uefi_docker/build/nvidia-uefi

When tried with
$sudo edk2_docker edkrepo clone nvidia-uefi NVIDIA-Platforms main
sudo: edk2_docker: command not found

I could even see hello when giving
edk2_docker echo hello

Please guide.

Regards

Can't enter UEFI/ BIOS menu with keyboard at boot up

I was trying to enter BIOS menu but the keyboard is not working at boot up.
ESC, F11 and ENTER buttons are not working.

Specs:
Jetson Xavier NX with SEEED A206 carrier board
Jetpack 5.1 (L4T 35.2.1)

Keyboard works up to edk2-nvidia-r35.1-updates-20220930 6bc2699.
Keyboard is not working starting edk2-nvidia-202209.0 a87aded.

Tested by flasing uefi_jetson.bin in tarball from releases.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.