All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ata: ahci: enable bus mastering
@ 2019-05-22  8:40 Christian Gmeiner
  2019-05-22 18:39 ` Simon Glass
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Gmeiner @ 2019-05-22  8:40 UTC (permalink / raw)
  To: u-boot

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@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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-05-23 13:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22  8:40 [U-Boot] [PATCH] ata: ahci: enable bus mastering Christian Gmeiner
2019-05-22 18:39 ` Simon Glass
2019-05-23  2:17   ` Bin Meng
2019-05-23 13:33     ` Christian Gmeiner
2019-05-23 13:28   ` Christian Gmeiner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.