-static void ide_init(void)
-{
- bool bus_ok[CONFIG_SYS_IDE_MAXBUS];
- int i, bus;
-
- schedule();
-
- /* ATAPI Drives seems to need a proper IDE Reset */
- ide_reset();
-
- /*
- * Wait for IDE to get ready.
- * According to spec, this can take up to 31 seconds!
- */
- for (bus = 0; bus < CONFIG_SYS_IDE_MAXBUS; ++bus) {
- bus_ok[bus] = !ide_init_one(bus);
- schedule();
- }
-
- putc('\n');
-
- for (i = 0; i < CONFIG_SYS_IDE_MAXDEVICE; ++i) {
- ide_dev_desc[i].type = DEV_TYPE_UNKNOWN;
- ide_dev_desc[i].uclass_id = UCLASS_IDE;
- ide_dev_desc[i].devnum = i;
- ide_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
- ide_dev_desc[i].blksz = 0;
- ide_dev_desc[i].log2blksz =
- LOG2_INVALID(typeof(ide_dev_desc[i].log2blksz));
- ide_dev_desc[i].lba = 0;
- if (!bus_ok[IDE_BUS(i)])
- continue;
- ide_ident(&ide_dev_desc[i]);
- dev_print(&ide_dev_desc[i]);
- }
- schedule();
-}
-