diff options
author | Jordan Crouse <jordan.crouse@amd.com> | 2008-10-20 16:51:20 +0000 |
---|---|---|
committer | Jordan Crouse <jordan.crouse@amd.com> | 2008-10-20 16:51:20 +0000 |
commit | 369a5f6c7a18516cb4da054d0e328f7464da9da7 (patch) | |
tree | cbb2dd56a1ec1227e8e8295c750c65bbe77c0bb6 /payloads/libpayload/drivers | |
parent | 17f6a8778817ad592a2458083a1ba46032df22f6 (diff) | |
download | coreboot-369a5f6c7a18516cb4da054d0e328f7464da9da7.tar.xz |
[PATCH] libpayload: Add pci_set_bus_master() function
Allow the payload to enable a PCI device as a bus master.
Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3672 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads/libpayload/drivers')
-rw-r--r-- | payloads/libpayload/drivers/pci.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/payloads/libpayload/drivers/pci.c b/payloads/libpayload/drivers/pci.c index fc1940afbc..be92613e88 100644 --- a/payloads/libpayload/drivers/pci.c +++ b/payloads/libpayload/drivers/pci.c @@ -112,3 +112,11 @@ u32 pci_read_resource(pcidev_t dev, int bar) { return pci_read_config32(dev, 0x10 + (bar * 4)); } + +void pci_set_bus_master(pcidev_t dev) +{ + u16 val = pci_read_config16(dev, REG_COMMAND); + val |= REG_COMMAND_BM; + pci_write_config16(dev, REG_COMMAND, val); +} + |