summaryrefslogtreecommitdiff
path: root/arch/arm/common/pci.c
blob: 44325adb3c40132c69e928bc7b6da1a5c16076cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 *  linux/arch/arm/common/pci.c
 *
 *	Some descriptions of such software. Copyright (c) 2008 WonderMedia Technologies, Inc.
 *
 *	This program is free software: you can redistribute it and/or modify it under the
 *	terms of the GNU General Public License as published by the Free Software Foundation,
 *	either version 2 of the License, or (at your option) any later version.
 *
 *	This program is distributed in the hope that it will be useful, but WITHOUT
 *	ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 *	PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 *	You should have received a copy of the GNU General Public License along with
 *	this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *	WonderMedia Technologies, Inc.
 *	10F, 529, Chung-Cheng Road, Hsin-Tien, Taipei 231, R.O.C.
 *
 *  PCI bios-type initialisation for PCI machines
 *
 *  Bits taken from various places.
 */

#include <linux/kernel.h>
#include <linux/pci.h>
#include <linux/init.h>

#include <asm/irq.h>
#include <asm/mach/pci.h>
#include <asm/mach-types.h>

extern int __init wmt_pci_setup(int nr, struct pci_sys_data *sys);
extern struct pci_bus * __init wmt_pci_scan_bus(int nr, struct pci_sys_data *sysdata);

static int __init wmt_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
{
    u8 int_line;

    pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &int_line);
    return int_line;
}

extern void __init wmt_pci_preinit(void *sysdata);

static struct hw_pci wmt_pci __initdata = {
	.setup	    = wmt_pci_setup,
	.swizzle    = pci_std_swizzle,
	.map_irq    = wmt_map_irq,
	.nr_controllers = 1,
	.scan       = wmt_pci_scan_bus,
	.preinit    = wmt_pci_preinit
};

static int __init wmt_pci_init(void)
{
	/* {JHT} */
	printk("wmt_pci_init\n");
		pci_common_init(&wmt_pci);
	return 0;
}

subsys_initcall(wmt_pci_init);