summaryrefslogtreecommitdiffstats
path: root/MdePkg
diff options
context:
space:
mode:
authorLeif Lindholm <quic_llindhol@quicinc.com>2024-10-01 15:51:26 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-10-02 02:58:31 +0000
commit5bad56093534d943e4fa6e00a068dbe20c39ef81 (patch)
tree250a1642eeb242ac3ee9f0d209bbc7457047935f /MdePkg
parent9ba11ee131fb2aaaf821c72477e3cf7b441e5c99 (diff)
downloadedk2-5bad56093534d943e4fa6e00a068dbe20c39ef81.tar.gz
edk2-5bad56093534d943e4fa6e00a068dbe20c39ef81.tar.bz2
edk2-5bad56093534d943e4fa6e00a068dbe20c39ef81.zip
MdePkg: export FdtAddressCells/FdtSizeCells from BaseFdtLib
Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/Library/FdtLib.h30
-rw-r--r--MdePkg/Library/BaseFdtLib/FdtLib.c36
2 files changed, 66 insertions, 0 deletions
diff --git a/MdePkg/Include/Library/FdtLib.h b/MdePkg/Include/Library/FdtLib.h
index 9e085b0b60..e4471fc2ab 100644
--- a/MdePkg/Include/Library/FdtLib.h
+++ b/MdePkg/Include/Library/FdtLib.h
@@ -639,6 +639,36 @@ FdtNodeOffsetByCompatible (
IN CONST CHAR8 *Compatible
);
+/**
+ Retrieve address size for a bus represented in the tree
+
+ @param[in] Fdt The pointer to FDT blob.
+ @param[in] NodeOffset Offset of node to check.
+
+ @return Number of cells in the bus address, or negative error.
+**/
+INT32
+EFIAPI
+FdtAddressCells (
+ IN CONST VOID *Fdt,
+ IN INT32 NodeOffset
+ );
+
+/**
+ Retrieve address range size for a bus represented in the tree
+
+ @param[in] Fdt The pointer to FDT blob.
+ @param[in] NodeOffset Offset of node to check.
+
+ @return Number of cells in the bus size, or negative error.
+**/
+INT32
+EFIAPI
+FdtSizeCells (
+ IN CONST VOID *Fdt,
+ IN INT32 NodeOffset
+ );
+
/* Debug functions. */
CONST
CHAR8
diff --git a/MdePkg/Library/BaseFdtLib/FdtLib.c b/MdePkg/Library/BaseFdtLib/FdtLib.c
index ca25a292cd..530549ba75 100644
--- a/MdePkg/Library/BaseFdtLib/FdtLib.c
+++ b/MdePkg/Library/BaseFdtLib/FdtLib.c
@@ -542,6 +542,42 @@ FdtNodeOffsetByCompatible (
return fdt_node_offset_by_compatible (Fdt, StartOffset, Compatible);
}
+/**
+ Retrieve address size for a bus represented in the tree
+
+ @param[in] Fdt The pointer to FDT blob.
+ @param[in] NodeOffset Offset of node to check.
+
+ @return Number of cells in the bus address, or negative error.
+**/
+INT32
+EFIAPI
+FdtAddressCells (
+ IN CONST VOID *Fdt,
+ IN INT32 NodeOffset
+ )
+{
+ return fdt_address_cells (Fdt, NodeOffset);
+}
+
+/**
+ Retrieve address range size for a bus represented in the tree
+
+ @param[in] Fdt The pointer to FDT blob.
+ @param[in] NodeOffset Offset of node to check.
+
+ @return Number of cells in the bus size, or negative error.
+**/
+INT32
+EFIAPI
+FdtSizeCells (
+ IN CONST VOID *Fdt,
+ IN INT32 NodeOffset
+ )
+{
+ return fdt_size_cells (Fdt, NodeOffset);
+}
+
/* Debug functions. */
CONST
CHAR8