summaryrefslogtreecommitdiff
path: root/pcidev.c
diff options
context:
space:
mode:
authoruwe <uwe@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2009-09-30 18:29:55 +0000
committeruwe <uwe@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2009-09-30 18:29:55 +0000
commitd33c24417119ece174d3a47ec8f0316602d0f443 (patch)
tree38ba744f115d9c9673f2edc35176e2ba7bb211d1 /pcidev.c
parent6744956b482487f3b91cdbe18be9cdf1b6030519 (diff)
downloadflashrom-d33c24417119ece174d3a47ec8f0316602d0f443.tar.gz
Add initial support for flashing some NVIDIA graphics cards.
The new option is '-p gfxnvidia', rest of the interface is as usual. I tested a successful identify and read on a "RIVA TNT2 Model 64/Model 64 Pro" card for now, erase and write did NOT work properly so far! Please do not attempt to write/erase cards yet, unless you can recover! In addition to the NVIDIA handling code it was required to call programmer_shutdown() in a lot more places, otherwise the graphics card will be disabled in the init function, but never enabled again as the shutdown function is not called. The shutdown handling may be changed to use atexit() later. Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de> Acked-by: Luc Verhaegen <libv@skynet.be> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@737 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'pcidev.c')
-rw-r--r--pcidev.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/pcidev.c b/pcidev.c
index 3ad9db5..9630786 100644
--- a/pcidev.c
+++ b/pcidev.c
@@ -28,7 +28,8 @@ struct pci_access *pacc;
struct pci_filter filter;
struct pci_dev *pcidev_dev = NULL;
-uint32_t pcidev_validate(struct pci_dev *dev, uint32_t bar, struct pcidev_status *devs)
+uint32_t pcidev_validate(struct pci_dev *dev, uint32_t bar,
+ struct pcidev_status *devs)
{
int i;
uint32_t addr;
@@ -37,12 +38,16 @@ uint32_t pcidev_validate(struct pci_dev *dev, uint32_t bar, struct pcidev_status
if (dev->device_id != devs[i].device_id)
continue;
- /* Don't use dev->base_addr[x] (as value for 'bar'), won't work on older libpci. */
+ /*
+ * Don't use dev->base_addr[x] (as value for 'bar'), won't
+ * work on older libpci.
+ */
addr = pci_read_long(dev, bar) & ~0x03;
printf("Found \"%s %s\" (%04x:%04x, BDF %02x:%02x.%x).\n",
- devs[i].vendor_name, devs[i].device_name, dev->vendor_id,
- dev->device_id, dev->bus, dev->dev, dev->func);
+ devs[i].vendor_name, devs[i].device_name,
+ dev->vendor_id, dev->device_id, dev->bus, dev->dev,
+ dev->func);
if (devs[i].status == PCI_NT) {
printf("===\nThis PCI device is UNTESTED. Please "
@@ -57,7 +62,8 @@ uint32_t pcidev_validate(struct pci_dev *dev, uint32_t bar, struct pcidev_status
return 0;
}
-uint32_t pcidev_init(uint16_t vendor_id, uint32_t bar, struct pcidev_status *devs, char *pcidev_bdf)
+uint32_t pcidev_init(uint16_t vendor_id, uint32_t bar,
+ struct pcidev_status *devs, char *pcidev_bdf)
{
struct pci_dev *dev;
char *msg = NULL;