Skip to content

Commit

Permalink
[MIPS] merge GT64111 PCI routines and GT64120 PCI_0 routines
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yoichi Yuasa authored and Ralf Baechle committed Apr 27, 2007
1 parent 2a9effc commit 252161e
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 137 deletions.
19 changes: 8 additions & 11 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ config MIPS_COBALT
select HW_HAS_PCI
select I8259
select IRQ_CPU
select MIPS_GT64111
select PCI_GT64XXX_PCI0
select SYS_HAS_CPU_NEVADA
select SYS_HAS_EARLY_PRINTK
select SYS_SUPPORTS_32BIT_KERNEL
Expand Down Expand Up @@ -207,7 +207,7 @@ config MIPS_EV64120
depends on EXPERIMENTAL
select DMA_NONCOHERENT
select HW_HAS_PCI
select MIPS_GT64120
select PCI_GT64XXX_PCI0
select SYS_HAS_CPU_R5000
select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_64BIT_KERNEL
Expand Down Expand Up @@ -245,7 +245,7 @@ config LASAT
select DMA_NONCOHERENT
select SYS_HAS_EARLY_PRINTK
select HW_HAS_PCI
select MIPS_GT64120
select PCI_GT64XXX_PCI0
select MIPS_NILE4
select R5000_CPU_SCACHE
select SYS_HAS_CPU_R5000
Expand All @@ -263,7 +263,7 @@ config MIPS_ATLAS
select HW_HAS_PCI
select MIPS_BOARDS_GEN
select MIPS_BONITO64
select MIPS_GT64120
select PCI_GT64XXX_PCI0
select MIPS_MSC
select RM7000_CPU_SCACHE
select SWAP_IO_SPACE
Expand Down Expand Up @@ -296,7 +296,7 @@ config MIPS_MALTA
select MIPS_BOARDS_GEN
select MIPS_BONITO64
select MIPS_CPU_SCACHE
select MIPS_GT64120
select PCI_GT64XXX_PCI0
select MIPS_MSC
select SWAP_IO_SPACE
select SYS_HAS_CPU_MIPS32_R1
Expand Down Expand Up @@ -340,7 +340,7 @@ config WR_PPMC
select BOOT_ELF32
select DMA_NONCOHERENT
select HW_HAS_PCI
select MIPS_GT64120
select PCI_GT64XXX_PCI0
select SWAP_IO_SPACE
select SYS_HAS_CPU_MIPS32_R1
select SYS_HAS_CPU_MIPS32_R2
Expand Down Expand Up @@ -398,7 +398,7 @@ config MOMENCO_OCELOT
select HW_HAS_PCI
select IRQ_CPU
select IRQ_CPU_RM7K
select MIPS_GT64120
select PCI_GT64XXX_PCI0
select RM7000_CPU_SCACHE
select SWAP_IO_SPACE
select SYS_HAS_CPU_RM7000
Expand Down Expand Up @@ -999,10 +999,7 @@ config DDB5XXX_COMMON
config MIPS_BOARDS_GEN
bool

config MIPS_GT64111
bool

config MIPS_GT64120
config PCI_GT64XXX_PCI0
bool

config MIPS_TX3927
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/cobalt/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include <asm/gt64120.h>

extern struct pci_ops gt64111_pci_ops;
extern struct pci_ops gt64xxx_pci0_ops;

