summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAlexandre Ghiti <alexandre.ghiti@canonical.com>2021-10-27 10:43:36 +0300
committerAnup Patel <anup@brainfault.org>2021-11-02 08:53:16 +0300
commitc891acca172dfc60719419e19338508a83d97931 (patch)
tree04658a01d122f0fbaf81b91adce26e738c812659 /include
parent723aa88ff4cc44230cf871bda319905113003279 (diff)
downloadopensbi-c891acca172dfc60719419e19338508a83d97931.tar.xz
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>
Diffstat (limited to 'include')
-rw-r--r--include/sbi_utils/fdt/fdt_helper.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/sbi_utils/fdt/fdt_helper.h b/include/sbi_utils/fdt/fdt_helper.h
index 5cb7340..24fee7a 100644
--- a/include/sbi_utils/fdt/fdt_helper.h
+++ b/include/sbi_utils/fdt/fdt_helper.h
@@ -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__ */