summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-04-24 19:27:29 +0300
committerTom Rini <trini@konsulko.com>2019-04-24 19:27:29 +0300
commit7d994067424776b6184872b82fcaf4c0b95528f9 (patch)
treef8aaab8764ad4bc88c6389f8ee6b1ee75360b7a6 /drivers
parent180e38ad2dbb3340cc71fb4fa335a68f2a4122ef (diff)
parent8781d04f422e110fef864dd849085054fe5b0e65 (diff)
downloadu-boot-7d994067424776b6184872b82fcaf4c0b95528f9.tar.xz
Merge tag 'pull-24apr19' of git://git.denx.de/u-boot-dm
Various minor sandbox iumprovements Fixes for tracing with sandbox Refactoring for boot_get_fdt()
Diffstat (limited to 'drivers')
-rw-r--r--drivers/core/Kconfig9
-rw-r--r--drivers/core/fdtaddr.c9
-rw-r--r--drivers/core/root.c21
-rw-r--r--drivers/core/simple-bus.c1
4 files changed, 16 insertions, 24 deletions
diff --git a/drivers/core/Kconfig b/drivers/core/Kconfig
index ddf2fb3fb8..2d195ae35e 100644
--- a/drivers/core/Kconfig
+++ b/drivers/core/Kconfig
@@ -225,6 +225,15 @@ config SPL_OF_TRANSLATE
used for the address translation. This function is faster and
smaller in size than fdt_translate_address().
+config TRANSLATION_OFFSET
+ bool "Platforms specific translation offset"
+ depends on DM && OF_CONTROL
+ help
+ Some platforms need a special address translation. Those
+ platforms (e.g. mvebu in SPL) can configure a translation
+ offset by enabling this option and setting the translation_offset
+ variable in the GD in their platform- / board-specific code.
+
config OF_ISA_BUS
bool
depends on OF_TRANSLATE
diff --git a/drivers/core/fdtaddr.c b/drivers/core/fdtaddr.c
index e113f1dd39..c2873861da 100644
--- a/drivers/core/fdtaddr.c
+++ b/drivers/core/fdtaddr.c
@@ -74,13 +74,16 @@ fdt_addr_t devfdt_get_addr_index(struct udevice *dev, int index)
}
}
+#if defined(CONFIG_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 dm_set_translation_offset() that
- * will get added to all addresses returned by devfdt_get_addr().
+ * offset by setting this value in the GD and enaling this
+ * feature via CONFIG_TRANSLATION_OFFSET. This value will
+ * get added to all addresses returned by devfdt_get_addr().
*/
- addr += dm_get_translation_offset();
+ addr += gd->translation_offset;
+#endif
return addr;
#else
diff --git a/drivers/core/root.c b/drivers/core/root.c
index e6ec7faf37..8fa096648e 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -25,10 +25,6 @@
DECLARE_GLOBAL_DATA_PTR;
-struct root_priv {
- fdt_addr_t translation_offset; /* optional translation offset */
-};
-
static const struct driver_info root_info = {
.name = "root_driver",
};
@@ -52,22 +48,6 @@ void dm_fixup_for_gd_move(struct global_data *new_gd)
}
}
-fdt_addr_t dm_get_translation_offset(void)
-{
- struct udevice *root = dm_root();
- struct root_priv *priv = dev_get_priv(root);
-
- return priv->translation_offset;
-}
-
-void dm_set_translation_offset(fdt_addr_t offs)
-{
- struct udevice *root = dm_root();
- struct root_priv *priv = dev_get_priv(root);
-
- priv->translation_offset = offs;
-}
-
#if defined(CONFIG_NEEDS_MANUAL_RELOC)
void fix_drivers(void)
{
@@ -420,7 +400,6 @@ int dm_init_and_scan(bool pre_reloc_only)
U_BOOT_DRIVER(root_driver) = {
.name = "root_driver",
.id = UCLASS_ROOT,
- .priv_auto_alloc_size = sizeof(struct root_priv),
};
/* This is the root uclass */
diff --git a/drivers/core/simple-bus.c b/drivers/core/simple-bus.c
index e16d8a9ff4..7fc23ef82d 100644
--- a/drivers/core/simple-bus.c
+++ b/drivers/core/simple-bus.c
@@ -60,4 +60,5 @@ U_BOOT_DRIVER(simple_bus_drv) = {
.name = "generic_simple_bus",
.id = UCLASS_SIMPLE_BUS,
.of_match = generic_simple_bus_ids,
+ .flags = DM_FLAG_PRE_RELOC,
};