From: Simon Glass Date: Thu, 4 May 2023 22:55:07 +0000 (-0600) Subject: nvme: Enable PCI bus mastering X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=38534712cd4c4d8acdf760ee87ba219f82d738c9;p=u-boot.git nvme: Enable PCI bus mastering U-Boot sets up devices ready for use, but coreboot does not. Enable this so that NVMe works OK from coreboot. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- diff --git a/drivers/nvme/nvme_pci.c b/drivers/nvme/nvme_pci.c index 36bf9c5ffb..5bb43d299f 100644 --- a/drivers/nvme/nvme_pci.c +++ b/drivers/nvme/nvme_pci.c @@ -6,6 +6,7 @@ #include #include +#include #include #include "nvme.h" @@ -30,6 +31,10 @@ static int nvme_probe(struct udevice *udev) ndev->instance = trailing_strtol(udev->name); ndev->bar = dm_pci_map_bar(udev, PCI_BASE_ADDRESS_0, 0, 0, PCI_REGION_TYPE, PCI_REGION_MEM); + + /* Turn on bus-mastering */ + dm_pci_clrset_config16(udev, PCI_COMMAND, 0, PCI_COMMAND_MASTER); + return nvme_init(udev); }