diff options
| -rw-r--r-- | arch/mips/cavium-octeon/setup.c | 28 | ||||
| -rw-r--r-- | arch/mips/pci/pci-octeon.c | 9 |
2 files changed, 33 insertions, 4 deletions
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c index 48b08eb9d9e4..b212ae12e5ac 100644 --- a/arch/mips/cavium-octeon/setup.c +++ b/arch/mips/cavium-octeon/setup.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | * written by Ralf Baechle <ralf@linux-mips.org> | 8 | * written by Ralf Baechle <ralf@linux-mips.org> |
| 9 | */ | 9 | */ |
| 10 | #include <linux/compiler.h> | 10 | #include <linux/compiler.h> |
| 11 | #include <linux/vmalloc.h> | ||
| 11 | #include <linux/init.h> | 12 | #include <linux/init.h> |
| 12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 13 | #include <linux/console.h> | 14 | #include <linux/console.h> |
| @@ -1139,3 +1140,30 @@ static int __init edac_devinit(void) | |||
| 1139 | return err; | 1140 | return err; |
| 1140 | } | 1141 | } |
| 1141 | device_initcall(edac_devinit); | 1142 | device_initcall(edac_devinit); |
| 1143 | |||
| 1144 | static void __initdata *octeon_dummy_iospace; | ||
| 1145 | |||
| 1146 | static int __init octeon_no_pci_init(void) | ||
| 1147 | { | ||
| 1148 | /* | ||
| 1149 | * Initially assume there is no PCI. The PCI/PCIe platform code will | ||
| 1150 | * later re-initialize these to correct values if they are present. | ||
| 1151 | */ | ||
| 1152 | octeon_dummy_iospace = vzalloc(IO_SPACE_LIMIT); | ||
| 1153 | set_io_port_base((unsigned long)octeon_dummy_iospace); | ||
| 1154 | ioport_resource.start = MAX_RESOURCE; | ||
| 1155 | ioport_resource.end = 0; | ||
| 1156 | return 0; | ||
| 1157 | } | ||
| 1158 | core_initcall(octeon_no_pci_init); | ||
| 1159 | |||
| 1160 | static int __init octeon_no_pci_release(void) | ||
| 1161 | { | ||
| 1162 | /* | ||
| 1163 | * Release the allocated memory if a real IO space is there. | ||
| 1164 | */ | ||
| 1165 | if ((unsigned long)octeon_dummy_iospace != mips_io_port_base) | ||
| 1166 | vfree(octeon_dummy_iospace); | ||
| 1167 | return 0; | ||
| 1168 | } | ||
| 1169 | late_initcall(octeon_no_pci_release); | ||
diff --git a/arch/mips/pci/pci-octeon.c b/arch/mips/pci/pci-octeon.c index 95c2ea815cac..59cccd95688b 100644 --- a/arch/mips/pci/pci-octeon.c +++ b/arch/mips/pci/pci-octeon.c | |||
| @@ -586,15 +586,16 @@ static int __init octeon_pci_setup(void) | |||
| 586 | else | 586 | else |
| 587 | octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_BIG; | 587 | octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_BIG; |
| 588 | 588 | ||
| 589 | /* PCI I/O and PCI MEM values */ | ||
| 590 | set_io_port_base(OCTEON_PCI_IOSPACE_BASE); | ||
| 591 | ioport_resource.start = 0; | ||
| 592 | ioport_resource.end = OCTEON_PCI_IOSPACE_SIZE - 1; | ||
| 593 | if (!octeon_is_pci_host()) { | 589 | if (!octeon_is_pci_host()) { |
| 594 | pr_notice("Not in host mode, PCI Controller not initialized\n"); | 590 | pr_notice("Not in host mode, PCI Controller not initialized\n"); |
| 595 | return 0; | 591 | return 0; |
| 596 | } | 592 | } |
| 597 | 593 | ||
| 594 | /* PCI I/O and PCI MEM values */ | ||
| 595 | set_io_port_base(OCTEON_PCI_IOSPACE_BASE); | ||
| 596 | ioport_resource.start = 0; | ||
| 597 | ioport_resource.end = OCTEON_PCI_IOSPACE_SIZE - 1; | ||
| 598 | |||
| 598 | pr_notice("%s Octeon big bar support\n", | 599 | pr_notice("%s Octeon big bar support\n", |
| 599 | (octeon_dma_bar_type == | 600 | (octeon_dma_bar_type == |
| 600 | OCTEON_DMA_BAR_TYPE_BIG) ? "Enabling" : "Disabling"); | 601 | OCTEON_DMA_BAR_TYPE_BIG) ? "Enabling" : "Disabling"); |
