[RFC] devices without FDT node

Heinrich Schuchardt xypron.glpk at gmx.de
Thu Mar 4 21:10:52 CET 2021

Am 4. März 2021 20:26:49 MEZ schrieb Simon Glass <sjg at chromium.org>:
>Hi Heinrich,
>On Thu, 4 Mar 2021 at 08:01, Heinrich Schuchardt <xypron.glpk at gmx.de>
>> Hello Simon,
>> in U-Boot we can define drivers via U_BOOT_DRVINFO and U_BOOT_DRIVER.
>> My current use case is SBI system reset extension. A driver would not
>> reasonably depend on the device-tree because if the RISC-V cpu is in
>> S-mode we know that there must be an SBI implementation. If the
>> extension is available, has to be determined in the probe() function
>> the driver.
>> My current solution is to use U_BOOT_DRIVER and to call
>> device_bind_driver(gd->dm_root,...) in board_init(). But that results
>> code duplication in the board files.
>> What do think about adding the usual driver functions to struct
>>         int (*bind)(struct udevice *dev);
>>         int (*probe)(struct udevice *dev);
>>         int (*remove)(struct udevice *dev);
>>         int (*unbind)(struct udevice *dev);
>> Alternatively one could add a flag DM_FLAG_AUTO_PROBE to the struct
>> driver flags field which would lead to probing irrespective of the
>> device-tree.
>> I would prefer the latter solution.
>Surely this should be in the devicetree. Why would it not be?

Here is the background to my question:


The OpenSBI maintainers did not see any need for a device tree node for calling the system reset extension.

Best regards



More information about the U-Boot mailing list