aboutsummaryrefslogtreecommitdiff
path: root/boot/bootmeth_script.c
diff options
context:
space:
mode:
authorTony Dinh2023-10-11 13:26:42 -0700
committerTom Rini2023-10-23 13:07:12 -0400
commita7527fbbf20619e16f4b3bf13139f6f9a881b964 (patch)
treebbce5bd54f94c777a7b8acfe3aec28890fed0c26 /boot/bootmeth_script.c
parent7a790f018a812b5897fc144c46291de8df633429 (diff)
bootstd: sata: Add bootstd support for ahci sata
Add ahci sata bootdev and corresponding hunting function. Signed-off-by: Tony Dinh <mibodhi@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'boot/bootmeth_script.c')
-rw-r--r--boot/bootmeth_script.c16
1 files changed, 12 insertions, 4 deletions
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)