[PATCH v4] bootstd: sata: Add bootstd support for ahci sata

Tony Dinh mibodhi at gmail.com
Wed Oct 11 20:49:01 CEST 2023


Hi Tom,

On Wed, Oct 11, 2023 at 7:43 AM Tom Rini <trini at konsulko.com> wrote:
>
> On Sun, Sep 17, 2023 at 04:06:48PM -0700, Tony Dinh wrote:
> > Add ahci sata bootdev and corresponding hunting function.
> >
> > Signed-off-by: Tony Dinh <mibodhi at gmail.com>
> > Reviewed-by: Simon Glass <sjg at chromium.org>
> > ---
> >
> > Changes in v4:
> > - Revise logic in bootmeth_script() to set devtype to sata for non-scsi
> > SATA device
> > - Rewrite sata_rescan() logic to properly remove all devices before probing
> > - Add description to sata_rescan() header
> >
> > Changes in v3:
> > - Correct drivers/ata/Makefile to compile sata_bootdev only if
> > ahci sata is enabled.
> >
> > Changes in v2:
> > - set devtype to sata in bootmeth_script for non-scsi SATA device.
> >
> >  boot/bootmeth_script.c     | 14 +++++++--
> >  drivers/ata/Makefile       |  2 +-
> >  drivers/ata/sata.c         | 32 ++++++++++++++++++++
> >  drivers/ata/sata_bootdev.c | 62 ++++++++++++++++++++++++++++++++++++++
> >  include/sata.h             |  6 ++++
> >  5 files changed, 112 insertions(+), 4 deletions(-)
> >  create mode 100644 drivers/ata/sata_bootdev.c
> >
> > diff --git a/boot/bootmeth_script.c b/boot/bootmeth_script.c
> > index 58c57a2d4b..96e0ec5efa 100644
> > --- a/boot/bootmeth_script.c
> > +++ b/boot/bootmeth_script.c
> > @@ -190,10 +190,18 @@ static int script_boot(struct udevice *dev, struct bootflow *bflow)
> >       ulong addr;
> >       int ret;
> >
> > -     if (desc->uclass_id == UCLASS_USB)
> > +     if (desc->uclass_id == UCLASS_USB) {
> >               ret = env_set("devtype", "usb");
> > -     else
> > -             ret = env_set("devtype", blk_get_devtype(bflow->blk));
> > +     } else {
> > +             /* If the uclass is AHCI, but the driver is ATA
> > +              * (not scsi), set devtype to sata
> > +              */
> > +             if (!ret && IS_ENABLED(CONFIG_SATA) &&
>
> This is a warning here as ret is uninitalized at this point.

Thanks! I'll send the v5 patch.

All the best ,
Tony

>
> --
> Tom


More information about the U-Boot mailing list