summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Ma <peng.ma@nxp.com>2019-12-04 10:36:47 +0000
committerTom Rini <trini@konsulko.com>2020-01-27 12:11:38 -0500
commit403a4c7bcca6fa51f70821d2c6f193f4558a2816 (patch)
tree87c5d24360661240a70983b0fd6a67958d4d4c0a
parentb6ccf34194f1254e3e8e75a34729cc0125a91a85 (diff)
downloadu-boot-403a4c7bcca6fa51f70821d2c6f193f4558a2816.tar.gz
cmd: sata: Add block unbind device function
If we didn't unbind the sata from block device, the same devices would be added after sata remove, This patch is to resolve this issue as below: => sata info SATA#0: (3.0 Gbps) SATA#1: (3.0 Gbps) Device 0: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005PY30 Type: Hard Disk Supports 48-bit addressing Capacity: 286168.1 MB = 279.4 GB (586072368 x 512) Device 1: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005VX30 Type: Hard Disk Supports 48-bit addressing Capacity: 286168.1 MB = 279.4 GB (586072368 x 512) => sata stop => sata info SATA#0: (3.0 Gbps) SATA#1: (3.0 Gbps) Device 0: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005PY300 Type: Hard Disk Supports 48-bit addressing Capacity: 286168.1 MB = 279.4 GB (586072368 x 512) Device 1: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005VX300 Type: Hard Disk Supports 48-bit addressing Capacity: 286168.1 MB = 279.4 GB (586072368 x 512) Device 2: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005PY300 Type: Hard Disk Supports 48-bit addressing Capacity: 286168.1 MB = 279.4 GB (586072368 x 512) Device 3: Model: INTEL SSDSA2BW300G3D Firm: 4PC10362 Ser#: BTPR247005VX300 Type: Hard Disk Supports 48-bit addressing Capacity: 286168.1 MB = 279.4 GB (586072368 x 512) Signed-off-by: Peng Ma <peng.ma@nxp.com> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--cmd/sata.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd/sata.c b/cmd/sata.c
index a73cc54bd3..6bdb516cb5 100644
--- a/cmd/sata.c
+++ b/cmd/sata.c
@@ -26,6 +26,8 @@ int sata_remove(int devnum)
struct udevice *dev;
int rc;
+ blk_unbind_all(IF_TYPE_SATA);
+
rc = uclass_find_device(UCLASS_AHCI, devnum, &dev);
if (!rc && !dev)
rc = uclass_find_first_device(UCLASS_AHCI, &dev);