Changeset 33026 in vbox for trunk/src/VBox/Devices/EFI/Firmware2
- Timestamp:
- Oct 11, 2010 6:07:01 AM (14 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/VBoxIdeBusDxe
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/VBoxIdeBusDxe/Ide.c
r33024 r33026 285 285 EFI_STATUS Status; 286 286 PCI_TYPE00 PciData; 287 UINT8 PciClass; 288 UINT8 PciSubClass; 287 289 288 290 Status = PciIo->Pci.Read ( … … 297 299 return Status; 298 300 } 299 301 Status = PciIo->Pci.Read ( 302 PciIo, 303 EfiPciIoWidthUint8, 304 PCI_CLASSCODE_OFFSET + 2, 305 1, 306 &PciClass 307 ); 308 if (EFI_ERROR (Status)) { 309 return Status; 310 } 311 312 Status = PciIo->Pci.Read ( 313 PciIo, 314 EfiPciIoWidthUint8, 315 PCI_CLASSCODE_OFFSET + 1, 316 1, 317 &PciSubClass 318 ); 319 if (EFI_ERROR (Status)) { 320 return Status; 321 } 322 DEBUG((DEBUG_INFO, "class code: %x\n", PciData.Hdr.ClassCode[0] & IDE_PRIMARY_OPERATING_MODE)); 300 323 if ((PciData.Hdr.ClassCode[0] & IDE_PRIMARY_OPERATING_MODE) == 0) { 301 IdeRegsBaseAddr[IdePrimary].CommandBlockBaseAddr = 0x1f0; 302 IdeRegsBaseAddr[IdePrimary].ControlBlockBaseAddr = 0x3f6; 324 switch (PciSubClass) 325 { 326 case PCI_CLASS_MASS_STORAGE_IDE: 327 IdeRegsBaseAddr[IdePrimary].CommandBlockBaseAddr = 0x1f0; 328 IdeRegsBaseAddr[IdePrimary].ControlBlockBaseAddr = 0x3f6; 329 break; 330 case 0x6: 331 IdeRegsBaseAddr[IdePrimary].CommandBlockBaseAddr = 0x1e8; 332 IdeRegsBaseAddr[IdePrimary].ControlBlockBaseAddr = 0x3e6; 333 break; 334 default: 335 ASSERT_EFI_ERROR((EFI_UNSUPPORTED)); 336 } 303 337 IdeRegsBaseAddr[IdePrimary].BusMasterBaseAddr = 304 338 (UINT16)((PciData.Device.Bar[4] & 0x0000fff0)); … … 309 343 if ((PciData.Device.Bar[0] & BIT0) == 0 || 310 344 (PciData.Device.Bar[1] & BIT0) == 0) { 345 DEBUG((DEBUG_INFO, "%a:%d\n", __FILE__, __LINE__)); 311 346 return EFI_UNSUPPORTED; 312 347 } 313 348 314 IdeRegsBaseAddr[IdePrimary].CommandBlockBaseAddr = 315 (UINT16) (PciData.Device.Bar[0] & 0x0000fff8); 316 IdeRegsBaseAddr[IdePrimary].ControlBlockBaseAddr = 317 (UINT16) ((PciData.Device.Bar[1] & 0x0000fffc) + 2); 349 switch (PciSubClass) 350 { 351 case PCI_CLASS_MASS_STORAGE_IDE: 352 IdeRegsBaseAddr[IdePrimary].CommandBlockBaseAddr = 353 (UINT16) (PciData.Device.Bar[0] & 0x0000fff8); 354 IdeRegsBaseAddr[IdePrimary].ControlBlockBaseAddr = 355 (UINT16) ((PciData.Device.Bar[1] & 0x0000fffc) + 2); 356 break; 357 case 0x6: 358 IdeRegsBaseAddr[IdePrimary].CommandBlockBaseAddr = 0x1e8; 359 IdeRegsBaseAddr[IdePrimary].ControlBlockBaseAddr = 0x3e6; 360 break; 361 default: 362 ASSERT_EFI_ERROR((EFI_UNSUPPORTED)); 363 } 318 364 IdeRegsBaseAddr[IdePrimary].BusMasterBaseAddr = 319 365 (UINT16) ((PciData.Device.Bar[4] & 0x0000fff0)); … … 321 367 322 368 if ((PciData.Hdr.ClassCode[0] & IDE_SECONDARY_OPERATING_MODE) == 0) { 323 IdeRegsBaseAddr[IdeSecondary].CommandBlockBaseAddr = 0x170; 324 IdeRegsBaseAddr[IdeSecondary].ControlBlockBaseAddr = 0x376; 369 switch (PciSubClass) 370 { 371 case PCI_CLASS_MASS_STORAGE_IDE: 372 IdeRegsBaseAddr[IdeSecondary].CommandBlockBaseAddr = 0x170; 373 IdeRegsBaseAddr[IdeSecondary].ControlBlockBaseAddr = 0x376; 374 break; 375 case 0x6: 376 IdeRegsBaseAddr[IdeSecondary].CommandBlockBaseAddr = 0x168; 377 IdeRegsBaseAddr[IdeSecondary].ControlBlockBaseAddr = 0x366; 378 break; 379 default: 380 ASSERT_EFI_ERROR((EFI_UNSUPPORTED)); 381 } 325 382 IdeRegsBaseAddr[IdeSecondary].BusMasterBaseAddr = 326 383 (UINT16) ((PciData.Device.Bar[4] & 0x0000fff0)); … … 331 388 if ((PciData.Device.Bar[2] & BIT0) == 0 || 332 389 (PciData.Device.Bar[3] & BIT0) == 0) { 390 DEBUG((DEBUG_INFO, "%a:%d\n", __FILE__, __LINE__)); 333 391 return EFI_UNSUPPORTED; 334 392 } … … 342 400 } 343 401 402 DEBUG((DEBUG_INFO, "%a:%d CommandBlockBaseAddr:%x, " 403 "ControlBlockBaseAddr:%x, " 404 "BusMasterBaseAddr:%x\n", __FILE__, __LINE__, 405 IdeRegsBaseAddr[IdePrimary].CommandBlockBaseAddr, 406 IdeRegsBaseAddr[IdePrimary].ControlBlockBaseAddr, 407 IdeRegsBaseAddr[IdePrimary].BusMasterBaseAddr)); 408 DEBUG((DEBUG_INFO, "%a:%d CommandBlockBaseAddr:%x, " 409 "ControlBlockBaseAddr:%x, " 410 "BusMasterBaseAddr:%x\n", __FILE__, __LINE__, 411 IdeRegsBaseAddr[IdeSecondary].CommandBlockBaseAddr, 412 IdeRegsBaseAddr[IdeSecondary].ControlBlockBaseAddr, 413 IdeRegsBaseAddr[IdeSecondary].BusMasterBaseAddr)); 344 414 return EFI_SUCCESS; 345 415 } -
trunk/src/VBox/Devices/EFI/Firmware2/VBoxPkg/VBoxIdeBusDxe/VBoxIdeBusDxe.inf
r33024 r33026 19 19 INF_VERSION = 0x00010005 20 20 BASE_NAME = IdeBusDxe 21 FILE_GUID = 69FD8E47-A161-4550-B01A-5594CEB2B2B221 FILE_GUID = 2f709c46-d2e7-11df-ad38-080027a4ca0d 22 22 MODULE_TYPE = UEFI_DRIVER 23 23 VERSION_STRING = 1.0 … … 53 53 [Packages] 54 54 MdePkg/MdePkg.dec 55 VBoxPkg/VBoxPkg.dec 55 56 IntelFrameworkPkg/IntelFrameworkPkg.dec 56 57 IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
Note:
See TracChangeset
for help on using the changeset viewer.