All of lore.kernel.org
 help / color / mirror / Atom feed
From: Walter Lozano <walter.lozano@collabora.com>
To: u-boot@lists.denx.de
Subject: [PATCH 07/10] dm: doc: update of-plat with new phandle support
Date: Fri, 29 May 2020 15:15:18 -0300	[thread overview]
Message-ID: <20200529181521.22073-8-walter.lozano@collabora.com> (raw)
In-Reply-To: <20200529181521.22073-1-walter.lozano@collabora.com>

Update documentation to reflect the new phandle support when OF_PLATDATA
is used. Now phandles are implemented as pointers to U_BOOT_DEVICE,
which makes it possible to get a pointer to the actual device.

Signed-off-by: Walter Lozano <walter.lozano@collabora.com>
---
 doc/driver-model/of-plat.rst | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/doc/driver-model/of-plat.rst b/doc/driver-model/of-plat.rst
index aa0c8dde91..67477feec3 100644
--- a/doc/driver-model/of-plat.rst
+++ b/doc/driver-model/of-plat.rst
@@ -69,9 +69,8 @@ strictly necessary. Notable problems include:
    - Correct relations between nodes are not implemented. This means that
      parent/child relations (like bus device iteration) do not work yet.
      Some phandles (those that are recognised as such) are converted into
-     a pointer to platform data. This pointer can potentially be used to
-     access the referenced device (by searching for the pointer value).
-     This feature is not yet implemented, however.
+     a pointer to struct driver_info. This pointer can be used to access
+     the referenced device.
 
 
 How it works
@@ -146,10 +145,10 @@ and the following device declaration:
             .clock_freq_min_max     = {0x61a80, 0x8f0d180},
             .vmmc_supply            = 0xb,
             .num_slots              = 0x1,
-            .clocks                 = {{&dtv_clock_controller_at_ff760000, 456},
-                                       {&dtv_clock_controller_at_ff760000, 68},
-                                       {&dtv_clock_controller_at_ff760000, 114},
-                                       {&dtv_clock_controller_at_ff760000, 118}},
+            .clocks                 = {{NULL, 456},
+                                       {NULL, 68},
+                                       {NULL, 114},
+                                       {NULL, 118}},
             .cap_mmc_highspeed      = true,
             .disable_wp             = true,
             .bus_width              = 0x4,
@@ -164,6 +163,13 @@ and the following device declaration:
             .platdata_size  = sizeof(dtv_dwmmc_at_ff0c0000),
     };
 
+    void populate_phandle_data(void) {
+            dtv_dwmmc_at_ff0c0000.clocks[0].node = DM_GET_DEVICE(clock_controller_at_ff760000);
+            dtv_dwmmc_at_ff0c0000.clocks[1].node = DM_GET_DEVICE(clock_controller_at_ff760000);
+            dtv_dwmmc_at_ff0c0000.clocks[2].node = DM_GET_DEVICE(clock_controller_at_ff760000);
+            dtv_dwmmc_at_ff0c0000.clocks[3].node = DM_GET_DEVICE(clock_controller_at_ff760000);
+    }
+
 The device is then instantiated at run-time and the platform data can be
 accessed using:
 
@@ -329,7 +335,9 @@ prevents them being used inadvertently. All usage must be bracketed with
 #if CONFIG_IS_ENABLED(OF_PLATDATA).
 
 The dt-platdata.c file contains the device declarations and is is built in
-spl/dt-platdata.c.
+spl/dt-platdata.c. It additionally contains the definition of
+populate_phandle_data() which is responsible of filling the phandle
+information by adding references to U_BOOT_DEVICE by using DM_GET_DEVICE
 
 The beginnings of a libfdt Python module are provided. So far this only
 implements a subset of the features.
-- 
2.20.1

  parent reply	other threads:[~2020-05-29 18:15 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29 18:15 [PATCH 00/10] improve OF_PLATDATA support Walter Lozano
2020-05-29 18:15 ` [PATCH 01/10] dtoc: add support to scan drivers Walter Lozano
2020-06-04 15:59   ` Simon Glass
2020-06-08 15:49     ` Walter Lozano
2020-06-11 16:15       ` Walter Lozano
2020-06-11 16:44         ` Simon Glass
2020-06-11 16:45       ` Simon Glass
2020-06-11 17:11         ` Walter Lozano
2020-06-11 17:22           ` Simon Glass
2020-06-11 19:07             ` Walter Lozano
2020-06-12  2:22               ` Simon Glass
2020-06-12 17:38                 ` Walter Lozano
2020-06-16 13:43                   ` Simon Glass
2020-05-29 18:15 ` [PATCH 02/10] dtoc: add option to disable warnings Walter Lozano
2020-06-04 15:59   ` Simon Glass
2020-06-08 15:51     ` Walter Lozano
2020-05-29 18:15 ` [PATCH 03/10] dm: doc: update of-plat with the suppor for driver aliases Walter Lozano
2020-06-04 15:59   ` Simon Glass
2020-05-29 18:15 ` [PATCH 04/10] core: drop const for struct driver_info Walter Lozano
2020-06-04 15:59   ` Simon Glass
2020-05-29 18:15 ` [PATCH 05/10] core: extend struct driver_info to point to device Walter Lozano
2020-05-29 18:56   ` Walter Lozano
2020-05-29 19:00     ` Simon Glass
2020-05-29 19:20       ` Walter Lozano
2020-05-29 20:42         ` Simon Glass
2020-06-04 15:59   ` Simon Glass
2020-06-08 15:53     ` Walter Lozano
2020-05-29 18:15 ` [PATCH 06/10] dtoc: extend dtoc to use struct driver_info when linking nodes Walter Lozano
2020-06-04 15:59   ` Simon Glass
2020-05-29 18:15 ` Walter Lozano [this message]
2020-06-04 15:59   ` [PATCH 07/10] dm: doc: update of-plat with new phandle support Simon Glass
2020-06-08 15:54     ` Walter Lozano
2020-05-29 18:15 ` [PATCH 08/10] dtoc: update tests to match new platdata Walter Lozano
2020-06-04 15:59   ` Simon Glass
2020-05-29 18:15 ` [PATCH 09/10] dtoc: update dtb_platdata to support cd-gpios Walter Lozano
2020-06-04 15:59   ` Simon Glass
2020-06-08 16:01     ` Walter Lozano
2020-06-14  2:49       ` Simon Glass
2020-05-29 18:15 ` [PATCH 10/10] dtoc add test for cd-gpios Walter Lozano
2020-06-04 15:59   ` Simon Glass
2020-05-29 18:25 ` [PATCH 00/10] improve OF_PLATDATA support Jagan Teki
2020-05-29 19:15   ` Walter Lozano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200529181521.22073-8-walter.lozano@collabora.com \
    --to=walter.lozano@collabora.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.