summaryrefslogtreecommitdiff
path: root/include/dm
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2015-12-14 16:18:15 +0100
committerSimon Glass <sjg@chromium.org>2016-01-12 10:19:09 -0700
commit66eaea6cd152a0dae5964930483f68d92047b2f5 (patch)
tree725a81c3cb8c4a31acc58ea706e735b8e1171573 /include/dm
parent9b20519887ab39b389cd3e178c11d5bdb19c92e6 (diff)
downloadu-boot-imx-66eaea6cd152a0dae5964930483f68d92047b2f5.zip
u-boot-imx-66eaea6cd152a0dae5964930483f68d92047b2f5.tar.gz
u-boot-imx-66eaea6cd152a0dae5964930483f68d92047b2f5.tar.bz2
dm: core: Add option to configure an offset for the address translation
Some platforms need to ability to configure an offset to the standard addresses extracted from the device-tree. This patch allows this by adding a function to DM to configure this offset (if needed). Signed-off-by: Stefan Roese <sr@denx.de> Acked-by: Simon Glass <sjg@chromium.org> Cc: Simon Glass <sjg@chromium.org> Fixed space before tab: Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm')
-rw-r--r--include/dm/device.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/dm/device.h b/include/dm/device.h
index 7fb9935..d9fc7fb 100644
--- a/include/dm/device.h
+++ b/include/dm/device.h
@@ -776,4 +776,25 @@ static inline void devm_kfree(struct udevice *dev, void *ptr)
#endif /* ! CONFIG_DEVRES */
+/**
+ * dm_set_translation_offset() - Set translation offset
+ * @offs: Translation offset
+ *
+ * Some platforms need a special address translation. Those
+ * platforms (e.g. mvebu in SPL) can configure a translation
+ * offset in the DM by calling this function. It will be
+ * added to all addresses returned in dev_get_addr().
+ */
+void dm_set_translation_offset(fdt_addr_t offs);
+
+/**
+ * dm_get_translation_offset() - Get translation offset
+ *
+ * This function returns the translation offset that can
+ * be configured by calling dm_set_translation_offset().
+ *
+ * @return translation offset for the device address (0 as default).
+ */
+fdt_addr_t dm_get_translation_offset(void);
+
#endif