mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-20 22:21:41 +00:00
Fix problems with CDROM drive as slave device on Lite5200 IDE bus.
This commit is contained in:
parent
cce625e557
commit
64f70bede3
4 changed files with 37 additions and 26 deletions
|
@ -2,6 +2,8 @@
|
||||||
Changes since U-Boot 1.1.1:
|
Changes since U-Boot 1.1.1:
|
||||||
======================================================================
|
======================================================================
|
||||||
|
|
||||||
|
* Fix problems with CDROM drive as slave device on Lite5200 IDE bus.
|
||||||
|
|
||||||
* Patch by Stephen Williams, 15 July 2004
|
* Patch by Stephen Williams, 15 July 2004
|
||||||
Set the PCI class code for JSE board as part of PCI interface setup
|
Set the PCI class code for JSE board as part of PCI interface setup
|
||||||
|
|
||||||
|
|
|
@ -288,6 +288,8 @@ void init_ide_reset (void)
|
||||||
/* Configure PSC1_4 as GPIO output for ATA reset */
|
/* Configure PSC1_4 as GPIO output for ATA reset */
|
||||||
*(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC1_4;
|
*(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC1_4;
|
||||||
*(vu_long *) MPC5XXX_WU_GPIO_DIR |= GPIO_PSC1_4;
|
*(vu_long *) MPC5XXX_WU_GPIO_DIR |= GPIO_PSC1_4;
|
||||||
|
/* Deassert reset */
|
||||||
|
*(vu_long *) MPC5XXX_WU_GPIO_DATA |= GPIO_PSC1_4;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ide_set_reset (int idereset)
|
void ide_set_reset (int idereset)
|
||||||
|
@ -296,6 +298,8 @@ void ide_set_reset (int idereset)
|
||||||
|
|
||||||
if (idereset) {
|
if (idereset) {
|
||||||
*(vu_long *) MPC5XXX_WU_GPIO_DATA &= ~GPIO_PSC1_4;
|
*(vu_long *) MPC5XXX_WU_GPIO_DATA &= ~GPIO_PSC1_4;
|
||||||
|
/* Make a delay. MPC5200 spec says 25 usec min */
|
||||||
|
udelay(500000);
|
||||||
} else {
|
} else {
|
||||||
*(vu_long *) MPC5XXX_WU_GPIO_DATA |= GPIO_PSC1_4;
|
*(vu_long *) MPC5XXX_WU_GPIO_DATA |= GPIO_PSC1_4;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1009,8 +1009,10 @@ static void ide_ident (block_dev_desc_t *dev_desc)
|
||||||
|
|
||||||
#ifdef CONFIG_AMIGAONEG3SE
|
#ifdef CONFIG_AMIGAONEG3SE
|
||||||
int max_bus_scan;
|
int max_bus_scan;
|
||||||
int retries = 0;
|
|
||||||
char *s;
|
char *s;
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_ATAPI
|
||||||
|
int retries = 0;
|
||||||
int do_retry = 0;
|
int do_retry = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1041,14 +1043,11 @@ static void ide_ident (block_dev_desc_t *dev_desc)
|
||||||
dev_desc->if_type=IF_TYPE_IDE;
|
dev_desc->if_type=IF_TYPE_IDE;
|
||||||
#ifdef CONFIG_ATAPI
|
#ifdef CONFIG_ATAPI
|
||||||
|
|
||||||
#ifdef CONFIG_AMIGAONEG3SE
|
|
||||||
do_retry = 0;
|
do_retry = 0;
|
||||||
retries = 0;
|
retries = 0;
|
||||||
|
|
||||||
/* Warning: This will be tricky to read */
|
/* Warning: This will be tricky to read */
|
||||||
while (retries <= 1) {
|
while (retries <= 1) {
|
||||||
#endif /* CONFIG_AMIGAONEG3SE */
|
|
||||||
|
|
||||||
/* check signature */
|
/* check signature */
|
||||||
if ((ide_inb(device,ATA_SECT_CNT) == 0x01) &&
|
if ((ide_inb(device,ATA_SECT_CNT) == 0x01) &&
|
||||||
(ide_inb(device,ATA_SECT_NUM) == 0x01) &&
|
(ide_inb(device,ATA_SECT_NUM) == 0x01) &&
|
||||||
|
@ -1079,32 +1078,35 @@ static void ide_ident (block_dev_desc_t *dev_desc)
|
||||||
|
|
||||||
if (((c & ATA_STAT_DRQ) == 0) ||
|
if (((c & ATA_STAT_DRQ) == 0) ||
|
||||||
((c & (ATA_STAT_FAULT|ATA_STAT_ERR)) != 0) ) {
|
((c & (ATA_STAT_FAULT|ATA_STAT_ERR)) != 0) ) {
|
||||||
|
#ifdef CONFIG_ATAPI
|
||||||
#ifdef CONFIG_AMIGAONEG3SE
|
#ifdef CONFIG_AMIGAONEG3SE
|
||||||
if (retries == 0) {
|
s = getenv("ide_doreset");
|
||||||
do_retry = 1;
|
if (s && strcmp(s, "on") == 0)
|
||||||
} else {
|
#endif
|
||||||
return;
|
{
|
||||||
}
|
/* Need to soft reset the device in case it's an ATAPI... */
|
||||||
|
PRINTF("Retrying...\n");
|
||||||
|
ide_outb (device, ATA_DEV_HD, ATA_LBA | ATA_DEVICE(device));
|
||||||
|
udelay(100000);
|
||||||
|
ide_outb (device, ATA_COMMAND, 0x08);
|
||||||
|
udelay (500000); /* 500 ms */
|
||||||
|
}
|
||||||
|
/* Select device
|
||||||
|
*/
|
||||||
|
ide_outb (device, ATA_DEV_HD, ATA_LBA | ATA_DEVICE(device));
|
||||||
|
retries++;
|
||||||
#else
|
#else
|
||||||
return;
|
return;
|
||||||
#endif /* CONFIG_AMIGAONEG3SE */
|
#endif
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_AMIGAONEG3SE
|
|
||||||
s = getenv("ide_doreset");
|
|
||||||
if (s && strcmp(s, "on") == 0 && 1 == do_retry) {
|
|
||||||
/* Need to soft reset the device in case it's an ATAPI... */
|
|
||||||
PRINTF("Retrying...\n");
|
|
||||||
ide_outb (device, ATA_DEV_HD, ATA_LBA | ATA_DEVICE(device));
|
|
||||||
udelay(100000);
|
|
||||||
ide_outb (device, ATA_COMMAND, 0x08);
|
|
||||||
udelay (100000); /* 100 ms */
|
|
||||||
retries++;
|
|
||||||
} else {
|
|
||||||
retries = 100;
|
|
||||||
}
|
}
|
||||||
|
#ifdef CONFIG_ATAPI
|
||||||
|
else
|
||||||
|
break;
|
||||||
} /* see above - ugly to read */
|
} /* see above - ugly to read */
|
||||||
#endif /* CONFIG_AMIGAONEG3SE */
|
|
||||||
|
if (retries == 2) /* Not found */
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
input_swap_data (device, iobuf, ATA_SECTORWORDS);
|
input_swap_data (device, iobuf, ATA_SECTORWORDS);
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,7 @@
|
||||||
/* Partitions */
|
/* Partitions */
|
||||||
#define CONFIG_MAC_PARTITION
|
#define CONFIG_MAC_PARTITION
|
||||||
#define CONFIG_DOS_PARTITION
|
#define CONFIG_DOS_PARTITION
|
||||||
|
#define CONFIG_ISO_PARTITION
|
||||||
|
|
||||||
/* USB */
|
/* USB */
|
||||||
#if 1
|
#if 1
|
||||||
|
@ -324,7 +325,7 @@
|
||||||
#define CONFIG_IDE_PREINIT
|
#define CONFIG_IDE_PREINIT
|
||||||
|
|
||||||
#define CFG_IDE_MAXBUS 1 /* max. 1 IDE bus */
|
#define CFG_IDE_MAXBUS 1 /* max. 1 IDE bus */
|
||||||
#define CFG_IDE_MAXDEVICE 1 /* max. 1 drive per IDE bus */
|
#define CFG_IDE_MAXDEVICE 2 /* max. 1 drive per IDE bus */
|
||||||
|
|
||||||
#define CFG_ATA_IDE0_OFFSET 0x0000
|
#define CFG_ATA_IDE0_OFFSET 0x0000
|
||||||
|
|
||||||
|
@ -342,4 +343,6 @@
|
||||||
/* Interval between registers */
|
/* Interval between registers */
|
||||||
#define CFG_ATA_STRIDE 4
|
#define CFG_ATA_STRIDE 4
|
||||||
|
|
||||||
|
#define CONFIG_ATAPI 1
|
||||||
|
|
||||||
#endif /* __CONFIG_H */
|
#endif /* __CONFIG_H */
|
||||||
|
|
Loading…
Add table
Reference in a new issue