summaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-12-03 19:43:51 -0500
committerTom Rini <trini@konsulko.com>2016-12-03 19:43:51 -0500
commit73eed452b9c9827474c0789c30729dca6fcf061d (patch)
treeb33a39a41b7b2891b0171f79ea9b5599658884c3 /drivers/core
parentbfb380b30ad2d678c09037560abb6f09a5e9c9b6 (diff)
parenta2558e8729831e0bcef634ea2440e60425ef0ff6 (diff)
downloadu-boot-imx-73eed452b9c9827474c0789c30729dca6fcf061d.zip
u-boot-imx-73eed452b9c9827474c0789c30729dca6fcf061d.tar.gz
u-boot-imx-73eed452b9c9827474c0789c30729dca6fcf061d.tar.bz2
Merge branch 'master' of git://www.denx.de/git/u-boot-dm
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/device.c22
-rw-r--r--drivers/core/root.c7
2 files changed, 29 insertions, 0 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index dcf5d9d..ed553d7 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -693,6 +693,28 @@ fdt_addr_t dev_get_addr_index(struct udevice *dev, int index)
#endif
}
+fdt_addr_t dev_get_addr_size_index(struct udevice *dev, int index,
+ fdt_size_t *size)
+{
+#if CONFIG_IS_ENABLED(OF_CONTROL)
+ /*
+ * Only get the size in this first call. We'll get the addr in the
+ * next call to the exisiting dev_get_xxx function which handles
+ * all config options.
+ */
+ fdtdec_get_addr_size_auto_noparent(gd->fdt_blob, dev->of_offset,
+ "reg", index, size, false);
+
+ /*
+ * Get the base address via the existing function which handles
+ * all Kconfig cases
+ */
+ return dev_get_addr_index(dev, index);
+#else
+ return FDT_ADDR_T_NONE;
+#endif
+}
+
fdt_addr_t dev_get_addr_name(struct udevice *dev, const char *name)
{
#if CONFIG_IS_ENABLED(OF_CONTROL)
diff --git a/drivers/core/root.c b/drivers/core/root.c
index 33dc9c0..9edfc1e 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -41,6 +41,13 @@ struct udevice *dm_root(void)
return gd->dm_root;
}
+void dm_fixup_for_gd_move(struct global_data *new_gd)
+{
+ /* The sentinel node has moved, so update things that point to it */
+ new_gd->uclass_root.next->prev = &new_gd->uclass_root;
+ new_gd->uclass_root.prev->next = &new_gd->uclass_root;
+}
+
fdt_addr_t dm_get_translation_offset(void)
{
struct udevice *root = dm_root();