comparison packages/redboot/current/src/fs/ide.c @ 1230:7d2ca52b341a

Improve IDE handling - better for systems where IDE may be missing
author gthomas
date Sat, 20 Sep 2003 19:22:19 +0000
parents 8285bebc3a89
children 55fbbf4dffb2
comparison
equal deleted inserted replaced
1229:2159dd1d9220 1230:7d2ca52b341a
406 ide_init(void) 406 ide_init(void)
407 { 407 {
408 cyg_uint32 buf[SECTOR_SIZE/sizeof(cyg_uint32)], u32; 408 cyg_uint32 buf[SECTOR_SIZE/sizeof(cyg_uint32)], u32;
409 cyg_uint16 u16; 409 cyg_uint16 u16;
410 cyg_uint8 u8; 410 cyg_uint8 u8;
411 int i, j; 411 int i, j, num_controllers;
412 disk_t disk; 412 disk_t disk;
413 struct ide_priv *priv; 413 struct ide_priv *priv;
414 414
415 #define DEV_INIT_VAL ((j << 4) | 0xA0) 415 #define DEV_INIT_VAL ((j << 4) | 0xA0)
416 416
417 HAL_IDE_INIT(); 417 num_controllers = HAL_IDE_INIT();
418 418
419 CYGACC_CALL_IF_DELAY_US(5); 419 CYGACC_CALL_IF_DELAY_US(5);
420 420
421 priv = ide_privs; 421 priv = ide_privs;
422 for (i = 0; i < HAL_IDE_NUM_CONTROLLERS; i++) { 422 for (i = 0; i < num_controllers; i++) {
423 423
424 // soft reset the devices on this controller 424 // soft reset the devices on this controller
425 if (!ide_reset(i)) 425 if (!ide_reset(i))
426 continue; 426 continue;
427 427