From 002342aa5de40fb3b7a76582c056cbbcab3c84b9 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Mon, 22 Jul 2019 20:51:25 -0700 Subject: [PATCH] MLK-22293-10 imx6: Remove AHCI device before boot OS Since we remove SATA device before boot OS, when AHCI is enabled, update the codes to remove AHCI device. Signed-off-by: Ye Li --- arch/arm/mach-imx/cpu.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index 45d56619b6..bd93a3ccfa 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #ifdef CONFIG_VIDEO_GIS #include @@ -356,6 +358,20 @@ void arch_preboot_os(void) #if defined(CONFIG_PCIE_IMX) imx_pcie_remove(); #endif + +#if defined(CONFIG_IMX_AHCI) + struct udevice *dev; + int rc; + + rc = uclass_find_device(UCLASS_AHCI, 0, &dev); + if (!rc && dev) { + rc = device_remove(dev, DM_REMOVE_NORMAL); + if (rc) + printf("Cannot remove SATA device '%s' (err=%d)\n", + dev->name, rc); + } +#endif + #if defined(CONFIG_SATA) sata_remove(0); #if defined(CONFIG_MX6) -- 2.17.1