[U-Boot] [PATCH] ata: ahci: enable bus mastering
Christian Gmeiner
christian.gmeiner at gmail.com
Wed May 22 08:40:42 UTC 2019
When using the coreboot target CONFIG_DM_SCSI gets set to y. This has the effect
that the current 'enable bus mastering' logic gets not compiled in. This change
fixes ahci problems I am seeing on an Intel Apollolake device.
Signed-off-by: Christian Gmeiner <christian.gmeiner at gmail.com>
---
drivers/ata/ahci.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index e3135bb75f..3f9348a8b3 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1174,6 +1174,12 @@ int ahci_probe_scsi(struct udevice *ahci_dev, ulong base)
int ahci_probe_scsi_pci(struct udevice *ahci_dev)
{
ulong base;
+ u16 cmd;
+
+ /* Enable bus mastering. */
+ dm_pci_read_config16(ahci_dev, PCI_COMMAND, &cmd);
+ cmd |= PCI_COMMAND_MASTER;
+ dm_pci_write_config16(ahci_dev, PCI_COMMAND, cmd);
base = (ulong)dm_pci_map_bar(ahci_dev, PCI_BASE_ADDRESS_5,
PCI_REGION_MEM);
--
2.21.0
More information about the U-Boot
mailing list