From a7527fbbf20619e16f4b3bf13139f6f9a881b964 Mon Sep 17 00:00:00 2001 From: Tony Dinh Date: Wed, 11 Oct 2023 13:26:42 -0700 Subject: bootstd: sata: Add bootstd support for ahci sata Add ahci sata bootdev and corresponding hunting function. Signed-off-by: Tony Dinh Reviewed-by: Simon Glass Reviewed-by: Stefan Roese --- boot/bootmeth_script.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'boot/bootmeth_script.c') diff --git a/boot/bootmeth_script.c b/boot/bootmeth_script.c index 345114dabf7..06340e43d2d 100644 --- a/boot/bootmeth_script.c +++ b/boot/bootmeth_script.c @@ -188,12 +188,20 @@ static int script_boot(struct udevice *dev, struct bootflow *bflow) { struct blk_desc *desc = dev_get_uclass_plat(bflow->blk); ulong addr; - int ret; + int ret = 0; - 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 (IS_ENABLED(CONFIG_SATA) && + desc->uclass_id == UCLASS_AHCI) + ret = env_set("devtype", "sata"); + else + ret = env_set("devtype", blk_get_devtype(bflow->blk)); + } if (!ret) ret = env_set_hex("devnum", desc->devnum); if (!ret) -- cgit v1.2.3