summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/drivers')
-rw-r--r--payloads/libpayload/drivers/storage/ahci.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/storage/ahci.c b/payloads/libpayload/drivers/storage/ahci.c
index 0e7fd7d8e0..3a0b99df42 100644
--- a/payloads/libpayload/drivers/storage/ahci.c
+++ b/payloads/libpayload/drivers/storage/ahci.c
@@ -34,6 +34,7 @@
#include <string.h>
#include <libpayload.h>
#include <pci.h>
+#include <pci/pci.h>
#include <storage/ata.h>
#include <storage/ahci.h>
@@ -267,6 +268,10 @@ static void ahci_init_pci(pcidev_t dev)
/* Set AHCI access mode. */
ctrl->global_ctrl |= HBA_CTRL_AHCI_EN;
+ /* Enable bus mastering. */
+ const u16 command = pci_read_config16(dev, PCI_COMMAND);
+ pci_write_config16(dev, PCI_COMMAND, command | PCI_COMMAND_MASTER);
+
/* Probe for devices. */
for (i = 0; i < 32; ++i) {
if (ctrl->ports_impl & (1 << i))