Skip to content

Commit 252161e

Browse files
Yoichi Yuasaralfbaechle
authored andcommitted
[MIPS] merge GT64111 PCI routines and GT64120 PCI_0 routines
This patch has merged GT64111 PCI routines and GT64120 PCI_0 routines. GT64111 PCI is almost the same as GT64120's PCI_0. This patch don't change GT64120 PCI routines. Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 2a9effc commit 252161e

9 files changed

Lines changed: 33 additions & 137 deletions

File tree

‎arch/mips/Kconfig‎

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ config MIPS_COBALT
165165
select HW_HAS_PCI
166166
select I8259
167167
select IRQ_CPU
168-
select MIPS_GT64111
168+
select PCI_GT64XXX_PCI0
169169
select SYS_HAS_CPU_NEVADA
170170
select SYS_HAS_EARLY_PRINTK
171171
select SYS_SUPPORTS_32BIT_KERNEL
@@ -207,7 +207,7 @@ config MIPS_EV64120
207207
depends on EXPERIMENTAL
208208
select DMA_NONCOHERENT
209209
select HW_HAS_PCI
210-
select MIPS_GT64120
210+
select PCI_GT64XXX_PCI0
211211
select SYS_HAS_CPU_R5000
212212
select SYS_SUPPORTS_32BIT_KERNEL
213213
select SYS_SUPPORTS_64BIT_KERNEL
@@ -245,7 +245,7 @@ config LASAT
245245
select DMA_NONCOHERENT
246246
select SYS_HAS_EARLY_PRINTK
247247
select HW_HAS_PCI
248-
select MIPS_GT64120
248+
select PCI_GT64XXX_PCI0
249249
select MIPS_NILE4
250250
select R5000_CPU_SCACHE
251251
select SYS_HAS_CPU_R5000
@@ -263,7 +263,7 @@ config MIPS_ATLAS
263263
select HW_HAS_PCI
264264
select MIPS_BOARDS_GEN
265265
select MIPS_BONITO64
266-
select MIPS_GT64120
266+
select PCI_GT64XXX_PCI0
267267
select MIPS_MSC
268268
select RM7000_CPU_SCACHE
269269
select SWAP_IO_SPACE
@@ -296,7 +296,7 @@ config MIPS_MALTA
296296
select MIPS_BOARDS_GEN
297297
select MIPS_BONITO64
298298
select MIPS_CPU_SCACHE
299-
select MIPS_GT64120
299+
select PCI_GT64XXX_PCI0
300300
select MIPS_MSC
301301
select SWAP_IO_SPACE
302302
select SYS_HAS_CPU_MIPS32_R1
@@ -340,7 +340,7 @@ config WR_PPMC
340340
select BOOT_ELF32
341341
select DMA_NONCOHERENT
342342
select HW_HAS_PCI
343-
select MIPS_GT64120
343+
select PCI_GT64XXX_PCI0
344344
select SWAP_IO_SPACE
345345
select SYS_HAS_CPU_MIPS32_R1
346346
select SYS_HAS_CPU_MIPS32_R2
@@ -398,7 +398,7 @@ config MOMENCO_OCELOT
398398
select HW_HAS_PCI
399399
select IRQ_CPU
400400
select IRQ_CPU_RM7K
401-
select MIPS_GT64120
401+
select PCI_GT64XXX_PCI0
402402
select RM7000_CPU_SCACHE
403403
select SWAP_IO_SPACE
404404
select SYS_HAS_CPU_RM7000
@@ -999,10 +999,7 @@ config DDB5XXX_COMMON
999999
config MIPS_BOARDS_GEN
10001000
bool
10011001

1002-
config MIPS_GT64111
1003-
bool
1004-
1005-
config MIPS_GT64120
1002+
config PCI_GT64XXX_PCI0
10061003
bool
10071004

10081005
config MIPS_TX3927

‎arch/mips/cobalt/pci.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
#include <asm/gt64120.h>
1616

