From 66eaea6cd152a0dae5964930483f68d92047b2f5 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Mon, 14 Dec 2015 16:18:15 +0100 Subject: 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 Acked-by: Simon Glass Cc: Simon Glass Fixed space before tab: Signed-off-by: Simon Glass --- include/dm/device.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include') diff --git a/include/dm/device.h b/include/dm/device.h index 7fb99356be..d9fc7fb953 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 -- cgit v1.2.3