aboutsummaryrefslogtreecommitdiff
path: root/include/fdt_support.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-07-23 14:16:21 -0400
committerTom Rini <trini@konsulko.com>2019-07-23 14:16:21 -0400
commitff8c23e784f57a7098e91a200ed7f5a48612b653 (patch)
tree2d007e81ba9fc0d6334a9568d31422bd0e9dba88 /include/fdt_support.h
parent9565bd7c6f4241af746fd67ee5c8406a99c148b3 (diff)
parent1f99eaff08f699472860c82480344e824a737d57 (diff)
Merge tag 'u-boot-stm32-20190723' of https://gitlab.denx.de/u-boot/custodians/u-boot-stm
- add rtc driver for stm32mp1 - add remoteproc driver for stm32mp1 - use kernel qspi compatible string for stm32
Diffstat (limited to 'include/fdt_support.h')
-rw-r--r--include/fdt_support.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/fdt_support.h b/include/fdt_support.h
index 27fe564f0b..cefb2b2cce 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -218,8 +218,32 @@ static inline void fdt_fixup_mtdparts(void *fdt,
#endif
void fdt_del_node_and_alias(void *blob, const char *alias);
+
+/**
+ * Translate an address from the DT into a CPU physical address
+ *
+ * The translation relies on the "ranges" property.
+ *
+ * @param blob Pointer to device tree blob
+ * @param node_offset Node DT offset
+ * @param in_addr Pointer to the address to translate
+ * @return translated address or OF_BAD_ADDR on error
+ */
u64 fdt_translate_address(const void *blob, int node_offset,
const __be32 *in_addr);
+/**
+ * Translate a DMA address from the DT into a CPU physical address
+ *
+ * The translation relies on the "dma-ranges" property.
+ *
+ * @param blob Pointer to device tree blob
+ * @param node_offset Node DT offset
+ * @param in_addr Pointer to the DMA address to translate
+ * @return translated DMA address or OF_BAD_ADDR on error
+ */
+u64 fdt_translate_dma_address(const void *blob, int node_offset,
+ const __be32 *in_addr);
+
int fdt_node_offset_by_compat_reg(void *blob, const char *compat,
phys_addr_t compat_off);
int fdt_alloc_phandle(void *blob);