17-
extern struct pci_ops gt64111_pci_ops;
17+
extern struct pci_ops gt64xxx_pci0_ops;
1818

1919
static struct resource cobalt_mem_resource = {
2020
.start = GT_DEF_PCI0_MEM0_BASE,
@@ -31,7 +31,7 @@ static struct resource cobalt_io_resource = {
3131
};
3232

3333
static struct pci_controller cobalt_pci_controller = {
34-
.pci_ops = &gt64111_pci_ops,
34+
.pci_ops = &gt64xxx_pci0_ops,
3535
.mem_resource = &cobalt_mem_resource,
3636
.io_resource = &cobalt_io_resource,
3737
.io_offset = 0 - GT_DEF_PCI0_IO_BASE,

‎arch/mips/gt64120/wrppmc/pci.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <linux/kernel.h>
1414
#include <asm/gt64120.h>
1515

16-
extern struct pci_ops gt64120_pci_ops;
16+
extern struct pci_ops gt64xxx_pci0_ops;
1717

1818
static struct resource pci0_io_resource = {
1919
.name = "pci_0 io",
@@ -30,7 +30,7 @@ static struct resource pci0_mem_resource = {
3030
};
3131

3232
static struct pci_controller hose_0 = {
33-
.pci_ops = &gt64120_pci_ops,
33+
.pci_ops = &gt64xxx_pci0_ops,
3434
.io_resource = &pci0_io_resource,
3535
.mem_resource = &pci0_mem_resource,
3636
};

‎arch/mips/mips-boards/generic/pci.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static struct resource msc_io_resource = {
6565
};
6666

6767
extern struct pci_ops bonito64_pci_ops;
68-
extern struct pci_ops gt64120_pci_ops;
68+
extern struct pci_ops gt64xxx_pci0_ops;
6969
extern struct pci_ops msc_pci_ops;
7070

7171
static struct pci_controller bonito64_controller = {
@@ -76,7 +76,7 @@ static struct pci_controller bonito64_controller = {
7676
};
7777

7878
static struct pci_controller gt64120_controller = {
79-
.pci_ops = &gt64120_pci_ops,
79+
.pci_ops = &gt64xxx_pci0_ops,
8080
.io_resource = &gt64120_io_resource,
8181
.mem_resource = &gt64120_mem_resource,
8282
};

‎arch/mips/pci/Makefile‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ obj-y += pci.o pci-dac.o
88
# PCI bus host bridge specific code
99
#
1010
obj-$(CONFIG_MIPS_BONITO64) += ops-bonito64.o
11-
obj-$(CONFIG_MIPS_GT64111) += ops-gt64111.o
12-
obj-$(CONFIG_MIPS_GT64120) += ops-gt64120.o
11+
obj-$(CONFIG_PCI_GT64XXX_PCI0) += ops-gt64xxx_pci0.o
1312
obj-$(CONFIG_PCI_MARVELL) += ops-marvell.o
1413
obj-$(CONFIG_MIPS_MSC) += ops-msc.o
1514
obj-$(CONFIG_MIPS_NILE4) += ops-nile4.o

‎arch/mips/pci/ops-gt64111.c‎

Lines changed: 0 additions & 100 deletions
This file was deleted.
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
#define PCI_CFG_TYPE1_DEV_SHF 11
4040
#define PCI_CFG_TYPE1_BUS_SHF 16
4141

42-
static int gt64120_pcibios_config_access(unsigned char access_type,
43-
struct pci_bus *bus, unsigned int devfn, int where, u32 * data)
42+
static int gt64xxx_pci0_pcibios_config_access(unsigned char access_type,
43+
struct pci_bus *bus, unsigned int devfn, int where, u32 * data)
4444
{
4545
unsigned char busnum = bus->number;
4646
u32 intr;
@@ -100,13 +100,13 @@ static int gt64120_pcibios_config_access(unsigned char access_type,
100100
* We can't address 8 and 16 bit words directly. Instead we have to
101101
* read/write a 32bit word and mask/modify the data we actually want.
102102
*/
103-
static int gt64120_pcibios_read(struct pci_bus *bus, unsigned int devfn,
104-
int where, int size, u32 * val)
103+
static int gt64xxx_pci0_pcibios_read(struct pci_bus *bus, unsigned int devfn,
104+
int where, int size, u32 * val)
105105
{
106106
u32 data = 0;
107107

108-
if (gt64120_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where,
109-
&data))
108+
if (gt64xxx_pci0_pcibios_config_access(PCI_ACCESS_READ, bus, devfn,
109+
where, &data))
110110
return PCIBIOS_DEVICE_NOT_FOUND;
111111

112112
if (size == 1)
@@ -119,16 +119,16 @@ static int gt64120_pcibios_read(struct pci_bus *bus, unsigned int devfn,
119119
return PCIBIOS_SUCCESSFUL;
120120
}
121121

122-
static int gt64120_pcibios_write(struct pci_bus *bus, unsigned int devfn,
123-
int where, int size, u32 val)
122+
static int gt64xxx_pci0_pcibios_write(struct pci_bus *bus, unsigned int devfn,
123+
int where, int size, u32 val)
124124
{
125125
u32 data = 0;
126126

127127
if (size == 4)
128128
data = val;
129129
else {
130-
if (gt64120_pcibios_config_access(PCI_ACCESS_READ, bus, devfn,
131-
where, &data))
130+
if (gt64xxx_pci0_pcibios_config_access(PCI_ACCESS_READ, bus,
131+
devfn, where, &data))
132132
return PCIBIOS_DEVICE_NOT_FOUND;
133133

134134
if (size == 1)
@@ -139,14 +139,14 @@ static int gt64120_pcibios_write(struct pci_bus *bus, unsigned int devfn,
139139
(val << ((where & 3) << 3));
140140
}
141141

142-
if (gt64120_pcibios_config_access(PCI_ACCESS_WRITE, bus, devfn, where,
143-
&data))
142+
if (gt64xxx_pci0_pcibios_config_access(PCI_ACCESS_WRITE, bus, devfn,
143+
where, &data))
144144
return PCIBIOS_DEVICE_NOT_FOUND;
145145

146146
return PCIBIOS_SUCCESSFUL;
147147
}
148148

149-
struct pci_ops gt64120_pci_ops = {
150-
.read = gt64120_pcibios_read,
151-
.write = gt64120_pcibios_write
149+
struct pci_ops gt64xxx_pci0_ops = {
150+
.read = gt64xxx_pci0_pcibios_read,
151+
.write = gt64xxx_pci0_pcibios_write
152152
};

‎arch/mips/pci/pci-lasat.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <asm/bootinfo.h>
1313

1414
extern struct pci_ops nile4_pci_ops;
15-
extern struct pci_ops gt64120_pci_ops;
15+
extern struct pci_ops gt64xxx_pci0_ops;
1616
static struct resource lasat_pci_mem_resource = {
1717
.name = "LASAT PCI MEM",
1818
.start = 0x18000000,
@@ -38,7 +38,7 @@ static int __init lasat_pci_setup(void)
3838

3939
switch (mips_machtype) {
4040
case MACH_LASAT_100:
41-
lasat_pci_controller.pci_ops = &gt64120_pci_ops;
41+
lasat_pci_controller.pci_ops = &gt64xxx_pci0_ops;
4242
break;
4343
case MACH_LASAT_200:
4444
lasat_pci_controller.pci_ops = &nile4_pci_ops;

‎arch/mips/pci/pci-ocelot.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static struct resource ocelot_io_resource = {
8181
};
8282

8383
static struct pci_controller ocelot_pci_controller = {
84-
.pci_ops = gt64120_pci_ops;
84+
.pci_ops = gt64xxx_pci0_ops;
8585
.mem_resource = &ocelot_mem_resource;
8686
.io_resource = &ocelot_io_resource;
8787
};

0 commit comments

Comments
 (0)