Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: cache some embedded DT info + generic bisect helper function #7067

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/arch/arm/plat-stm32mp1/conf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -411,3 +411,7 @@ CFG_STM32_DEBUG_ACCESS ?= $(CFG_TEE_CORE_DEBUG)
ifeq ($(call cfg-all-enabled,CFG_STM32MP15 CFG_STM32MP13),y)
$(error CFG_STM32MP13_CLK and CFG_STM32MP15_CLK are exclusive)
endif

# Enabling CFG_DT_CACHED_NODE_INFO saves few hundreds of millisecond
# at boot time.
CFG_DT_CACHED_NODE_INFO ?= y
5 changes: 5 additions & 0 deletions core/arch/arm/plat-stm32mp2/conf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,8 @@ endif

# Default enable firewall support
CFG_DRIVERS_FIREWALL ?= y

# Enabling CFG_DT_CACHED_NODE_INFO saves few hundreds of millisecond
# at boot time.
CFG_DT_CACHED_NODE_INFO ?= y

54 changes: 54 additions & 0 deletions core/include/kernel/dt.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,4 +489,58 @@ static inline void *get_manifest_dt(void)
}

#endif /* !CFG_DT */

#ifdef CFG_DT_CACHED_NODE_INFO
/*
* Find the offset of a parent node in the parent node cache
* @fdt: FDT to work on
* @node_offset: Offset of the node we look for its parent
* @parent_offset: Output parent node offset upon success
* @return 0 on success and -1 on failure
*/
int fdt_find_cached_parent_node(const void *fdt, int node_offset,
int *parent_offset);

/*
* Find the address/size cells value of a parent node in the parent node cache
* @fdt: FDT to work on
* @node_offset: Offset of the node we look for its parent
* @address_cells: Pointer to output #address-cells value upon success or NULL
* @size_cells: Pointer to output #size-cells value upon success or NULL
* @return 0 on success and -FDT_ERR_NOTFOUND on failure
*/
int fdt_find_cached_parent_reg_cells(const void *fdt, int node_offset,
int *address_cells, int *size_cells);
/*
* Find the node offset from its phandle in the phandle cache
* @fdt: FDT to work on
* @phandle: Node phandle
* @node_offset: Pointer to output node offset upon success
* @return 0 on success and -FDT_ERR_NOTFOUND on failure
*/
int fdt_find_cached_node_phandle(const void *fdt, uint32_t phandle,
int *node_offset);
#else
static inline int fdt_find_cached_parent_node(const void *fdt __unused,
int node_offset __unused,
int *parent_offset __unused)
{
return -1;
}

static inline int fdt_find_cached_parent_reg_cells(const void *fdt __unused,
int node_offset __unused,
int *address_cells __unused,
int *size_cells __unused)
{
return -1;
}

static inline int fdt_find_cached_node_phandle(const void *fdt __unused,
uint32_t phandle __unused,
int *node_offset __unused)
{
return -1;
}
#endif /* CFG_DT_CACHED_NODE_INFO */
#endif /* __KERNEL_DT_H */
Loading
Loading