public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Walter Lozano <walter.lozano@collabora.com>
To: u-boot@lists.denx.de
Subject: [PATCH 03/10] dm: doc: update of-plat with the suppor for driver aliases
Date: Fri, 29 May 2020 15:15:14 -0300	[thread overview]
Message-ID: <20200529181521.22073-4-walter.lozano@collabora.com> (raw)
In-Reply-To: <20200529181521.22073-1-walter.lozano@collabora.com>

Update the documentation with the support for driver aliases using
U_BOOT_DRIVER_ALIAS.

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

diff --git a/doc/driver-model/of-plat.rst b/doc/driver-model/of-plat.rst
index 034a68bb4e..aa0c8dde91 100644
--- a/doc/driver-model/of-plat.rst
+++ b/doc/driver-model/of-plat.rst
@@ -183,6 +183,17 @@ via U_BOOT_DRIVER(). This effectively means that a U_BOOT_DRIVER() with a
 it to a valid name for C) is needed, so a dedicated driver is required for
 each 'compatible' string.
 
+In order to make this a bit more flexible U_BOOT_DRIVER_ALIAS macro can be
+used to declare an alias for a driver name, typically a 'compatible' string.
+This macro produces no code, but it is by dtoc tool.
+
+During the build process dtoc parses both U_BOOT_DRIVER and U_BOOT_DRIVER_ALIAS
+to build a list of valid driver names and driver aliases. If the 'compatible'
+string used for a device does not not match a valid driver name, it will be
+checked against the list of driver aliases in order to get the right driver
+name to use. If in this step there is no match found a warning is issued to
+avoid run-time failures.
+
 Where a node has multiple compatible strings, a #define is used to make them
 equivalent, e.g.:
 
@@ -269,7 +280,7 @@ For example:
     };
 
     U_BOOT_DRIVER(mmc_drv) = {
-            .name           = "vendor_mmc",  /* matches compatible string */
+            .name           = "mmc_drv",
             .id             = UCLASS_MMC,
             .of_match       = mmc_ids,
             .ofdata_to_platdata = mmc_ofdata_to_platdata,
@@ -278,6 +289,7 @@ For example:
             .platdata_auto_alloc_size = sizeof(struct mmc_platdata),
     };
 
+    U_BOOT_DRIVER_ALIAS(vendor_mmc, mmc_drv) /* matches compatible string */
 
 Note that struct mmc_platdata is defined in the C file, not in a header. This
 is to avoid needing to include dt-structs.h in a header file. The idea is to
-- 
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 ` Walter Lozano [this message]
2020-06-04 15:59   ` [PATCH 03/10] dm: doc: update of-plat with the suppor for driver aliases 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 ` [PATCH 07/10] dm: doc: update of-plat with new phandle support Walter Lozano
2020-06-04 15:59   ` 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-4-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox