Revision: 18531
http://sourceforge.net/p/edk2/code/18531
Author: lersek
Date: 2015-09-22 11:18:41 +0000 (Tue, 22 Sep 2015)
Log Message:
-----------
OvmfPkg: QemuBootOrderLib: recognize Q35 SATA disks / CD-ROMs
The OpenFirmware device paths that QEMU generates for these disks and
CD-ROMs are very similar to those generated for the i440fx IDE disks and
CD-ROMs (including the same number of devpath nodes necessary for unique
parsing). The interpretations and the translation to UEFI devpath
fragments are different, of course.
(The spaces after "ide@1,1" are inserted below only for illustration
purposes.)
primary or secondary
| master or slave
v v
i440fx IDE: /pci@i0cf8/ide@1,1 /drive@0/disk@0
Q35 SATA: /pci@i0cf8/pci8086,2922@1f,2/drive@1/disk@0
^ ^
| device number
| (fixed 0)
channel (port) number
The similarity is reflected in the translation output (spaces again
inserted for illustration only):
i440fx IDE: PciRoot(0x0)/Pci(0x1,0x1) /Ata(Primary,Master,0x0)
Q35 SATA: PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x1,0x0,0x0)
^ ^ ^
| | LUN;
| | always 0 on Q35
| port multiplier port
| number; always 0 on Q35
channel (port) number
Cc: Alexander Graf <[email protected]>
Cc: Reza Jelveh <[email protected]>
Cc: Jordan Justen <[email protected]>
Cc: Hannes Reinecke <[email protected]>
Cc: Gabriel L. Somlo <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
Tested-by: Gabriel Somlo <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Modified Paths:
--------------
trunk/edk2/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
Modified: trunk/edk2/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
===================================================================
--- trunk/edk2/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
2015-09-22 11:18:36 UTC (rev 18530)
+++ trunk/edk2/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c
2015-09-22 11:18:41 UTC (rev 18531)
@@ -770,6 +770,49 @@
Slave ? "Slave" : "Master"
);
} else if (NumNodes >= FirstNonBridge + 3 &&
+ SubstringEq (OfwNode[FirstNonBridge + 0].DriverName, "pci8086,2922") &&
+ SubstringEq (OfwNode[FirstNonBridge + 1].DriverName, "drive") &&
+ SubstringEq (OfwNode[FirstNonBridge + 2].DriverName, "disk")
+ ) {
+ //
+ // OpenFirmware device path (Q35 SATA disk and CD-ROM):
+ //
+ // /pci@i0cf8/pci8086,2922@1f,2/drive@1/disk@0
+ // ^ ^ ^ ^ ^
+ // | | | | device number (fixed 0)
+ // | | | channel (port) number
+ // | PCI slot & function holding SATA HBA
+ // PCI root at system bus port, PIO
+ //
+ // UEFI device path:
+ //
+ // PciRoot(0x0)/Pci(0x1F,0x2)/Sata(0x1,0x0,0x0)
+ // ^ ^ ^
+ // | | LUN (always 0 on Q35)
+ // | port multiplier port number,
+ // | always 0 on Q35
+ // channel (port) number
+ //
+ UINT64 Channel;
+
+ NumEntries = 1;
+ if (RETURN_ERROR (ParseUnitAddressHexList (
+ OfwNode[FirstNonBridge + 1].UnitAddress, &Channel,
+ &NumEntries))) {
+ return RETURN_UNSUPPORTED;
+ }
+
+ Written = UnicodeSPrintAsciiFormat (
+ Translated,
+ *TranslatedSize * sizeof (*Translated), // BufferSize in bytes
+ "PciRoot(0x%x)%s/Pci(0x%Lx,0x%Lx)/Sata(0x%Lx,0x0,0x0)",
+ PciRoot,
+ Bridges,
+ PciDevFun[0],
+ PciDevFun[1],
+ Channel
+ );
+ } else if (NumNodes >= FirstNonBridge + 3 &&
SubstringEq (OfwNode[FirstNonBridge + 0].DriverName, "isa") &&
SubstringEq (OfwNode[FirstNonBridge + 1].DriverName, "fdc") &&
SubstringEq (OfwNode[FirstNonBridge + 2].DriverName, "floppy")
------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits