aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-01-03 12:28:33 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-01-03 12:28:33 -0500
commit9d4f13e531b4722fe40cc8e28c02a495bdd49267 (patch)
tree4fe18552620677dbe4f6831c4d9d0ecdb34e678a
parent88026842b0a760145aa71d69e74fbc9ec118ca44 (diff)
[ARM] Make kernel link address depend on PAGE_OFFSET
We are coding the kernel link address into the makefiles, which is invisibly dependent on PAGE_OFFSET. If PAGE_OFFSET is changed, the makefiles also need to be changed. Make adjustments such that the makefiles encode just the offset from PAGE_OFFSET for the kernel link address, and use PAGE_OFFSET in the linker scripts directly. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/Makefile15
-rw-r--r--arch/arm/boot/Makefile2
-rw-r--r--arch/arm/kernel/Makefile2
-rw-r--r--arch/arm/kernel/head.S2
-rw-r--r--arch/arm/kernel/vmlinux.lds.S12
5 files changed, 16 insertions, 17 deletions
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 81bd2193fe6d..afaf3a1e903c 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -8,7 +8,7 @@
8# Copyright (C) 1995-2001 by Russell King 8# Copyright (C) 1995-2001 by Russell King
9 9
10LDFLAGS_vmlinux :=-p --no-undefined -X 10LDFLAGS_vmlinux :=-p --no-undefined -X
11CPPFLAGS_vmlinux.lds = -DKERNEL_RAM_ADDR=$(TEXTADDR) 11CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET)
12OBJCOPYFLAGS :=-O binary -R .note -R .comment -S 12OBJCOPYFLAGS :=-O binary -R .note -R .comment -S
13GZFLAGS :=-9 13GZFLAGS :=-9
14#CFLAGS +=-pipe 14#CFLAGS +=-pipe
@@ -65,7 +65,7 @@ CHECKFLAGS += -D__arm__
65 65
66#Default value 66#Default value
67head-y := arch/arm/kernel/head.o arch/arm/kernel/init_task.o 67head-y := arch/arm/kernel/head.o arch/arm/kernel/init_task.o
68textaddr-y := 0xC0008000 68textofs-y := 0x00008000
69 69
70 machine-$(CONFIG_ARCH_RPC) := rpc 70 machine-$(CONFIG_ARCH_RPC) := rpc
71 machine-$(CONFIG_ARCH_EBSA110) := ebsa110 71 machine-$(CONFIG_ARCH_EBSA110) := ebsa110
@@ -73,22 +73,20 @@ textaddr-y := 0xC0008000
73 incdir-$(CONFIG_ARCH_CLPS7500) := cl7500 73 incdir-$(CONFIG_ARCH_CLPS7500) := cl7500
74 machine-$(CONFIG_FOOTBRIDGE) := footbridge 74 machine-$(CONFIG_FOOTBRIDGE) := footbridge
75 incdir-$(CONFIG_FOOTBRIDGE) := ebsa285 75 incdir-$(CONFIG_FOOTBRIDGE) := ebsa285
76textaddr-$(CONFIG_ARCH_CO285) := 0x60008000
77 machine-$(CONFIG_ARCH_CO285) := footbridge 76 machine-$(CONFIG_ARCH_CO285) := footbridge
78 incdir-$(CONFIG_ARCH_CO285) := ebsa285 77 incdir-$(CONFIG_ARCH_CO285) := ebsa285
79 machine-$(CONFIG_ARCH_SHARK) := shark 78 machine-$(CONFIG_ARCH_SHARK) := shark
80 machine-$(CONFIG_ARCH_SA1100) := sa1100 79 machine-$(CONFIG_ARCH_SA1100) := sa1100
81ifeq ($(CONFIG_ARCH_SA1100),y) 80ifeq ($(CONFIG_ARCH_SA1100),y)
82# SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory 81# SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory
83textaddr-$(CONFIG_SA1111) := 0xc0208000 82 textofs-$(CONFIG_SA1111) := 0x00208000
84endif 83endif
85 machine-$(CONFIG_ARCH_PXA) := pxa 84 machine-$(CONFIG_ARCH_PXA) := pxa
86 machine-$(CONFIG_ARCH_L7200) := l7200 85 machine-$(CONFIG_ARCH_L7200) := l7200
87 machine-$(CONFIG_ARCH_INTEGRATOR) := integrator 86 machine-$(CONFIG_ARCH_INTEGRATOR) := integrator
88 machine-$(CONFIG_ARCH_CAMELOT) := epxa10db 87 machine-$(CONFIG_ARCH_CAMELOT) := epxa10db
89textaddr-$(CONFIG_ARCH_CLPS711X) := 0xc0028000 88 textofs-$(CONFIG_ARCH_CLPS711X) := 0x00028000
90 machine-$(CONFIG_ARCH_CLPS711X) := clps711x 89 machine-$(CONFIG_ARCH_CLPS711X) := clps711x
91textaddr-$(CONFIG_ARCH_FORTUNET) := 0xc0008000
92 machine-$(CONFIG_ARCH_IOP3XX) := iop3xx 90 machine-$(CONFIG_ARCH_IOP3XX) := iop3xx
93 machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx 91 machine-$(CONFIG_ARCH_IXP4XX) := ixp4xx
94 machine-$(CONFIG_ARCH_IXP2000) := ixp2000 92 machine-$(CONFIG_ARCH_IXP2000) := ixp2000
@@ -110,7 +108,8 @@ CFLAGS_3c589_cs.o :=-DISA_SIXTEEN_BIT_PERIPHERAL
110export CFLAGS_3c589_cs.o 108export CFLAGS_3c589_cs.o
111endif 109endif
112 110
113TEXTADDR := $(textaddr-y) 111# The byte offset of the kernel image in RAM from the start of RAM.
112TEXT_OFFSET := $(textofs-y)
114 113
115ifeq ($(incdir-y),) 114ifeq ($(incdir-y),)
116incdir-y := $(machine-y) 115incdir-y := $(machine-y)
@@ -123,7 +122,7 @@ else
123MACHINE := 122MACHINE :=
124endif 123endif
125 124
126export TEXTADDR GZFLAGS 125export TEXT_OFFSET GZFLAGS
127 126
128# Do we have FASTFPE? 127# Do we have FASTFPE?
129FASTFPE :=arch/arm/fastfpe 128FASTFPE :=arch/arm/fastfpe
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index 937a353bc37c..a174d63395ea 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -15,7 +15,7 @@ include $(srctree)/$(MACHINE)/Makefile.boot
15endif 15endif
16 16
17# Note: the following conditions must always be true: 17# Note: the following conditions must always be true:
18# ZRELADDR == virt_to_phys(TEXTADDR) 18# ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
19# PARAMS_PHYS must be within 4MB of ZRELADDR 19# PARAMS_PHYS must be within 4MB of ZRELADDR
20# INITRD_PHYS must be in RAM 20# INITRD_PHYS must be in RAM
21ZRELADDR := $(zreladdr-y) 21ZRELADDR := $(zreladdr-y)
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index c11169b5ed9a..25b14c3fdc4a 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -2,7 +2,7 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5AFLAGS_head.o := -DKERNEL_RAM_ADDR=$(TEXTADDR) 5AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
6 6
7# Object file lists. 7# Object file lists.
8 8
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index d7d69fd7039f..1e985f2cd70f 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -33,6 +33,8 @@
33#define MACHINFO_PGOFFIO 12 33#define MACHINFO_PGOFFIO 12
34#define MACHINFO_NAME 16 34#define MACHINFO_NAME 16
35 35
36#define KERNEL_RAM_ADDR (PAGE_OFFSET + TEXT_OFFSET)
37
36/* 38/*
37 * swapper_pg_dir is the virtual address of the initial page table. 39 * swapper_pg_dir is the virtual address of the initial page table.
38 * We place the page tables 16K below KERNEL_RAM_ADDR. Therefore, we must 40 * We place the page tables 16K below KERNEL_RAM_ADDR. Therefore, we must
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 9a47770114d4..2b254e88595c 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -17,15 +17,13 @@ jiffies = jiffies_64;
17jiffies = jiffies_64 + 4; 17jiffies = jiffies_64 + 4;
18#endif 18#endif
19 19
20SECTIONS
21{
20#ifdef CONFIG_XIP_KERNEL 22#ifdef CONFIG_XIP_KERNEL
21#define TEXTADDR XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR) 23 . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
22#else 24#else
23#define TEXTADDR KERNEL_RAM_ADDR 25 . = PAGE_OFFSET + TEXT_OFFSET;
24#endif 26#endif
25
26SECTIONS
27{
28 . = TEXTADDR;
29 .init : { /* Init code and data */ 27 .init : { /* Init code and data */
30 _stext = .; 28 _stext = .;
31 _sinittext = .; 29 _sinittext = .;
@@ -104,7 +102,7 @@ SECTIONS
104 102
105#ifdef CONFIG_XIP_KERNEL 103#ifdef CONFIG_XIP_KERNEL
106 __data_loc = ALIGN(4); /* location in binary */ 104 __data_loc = ALIGN(4); /* location in binary */
107 . = KERNEL_RAM_ADDR; 105 . = PAGE_OFFSET + TEXT_OFFSET;
108#else 106#else
109 . = ALIGN(THREAD_SIZE); 107 . = ALIGN(THREAD_SIZE);
110 __data_loc = .; 108 __data_loc = .;