Add CSM support
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
diff --git a/src/boot.c b/src/boot.c
index 3bafa5a..85d5051 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -14,6 +14,7 @@
#include "paravirt.h" // qemu_cfg_show_boot_menu
#include "pci.h" // pci_bdf_to_*
#include "usb.h" // struct usbdevice_s
+#include "csm.h" // csm_bootprio_*
/****************************************************************
@@ -120,6 +121,8 @@
int bootprio_find_pci_device(struct pci_device *pci)
{
+ if (CONFIG_CSM)
+ return csm_bootprio_pci(pci);
if (!CONFIG_BOOTORDER)
return -1;
// Find pci device - for example: /pci@i0cf8/ethernet@5
@@ -144,6 +147,8 @@
int bootprio_find_ata_device(struct pci_device *pci, int chanid, int slave)
{
+ if (CONFIG_CSM)
+ return csm_bootprio_ata(pci, chanid, slave);
if (!CONFIG_BOOTORDER)
return -1;
if (!pci)
@@ -158,6 +163,8 @@
int bootprio_find_fdc_device(struct pci_device *pci, int port, int fdid)
{
+ if (CONFIG_CSM)
+ return csm_bootprio_fdc(pci, port, fdid);
if (!CONFIG_BOOTORDER)
return -1;
if (!pci)