static struct resource cobalt_mem_resource = {
.start = GT_DEF_PCI0_MEM0_BASE,
Expand All @@ -31,7 +31,7 @@ static struct resource cobalt_io_resource = {
};

static struct pci_controller cobalt_pci_controller = {
.pci_ops = &gt64111_pci_ops,
.pci_ops = &gt64xxx_pci0_ops,
.mem_resource = &cobalt_mem_resource,
.io_resource = &cobalt_io_resource,
.io_offset = 0 - GT_DEF_PCI0_IO_BASE,
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/gt64120/wrppmc/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <linux/kernel.h>
#include <asm/gt64120.h>

extern struct pci_ops gt64120_pci_ops;
extern struct pci_ops gt64xxx_pci0_ops;

static struct resource pci0_io_resource = {
.name = "pci_0 io",
Expand All @@ -30,7 +30,7 @@ static struct resource pci0_mem_resource = {
};

static struct pci_controller hose_0 = {
.pci_ops = &gt64120_pci_ops,
.pci_ops = &gt64xxx_pci0_ops,
.io_resource = &pci0_io_resource,
.mem_resource = &pci0_mem_resource,
};
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/mips-boards/generic/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ static struct resource msc_io_resource = {
};

extern struct pci_ops bonito64_pci_ops;
extern struct pci_ops gt64120_pci_ops;
extern struct pci_ops gt64xxx_pci0_ops;
extern struct pci_ops msc_pci_ops;

static struct pci_controller bonito64_controller = {
Expand All @@ -76,7 +76,7 @@ static struct pci_controller bonito64_controller = {
};

static struct pci_controller gt64120_controller = {
.pci_ops = &gt64120_pci_ops,
.pci_ops = &gt64xxx_pci0_ops,
.io_resource = &gt64120_io_resource,
.mem_resource = &gt64120_mem_resource,
};
Expand Down
3 changes: 1 addition & 2 deletions arch/mips/pci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ obj-y += pci.o pci-dac.o
# PCI bus host bridge specific code
#
obj-$(CONFIG_MIPS_BONITO64) += ops-bonito64.o
obj-$(CONFIG_MIPS_GT64111) += ops-gt64111.o
obj-$(CONFIG_MIPS_GT64120) += ops-gt64120.o
obj-$(CONFIG_PCI_GT64XXX_PCI0) += ops-gt64xxx_pci0.o
obj-$(CONFIG_PCI_MARVELL) += ops-marvell.o
obj-$(CONFIG_MIPS_MSC) += ops-msc.o
obj-$(CONFIG_MIPS_NILE4) += ops-nile4.o
Expand Down
100 changes: 0 additions & 100 deletions arch/mips/pci/ops-gt64111.c

This file was deleted.

30 changes: 15 additions & 15 deletions arch/mips/pci/ops-gt64120.c → arch/mips/pci/ops-gt64xxx_pci0.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
#define PCI_CFG_TYPE1_DEV_SHF 11
#define PCI_CFG_TYPE1_BUS_SHF 16

static int gt64120_pcibios_config_access(unsigned char access_type,
struct pci_bus *bus, unsigned int devfn, int where, u32 * data)
static int gt64xxx_pci0_pcibios_config_access(unsigned char access_type,
struct pci_bus *bus, unsigned int devfn, int where, u32 * data)
{
unsigned char busnum = bus->number;
u32 intr;
Expand Down Expand Up @@ -100,13 +100,13 @@ static int gt64120_pcibios_config_access(unsigned char access_type,
* We can't address 8 and 16 bit words directly. Instead we have to
* read/write a 32bit word and mask/modify the data we actually want.
*/
static int gt64120_pcibios_read(struct pci_bus *bus, unsigned int devfn,
int where, int size, u32 * val)
static int gt64xxx_pci0_pcibios_read(struct pci_bus *bus, unsigned int devfn,
int where, int size, u32 * val)
{
u32 data = 0;

if (gt64120_pcibios_config_access(PCI_ACCESS_READ, bus, devfn, where,
&data))
if (gt64xxx_pci0_pcibios_config_access(PCI_ACCESS_READ, bus, devfn,
where, &data))
return PCIBIOS_DEVICE_NOT_FOUND;

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

static int gt64120_pcibios_write(struct pci_bus *bus, unsigned int devfn,
int where, int size, u32 val)
static int gt64xxx_pci0_pcibios_write(struct pci_bus *bus, unsigned int devfn,
int where, int size, u32 val)
{
u32 data = 0;

if (size == 4)
data = val;
else {
if (gt64120_pcibios_config_access(PCI_ACCESS_READ, bus, devfn,
where, &data))
if (gt64xxx_pci0_pcibios_config_access(PCI_ACCESS_READ, bus,
devfn, where, &data))
return PCIBIOS_DEVICE_NOT_FOUND;

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

if (gt64120_pcibios_config_access(PCI_ACCESS_WRITE, bus, devfn, where,
&data))
if (gt64xxx_pci0_pcibios_config_access(PCI_ACCESS_WRITE, bus, devfn,
where, &data))
return PCIBIOS_DEVICE_NOT_FOUND;

return PCIBIOS_SUCCESSFUL;
}

struct pci_ops gt64120_pci_ops = {
.read = gt64120_pcibios_read,
.write = gt64120_pcibios_write
struct pci_ops gt64xxx_pci0_ops = {
.read = gt64xxx_pci0_pcibios_read,
.write = gt64xxx_pci0_pcibios_write
};
4 changes: 2 additions & 2 deletions arch/mips/pci/pci-lasat.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <asm/bootinfo.h>

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

switch (mips_machtype) {
case MACH_LASAT_100:
lasat_pci_controller.pci_ops = &gt64120_pci_ops;
lasat_pci_controller.pci_ops = &gt64xxx_pci0_ops;
break;
case MACH_LASAT_200:
lasat_pci_controller.pci_ops = &nile4_pci_ops;
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/pci-ocelot.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ static struct resource ocelot_io_resource = {
};

static struct pci_controller ocelot_pci_controller = {
.pci_ops = gt64120_pci_ops;
.pci_ops = gt64xxx_pci0_ops;
.mem_resource = &ocelot_mem_resource;
.io_resource = &ocelot_io_resource;
};
Expand Down

0 comments on commit 252161e

Please sign in to comment.