blob: 1257b086f2e9b641451649d77e355992a60ba28e [file] [log] [blame]
wdenkc6097192002-11-03 00:24:07 +00001/*
Stefan Roesea47a12b2010-04-15 16:07:28 +02002 * arch/powerpc/kernel/mpc10x_common.c
wdenkc6097192002-11-03 00:24:07 +00003 *
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 *
Wolfgang Denk1a459662013-07-08 09:37:19 +020012 * SPDX-License-Identifier: GPL-2.0+
wdenkc6097192002-11-03 00:24:07 +000013 */
14
15#include <common.h>
16
17#ifdef CONFIG_PCI
18
19#include <asm/processor.h>
20#include <asm/io.h>
21#include <pci.h>
22#include <mpc824x.h>
23
24void pci_mpc824x_init (struct pci_controller *hose)
25{
26 hose->first_busno = 0;
27 hose->last_busno = 0xff;
28
29 /* System memory space */
30 pci_set_region(hose->regions + 0,
31 CHRP_PCI_MEMORY_BUS,
32 CHRP_PCI_MEMORY_PHYS,
33 CHRP_PCI_MEMORY_SIZE,
Kumar Galaff4e66e2009-02-06 09:49:31 -060034 PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
wdenkc6097192002-11-03 00:24:07 +000035
36 /* PCI memory space */
37 pci_set_region(hose->regions + 1,
38 CHRP_PCI_MEM_BUS,
39 CHRP_PCI_MEM_PHYS,
40 CHRP_PCI_MEM_SIZE,
41 PCI_REGION_MEM);
42
43 /* ISA/PCI memory space */
44 pci_set_region(hose->regions + 2,
45 CHRP_ISA_MEM_BUS,
46 CHRP_ISA_MEM_PHYS,
47 CHRP_ISA_MEM_SIZE,
48 PCI_REGION_MEM);
49
50 /* PCI I/O space */
51 pci_set_region(hose->regions + 3,
52 CHRP_PCI_IO_BUS,
53 CHRP_PCI_IO_PHYS,
54 CHRP_PCI_IO_SIZE,
55 PCI_REGION_IO);
56
57 /* ISA/PCI I/O space */
58 pci_set_region(hose->regions + 4,
59 CHRP_ISA_IO_BUS,
60 CHRP_ISA_IO_PHYS,
61 CHRP_ISA_IO_SIZE,
62 PCI_REGION_IO);
63
64 hose->region_count = 5;
65
66 pci_setup_indirect(hose,
67 CHRP_REG_ADDR,
68 CHRP_REG_DATA);
69
70 pci_register_hose(hose);
71
72 hose->last_busno = pci_hose_scan(hose);
73}
74
75#endif