diff options
author | Ye Li <ye.li@nxp.com> | 2019-07-23 06:51:25 +0300 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2021-01-23 13:30:31 +0300 |
commit | acc403cb2c903d367292b0a231d3f81cfe8eccee (patch) | |
tree | fa6038fbb43f421006d6beeb4f825cce29558d1a /arch/arm | |
parent | 79e0217a8ea85706547130668f4ace0ffd6248d4 (diff) | |
download | u-boot-acc403cb2c903d367292b0a231d3f81cfe8eccee.tar.xz |
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 <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-imx/cpu.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/cpu.c b/arch/arm/mach-imx/cpu.c index 425d0f0327..af0b7fbf7b 100644 --- a/arch/arm/mach-imx/cpu.c +++ b/arch/arm/mach-imx/cpu.c @@ -24,6 +24,8 @@ #include <ipu_pixfmt.h> #include <thermal.h> #include <sata.h> +#include <dm/device-internal.h> +#include <dm/uclass-internal.h> #ifdef CONFIG_FSL_ESDHC_IMX #include <fsl_esdhc_imx.h> @@ -278,6 +280,20 @@ void arch_preboot_os(void) #if defined(CONFIG_PCIE_IMX) && !CONFIG_IS_ENABLED(DM_PCI) 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) if (!is_mx6sdl()) { sata_remove(0); |