summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/cpu/mpc824x/pci.c
blob: 1257b086f2e9b641451649d77e355992a60ba28e (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
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
 * arch/powerpc/kernel/mpc10x_common.c
 *
 * Common routines for the Motorola SPS MPC106, MPC107 and MPC8240 Host bridge,
 * Mem ctlr, EPIC, etc.
 *
 * Author: Mark A. Greer
 *         mgreer@mvista.com
 *
 * Copyright 2001 MontaVista Software Inc.
 *
 * SPDX-License-Identifier:	GPL-2.0+
 */

#include <common.h>

#ifdef CONFIG_PCI

#include <asm/processor.h>
#include <asm/io.h>
#include <pci.h>
#include <mpc824x.h>

void pci_mpc824x_init (struct pci_controller *hose)
{
	hose->first_busno = 0;
	hose->last_busno = 0xff;

	/* System memory space */
	pci_set_region(hose->regions + 0,
		       CHRP_PCI_MEMORY_BUS,
		       CHRP_PCI_MEMORY_PHYS,
		       CHRP_PCI_MEMORY_SIZE,
		       PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);

	/* PCI memory space */
	pci_set_region(hose->regions + 1,
		       CHRP_PCI_MEM_BUS,
		       CHRP_PCI_MEM_PHYS,
		       CHRP_PCI_MEM_SIZE,
		       PCI_REGION_MEM);

	/* ISA/PCI memory space */
	pci_set_region(hose->regions + 2,
		       CHRP_ISA_MEM_BUS,
		       CHRP_ISA_MEM_PHYS,
		       CHRP_ISA_MEM_SIZE,
		       PCI_REGION_MEM);

	/* PCI I/O space */
	pci_set_region(hose->regions + 3,
		       CHRP_PCI_IO_BUS,
		       CHRP_PCI_IO_PHYS,
		       CHRP_PCI_IO_SIZE,
		       PCI_REGION_IO);

	/* ISA/PCI I/O space */
	pci_set_region(hose->regions + 4,
		       CHRP_ISA_IO_BUS,
		       CHRP_ISA_IO_PHYS,
		       CHRP_ISA_IO_SIZE,
		       PCI_REGION_IO);

	hose->region_count = 5;

	pci_setup_indirect(hose,
			   CHRP_REG_ADDR,
			   CHRP_REG_DATA);

	pci_register_hose(hose);

	hose->last_busno = pci_hose_scan(hose);
}

#endif
OpenPOWER on IntegriCloud