[PATCH v2 1/8] dm: fpga: Introduce new uclass

Simon Glass sjg at chromium.org
Thu Sep 22 13:35:46 CEST 2022


Hi,

On Thu, 22 Sept 2022 at 12:27, Michal Simek <michal.simek at amd.com> wrote:
>
>
>
> On 9/21/22 15:22, Alexander Dahl wrote:
> > For future DM based FPGA drivers and for now to have a meaningful
> > logging class for old FPGA drivers.
> >
> > Suggested-by: Michal Simek <michal.simek at amd.com>
> > Signed-off-by: Alexander Dahl <ada at thorsis.com>
> > ---
> >   include/dm/uclass-id.h | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h
> > index a432e43871..c2b15881ba 100644
> > --- a/include/dm/uclass-id.h
> > +++ b/include/dm/uclass-id.h
> > @@ -56,6 +56,7 @@ enum uclass_id {
> >       UCLASS_ETH,             /* Ethernet device */
> >       UCLASS_ETH_PHY,         /* Ethernet PHY device */
> >       UCLASS_FIRMWARE,        /* Firmware */
> > +     UCLASS_FPGA,            /* FPGA device */
> >       UCLASS_FUZZING_ENGINE,  /* Fuzzing engine */
> >       UCLASS_FS_FIRMWARE_LOADER,              /* Generic loader */
> >       UCLASS_GPIO,            /* Bank of general-purpose I/O pins */
>
> Simon: the whole series look good to me. I am happy to take it via my tree when
> you ACK it. Also no problem if you want to take it via your tree.
> Please let me know which way you want to go.

This is a good step forward but needs a lot more work.

Please add a uclass file for the FPGA - i.e.
drivers/fpga/fpga-uclass.c - see other such files for examples.

The FPGA uclass should have methods that match the non-DM interface.
You will likely need a DM_FPGA config to allow enabling the uclass.

Also this needs a simple sandbox driver/emulator pair, so that it can
be tested, with tests in test/dm/fpga.c that use the driver.

Admittedly this should have been done ages ago. I vaguely remember
mentioning it at the time, but perhaps I missed it. In any case, all
uclasses must have an API, implementation and tests that run in CI
with sandbox. Testing is a vital part of U-Boot and lack of testing is
the main reason why we went back to the 3-month release cycle.

Regards,
Simon


More information about the U-Boot mailing list