提交 5556ecf5 编写于 作者: B Benjamin Herrenschmidt 提交者: Michael Ellerman

powerpc/mm/hash: Don't use machine_is() early during boot

Use the device-tree instead as we'll be moving probe_machine()
out of early_setup
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 388dc1c3
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/signal.h> #include <linux/signal.h>
#include <linux/memblock.h> #include <linux/memblock.h>
#include <linux/context_tracking.h> #include <linux/context_tracking.h>
#include <linux/libfdt.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/pgtable.h> #include <asm/pgtable.h>
...@@ -749,7 +750,7 @@ static void __init htab_initialize(void) ...@@ -749,7 +750,7 @@ static void __init htab_initialize(void)
unsigned long table; unsigned long table;
unsigned long pteg_count; unsigned long pteg_count;
unsigned long prot; unsigned long prot;
unsigned long base = 0, size = 0, limit; unsigned long base = 0, size = 0;
struct memblock_region *reg; struct memblock_region *reg;
DBG(" -> htab_initialize()\n"); DBG(" -> htab_initialize()\n");
...@@ -775,7 +776,8 @@ static void __init htab_initialize(void) ...@@ -775,7 +776,8 @@ static void __init htab_initialize(void)
htab_hash_mask = pteg_count - 1; htab_hash_mask = pteg_count - 1;
if (firmware_has_feature(FW_FEATURE_LPAR)) { if (firmware_has_feature(FW_FEATURE_LPAR) ||
firmware_has_feature(FW_FEATURE_PS3_LV1)) {
/* Using a hypervisor which owns the htab */ /* Using a hypervisor which owns the htab */
htab_address = NULL; htab_address = NULL;
_SDR1 = 0; _SDR1 = 0;
...@@ -790,16 +792,22 @@ static void __init htab_initialize(void) ...@@ -790,16 +792,22 @@ static void __init htab_initialize(void)
ppc_md.hpte_clear_all(); ppc_md.hpte_clear_all();
#endif #endif
} else { } else {
/* Find storage for the HPT. Must be contiguous in unsigned long limit = MEMBLOCK_ALLOC_ANYWHERE;
* the absolute address space. On cell we want it to be
* in the first 2 Gig so we can use it for IOMMU hacks. #ifdef CONFIG_PPC_CELL
/*
* Cell may require the hash table down low when using the
* Axon IOMMU in order to fit the dynamic region over it, see
* comments in cell/iommu.c
*/ */
if (machine_is(cell)) if (fdt_subnode_offset(initial_boot_params, 0, "axon") > 0) {
limit = 0x80000000; limit = 0x80000000;
else pr_info("Hash table forced below 2G for Axon IOMMU\n");
limit = MEMBLOCK_ALLOC_ANYWHERE; }
#endif /* CONFIG_PPC_CELL */
table = memblock_alloc_base(htab_size_bytes, htab_size_bytes, limit); table = memblock_alloc_base(htab_size_bytes, htab_size_bytes,
limit);
DBG("Hash table allocated at %lx, size: %lx\n", table, DBG("Hash table allocated at %lx, size: %lx\n", table,
htab_size_bytes); htab_size_bytes);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册