On 01/29/16 19:36, Laszlo Ersek wrote: > On 01/29/16 19:19, Jordan Justen wrote: >> Series Reviewed-by: Jordan Justen <jordan.l.jus...@intel.com> > > Thank you very much for the quick review. I'll delay committing this > until the QEMU patch gets in.
The QEMU commit hash is a907ec52cc1aefc820768b6e341b56f8f3caaca7. I updated the QEMU reference in this patch accordingly, and committed both patches #2 and #3 as SVN r19791..r19792, inclusive. (Patch #1 had been committed earlier, independently.) Thanks! Laszlo > > Vladislav, as I asked in issue#48, can you please respond with your > Tested-by in both this edk2 thread, and the QEMU thread? > > Thanks! > Laszlo > >> On 2016-01-26 18:36:02, Laszlo Ersek wrote: >>> This patch enables QemuBootOrderLib to parse OFW device paths formatted by >>> the QEMU patch >>> >>> nvme: generate OpenFirmware device path in the "bootorder" fw_cfg file >>> >>> http://thread.gmane.org/gmane.comp.emulators.qemu.block/8332 >>> >>> With both patches applied, OVMF will honor the bootindex=N property of the >>> NVMe device: >>> >>> -drive id=drive0,if=none,format=FORMAT,file=PATHNAME \ >>> -device nvme,drive=drive0,serial=SERIAL,bootindex=N >>> ^^^^^^^^^^^ >>> >>> Cc: Vladislav Vovchenko <vladislav.vovche...@sk.com> >>> Cc: Jordan Justen <jordan.l.jus...@intel.com> >>> Reference: https://github.com/tianocore/edk2/issues/48 >>> Contributed-under: TianoCore Contribution Agreement 1.0 >>> Signed-off-by: Laszlo Ersek <ler...@redhat.com> >>> --- >>> OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c | 55 >>> ++++++++++++++++++++ >>> 1 file changed, 55 insertions(+) >>> >>> diff --git a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c >>> b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c >>> index 43dbaff..15065b7 100644 >>> --- a/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c >>> +++ b/OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c >>> @@ -931,6 +931,61 @@ TranslatePciOfwNodes ( >>> TargetLun[0], >>> TargetLun[1] >>> ); >>> + } else if (NumNodes >= FirstNonBridge + 2 && >>> + SubstringEq (OfwNode[FirstNonBridge + 0].DriverName, "pci8086,5845") >>> && >>> + SubstringEq (OfwNode[FirstNonBridge + 1].DriverName, "namespace") >>> + ) { >>> + // >>> + // OpenFirmware device path (NVMe device): >>> + // >>> + // /pci@i0cf8/pci8086,5845@6[,1]/namespace@1,0 >>> + // ^ ^ ^ ^ ^ >>> + // | | | | Extended Unique >>> Identifier >>> + // | | | | (EUI-64), big endian >>> interp. >>> + // | | | namespace ID >>> + // | PCI slot & function holding NVMe >>> controller >>> + // PCI root at system bus port, PIO >>> + // >>> + // UEFI device path: >>> + // >>> + // PciRoot(0x0)/Pci(0x6,0x1)/NVMe(0x1,00-00-00-00-00-00-00-00) >>> + // ^ ^ >>> + // | octets of the EUI-64 >>> + // | in address order >>> + // namespace ID >>> + // >>> + UINT64 Namespace[2]; >>> + UINTN RequiredEntries; >>> + UINT8 *Eui64; >>> + >>> + RequiredEntries = sizeof (Namespace) / sizeof (Namespace[0]); >>> + NumEntries = RequiredEntries; >>> + if (ParseUnitAddressHexList ( >>> + OfwNode[FirstNonBridge + 1].UnitAddress, >>> + Namespace, >>> + &NumEntries >>> + ) != RETURN_SUCCESS || >>> + NumEntries != RequiredEntries || >>> + Namespace[0] == 0 || >>> + Namespace[0] >= MAX_UINT32 >>> + ) { >>> + return RETURN_UNSUPPORTED; >>> + } >>> + >>> + Eui64 = (UINT8 *)&Namespace[1]; >>> + Written = UnicodeSPrintAsciiFormat ( >>> + Translated, >>> + *TranslatedSize * sizeof (*Translated), // BufferSize in bytes >>> + "PciRoot(0x%x)%s/Pci(0x%Lx,0x%Lx)/" >>> + "NVMe(0x%Lx,%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x)", >>> + PciRoot, >>> + Bridges, >>> + PciDevFun[0], >>> + PciDevFun[1], >>> + Namespace[0], >>> + Eui64[7], Eui64[6], Eui64[5], Eui64[4], >>> + Eui64[3], Eui64[2], Eui64[1], Eui64[0] >>> + ); >>> } else { >>> // >>> // Generic OpenFirmware device path for PCI devices: >>> -- >>> 1.8.3.1 >>> > > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel > _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel