[ipxe-devel] Option ROM experience on a various mobos and NICs adapters
Vasiliy Tolstov
v.tolstov at selfip.ru
Wed May 21 19:40:56 UTC 2014
does it possible to replace intel boot agent with ipxe on supermicro server?
2014-05-21 23:00 GMT+04:00 Anton D. Kachalov <mouse at yandex-team.ru>:
> Hello.
>
> I would like to share my Option ROM's embedding experience.
>
>
> == AMIBIOS8 ==
> Tested server platforms:
>
> Asus: KGNE-D16, KGP(M)E-D16, Z8NR-D12 and Z8PG-D18
> Supermicro: all mobos series X7, X8 and H8 (X8DTU, X8DTT, X8DT3, H8DGU)
> Huawei: Tecal RH1285
> HP: Proliant DL160 G6 and DL165 G7
>
> There is a trick with AMI BIOS image to replace original Option ROM with
> iPXE. Every BIOS image contains two Option ROMs: iSCSI and PXE. It might be
> choosen from BIOS settings. Meanwhile AMI MMTool allows to replace only one
> module with specific ModuleID/VendorID/DeviceID. In case of the platforms
> above we always have two records with identical IDs. Therefore, we need to
> workaround this in HEX-editor:
>
> Look for requested LAN vendor/product IDs in RunLoc column (e.g. 8086:10C9)
> column. Write down RomLoc value.
> There is a DeviceID at offset "RomLoc - 2" in BIOS image. Change it to some
> value (e.g. C9 -> CD). Save.
> Run MMTool and replace module with our original VendorID/DeviceID.
> Look for changed VID/PID (i.e. 8086:10CD) in RunLoc column and revert back
> our change at offset "RomLoc - 2".
> For the second module repeat steps 1-4.
> To correct CRCs just replace first module again.
>
> Now we are ready to update BIOS in the standard way: using flashrom or via
> AFU{WIN,LNX,DOS}.
>
> NOTE: Use MMtool version 3.22+ only.
>
>
> == UEFI (APTIO) ==
> Tested server platforms:
>
> Asus: Z9PE and Z9PG series
> Supermicro: X9DRW, X9DRFF, X9DRT
> Gigabyte: GA-7PPSH, GA-7PTSH
> Quanta: R210-MB2MS
>
> AMI APTIO (UEFI enabled) much is much easier to update rather tan AMIBIOS8.
> To update Option ROM we need AMI MMTool-APTIO tool:
>
> Choose "Replace" tab and select our Option ROM.
> Check "Link Present" in "For Option ROM only" group.
> Select requested VID/PID in the list and click "Replace".
> Profit :)
>
> Now we are ready to update BIOS in the standard way.
>
>
> == HP Proliant360 G5 ==
> It's a special case with a very proprietary BIOS. BIOS packed by 64k chunks
> by old-school PKWare. The BIOS tool might be found within the same BIOS ROM
> bundle.
> To unpack BIOS it's required to:
>
> C:\> rompaq /d cpqp5802.49a cpqp5802.rom
>
> To pack BIOS back (chunk size is mandatory!):
>
> C:\> rompaq /c cpqp5802.rom CPQP580 249A 08/20/2012 64
>
> When unpacked (CPQP5802.ROM) PXE Option ROM has offset 0x00171800. Next
> Video Option ROM at offset 0x00183800. That means we have only 0x12_000
> bytes for our iPXE Option ROM. Not so much. To replace a chunk we can use
> standard "dd" util. Then pack everything back:
>
> C:\> rompaq /t /u CPQSRVR2.CPU CPQP5802.49A
>
> and ready to burn.
>
>
> == Intel 82599 (X520-DA2) ==
> Intel's burning tool accepts only FLB files. The simplest wat to obtain FLB
> header is to dump (backup) flash:
>
> $ bootutil64e -nic X -saveimage -file backup.flb
>
> Then catch the header (first 0x17a bytes). Here is the significant offsets:
>
>
> Option ROM size is at offset 0x0E0 (e.g. 00 00 01 is 64k). For example, our
> Option ROM is 68608 (0x10C00) bytes. We need to change bytes to: "00 0C 01"
> @ 0x0E0.
> PXE version is at offset 0x136 (e.g. 02 03 0B is 2.2.11). For example, our
> Option ROM's version is 7.8.150. We need to change bytes to: "07 08 96" @
> 0x136.
>
>
> To obtain PXE version size just run
>
> # bootutil64e -iv -file 808610fb.rom
>
> To burn image just cat fixed header and your custom Option ROM and run:
>
> # bootutil64e -nic X -restoreimage -file 808610fb.flb
>
> Current BootUtil could be downloaded from Intel Download Center
>
> https://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&DwnldID=19186
>
>
> == Mellanox MCX311A-XCAT (to be completed) ==
> Upstream iPXE modification could be obtains from
> http://www.mellanox.com/downloads/Drivers/PXE/gpxe_3.4.225.tgz
> Burning tool: http://www.mellanox.com/downloads/MFT/mft-3.6.0-24.tgz To burn
> Option ROM we need "flint" (or flint_oem) and "minit" tools.
> Current adapter (15b3:1003, ConnectX3) have not supported in iPXE upstream.
>
> Requirements:
>
> Build and insmod kernel modules mst_pci and mst_pciconf (sources could be
> found in mft.tar.gz).
> Create character devices:
> mknod /dev/mst/mt27500_pciconf_cr0 c 245 0
> mknod /dev/mst/mt27500_pci_cr0 c 246 0
> Initialize MLX:
> minit /dev/mst/mt27500_pci_cr0 07:00.0 0 (07:00.0 is a PCI bus address
> and function. Get it from "lspci -n").
> Burn ROM:
> flint -d /dev/mst/mt27500_pci_cr0 bbrom 15b31003.rom
>
> FLINT expects a header with PXE version that is lack in iPXE ROM. Just
> warning. Ignore it.
>
> To be continued…
>
> _______________________________________________
> ipxe-devel mailing list
> ipxe-devel at lists.ipxe.org
> https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel
>
--
Vasiliy Tolstov,
e-mail: v.tolstov at selfip.ru
jabber: vase at selfip.ru
More information about the ipxe-devel
mailing list