wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 1 | /* |
Stefan Roese | a47a12b | 2010-04-15 16:07:28 +0200 | [diff] [blame] | 2 | * arch/powerpc/kernel/mpc10x_common.c |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 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 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame^] | 12 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 13 | */ |
| 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 | |
| 24 | void 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 Gala | ff4e66e | 2009-02-06 09:49:31 -0600 | [diff] [blame] | 34 | PCI_REGION_MEM | PCI_REGION_SYS_MEMORY); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 35 | |
| 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 |