]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ata: pci: enable bus mastering
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Tue, 11 Apr 2023 15:07:02 +0000 (17:07 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 25 Apr 2023 19:31:28 +0000 (15:31 -0400)
The non DM code path already would enable pci bus mastering. Do the
same for the DM code path.

Fixes AHCI problems I am seeing on an Intel Apollolake device.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[trini: Use ahci_dev not dev in the calls]
Signed-off-by: Tom Rini <trini@konsulko.com>
drivers/ata/ahci.c

index 6998b82aa5100a66da1bfe77f5b787087f0fc97d..cb2c648a91fd73d8b92cae22f2fb3bf54a9a5801 100644 (file)
@@ -1152,7 +1152,12 @@ int ahci_probe_scsi(struct udevice *ahci_dev, ulong base)
 int ahci_probe_scsi_pci(struct udevice *ahci_dev)
 {
        ulong base;
-       u16 vendor, device;
+       u16 vendor, device, 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, 0, 0,
                                     PCI_REGION_TYPE, PCI_REGION_MEM);