Skip to content

Commit

Permalink
core: kernel: change DT getters to use manifest DT
Browse files Browse the repository at this point in the history
This change get_dt() and get_secure_dt() to use manifest DT
as an alternative if there is no embedded DT or external DT.

Signed-off-by: Sungbae Yoo <[email protected]>
Reviewed-by: Joakim Bech <[email protected]>
Acked-by: Jerome Forissier <[email protected]>
Reviewed-by: Etienne Carriere <[email protected]>
  • Loading branch information
ysbnim authored and jforissier committed Jun 12, 2024
1 parent 4bc2c5f commit c5e3e79
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/include/kernel/dt.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@ int fdt_get_reg_props_by_index(const void *fdt, int node, int index,
int fdt_get_reg_props_by_name(const void *fdt, int node, const char *name,
paddr_t *base, size_t *size);

/* Returns embedded DTB if present, then external DTB if found, then NULL */
/*
* Returns embedded DTB if present, then external DTB if found,
* then manifest DTB if found, then NULL.
*/
void *get_dt(void);

/*
Expand All @@ -247,7 +250,8 @@ void *get_dt(void);
*
* 1. Returns embedded DTB if available,
* 2. Secure external DTB if available,
* 3. If neither then NULL
* 3. Manifest DTB if available,
* 4. If neither then NULL
*/
void *get_secure_dt(void);

Expand Down
6 changes: 6 additions & 0 deletions core/kernel/dt.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,9 @@ void *get_dt(void)
if (!fdt)
fdt = get_external_dt();

if (!fdt)
fdt = get_manifest_dt();

return fdt;
}

Expand All @@ -463,6 +466,9 @@ void *get_secure_dt(void)
if (!fdt && IS_ENABLED(CFG_MAP_EXT_DT_SECURE))
fdt = get_external_dt();

if (!fdt)
fdt = get_manifest_dt();

return fdt;
}

Expand Down

0 comments on commit c5e3e79

Please sign in to comment.