public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
To: Simon Glass <sjg@chromium.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Marek Vasut <marex@denx.de>, Peng Fan <peng.fan@nxp.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	Patrick Delaunay <patrick.delaunay@foss.st.com>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Michal Suchanek <msuchanek@suse.de>,
	AKASHI Takahiro <takahiro.akashi@linaro.org>,
	u-boot@lists.denx.de
Subject: Re: [RFC 1/7] dm: add get_dp_node() to struct uclass_driver
Date: Mon, 27 Mar 2023 08:48:11 +0200	[thread overview]
Message-ID: <b8bc2fd3-e4a2-8e01-6f17-e7cd864ee994@canonical.com> (raw)
In-Reply-To: <CAPnjgZ1n=+MEm=d9ZuZfYC_ZpP6MjC3GEUG7miGxryWRFumyng@mail.gmail.com>



On 3/27/23 06:00, Simon Glass wrote:
> Hi Heinrich,
> 
> On Mon, 27 Mar 2023 at 06:27, Heinrich Schuchardt
> <heinrich.schuchardt@canonical.com> wrote:
>>
>> Currently the device paths don't match the dm tree.
>> We should create a device path node per dm tree node.
>>
>> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
>> ---
>>   include/dm/uclass.h | 5 +++++
>>   1 file changed, 5 insertions(+)
> 
> This affects very few uclasses but adds a field to all of them. I
> think an event might be best for this. We can add an event spy in each
> of the affected uclasses.

EVENT_SPY does not allow to return information to the emitter of the event.

event_notfify() does not allow to select a single recipient.

In struct uclass_driver there are many other fields that are rarely used:

         int (*post_bind)(struct udevice *dev);
         int (*pre_unbind)(struct udevice *dev);
         int (*pre_probe)(struct udevice *dev);
         int (*post_probe)(struct udevice *dev);
         int (*pre_remove)(struct udevice *dev);
         int (*child_post_bind)(struct udevice *dev);
         int (*child_pre_probe)(struct udevice *dev);
         int (*child_post_probe)(struct udevice *dev);

If we wanted to save memory in linker generated lists we would convert 
structures with pointers to variable size arrays e.g.

struct ops * =
{
{ POST_BIND, post_bind },
{ CHILD_POST_BIND, child_post_bind},
{ END, NULL },
}

Best regards

Heinrich

> 
> 
>>
>> diff --git a/include/dm/uclass.h b/include/dm/uclass.h
>> index ee15c92063..e11637ce4d 100644
>> --- a/include/dm/uclass.h
>> +++ b/include/dm/uclass.h
>> @@ -11,6 +11,7 @@
>>
>>   #include <dm/ofnode.h>
>>   #include <dm/uclass-id.h>
>> +#include <efi.h>
>>   #include <linker_lists.h>
>>   #include <linux/list.h>
>>
>> @@ -68,6 +69,7 @@ struct udevice;
>>    * @child_post_probe: Called after a child in this uclass is probed
>>    * @init: Called to set up the uclass
>>    * @destroy: Called to destroy the uclass
>> + * @get_dp_node: Get EFI device path node
>>    * @priv_auto: If non-zero this is the size of the private data
>>    * to be allocated in the uclass's ->priv pointer. If zero, then the uclass
>>    * driver is responsible for allocating any data required.
>> @@ -99,6 +101,9 @@ struct uclass_driver {
>>          int (*child_post_probe)(struct udevice *dev);
>>          int (*init)(struct uclass *class);
>>          int (*destroy)(struct uclass *class);
>> +#if CONFIG_IS_ENABLED(EFI_LOADER)
>> +       struct efi_device_path *(*get_dp_node)(struct udevice *dev);
>> +#endif
>>          int priv_auto;
>>          int per_device_auto;
>>          int per_device_plat_auto;
>> --
>> 2.39.2
>>

  parent reply	other threads:[~2023-03-27  6:48 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-26 17:27 [RFC 0/7] efi_loader: move device-path node generation to DM Heinrich Schuchardt
2023-03-26 17:27 ` [RFC 1/7] dm: add get_dp_node() to struct uclass_driver Heinrich Schuchardt
2023-03-27  4:00   ` Simon Glass
2023-03-27  6:44     ` Ilias Apalodimas
2023-03-27  6:48     ` Heinrich Schuchardt [this message]
2023-03-27  8:24       ` Simon Glass
2023-03-27  9:41         ` Heinrich Schuchardt
2023-03-27 19:03           ` Simon Glass
2023-03-26 17:27 ` [RFC 2/7] dm: implement uclass_get_dp_node() Heinrich Schuchardt
2023-03-27  4:00   ` Simon Glass
2023-03-26 17:27 ` [RFC 3/7] dm: implement get_dp_node for block devices Heinrich Schuchardt
2023-03-27  4:00   ` Simon Glass
2023-03-27  6:13     ` Heinrich Schuchardt
2023-03-27  8:24       ` Simon Glass
2023-03-27  9:31         ` Heinrich Schuchardt
2023-03-27 19:02           ` Simon Glass
2023-03-26 17:27 ` [RFC 4/7] dm: implement get_dp_node for USB hub devices Heinrich Schuchardt
2023-03-26 17:27 ` [RFC 5/7] dm: implement get_dp_node for USB mass storage devices Heinrich Schuchardt
2023-03-26 17:27 ` [RFC 6/7] dm: implement get_dp_node for MMC devices Heinrich Schuchardt
2023-03-26 17:27 ` [RFC 7/7] efi_loader: use uclass_get_dp_node Heinrich Schuchardt
2023-03-27  4:00   ` Simon Glass

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=b8bc2fd3-e4a2-8e01-6f17-e7cd864ee994@canonical.com \
    --to=heinrich.schuchardt@canonical.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jh80.chung@samsung.com \
    --cc=marex@denx.de \
    --cc=msuchanek@suse.de \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=peng.fan@nxp.com \
    --cc=sjg@chromium.org \
    --cc=takahiro.akashi@linaro.org \
    --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