VirtualBox

Changeset 75 in kStuff for hacks/xtide/atalib.c


Ignore:
Timestamp:
Dec 27, 2015 7:47:37 PM (9 years ago)
Author:
bird
Message:

xtide-utils: added ataid for dumping the identify device response. (untested)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • hacks/xtide/atalib.c

    r74 r75  
    522522}
    523523
    524 int AtaInit(uint16_t uBasePort, uint16_t uCtrlPort, uint8_t cPortShift, uint8_t bDevice, uint8_t f8BitData)
     524int AtaInit(uint16_t uBasePort, uint16_t uCtrlPort, uint8_t cPortShift, uint8_t bDevice, uint8_t f8BitData, uint8_t fReset)
    525525{
    526526    int rc;
     
    559559    {
    560560        /* Reset the controller + devices. */
    561         if (AtaReset() != 0)
    562             return -1;
     561        if (fReset)
     562            if (AtaReset() != 0)
     563                return -1;
     564        fReset = 1;
    563565
    564566        /* Enable 8-bit data transfers (just to be on the safe side). */
     
    620622
    621623        /* 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]);
    623624        if (   g_awIdentify[82] != 0 && g_awIdentify[82] != UINT16_C(0xffff)
    624625            && g_awIdentify[83] != 0 && g_awIdentify[83] != UINT16_C(0xffff)
     
    675676{
    676677    uint8_t  bDevice    = ATA_DEV_MASTER;
     678    uint8_t  fReset     = 0;
    677679#if 0
    678680    uint16_t uBasePort  = 0x1f0;    /* Primary ATA host controller. */
     
    741743                 || strcmp(pszArg, "-16") == 0)
    742744            f8BitData = 0;
     745        else if (strcmp(pszArg, "--reset") == 0)
     746            fReset = 1;
     747        else if (strcmp(pszArg, "--no-reset") == 0)
     748            fReset = 0;
    743749        else if (strcmp(pszArg, "--ide") == 0)
    744750        {
     
    759765    }
    760766
    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.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette