Changeset 75 in kStuff for hacks/xtide/atalib.c
- Timestamp:
- Dec 27, 2015 7:47:37 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
hacks/xtide/atalib.c
r74 r75 522 522 } 523 523 524 int AtaInit(uint16_t uBasePort, uint16_t uCtrlPort, uint8_t cPortShift, uint8_t bDevice, uint8_t f8BitData )524 int AtaInit(uint16_t uBasePort, uint16_t uCtrlPort, uint8_t cPortShift, uint8_t bDevice, uint8_t f8BitData, uint8_t fReset) 525 525 { 526 526 int rc; … … 559 559 { 560 560 /* Reset the controller + devices. */ 561 if (AtaReset() != 0) 562 return -1; 561 if (fReset) 562 if (AtaReset() != 0) 563 return -1; 564 fReset = 1; 563 565 564 566 /* Enable 8-bit data transfers (just to be on the safe side). */ … … 620 622 621 623 /* Figure 5-9 in SanDisk Manual Rev 12.0: */ 622 printf("debug: word82=%#x word83=%#x word84=%#x\n", g_awIdentify[82], g_awIdentify[83], g_awIdentify[84]);623 624 if ( g_awIdentify[82] != 0 && g_awIdentify[82] != UINT16_C(0xffff) 624 625 && g_awIdentify[83] != 0 && g_awIdentify[83] != UINT16_C(0xffff) … … 675 676 { 676 677 uint8_t bDevice = ATA_DEV_MASTER; 678 uint8_t fReset = 0; 677 679 #if 0 678 680 uint16_t uBasePort = 0x1f0; /* Primary ATA host controller. */ … … 741 743 || strcmp(pszArg, "-16") == 0) 742 744 f8BitData = 0; 745 else if (strcmp(pszArg, "--reset") == 0) 746 fReset = 1; 747 else if (strcmp(pszArg, "--no-reset") == 0) 748 fReset = 0; 743 749 else if (strcmp(pszArg, "--ide") == 0) 744 750 { … … 759 765 } 760 766 761 return AtaInit(uBasePort, uCtrlPort, cShiftPort, bDevice, f8BitData );762 } 763 767 return AtaInit(uBasePort, uCtrlPort, cShiftPort, bDevice, f8BitData, fReset); 768 } 769
Note:
See TracChangeset
for help on using the changeset viewer.