include: sbi_utils: Introduce an helper to get fdt base address

This simply adds an helper to get fdt address which is more explicit than
sbi_scratch_thishart_arg1_ptr.

Signed-off-by: Alexandre Ghiti <alexandre.ghiti@canonical.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
Alexandre Ghiti
2021-10-27 09:43:36 +02:00
committed by Anup Patel
parent 723aa88ff4
commit c891acca17
12 changed files with 24 additions and 14 deletions

View File

@@ -11,6 +11,7 @@
#define __FDT_HELPER_H__
#include <sbi/sbi_types.h>
#include <sbi/sbi_scratch.h>
struct fdt_match {
const char *compatible;
@@ -81,4 +82,9 @@ int fdt_parse_aclint_node(void *fdt, int nodeoffset, bool for_timer,
int fdt_parse_compat_addr(void *fdt, uint64_t *addr,
const char *compatible);
static inline void *fdt_get_address(void)
{
return sbi_scratch_thishart_arg1_ptr();
}
#endif /* __FDT_HELPER_H__ */