public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Tony Dinh <mibodhi@gmail.com>
Cc: Simon Glass <sjg@chromium.org>,
	U-Boot Mailing List <u-boot@lists.denx.de>,
	Stefan Roese <sr@denx.de>
Subject: Re: [PATCH v4] bootstd: sata: Add bootstd support for ahci sata
Date: Wed, 11 Oct 2023 10:43:56 -0400	[thread overview]
Message-ID: <20231011144356.GA900529@bill-the-cat> (raw)
In-Reply-To: <20230917230649.30357-1-mibodhi@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1767 bytes --]

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@gmail.com>
> Reviewed-by: Simon Glass <sjg@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.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  parent reply	other threads:[~2023-10-11 14:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-17 23:06 [PATCH v4] bootstd: sata: Add bootstd support for ahci sata Tony Dinh
2023-09-22 18:27 ` Simon Glass
2023-10-11 14:43 ` Tom Rini [this message]
2023-10-11 18:49   ` Tony Dinh

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=20231011144356.GA900529@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=mibodhi@gmail.com \
    --cc=sjg@chromium.org \
    --cc=sr@denx.de \
    --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