|
103 | 103 | #define FARADAY_PCI_DMA_MEM2_BASE 0x00000000
|
104 | 104 | #define FARADAY_PCI_DMA_MEM3_BASE 0x00000000
|
105 | 105 |
|
106 |
| -/* Defines for PCI configuration command register */ |
107 |
| -#define PCI_CONF_ENABLE BIT(31) |
108 |
| -#define PCI_CONF_WHERE(r) ((r) & 0xFC) |
109 |
| -#define PCI_CONF_BUS(b) (((b) & 0xFF) << 16) |
110 |
| -#define PCI_CONF_DEVICE(d) (((d) & 0x1F) << 11) |
111 |
| -#define PCI_CONF_FUNCTION(f) (((f) & 0x07) << 8) |
112 |
| - |
113 | 106 | /**
|
114 | 107 | * struct faraday_pci_variant - encodes IP block differences
|
115 | 108 | * @cascaded_irq: this host has cascaded IRQs from an interrupt controller
|
@@ -190,11 +183,8 @@ static int faraday_raw_pci_read_config(struct faraday_pci *p, int bus_number,
|
190 | 183 | unsigned int fn, int config, int size,
|
191 | 184 | u32 *value)
|
192 | 185 | {
|
193 |
| - writel(PCI_CONF_BUS(bus_number) | |
194 |
| - PCI_CONF_DEVICE(PCI_SLOT(fn)) | |
195 |
| - PCI_CONF_FUNCTION(PCI_FUNC(fn)) | |
196 |
| - PCI_CONF_WHERE(config) | |
197 |
| - PCI_CONF_ENABLE, |
| 186 | + writel(PCI_CONF1_ADDRESS(bus_number, PCI_SLOT(fn), |
| 187 | + PCI_FUNC(fn), config), |
198 | 188 | p->base + FTPCI_CONFIG);
|
199 | 189 |
|
200 | 190 | *value = readl(p->base + FTPCI_DATA);
|
@@ -225,11 +215,8 @@ static int faraday_raw_pci_write_config(struct faraday_pci *p, int bus_number,
|
225 | 215 | {
|
226 | 216 | int ret = PCIBIOS_SUCCESSFUL;
|
227 | 217 |
|
228 |
| - writel(PCI_CONF_BUS(bus_number) | |
229 |
| - PCI_CONF_DEVICE(PCI_SLOT(fn)) | |
230 |
| - PCI_CONF_FUNCTION(PCI_FUNC(fn)) | |
231 |
| - PCI_CONF_WHERE(config) | |
232 |
| - PCI_CONF_ENABLE, |
| 218 | + writel(PCI_CONF1_ADDRESS(bus_number, PCI_SLOT(fn), |
| 219 | + PCI_FUNC(fn), config), |
233 | 220 | p->base + FTPCI_CONFIG);
|
234 | 221 |
|
235 | 222 | switch (size) {
|
|
0 commit comments