diff options
author | Darren Stevens <darren@stevens-zone.net> | 2016-06-29 16:06:28 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-06-30 02:52:29 -0400 |
commit | bfa37087aa04e45f56c41142dfceecb79b8e6ef9 (patch) | |
tree | 10c6b93fe8200884e7010e1c3e27ead41cb00765 | |
parent | 190ce8693c23eae09ba5f303a83bf2fbeb6478b1 (diff) |
powerpc: Initialise pci_io_base as early as possible
Commit d6a9996e84ac ("powerpc/mm: vmalloc abstraction in preparation for
radix") turned kernel memory and IO addresses from #defined constants to
variables initialised at runtime.
On PA6T (pasemi) systems the setup_arch() machine call initialises the
onboard PCI-e root-ports, and uses pci_io_base to do this, which is now
before its value has been set, resulting in a panic early in boot before
console IO is initialised.
Move the pci_io_base initialisation to the same place as vmalloc ranges
are set (hash__early_init_mmu()/radix__early_init_mmu()) - this is the
earliest possible place we can initialise it.
Fixes: d6a9996e84ac ("powerpc/mm: vmalloc abstraction in preparation for radix")
Reported-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: Darren Stevens <darren@stevens-zone.net>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
[mpe: Add #ifdef CONFIG_PCI, massage change log slightly]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/include/asm/book3s/64/pgtable.h | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 1 | ||||
-rw-r--r-- | arch/powerpc/mm/hash_utils_64.c | 4 | ||||
-rw-r--r-- | arch/powerpc/mm/pgtable-radix.c | 5 |
4 files changed, 10 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h index 88a5ecaa157b..ab84c89c9e98 100644 --- a/arch/powerpc/include/asm/book3s/64/pgtable.h +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h | |||
@@ -230,6 +230,7 @@ extern unsigned long __kernel_virt_size; | |||
230 | #define KERN_VIRT_SIZE __kernel_virt_size | 230 | #define KERN_VIRT_SIZE __kernel_virt_size |
231 | extern struct page *vmemmap; | 231 | extern struct page *vmemmap; |
232 | extern unsigned long ioremap_bot; | 232 | extern unsigned long ioremap_bot; |
233 | extern unsigned long pci_io_base; | ||
233 | #endif /* __ASSEMBLY__ */ | 234 | #endif /* __ASSEMBLY__ */ |
234 | 235 | ||
235 | #include <asm/book3s/64/hash.h> | 236 | #include <asm/book3s/64/hash.h> |
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index 3759df52bd67..a5ae49a2dcc4 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -47,7 +47,6 @@ static int __init pcibios_init(void) | |||
47 | 47 | ||
48 | printk(KERN_INFO "PCI: Probing PCI hardware\n"); | 48 | printk(KERN_INFO "PCI: Probing PCI hardware\n"); |
49 | 49 | ||
50 | pci_io_base = ISA_IO_BASE; | ||
51 | /* For now, override phys_mem_access_prot. If we need it,g | 50 | /* For now, override phys_mem_access_prot. If we need it,g |
52 | * later, we may move that initialization to each ppc_md | 51 | * later, we may move that initialization to each ppc_md |
53 | */ | 52 | */ |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index 5b22ba0b58bc..2971ea18c768 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -922,6 +922,10 @@ void __init hash__early_init_mmu(void) | |||
922 | vmemmap = (struct page *)H_VMEMMAP_BASE; | 922 | vmemmap = (struct page *)H_VMEMMAP_BASE; |
923 | ioremap_bot = IOREMAP_BASE; | 923 | ioremap_bot = IOREMAP_BASE; |
924 | 924 | ||
925 | #ifdef CONFIG_PCI | ||
926 | pci_io_base = ISA_IO_BASE; | ||
927 | #endif | ||
928 | |||
925 | /* Initialize the MMU Hash table and create the linear mapping | 929 | /* Initialize the MMU Hash table and create the linear mapping |
926 | * of memory. Has to be done before SLB initialization as this is | 930 | * of memory. Has to be done before SLB initialization as this is |
927 | * currently where the page size encoding is obtained. | 931 | * currently where the page size encoding is obtained. |
diff --git a/arch/powerpc/mm/pgtable-radix.c b/arch/powerpc/mm/pgtable-radix.c index e58707deef5c..7931e1496f0d 100644 --- a/arch/powerpc/mm/pgtable-radix.c +++ b/arch/powerpc/mm/pgtable-radix.c | |||
@@ -328,6 +328,11 @@ void __init radix__early_init_mmu(void) | |||
328 | __vmalloc_end = RADIX_VMALLOC_END; | 328 | __vmalloc_end = RADIX_VMALLOC_END; |
329 | vmemmap = (struct page *)RADIX_VMEMMAP_BASE; | 329 | vmemmap = (struct page *)RADIX_VMEMMAP_BASE; |
330 | ioremap_bot = IOREMAP_BASE; | 330 | ioremap_bot = IOREMAP_BASE; |
331 | |||
332 | #ifdef CONFIG_PCI | ||
333 | pci_io_base = ISA_IO_BASE; | ||
334 | #endif | ||
335 | |||
331 | /* | 336 | /* |
332 | * For now radix also use the same frag size | 337 | * For now radix also use the same frag size |
333 | */ | 338 | */ |