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>
This commit is contained in:
parent
0bfb66b6d1
commit
2cb4fade0e
|
@ -150,23 +150,25 @@ static int mvsata_ide_initialize_port(struct mvsata_port_registers *port)
|
||||||
|
|
||||||
int ide_preinit(void)
|
int ide_preinit(void)
|
||||||
{
|
{
|
||||||
|
int ret = MVSATA_STATUS_TIMEOUT;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
/* Enable ATA port 0 (could be SATA port 0 or 1) if declared */
|
/* Enable ATA port 0 (could be SATA port 0 or 1) if declared */
|
||||||
#if defined(CONFIG_SYS_ATA_IDE0_OFFSET)
|
#if defined(CONFIG_SYS_ATA_IDE0_OFFSET)
|
||||||
status = mvsata_ide_initialize_port(
|
status = mvsata_ide_initialize_port(
|
||||||
(struct mvsata_port_registers *)
|
(struct mvsata_port_registers *)
|
||||||
(CONFIG_SYS_ATA_BASE_ADDR + CONFIG_SYS_ATA_IDE0_OFFSET));
|
(CONFIG_SYS_ATA_BASE_ADDR + CONFIG_SYS_ATA_IDE0_OFFSET));
|
||||||
if (status)
|
if (status == MVSATA_STATUS_OK)
|
||||||
return status;
|
ret = MVSATA_STATUS_OK;
|
||||||
#endif
|
#endif
|
||||||
/* Enable ATA port 1 (could be SATA port 0 or 1) if declared */
|
/* Enable ATA port 1 (could be SATA port 0 or 1) if declared */
|
||||||
#if defined(CONFIG_SYS_ATA_IDE1_OFFSET)
|
#if defined(CONFIG_SYS_ATA_IDE1_OFFSET)
|
||||||
status = mvsata_ide_initialize_port(
|
status = mvsata_ide_initialize_port(
|
||||||
(struct mvsata_port_registers *)
|
(struct mvsata_port_registers *)
|
||||||
(CONFIG_SYS_ATA_BASE_ADDR + CONFIG_SYS_ATA_IDE1_OFFSET));
|
(CONFIG_SYS_ATA_BASE_ADDR + CONFIG_SYS_ATA_IDE1_OFFSET));
|
||||||
if (status)
|
if (status == MVSATA_STATUS_OK)
|
||||||
return status;
|
ret = MVSATA_STATUS_OK;
|
||||||
#endif
|
#endif
|
||||||
/* return success if all ports initializations succeeded */
|
/* Return success if at least one port initialization succeeded */
|
||||||
return MVSATA_STATUS_OK;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue