MINI2440: Updated early nand loader
[u-boot-openmoko/mini2440.git] / cpu / mpc824x / pci.c
blob7e3c4c3b7823788cb7779ca043bf926a190224fe
1 /*
2 * arch/ppc/kernel/mpc10x_common.c
4 * Common routines for the Motorola SPS MPC106, MPC107 and MPC8240 Host bridge,
5 * Mem ctlr, EPIC, etc.
7 * Author: Mark A. Greer
8 * mgreer@mvista.com
10 * Copyright 2001 MontaVista Software Inc.
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.
18 #include <common.h>
20 #ifdef CONFIG_PCI
22 #include <asm/processor.h>
23 #include <asm/io.h>
24 #include <pci.h>
25 #include <mpc824x.h>
27 void pci_mpc824x_init (struct pci_controller *hose)
29 hose->first_busno = 0;
30 hose->last_busno = 0xff;
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,
37 PCI_REGION_MEM | PCI_REGION_MEMORY);
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);
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);
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);
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);
67 hose->region_count = 5;
69 pci_setup_indirect(hose,
70 CHRP_REG_ADDR,
71 CHRP_REG_DATA);
73 pci_register_hose(hose);
75 hose->last_busno = pci_hose_scan(hose);
78 #endif