Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91555
b: refs/heads/master
c: 99c62dd
h: refs/heads/master
i:
  91553: 442f494
  91551: 20bc48b
v: v3
  • Loading branch information
Kumar Gala authored and Paul Mackerras committed Apr 16, 2008
1 parent d175116 commit 9b98552
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1993cbf4ae7d30f9a417e143c1344466f2e2ae2e
refs/heads/master: 99c62dd773797b68f3b1ca6bb3274725d1852fa2
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/mm/40x_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ unsigned long __init mmu_mapin_ram(void)
phys_addr_t p;

v = KERNELBASE;
p = PPC_MEMSTART;
p = 0;
s = total_lowmem;

if (__map_without_ltlbs)
Expand Down
11 changes: 5 additions & 6 deletions trunk/arch/powerpc/mm/fsl_booke_mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@
#include <asm/machdep.h>
#include <asm/setup.h>

#include "mmu_decl.h"

extern void loadcam_entry(unsigned int index);
unsigned int tlbcam_index;
unsigned int num_tlbcam_entries;
static unsigned long __cam0, __cam1, __cam2;
extern unsigned long total_lowmem;
extern unsigned long __max_low_memory;
extern unsigned long __initial_memory_limit;
#define MAX_LOW_MEM CONFIG_LOWMEM_SIZE

#define NUM_TLBCAMS (16)
Expand Down Expand Up @@ -165,15 +164,15 @@ void invalidate_tlbcam_entry(int index)
void __init cam_mapin_ram(unsigned long cam0, unsigned long cam1,
unsigned long cam2)
{
settlbcam(0, PAGE_OFFSET, PPC_MEMSTART, cam0, _PAGE_KERNEL, 0);
settlbcam(0, PAGE_OFFSET, memstart_addr, cam0, _PAGE_KERNEL, 0);
tlbcam_index++;
if (cam1) {
tlbcam_index++;
settlbcam(1, PAGE_OFFSET+cam0, PPC_MEMSTART+cam0, cam1, _PAGE_KERNEL, 0);
settlbcam(1, PAGE_OFFSET+cam0, memstart_addr+cam0, cam1, _PAGE_KERNEL, 0);
}
if (cam2) {
tlbcam_index++;
settlbcam(2, PAGE_OFFSET+cam0+cam1, PPC_MEMSTART+cam0+cam1, cam2, _PAGE_KERNEL, 0);
settlbcam(2, PAGE_OFFSET+cam0+cam1, memstart_addr+cam0+cam1, cam2, _PAGE_KERNEL, 0);
}
}

Expand Down
7 changes: 3 additions & 4 deletions trunk/arch/powerpc/mm/init_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
unsigned long total_memory;
unsigned long total_lowmem;

unsigned long ppc_memstart;
unsigned long ppc_memoffset = PAGE_OFFSET;
phys_addr_t memstart_addr;
phys_addr_t lowmem_end_addr;

int boot_mapsize;
#ifdef CONFIG_PPC_PMAC
Expand Down Expand Up @@ -145,8 +145,7 @@ void __init MMU_init(void)
printk(KERN_WARNING "Only using first contiguous memory region");
}

total_memory = lmb_end_of_DRAM();
total_lowmem = total_memory;
total_lowmem = total_memory = lmb_end_of_DRAM() - memstart_addr;

#ifdef CONFIG_FSL_BOOKE
/* Freescale Book-E parts expect lowmem to be mapped by fixed TLB
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/powerpc/mm/mmu_decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ extern unsigned long __max_low_memory;
extern unsigned long __initial_memory_limit;
extern unsigned long total_memory;
extern unsigned long total_lowmem;
extern phys_addr_t memstart_addr;

/* ...and now those things that may be slightly different between processor
* architectures. -- Dan
Expand Down
5 changes: 3 additions & 2 deletions trunk/arch/powerpc/mm/pgtable_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,13 @@ int map_page(unsigned long va, phys_addr_t pa, int flags)
*/
void __init mapin_ram(void)
{
unsigned long v, p, s, f;
unsigned long v, s, f;
phys_addr_t p;
int ktext;

s = mmu_mapin_ram();
v = KERNELBASE + s;
p = PPC_MEMSTART + s;
p = memstart_addr + s;
for (; s < total_lowmem; s += PAGE_SIZE) {
ktext = ((char *) v >= _stext && (char *) v < etext);
f = ktext ?_PAGE_RAM_TEXT : _PAGE_RAM;
Expand Down
11 changes: 2 additions & 9 deletions trunk/arch/powerpc/mm/ppc_mmu_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ unsigned long __init mmu_mapin_ram(void)
#else
unsigned long tot, bl, done;
unsigned long max_size = (256<<20);
unsigned long align;

if (__map_without_bats) {
printk(KERN_DEBUG "RAM mapped without BATs\n");
Expand All @@ -93,27 +92,21 @@ unsigned long __init mmu_mapin_ram(void)

/* Make sure we don't map a block larger than the
smallest alignment of the physical address. */
/* alignment of PPC_MEMSTART */
align = ~(PPC_MEMSTART-1) & PPC_MEMSTART;
/* set BAT block size to MIN(max_size, align) */
if (align && align < max_size)
max_size = align;

tot = total_lowmem;
for (bl = 128<<10; bl < max_size; bl <<= 1) {
if (bl * 2 > tot)
break;
}

setbat(2, KERNELBASE, PPC_MEMSTART, bl, _PAGE_RAM);
setbat(2, KERNELBASE, 0, bl, _PAGE_RAM);
done = (unsigned long)bat_addrs[2].limit - KERNELBASE + 1;
if ((done < tot) && !bat_addrs[3].limit) {
/* use BAT3 to cover a bit more */
tot -= done;
for (bl = 128<<10; bl < max_size; bl <<= 1)
if (bl * 2 > tot)
break;
setbat(3, KERNELBASE+done, PPC_MEMSTART+done, bl, _PAGE_RAM);
setbat(3, KERNELBASE+done, done, bl, _PAGE_RAM);
done = (unsigned long)bat_addrs[3].limit - KERNELBASE + 1;
}

Expand Down
2 changes: 0 additions & 2 deletions trunk/include/asm-powerpc/page_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32

#define PPC_MEMSTART 0

#ifdef CONFIG_NOT_COHERENT_CACHE
#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
#endif
Expand Down

0 comments on commit 9b98552

Please sign in to comment.