Skip to content

Commit

Permalink
nvme: Enable PCI bus mastering
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Bin Meng <[email protected]>
  • Loading branch information
sjg20 authored and lbmeng committed May 11, 2023
1 parent 2f5210b commit 3853471
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/nvme/nvme_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <common.h>
#include <dm.h>
#include <init.h>
#include <pci.h>
#include "nvme.h"

Expand All @@ -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);
}

Expand Down

0 comments on commit 3853471

Please sign in to comment.