diff options
author | Simon Guinot <simon.guinot@sequanux.org> | 2011-11-21 19:25:46 +0530 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2011-12-06 23:59:30 +0100 |
commit | 2cb4fade0ef00ebf485db05d6aab4acd8897ecf9 (patch) | |
tree | a9beea80e04f77db0c29dc7d835ff10d88b25cdb /drivers/block/mvsata_ide.c | |
parent | 0bfb66b6d1497046aac9c4d61f4478a403659f5a (diff) | |
download | u-boot-imx-2cb4fade0ef00ebf485db05d6aab4acd8897ecf9.zip u-boot-imx-2cb4fade0ef00ebf485db05d6aab4acd8897ecf9.tar.gz u-boot-imx-2cb4fade0ef00ebf485db05d6aab4acd8897ecf9.tar.bz2 |
mvsata: fix ide_preinit for missing disks
Consider that ide_preinit() succeed if at least one port is successfully
initialized. This allows to iniatialize IDE support on a board with two
SATA ports but a single hard disk available.
Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Diffstat (limited to 'drivers/block/mvsata_ide.c')
-rw-r--r-- | drivers/block/mvsata_ide.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/block/mvsata_ide.c b/drivers/block/mvsata_ide.c index 1be395f..a88d0f7 100644 --- a/drivers/block/mvsata_ide.c +++ b/drivers/block/mvsata_ide.c @@ -150,23 +150,25 @@ static int mvsata_ide_initialize_port(struct mvsata_port_registers *port) int ide_preinit(void) { + int ret = MVSATA_STATUS_TIMEOUT; int status; + /* Enable ATA port 0 (could be SATA port 0 or 1) if declared */ #if defined(CONFIG_SYS_ATA_IDE0_OFFSET) status = mvsata_ide_initialize_port( (struct mvsata_port_registers *) (CONFIG_SYS_ATA_BASE_ADDR + CONFIG_SYS_ATA_IDE0_OFFSET)); - if (status) - return status; + if (status == MVSATA_STATUS_OK) + ret = MVSATA_STATUS_OK; #endif /* Enable ATA port 1 (could be SATA port 0 or 1) if declared */ #if defined(CONFIG_SYS_ATA_IDE1_OFFSET) status = mvsata_ide_initialize_port( (struct mvsata_port_registers *) (CONFIG_SYS_ATA_BASE_ADDR + CONFIG_SYS_ATA_IDE1_OFFSET)); - if (status) - return status; + if (status == MVSATA_STATUS_OK) + ret = MVSATA_STATUS_OK; #endif - /* return success if all ports initializations succeeded */ - return MVSATA_STATUS_OK; + /* Return success if at least one port initialization succeeded */ + return ret; } |