[RFC] devices without FDT node

Heinrich Schuchardt xypron.glpk at gmx.de
Thu Mar 4 16:01:24 CET 2021


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 of
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 in
code duplication in the board files.

What do think about adding the usual driver functions to struct driver_info:

        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.

Best regards

Heinrich


More information about the U-Boot mailing list