Skip to contentSkip to conversation

eepro100: Fix boot ROM support

PATCH New Stefan Weil 1 participant 1 message Oct 31, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eepro100: Fix boot ROM support

* Rename pxe-eepro100.bin to pxe-i82559er.bin. The other devices supported by eepro100.c need additional pxe boot ROM images.
* Call rom_add_option during initialisation. The code won't work with two or more different eepro100 devices, because it only adds one option ROM, but this use case is perhaps never needed.

Using this patch, model=i82559er at least works partially. For full support, more eepro100 patches are needed (will follow later, can be fetched from ar7 branch of QEMU).

---
 hw/eepro100.c            |   11 +++++++++++
 pc-bios/pxe-eepro100.bin |  Bin 56832 -> 0 bytes
 pc-bios/pxe-i82559er.bin |  Bin 0 -> 56832 bytes
 3 files changed, 11 insertions(+), 0 deletions(-)
 delete mode 100644 pc-bios/pxe-eepro100.bin
 create mode 100644 pc-bios/pxe-i82559er.bin
hw/eepro100.c +11 -0
index 5507295..f43a4c8 100644
@@ -40,6 +40,7 @@
 #include <stddef.h>             /* offsetof */
 #include <stdbool.h>
 #include "hw.h"
+#include "loader.h"             /* rom_add_option */
 #include "pci.h"
 #include "net.h"
 #include "eeprom93xx.h"
@@ -1839,6 +1840,16 @@ static int nic_init(PCIDevice *pci_dev, uint32_t device)
     memcpy(s->vmstate, &vmstate_eepro100, sizeof(vmstate_eepro100));
     s->vmstate->name = s->vc->model;
     vmstate_register(-1, s->vmstate, s);
+
+    if (!pci_dev->qdev.hotplugged) {
+        static int loaded = 0;
+        if (!loaded) {
+            char fname[32];
+            snprintf(fname, sizeof(fname), "pxe-%s.bin", s->vc->model);
+            rom_add_option(fname);
+            loaded = 1;
+        }
+    }
     return 0;
 }
 
pc-bios/pxe-eepro100.bin deleted binary +0 -0
deleted file mode 100644
index 2ca59ec369fa3aa829aa64b80339dc9aaab9026f..0000000000000000000000000000000000000000
GIT binary patch
pc-bios/pxe-i82559er.bin new file binary +0 -0
new file mode 100644
index 0000000000000000000000000000000000000000..2ca59ec369fa3aa829aa64b80339dc9aaab9026f
GIT binary patch
Signature · 1 line
1.5.6.5