Skip to content

intel/FdtBusPkg

Repository files navigation

FdtBusPkg - Devicetree-based Platform Device Driver Development for Tiano UEFI.

This repo implements support for developing Tiano platform device drivers compliant to the UEFI Driver Model, by performing driver binding and configuration using a Devicetree. Such a Devicetree is typically either passed to UEFI by higher-privileged firmware.

Note

This is a staging branch created as part of the ongoing RISE collaboration. The net goal is to upstream to TianoCore edk2 and the UEFI Specification.

Advantages:

  • Allows UEFI developers to fully embrace modularity and code reuse.
  • Facilitates development of complex (graphics, NIC, etc) drivers.
  • Enables a single firmware binary to work across SoC revisions and board designs.

FdtBusPkg consists of FdtBusDxe, a bus driver, and a number of examples drivers and libraries for demoing with the RISC-V OVMF firmware. FdtBusDxe is responsible for enumerating DT controllers based on Devicetree nodes, and implementing EFI_DT_IO_PROTOCOL for basic operations on such controllers, such as device property access, register I/O, DMA buffer handling and child device enumeration.

See further documentation:

FdtBusPkg components can be used on any architecture, but have been developed and tested with RISC-V. They should be reusable out of the box on AArch64 platforms as well, barring any missing dependencies.

Note: this is Devicetree being used internally by UEFI. There is no relation to using Devicetree as possible mechanism of describing hardware configuration to an OS.

See the presentation video and slides from the UEFI Fall 2023 Developers Conference and Plugfest. Also see the short demo video published February, 2024.

Updates

When What
October 2024 Support indirect access to preconfigured BARs.
September 2024 Range translation, DMA range narrowing, reg-attrs, range-attrs, improved address-cells and size-cells handling, PciHostBridgeFdtDxe support for indirect configuration space access, legacy VGA ranges, preconfigured BARs. PciInfo tool.
August 2024 Various fixes, DtInterrupt protocol.
February 2024 Docs complete. DtInfo, DtProp and DtReg tools added. VirtNorFlashDxe, PciSioSerialDxe, PciHostBridgeFdtDxe drivers ported. Demo video at https://youtu.be/9RqKq4wGYZI.
January 2024 Open sourced. Work on documentation.
October 2023 Presented at the UEFI Fall 2023 Developers Conference and Plugfest. See the presentation slides.
2023 Reported to RISE as a 2024 priority.

Quick Start

To build RISC-V OVMF firmware enabled with FdtBusPkg components:

    $ git clone https://github.com/tianocore/edk2.git
    $ cd edk2
    $ git submodule add https://github.com/intel/FdtBusPkg
    $ git submodule update --init --recursive
    $ . edksetup.sh
    $ git am FdtBusPkg/Docs/edk2-patches/*
    $ git am FdtBusPkg/Docs/ovmf-patches/*
    $ export GCC_RISCV64_PREFIX=... (if you are on a non-RISCV64 system)
    $ build -a RISCV64  -p OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc -t GCC -b DEBUG

See the README for Developers for more directions.

License

FdtBusPkg is licensed under the BSD-2-Clause-Patent license (just like Tiano).

Security Policy

Intel is committed to rapidly addressing security vulnerabilities affecting our customers and providing clear guidance on the solution, impact, severity and mitigation.

Reporting a Vulnerability

Please report any security vulnerabilities in this project utilizing the guidelines here.

Contribute

This is a RISE Project under the Firmware WG. See the project wiki page.

Contributions are welcome. Please raise issues and pull requests.

Please see the policy on contributions and our Code of Conduct.