Re: [U-Boot] [PATCH v3 04/26] dm: core: Set device tree node for root device

2015-01-26 Thread Simon Glass
On 25 January 2015 at 08:26, Simon Glass s...@chromium.org wrote:
 The root device corresponds to the root device tree node, so set this up.
 Also add a few notes to the documentation.

 Signed-off-by: Simon Glass s...@chromium.org
 ---

 Changes in v3: None
 Changes in v2: None

  doc/driver-model/README.txt | 4 
  drivers/core/root.c | 3 +++
  2 files changed, 7 insertions(+)

Applied to -u-boot-dm
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3 04/26] dm: core: Set device tree node for root device

2015-01-25 Thread Simon Glass
The root device corresponds to the root device tree node, so set this up.
Also add a few notes to the documentation.

Signed-off-by: Simon Glass s...@chromium.org
---

Changes in v3: None
Changes in v2: None

 doc/driver-model/README.txt | 4 
 drivers/core/root.c | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/doc/driver-model/README.txt b/doc/driver-model/README.txt
index eafa825..4041569 100644
--- a/doc/driver-model/README.txt
+++ b/doc/driver-model/README.txt
@@ -363,6 +363,10 @@ can leave out platdata_auto_alloc_size. In this case you 
can use malloc
 in your ofdata_to_platdata (or probe) method to allocate the required memory,
 and you should free it in the remove method.
 
+The driver model tree is intended to mirror that of the device tree. The
+root driver is at device tree offset 0 (the root node, '/'), and its
+children are the children of the root node.
+
 
 Declaring Uclasses
 --
diff --git a/drivers/core/root.c b/drivers/core/root.c
index 47b3acf..a5b0a61 100644
--- a/drivers/core/root.c
+++ b/drivers/core/root.c
@@ -49,6 +49,9 @@ int dm_init(void)
ret = device_bind_by_name(NULL, false, root_info, DM_ROOT_NON_CONST);
if (ret)
return ret;
+#ifdef CONFIG_OF_CONTROL
+   DM_ROOT_NON_CONST-of_offset = 0;
+#endif
ret = device_probe(DM_ROOT_NON_CONST);
if (ret)
return ret;
-- 
2.2.0.rc0.207.ga3a616c

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot