2006-05-06 11:04:20 +02:00
|
|
|
/*
|
|
|
|
* pci.c: GT64120 PCI support.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2006, Wind River System Inc. Rongkai.Zhan <rongkai.zhan@windriver.com>
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
#include <linux/init.h>
|
2007-10-09 17:28:26 +02:00
|
|
|
#include <linux/ioport.h>
|
2006-05-06 11:04:20 +02:00
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/pci.h>
|
2007-10-09 17:28:26 +02:00
|
|
|
|
2006-05-06 11:04:20 +02:00
|
|
|
#include <asm/gt64120.h>
|
|
|
|
|
2007-03-14 13:51:26 +01:00
|
|
|
extern struct pci_ops gt64xxx_pci0_ops;
|
2006-05-06 11:04:20 +02:00
|
|
|
|
|
|
|
static struct resource pci0_io_resource = {
|
|
|
|
.name = "pci_0 io",
|
|
|
|
.start = GT_PCI_IO_BASE,
|
|
|
|
.end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1,
|
|
|
|
.flags = IORESOURCE_IO,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct resource pci0_mem_resource = {
|
|
|
|
.name = "pci_0 memory",
|
|
|
|
.start = GT_PCI_MEM_BASE,
|
|
|
|
.end = GT_PCI_MEM_BASE + GT_PCI_MEM_SIZE - 1,
|
|
|
|
.flags = IORESOURCE_MEM,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct pci_controller hose_0 = {
|
2007-03-14 13:51:26 +01:00
|
|
|
.pci_ops = >64xxx_pci0_ops,
|
2006-05-06 11:04:20 +02:00
|
|
|
.io_resource = &pci0_io_resource,
|
|
|
|
.mem_resource = &pci0_mem_resource,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int __init gt64120_pci_init(void)
|
|
|
|
{
|
2012-09-06 11:03:03 +02:00
|
|
|
(void) GT_READ(GT_PCI0_CMD_OFS); /* Huh??? -- Ralf */
|
|
|
|
(void) GT_READ(GT_PCI0_BARE_OFS);
|
2006-05-06 11:04:20 +02:00
|
|
|
|
|
|
|
/* reset the whole PCI I/O space range */
|
|
|
|
ioport_resource.start = GT_PCI_IO_BASE;
|
|
|
|
ioport_resource.end = GT_PCI_IO_BASE + GT_PCI_IO_SIZE - 1;
|
|
|
|
|
|
|
|
register_pci_controller(&hose_0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
arch_initcall(gt64120_pci_init);
|