VirtualBox

Ignore:
Timestamp:
Oct 12, 2010 2:29:32 AM (14 years ago)
Author:
vboxsync
Message:

EFI: right port assignments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/VBoxIdeBusDxe/Ide.c

    r33029 r33049  
    337337    return Status;
    338338  }
    339   DEBUG((DEBUG_INFO, "class code: %x\n", PciData.Hdr.ClassCode[0] & IDE_PRIMARY_OPERATING_MODE));
     339  DEBUG((DEBUG_INFO, "class primary code: %x\n", PciData.Hdr.ClassCode[0] & IDE_PRIMARY_OPERATING_MODE));
     340  DEBUG((DEBUG_INFO, "class secondary code: %x\n", PciData.Hdr.ClassCode[0] & IDE_SECONDARY_OPERATING_MODE));
    340341  if ((PciData.Hdr.ClassCode[0] & IDE_PRIMARY_OPERATING_MODE) == 0) {
    341342    switch (PciSubClass)
     
    376377          break;
    377378       case 0x6:
    378           IdeRegsBaseAddr[IdePrimary].CommandBlockBaseAddr  = 0x1e8;
    379           IdeRegsBaseAddr[IdePrimary].ControlBlockBaseAddr  = 0x3e6;
    380           IdeRegsBaseAddr[IdePrimary].BusMasterBaseAddr     = 0;
     379          IdeRegsBaseAddr[IdePrimary].CommandBlockBaseAddr  = 0x168;
     380          IdeRegsBaseAddr[IdePrimary].ControlBlockBaseAddr  = 0x366;
     381          IdeRegsBaseAddr[IdePrimary].BusMasterBaseAddr     = 0;
    381382          break;
    382383        default:
     
    395396          break;
    396397       case 0x6:
     398          IdeRegsBaseAddr[IdeSecondary].CommandBlockBaseAddr  = 0x1e8;
     399          IdeRegsBaseAddr[IdeSecondary].ControlBlockBaseAddr  = 0x3e6;
     400          IdeRegsBaseAddr[IdeSecondary].BusMasterBaseAddr     = 0;
     401          break;
     402        default:
     403          ASSERT_EFI_ERROR((EFI_UNSUPPORTED));
     404    }
     405  } else {
     406    //
     407    // The BARs should be of IO type
     408    //
     409    if ((PciData.Device.Bar[2] & BIT0) == 0 ||
     410        (PciData.Device.Bar[3] & BIT0) == 0) {
     411      DEBUG((DEBUG_INFO, "%a:%d\n", __FILE__, __LINE__));
     412      return EFI_UNSUPPORTED;
     413    }
     414
     415    switch (PciSubClass)
     416    {
     417       case PCI_CLASS_MASS_STORAGE_IDE:
     418          IdeRegsBaseAddr[IdeSecondary].CommandBlockBaseAddr  =
     419          (UINT16) (PciData.Device.Bar[2] & 0x0000fff8);
     420          IdeRegsBaseAddr[IdeSecondary].ControlBlockBaseAddr  =
     421          (UINT16) ((PciData.Device.Bar[3] & 0x0000fffc) + 2);
     422          IdeRegsBaseAddr[IdeSecondary].BusMasterBaseAddr     =
     423          (UINT16) ((PciData.Device.Bar[4] & 0x0000fff0));
     424          break;
     425        case 0x6:
    397426          IdeRegsBaseAddr[IdeSecondary].CommandBlockBaseAddr  = 0x168;
    398427          IdeRegsBaseAddr[IdeSecondary].ControlBlockBaseAddr  = 0x366;
     
    401430        default:
    402431          ASSERT_EFI_ERROR((EFI_UNSUPPORTED));
    403     }
    404   } else {
    405     //
    406     // The BARs should be of IO type
    407     //
    408     if ((PciData.Device.Bar[2] & BIT0) == 0 ||
    409         (PciData.Device.Bar[3] & BIT0) == 0) {
    410       DEBUG((DEBUG_INFO, "%a:%d\n", __FILE__, __LINE__));
    411       return EFI_UNSUPPORTED;
    412     }
    413 
    414     IdeRegsBaseAddr[IdeSecondary].CommandBlockBaseAddr  =
    415     (UINT16) (PciData.Device.Bar[2] & 0x0000fff8);
    416     IdeRegsBaseAddr[IdeSecondary].ControlBlockBaseAddr  =
    417     (UINT16) ((PciData.Device.Bar[3] & 0x0000fffc) + 2);
    418     IdeRegsBaseAddr[IdeSecondary].BusMasterBaseAddr     =
    419     (UINT16) ((PciData.Device.Bar[4] & 0x0000fff0));
     432     }
    420433  }
    421434
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