blob: cf9cf41ae5353b207b28951bd7460ef49778b733 [file] [log] [blame]
wdenkc6097192002-11-03 00:24:07 +00001/*
2 * arch/ppc/kernel/mpc10x_common.c
3 *
4 * Common routines for the Motorola SPS MPC106, MPC107 and MPC8240 Host bridge,
5 * Mem ctlr, EPIC, etc.
6 *
7 * Author: Mark A. Greer
8 * mgreer@mvista.com
9 *
10 * Copyright 2001 MontaVista Software Inc.
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version.
16 */
17
18#include <common.h>
19
20#ifdef CONFIG_PCI
21
22#include <asm/processor.h>
23#include <asm/io.h>
24#include <pci.h>
25#include <mpc824x.h>
26
27void pci_mpc824x_init (struct pci_controller *hose)
28{
29 hose->first_busno = 0;
30 hose->last_busno = 0xff;
31
32 /* System memory space */
33 pci_set_region(hose->regions + 0,
34 CHRP_PCI_MEMORY_BUS,
35 CHRP_PCI_MEMORY_PHYS,
36 CHRP_PCI_MEMORY_SIZE,
Kumar Galaff4e66e2009-02-06 09:49:31 -060037 PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
wdenkc6097192002-11-03 00:24:07 +000038
39 /* PCI memory space */
40 pci_set_region(hose->regions + 1,
41 CHRP_PCI_MEM_BUS,
42 CHRP_PCI_MEM_PHYS,
43 CHRP_PCI_MEM_SIZE,
44 PCI_REGION_MEM);
45
46 /* ISA/PCI memory space */
47 pci_set_region(hose->regions + 2,
48 CHRP_ISA_MEM_BUS,
49 CHRP_ISA_MEM_PHYS,
50 CHRP_ISA_MEM_SIZE,
51 PCI_REGION_MEM);
52
53 /* PCI I/O space */
54 pci_set_region(hose->regions + 3,
55 CHRP_PCI_IO_BUS,
56 CHRP_PCI_IO_PHYS,
57 CHRP_PCI_IO_SIZE,
58 PCI_REGION_IO);
59
60 /* ISA/PCI I/O space */
61 pci_set_region(hose->regions + 4,
62 CHRP_ISA_IO_BUS,
63 CHRP_ISA_IO_PHYS,
64 CHRP_ISA_IO_SIZE,
65 PCI_REGION_IO);
66
67 hose->region_count = 5;
68
69 pci_setup_indirect(hose,
70 CHRP_REG_ADDR,
71 CHRP_REG_DATA);
72
73 pci_register_hose(hose);
74
75 hose->last_busno = pci_hose_scan(hose);
76}
77
78#endif