提交 0ec57e53 编写于 作者: M Marcelo Tosatti 提交者: Paul Mackerras

[PATCH] powerpc: generalize PPC44x_PIN_SIZE

The following patch generalizes PPC44x_PIN_SIZE by changing it to
PPC_PIN_SIZE, which can be defined by any sub-arch to automatically adjust
VMALLOC_START.

Define PPC_PIN_SIZE on 8xx, avoiding potential conflicts with the
pinned space.
Signed-off-by: NMarcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 f4fc4a5b
...@@ -104,7 +104,7 @@ unsigned long __init mmu_mapin_ram(void) ...@@ -104,7 +104,7 @@ unsigned long __init mmu_mapin_ram(void)
/* Determine number of entries necessary to cover lowmem */ /* Determine number of entries necessary to cover lowmem */
pinned_tlbs = (unsigned int) pinned_tlbs = (unsigned int)
(_ALIGN(total_lowmem, PPC44x_PIN_SIZE) >> PPC44x_PIN_SHIFT); (_ALIGN(total_lowmem, PPC_PIN_SIZE) >> PPC44x_PIN_SHIFT);
/* Write upper watermark to save location */ /* Write upper watermark to save location */
tlb_44x_hwater = PPC44x_LOW_SLOT - pinned_tlbs; tlb_44x_hwater = PPC44x_LOW_SLOT - pinned_tlbs;
...@@ -112,7 +112,7 @@ unsigned long __init mmu_mapin_ram(void) ...@@ -112,7 +112,7 @@ unsigned long __init mmu_mapin_ram(void)
/* If necessary, set additional pinned TLBs */ /* If necessary, set additional pinned TLBs */
if (pinned_tlbs > 1) if (pinned_tlbs > 1)
for (i = (PPC44x_LOW_SLOT-(pinned_tlbs-1)); i < PPC44x_LOW_SLOT; i++) { for (i = (PPC44x_LOW_SLOT-(pinned_tlbs-1)); i < PPC44x_LOW_SLOT; i++) {
unsigned int phys_addr = (PPC44x_LOW_SLOT-i) * PPC44x_PIN_SIZE; unsigned int phys_addr = (PPC44x_LOW_SLOT-i) * PPC_PIN_SIZE;
ppc44x_pin_tlb(i, phys_addr+PAGE_OFFSET, phys_addr); ppc44x_pin_tlb(i, phys_addr+PAGE_OFFSET, phys_addr);
} }
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
/* TLB entry offset/size used for pinning kernel lowmem */ /* TLB entry offset/size used for pinning kernel lowmem */
#define PPC44x_PIN_SHIFT 28 #define PPC44x_PIN_SHIFT 28
#define PPC44x_PIN_SIZE (1 << PPC44x_PIN_SHIFT) #define PPC_PIN_SIZE (1 << PPC44x_PIN_SHIFT)
/* Lowest TLB slot consumed by the default pinned TLBs */ /* Lowest TLB slot consumed by the default pinned TLBs */
#define PPC44x_LOW_SLOT 63 #define PPC44x_LOW_SLOT 63
......
...@@ -113,6 +113,8 @@ enum ppc_sys_devices { ...@@ -113,6 +113,8 @@ enum ppc_sys_devices {
MPC8xx_CPM_USB, MPC8xx_CPM_USB,
}; };
#define PPC_PIN_SIZE (24 * 1024 * 1024) /* 24Mbytes of data pinned */
#ifndef BOARD_CHIP_NAME #ifndef BOARD_CHIP_NAME
#define BOARD_CHIP_NAME "" #define BOARD_CHIP_NAME ""
#endif #endif
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <asm/processor.h> /* For TASK_SIZE */ #include <asm/processor.h> /* For TASK_SIZE */
#include <asm/mmu.h> #include <asm/mmu.h>
#include <asm/page.h> #include <asm/page.h>
#include <asm/io.h> /* For sub-arch specific PPC_PIN_SIZE */
struct mm_struct; struct mm_struct;
extern unsigned long va_to_phys(unsigned long address); extern unsigned long va_to_phys(unsigned long address);
...@@ -127,9 +128,8 @@ extern unsigned long ioremap_bot, ioremap_base; ...@@ -127,9 +128,8 @@ extern unsigned long ioremap_bot, ioremap_base;
* of RAM. -- Cort * of RAM. -- Cort
*/ */
#define VMALLOC_OFFSET (0x1000000) /* 16M */ #define VMALLOC_OFFSET (0x1000000) /* 16M */
#ifdef CONFIG_44x #ifdef PPC_PIN_SIZE
#include <asm/ibm44x.h> #define VMALLOC_START (((_ALIGN((long)high_memory, PPC_PIN_SIZE) + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
#define VMALLOC_START (((_ALIGN((long)high_memory, PPC44x_PIN_SIZE) + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
#else #else
#define VMALLOC_START ((((long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))) #define VMALLOC_START ((((long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册