Commit 99c62dd7 authored by Kumar Gala's avatar Kumar Gala Committed by Paul Mackerras
Browse files

[POWERPC] Remove and replace uses of PPC_MEMSTART with memstart_addr



A number of users of PPC_MEMSTART (40x, ppc_mmu_32) can just always
use 0 as we don't support booting these kernels at non-zero physical
addresses since their exception vectors must be at 0 (or 0xfffx_xxxx).

For the sub-arches that support relocatable interrupt vectors
(book-e), it's reasonable to have memory start at a non-zero physical
address.  For those cases use the variable memstart_addr instead of
the #define PPC_MEMSTART since the only uses of PPC_MEMSTART are for
initialization and in the future we can set memstart_addr at runtime
to have a relocatable kernel.

Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 1993cbf4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)
+5 −6
Original line number Diff line number Diff line
@@ -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)
@@ -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);
	}
}

+3 −4
Original line number Diff line number Diff line
@@ -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
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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
+3 −2
Original line number Diff line number Diff line
@@ -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;
Loading