Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be15cd72 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/home/rmk/linux-2.6-arm

parents e9d52234 37d07b72
Loading
Loading
Loading
Loading
+3 −11
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@
# Copyright (C) 1995-2001 by Russell King

LDFLAGS_vmlinux	:=-p --no-undefined -X
CPPFLAGS_vmlinux.lds = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR)
CPPFLAGS_vmlinux.lds = -DKERNEL_RAM_ADDR=$(TEXTADDR)
OBJCOPYFLAGS	:=-O binary -R .note -R .comment -S
GZFLAGS		:=-9
#CFLAGS		+=-pipe
@@ -108,27 +108,19 @@ export CFLAGS_3c589_cs.o
endif

TEXTADDR := $(textaddr-y)
ifeq ($(CONFIG_XIP_KERNEL),y)
  DATAADDR := $(TEXTADDR)
  xipaddr-$(CONFIG_ARCH_CO285) := 0x5f000000
  xipaddr-y ?= 0xbf000000
  # Replace phys addr with virt addr while keeping offset from base.
  TEXTADDR := $(shell echo $(CONFIG_XIP_PHYS_ADDR) $(xipaddr-y) | \
                      awk --non-decimal-data '/[:xdigit:]/ \
                          { printf("0x%x\n", and($$1, 0x000fffff) + $$2) }' )
endif

ifeq ($(incdir-y),)
incdir-y := $(machine-y)
endif
INCDIR   := arch-$(incdir-y)

ifneq ($(machine-y),)
MACHINE  := arch/arm/mach-$(machine-y)/
else
MACHINE  :=
endif
  
export	TEXTADDR DATAADDR GZFLAGS
export	TEXTADDR GZFLAGS

# Do we have FASTFPE?
FASTFPE		:=arch/arm/fastfpe
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
# Makefile for the linux kernel.
#

AFLAGS_head.o := -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR)
AFLAGS_head.o := -DKERNEL_RAM_ADDR=$(TEXTADDR)

# Object file lists.

+0 −1
Original line number Diff line number Diff line
@@ -94,7 +94,6 @@ int main(void)
  DEFINE(VM_EXEC,	       	VM_EXEC);
  BLANK();
  DEFINE(PAGE_SZ,	       	PAGE_SIZE);
  DEFINE(VIRT_OFFSET,		PAGE_OFFSET);
  BLANK();
  DEFINE(SYS_ERROR0,		0x9f0000);
  BLANK();
+2 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
#include <linux/config.h>

#include <asm/memory.h>
#include <asm/glue.h>
#include <asm/vfpmacros.h>
#include <asm/hardware.h>		/* should be moved into entry-macro.S */
@@ -310,7 +311,7 @@ __pabt_svc:

#if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
	@ make sure our user space atomic helper is aborted
	cmp	r2, #VIRT_OFFSET
	cmp	r2, #TASK_SIZE
	bichs	r3, r3, #PSR_Z_BIT
#endif

+17 −40
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <asm/procinfo.h>
#include <asm/ptrace.h>
#include <asm/asm-offsets.h>
#include <asm/memory.h>
#include <asm/thread_info.h>
#include <asm/system.h>

@@ -33,52 +34,28 @@
#define MACHINFO_PGOFFIO	12
#define MACHINFO_NAME		16

#ifndef CONFIG_XIP_KERNEL
/*
 * We place the page tables 16K below TEXTADDR.  Therefore, we must make sure
 * that TEXTADDR is correctly set.  Currently, we expect the least significant
 * 16 bits to be 0x8000, but we could probably relax this restriction to
 * TEXTADDR >= PAGE_OFFSET + 0x4000
 *
 * Note that swapper_pg_dir is the virtual address of the page tables, and
 * pgtbl gives us a position-independent reference to these tables.  We can
 * do this because stext == TEXTADDR
 * swapper_pg_dir is the virtual address of the initial page table.
 * We place the page tables 16K below KERNEL_RAM_ADDR.  Therefore, we must
 * make sure that KERNEL_RAM_ADDR is correctly set.  Currently, we expect
 * the least significant 16 bits to be 0x8000, but we could probably
 * relax this restriction to KERNEL_RAM_ADDR >= PAGE_OFFSET + 0x4000.
 */
#if (TEXTADDR & 0xffff) != 0x8000
#error TEXTADDR must start at 0xXXXX8000
#if (KERNEL_RAM_ADDR & 0xffff) != 0x8000
#error KERNEL_RAM_ADDR must start at 0xXXXX8000
#endif

	.globl	swapper_pg_dir
	.equ	swapper_pg_dir, TEXTADDR - 0x4000
	.equ	swapper_pg_dir, KERNEL_RAM_ADDR - 0x4000

	.macro	pgtbl, rd, phys
	adr	\rd, stext
	sub	\rd, \rd, #0x4000
	.macro	pgtbl, rd
	ldr	\rd, =(__virt_to_phys(KERNEL_RAM_ADDR - 0x4000))
	.endm
#else
/*
 * XIP Kernel:
 *
 * We place the page tables 16K below DATAADDR.  Therefore, we must make sure
 * that DATAADDR is correctly set.  Currently, we expect the least significant
 * 16 bits to be 0x8000, but we could probably relax this restriction to
 * DATAADDR >= PAGE_OFFSET + 0x4000
 *
 * Note that pgtbl is meant to return the physical address of swapper_pg_dir.
 * We can't make it relative to the kernel position in this case since
 * the kernel can physically be anywhere.
 */
#if (DATAADDR & 0xffff) != 0x8000
#error DATAADDR must start at 0xXXXX8000
#endif

	.globl	swapper_pg_dir
	.equ	swapper_pg_dir, DATAADDR - 0x4000

	.macro	pgtbl, rd, phys
	ldr	\rd, =((DATAADDR - 0x4000) - VIRT_OFFSET)
	add	\rd, \rd, \phys
	.endm
#ifdef CONFIG_XIP_KERNEL
#define TEXTADDR  XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR)
#else
#define TEXTADDR  KERNEL_RAM_ADDR
#endif

/*
@@ -279,7 +256,7 @@ __turn_mmu_on:
	.type	__create_page_tables, %function
__create_page_tables:
	ldr	r5, [r8, #MACHINFO_PHYSRAM]	@ physram
	pgtbl	r4, r5				@ page table address
	pgtbl	r4				@ page table address

	/*
	 * Clear the 16K level 1 swapper page table
@@ -324,7 +301,7 @@ __create_page_tables:
	/*
	 * Then map first 1MB of ram in case it contains our boot params.
	 */
	add	r0, r4, #VIRT_OFFSET >> 18
	add	r0, r4, #PAGE_OFFSET >> 18
	orr	r6, r5, r7
	str	r6, [r0]

Loading