summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2014-06-01 23:49:03 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2014-06-01 23:49:03 +0000
commit0ccec8f21228fab9e5e57c9392f6feafbf296ef1 (patch)
treeacd2e0d426a3ec0b7829df72f6a0cbb8a9c232e2
parent72d42f87a9a01a1d27fba593ce4569331e079cbe (diff)
downloadflashrom-0ccec8f21228fab9e5e57c9392f6feafbf296ef1.tar.gz
flashrom-0ccec8f21228fab9e5e57c9392f6feafbf296ef1.tar.bz2
flashrom-0ccec8f21228fab9e5e57c9392f6feafbf296ef1.zip
Move global io_base_addr into compilation units
Corresponding to flashrom svn r1813. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
-rw-r--r--atahpt.c2
-rw-r--r--gfxnvidia.c2
-rw-r--r--it8212.c2
-rw-r--r--nic3com.c1
-rw-r--r--nicintel_spi.c2
-rw-r--r--nicnatsemi.c1
-rw-r--r--nicrealtek.c1
-rw-r--r--ogp_spi.c2
-rw-r--r--pcidev.c1
-rw-r--r--programmer.h3
10 files changed, 10 insertions, 7 deletions
diff --git a/atahpt.c b/atahpt.c
index 242e14a84..edffa3b18 100644
--- a/atahpt.c
+++ b/atahpt.c
@@ -33,6 +33,8 @@
#define PCI_VENDOR_ID_HPT 0x1103
+static uint32_t io_base_addr = 0;
+
const struct dev_entry ata_hpt[] = {
{0x1103, 0x0004, NT, "Highpoint", "HPT366/368/370/370A/372/372N"},
{0x1103, 0x0005, NT, "Highpoint", "HPT372A/372N"},
diff --git a/gfxnvidia.c b/gfxnvidia.c
index d3ee14e4c..2a5c7ae4a 100644
--- a/gfxnvidia.c
+++ b/gfxnvidia.c
@@ -89,7 +89,7 @@ int gfxnvidia_init(void)
if (!dev)
return 1;
- io_base_addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
+ uint32_t io_base_addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
if (!io_base_addr)
return 1;
diff --git a/it8212.c b/it8212.c
index f68121a6b..4d1c403e9 100644
--- a/it8212.c
+++ b/it8212.c
@@ -59,7 +59,7 @@ int it8212_init(void)
return 1;
/* Bit 0 is address decode enable, 17-31 the base address, everything else reserved/zero. */
- io_base_addr = pcidev_readbar(dev, PCI_ROM_ADDRESS) & 0xFFFFFFFE;
+ uint32_t io_base_addr = pcidev_readbar(dev, PCI_ROM_ADDRESS) & 0xFFFFFFFE;
if (!io_base_addr)
return 1;
diff --git a/nic3com.c b/nic3com.c
index 27e28c780..145554df5 100644
--- a/nic3com.c
+++ b/nic3com.c
@@ -33,6 +33,7 @@
#define PCI_VENDOR_ID_3COM 0x10b7
+static uint32_t io_base_addr = 0;
static uint32_t internal_conf;
static uint16_t id;
diff --git a/nicintel_spi.c b/nicintel_spi.c
index 1522c9b3f..25bfa8f30 100644
--- a/nicintel_spi.c
+++ b/nicintel_spi.c
@@ -179,7 +179,7 @@ int nicintel_spi_init(void)
if (!dev)
return 1;
- io_base_addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
+ uint32_t io_base_addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
if (!io_base_addr)
return 1;
diff --git a/nicnatsemi.c b/nicnatsemi.c
index cb8da6d29..acefddb5e 100644
--- a/nicnatsemi.c
+++ b/nicnatsemi.c
@@ -30,6 +30,7 @@
#define BOOT_ROM_ADDR 0x50
#define BOOT_ROM_DATA 0x54
+static uint32_t io_base_addr = 0;
const struct dev_entry nics_natsemi[] = {
{0x100b, 0x0020, NT, "National Semiconductor", "DP83815/DP83816"},
{0x100b, 0x0022, NT, "National Semiconductor", "DP83820"},
diff --git a/nicrealtek.c b/nicrealtek.c
index 02fbd39c3..4a440ea93 100644
--- a/nicrealtek.c
+++ b/nicrealtek.c
@@ -28,6 +28,7 @@
#define PCI_VENDOR_ID_REALTEK 0x10ec
#define PCI_VENDOR_ID_SMC1211 0x1113
+static uint32_t io_base_addr = 0;
static int bios_rom_addr, bios_rom_data;
const struct dev_entry nics_realtek[] = {
diff --git a/ogp_spi.c b/ogp_spi.c
index 23431d140..a624dfd26 100644
--- a/ogp_spi.c
+++ b/ogp_spi.c
@@ -132,7 +132,7 @@ int ogp_spi_init(void)
if (!dev)
return 1;
- io_base_addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
+ uint32_t io_base_addr = pcidev_readbar(dev, PCI_BASE_ADDRESS_0);
if (!io_base_addr)
return 1;
diff --git a/pcidev.c b/pcidev.c
index 3a3f77c87..2c7806379 100644
--- a/pcidev.c
+++ b/pcidev.c
@@ -25,7 +25,6 @@
#include "programmer.h"
#include "hwaccess.h"
-uint32_t io_base_addr;
struct pci_access *pacc;
enum pci_bartype {
diff --git a/programmer.h b/programmer.h
index 3ea014cb9..d29965629 100644
--- a/programmer.h
+++ b/programmer.h
@@ -173,8 +173,7 @@ struct bitbang_spi_master {
struct pci_dev;
/* pcidev.c */
-// FIXME: These need to be local, not global
-extern uint32_t io_base_addr;
+// FIXME: This needs to be local, not global(?)
extern struct pci_access *pacc;
int pci_init_common(void);
uintptr_t pcidev_readbar(struct pci_dev *dev, int bar);