diff options
author | Graeme Russ <graeme.russ@gmail.com> | 2010-04-24 00:05:54 +1000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-05-06 00:18:52 +0200 |
commit | 21e67e796bb1d59a484dce2b4203d61bf1fd5be8 (patch) | |
tree | 49d0509ca042762c7dd389bac64857f18464251b | |
parent | 0278216b76fc1e5dbf4cbd10d5d734323039c36f (diff) | |
download | u-boot-imx-21e67e796bb1d59a484dce2b4203d61bf1fd5be8.zip u-boot-imx-21e67e796bb1d59a484dce2b4203d61bf1fd5be8.tar.gz u-boot-imx-21e67e796bb1d59a484dce2b4203d61bf1fd5be8.tar.bz2 |
sc520: Board Specific PCI Init
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
-rw-r--r-- | arch/i386/cpu/sc520/sc520_pci.c | 39 | ||||
-rw-r--r-- | arch/i386/include/asm/ic/pci.h | 1 | ||||
-rw-r--r-- | board/eNET/eNET_pci.c | 33 |
3 files changed, 36 insertions, 37 deletions
diff --git a/arch/i386/cpu/sc520/sc520_pci.c b/arch/i386/cpu/sc520/sc520_pci.c index ee7e720..b917734 100644 --- a/arch/i386/cpu/sc520/sc520_pci.c +++ b/arch/i386/cpu/sc520/sc520_pci.c @@ -27,6 +27,7 @@ #include <pci.h> #include <asm/io.h> #include <asm/pci.h> +#include <asm/ic/pci.h> #include <asm/ic/sc520.h> static struct { @@ -124,43 +125,7 @@ void pci_sc520_init(struct pci_controller *hose) { hose->first_busno = 0; hose->last_busno = 0xff; - - /* System memory space */ - pci_set_region(hose->regions + 0, - SC520_PCI_MEMORY_BUS, - SC520_PCI_MEMORY_PHYS, - SC520_PCI_MEMORY_SIZE, - PCI_REGION_MEM | PCI_REGION_SYS_MEMORY); - - /* PCI memory space */ - pci_set_region(hose->regions + 1, - SC520_PCI_MEM_BUS, - SC520_PCI_MEM_PHYS, - SC520_PCI_MEM_SIZE, - PCI_REGION_MEM); - - /* ISA/PCI memory space */ - pci_set_region(hose->regions + 2, - SC520_ISA_MEM_BUS, - SC520_ISA_MEM_PHYS, - SC520_ISA_MEM_SIZE, - PCI_REGION_MEM); - - /* PCI I/O space */ - pci_set_region(hose->regions + 3, - SC520_PCI_IO_BUS, - SC520_PCI_IO_PHYS, - SC520_PCI_IO_SIZE, - PCI_REGION_IO); - - /* ISA/PCI I/O space */ - pci_set_region(hose->regions + 4, - SC520_ISA_IO_BUS, - SC520_ISA_IO_PHYS, - SC520_ISA_IO_SIZE, - PCI_REGION_IO); - - hose->region_count = 5; + hose->region_count = pci_set_regions(hose); pci_setup_type1(hose, SC520_REG_ADDR, diff --git a/arch/i386/include/asm/ic/pci.h b/arch/i386/include/asm/ic/pci.h index 1a35f34..2e4376b 100644 --- a/arch/i386/include/asm/ic/pci.h +++ b/arch/i386/include/asm/ic/pci.h @@ -73,6 +73,7 @@ extern int sc520_pci_ints[]; void pci_sc520_init(struct pci_controller *hose); +int pci_set_regions(struct pci_controller *hose); int pci_sc520_set_irq(int pci_pin, int irq); #endif diff --git a/board/eNET/eNET_pci.c b/board/eNET/eNET_pci.c index e80a8fe..fefb1a4 100644 --- a/board/eNET/eNET_pci.c +++ b/board/eNET/eNET_pci.c @@ -93,3 +93,36 @@ void pci_init_board(void) { pci_sc520_init(&enet_hose); } + +int pci_set_regions(struct pci_controller *hose) +{ + /* System memory space */ + pci_set_region(hose->regions + 0, + SC520_PCI_MEMORY_BUS, + SC520_PCI_MEMORY_PHYS, + SC520_PCI_MEMORY_SIZE, + PCI_REGION_MEM | PCI_REGION_SYS_MEMORY); + + /* ISA/PCI memory space */ + pci_set_region(hose->regions + 1, + SC520_ISA_MEM_BUS, + SC520_ISA_MEM_PHYS, + SC520_ISA_MEM_SIZE, + PCI_REGION_MEM); + + /* PCI I/O space */ + pci_set_region(hose->regions + 2, + SC520_PCI_IO_BUS, + SC520_PCI_IO_PHYS, + SC520_PCI_IO_SIZE, + PCI_REGION_IO); + + /* ISA/PCI I/O space */ + pci_set_region(hose->regions + 3, + SC520_ISA_IO_BUS, + SC520_ISA_IO_PHYS, + SC520_ISA_IO_SIZE, + PCI_REGION_IO); + + return 4; +} |