aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-10-29 17:02:16 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-29 17:02:16 -0400
commitbe15cd72d256e5eb3261a781b8507fac83ab33f6 (patch)
tree1a8f95a9960e03149d27d935da25b768878feb3e /arch/arm
parente9d52234e35b27ea4ea5f2ab64ca47b1a0c740ab (diff)
parent37d07b72ef58f2d5ec7701ab75084fbeee0e503e (diff)
Merge master.kernel.org:/home/rmk/linux-2.6-arm
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Makefile14
-rw-r--r--arch/arm/kernel/Makefile2
-rw-r--r--arch/arm/kernel/asm-offsets.c1
-rw-r--r--arch/arm/kernel/entry-armv.S3
-rw-r--r--arch/arm/kernel/head.S57
-rw-r--r--arch/arm/kernel/vmlinux.lds.S11
-rw-r--r--arch/arm/mach-sa1100/generic.c2
-rw-r--r--arch/arm/mach-sa1100/jornada720.c64
-rw-r--r--arch/arm/mm/init.c30
9 files changed, 118 insertions, 66 deletions
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 299bc0468702..64cf480b0b02 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 = -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) 11CPPFLAGS_vmlinux.lds = -DKERNEL_RAM_ADDR=$(TEXTADDR)
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
@@ -108,27 +108,19 @@ export CFLAGS_3c589_cs.o
108endif 108endif
109 109
110TEXTADDR := $(textaddr-y) 110TEXTADDR := $(textaddr-y)
111ifeq ($(CONFIG_XIP_KERNEL),y)
112 DATAADDR := $(TEXTADDR)
113 xipaddr-$(CONFIG_ARCH_CO285) := 0x5f000000
114 xipaddr-y ?= 0xbf000000
115 # Replace phys addr with virt addr while keeping offset from base.
116 TEXTADDR := $(shell echo $(CONFIG_XIP_PHYS_ADDR) $(xipaddr-y) | \
117 awk --non-decimal-data '/[:xdigit:]/ \
118 { printf("0x%x\n", and($$1, 0x000fffff) + $$2) }' )
119endif
120 111
121ifeq ($(incdir-y),) 112ifeq ($(incdir-y),)
122incdir-y := $(machine-y) 113incdir-y := $(machine-y)
123endif 114endif
124INCDIR := arch-$(incdir-y) 115INCDIR := arch-$(incdir-y)
116
125ifneq ($(machine-y),) 117ifneq ($(machine-y),)
126MACHINE := arch/arm/mach-$(machine-y)/ 118MACHINE := arch/arm/mach-$(machine-y)/
127else 119else
128MACHINE := 120MACHINE :=
129endif 121endif
130 122
131export TEXTADDR DATAADDR GZFLAGS 123export TEXTADDR GZFLAGS
132 124
133# Do we have FASTFPE? 125# Do we have FASTFPE?
134FASTFPE :=arch/arm/fastfpe 126FASTFPE :=arch/arm/fastfpe
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 3e1b0327e4d7..c11169b5ed9a 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 := -DTEXTADDR=$(TEXTADDR) -DDATAADDR=$(DATAADDR) 5AFLAGS_head.o := -DKERNEL_RAM_ADDR=$(TEXTADDR)
6 6
7# Object file lists. 7# Object file lists.
8 8
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index c1ff4d1f1bfd..04d3082a7b94 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -94,7 +94,6 @@ int main(void)
94 DEFINE(VM_EXEC, VM_EXEC); 94 DEFINE(VM_EXEC, VM_EXEC);
95 BLANK(); 95 BLANK();
96 DEFINE(PAGE_SZ, PAGE_SIZE); 96 DEFINE(PAGE_SZ, PAGE_SIZE);
97 DEFINE(VIRT_OFFSET, PAGE_OFFSET);
98 BLANK(); 97 BLANK();
99 DEFINE(SYS_ERROR0, 0x9f0000); 98 DEFINE(SYS_ERROR0, 0x9f0000);
100 BLANK(); 99 BLANK();
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index 93b5e8e5292e..be439cab92c6 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -15,6 +15,7 @@
15 */ 15 */
16#include <linux/config.h> 16#include <linux/config.h>
17 17
18#include <asm/memory.h>
18#include <asm/glue.h> 19#include <asm/glue.h>
19#include <asm/vfpmacros.h> 20#include <asm/vfpmacros.h>
20#include <asm/hardware.h> /* should be moved into entry-macro.S */ 21#include <asm/hardware.h> /* should be moved into entry-macro.S */
@@ -310,7 +311,7 @@ __pabt_svc:
310 311
311#if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG) 312#if __LINUX_ARM_ARCH__ < 6 && !defined(CONFIG_NEEDS_SYSCALL_FOR_CMPXCHG)
312 @ make sure our user space atomic helper is aborted 313 @ make sure our user space atomic helper is aborted
313 cmp r2, #VIRT_OFFSET 314 cmp r2, #TASK_SIZE
314 bichs r3, r3, #PSR_Z_BIT 315 bichs r3, r3, #PSR_Z_BIT
315#endif 316#endif
316 317
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 539626351348..8d8748407cbe 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -21,6 +21,7 @@
21#include <asm/procinfo.h> 21#include <asm/procinfo.h>
22#include <asm/ptrace.h> 22#include <asm/ptrace.h>
23#include <asm/asm-offsets.h> 23#include <asm/asm-offsets.h>
24#include <asm/memory.h>
24#include <asm/thread_info.h> 25#include <asm/thread_info.h>
25#include <asm/system.h> 26#include <asm/system.h>
26 27
@@ -33,52 +34,28 @@
33#define MACHINFO_PGOFFIO 12 34#define MACHINFO_PGOFFIO 12
34#define MACHINFO_NAME 16 35#define MACHINFO_NAME 16
35 36
36#ifndef CONFIG_XIP_KERNEL
37/* 37/*
38 * We place the page tables 16K below TEXTADDR. Therefore, we must make sure 38 * swapper_pg_dir is the virtual address of the initial page table.
39 * that TEXTADDR is correctly set. Currently, we expect the least significant 39 * We place the page tables 16K below KERNEL_RAM_ADDR. Therefore, we must
40 * 16 bits to be 0x8000, but we could probably relax this restriction to 40 * make sure that KERNEL_RAM_ADDR is correctly set. Currently, we expect
41 * TEXTADDR >= PAGE_OFFSET + 0x4000 41 * the least significant 16 bits to be 0x8000, but we could probably
42 * 42 * relax this restriction to KERNEL_RAM_ADDR >= PAGE_OFFSET + 0x4000.
43 * Note that swapper_pg_dir is the virtual address of the page tables, and
44 * pgtbl gives us a position-independent reference to these tables. We can
45 * do this because stext == TEXTADDR
46 */ 43 */
47#if (TEXTADDR & 0xffff) != 0x8000 44#if (KERNEL_RAM_ADDR & 0xffff) != 0x8000
48#error TEXTADDR must start at 0xXXXX8000 45#error KERNEL_RAM_ADDR must start at 0xXXXX8000
49#endif 46#endif
50 47
51 .globl swapper_pg_dir 48 .globl swapper_pg_dir
52 .equ swapper_pg_dir, TEXTADDR - 0x4000 49 .equ swapper_pg_dir, KERNEL_RAM_ADDR - 0x4000
53 50
54 .macro pgtbl, rd, phys 51 .macro pgtbl, rd
55 adr \rd, stext 52 ldr \rd, =(__virt_to_phys(KERNEL_RAM_ADDR - 0x4000))
56 sub \rd, \rd, #0x4000
57 .endm 53 .endm
58#else
59/*
60 * XIP Kernel:
61 *
62 * We place the page tables 16K below DATAADDR. Therefore, we must make sure
63 * that DATAADDR is correctly set. Currently, we expect the least significant
64 * 16 bits to be 0x8000, but we could probably relax this restriction to
65 * DATAADDR >= PAGE_OFFSET + 0x4000
66 *
67 * Note that pgtbl is meant to return the physical address of swapper_pg_dir.
68 * We can't make it relative to the kernel position in this case since
69 * the kernel can physically be anywhere.
70 */
71#if (DATAADDR & 0xffff) != 0x8000
72#error DATAADDR must start at 0xXXXX8000
73#endif
74
75 .globl swapper_pg_dir
76 .equ swapper_pg_dir, DATAADDR - 0x4000
77 54
78 .macro pgtbl, rd, phys 55#ifdef CONFIG_XIP_KERNEL
79 ldr \rd, =((DATAADDR - 0x4000) - VIRT_OFFSET) 56#define TEXTADDR XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR)
80 add \rd, \rd, \phys 57#else
81 .endm 58#define TEXTADDR KERNEL_RAM_ADDR
82#endif 59#endif
83 60
84/* 61/*
@@ -279,7 +256,7 @@ __turn_mmu_on:
279 .type __create_page_tables, %function 256 .type __create_page_tables, %function
280__create_page_tables: 257__create_page_tables:
281 ldr r5, [r8, #MACHINFO_PHYSRAM] @ physram 258 ldr r5, [r8, #MACHINFO_PHYSRAM] @ physram
282 pgtbl r4, r5 @ page table address 259 pgtbl r4 @ page table address
283 260
284 /* 261 /*
285 * Clear the 16K level 1 swapper page table 262 * Clear the 16K level 1 swapper page table
@@ -324,7 +301,7 @@ __create_page_tables:
324 /* 301 /*
325 * Then map first 1MB of ram in case it contains our boot params. 302 * Then map first 1MB of ram in case it contains our boot params.
326 */ 303 */
327 add r0, r4, #VIRT_OFFSET >> 18 304 add r0, r4, #PAGE_OFFSET >> 18
328 orr r6, r5, r7 305 orr r6, r5, r7
329 str r6, [r0] 306 str r6, [r0]
330 307
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index 0d5db5279c5c..80c8e4c8cefa 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -6,14 +6,23 @@
6#include <asm-generic/vmlinux.lds.h> 6#include <asm-generic/vmlinux.lds.h>
7#include <linux/config.h> 7#include <linux/config.h>
8#include <asm/thread_info.h> 8#include <asm/thread_info.h>
9#include <asm/memory.h>
9 10
10OUTPUT_ARCH(arm) 11OUTPUT_ARCH(arm)
11ENTRY(stext) 12ENTRY(stext)
13
12#ifndef __ARMEB__ 14#ifndef __ARMEB__
13jiffies = jiffies_64; 15jiffies = jiffies_64;
14#else 16#else
15jiffies = jiffies_64 + 4; 17jiffies = jiffies_64 + 4;
16#endif 18#endif
19
20#ifdef CONFIG_XIP_KERNEL
21#define TEXTADDR XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR)
22#else
23#define TEXTADDR KERNEL_RAM_ADDR
24#endif
25
17SECTIONS 26SECTIONS
18{ 27{
19 . = TEXTADDR; 28 . = TEXTADDR;
@@ -95,7 +104,7 @@ SECTIONS
95 104
96#ifdef CONFIG_XIP_KERNEL 105#ifdef CONFIG_XIP_KERNEL
97 __data_loc = ALIGN(4); /* location in binary */ 106 __data_loc = ALIGN(4); /* location in binary */
98 . = DATAADDR; 107 . = KERNEL_RAM_ADDR;
99#else 108#else
100 . = ALIGN(THREAD_SIZE); 109 . = ALIGN(THREAD_SIZE);
101 __data_loc = .; 110 __data_loc = .;
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 93619497779c..f94b0fbcdcc8 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -23,6 +23,7 @@
23#include <asm/system.h> 23#include <asm/system.h>
24#include <asm/pgtable.h> 24#include <asm/pgtable.h>
25#include <asm/mach/map.h> 25#include <asm/mach/map.h>
26#include <asm/mach/flash.h>
26#include <asm/irq.h> 27#include <asm/irq.h>
27 28
28#include "generic.h" 29#include "generic.h"
@@ -283,6 +284,7 @@ static struct platform_device sa11x0mtd_device = {
283void sa11x0_set_flash_data(struct flash_platform_data *flash, 284void sa11x0_set_flash_data(struct flash_platform_data *flash,
284 struct resource *res, int nr) 285 struct resource *res, int nr)
285{ 286{
287 flash->name = "sa1100";
286 sa11x0mtd_device.dev.platform_data = flash; 288 sa11x0mtd_device.dev.platform_data = flash;
287 sa11x0mtd_device.resource = res; 289 sa11x0mtd_device.resource = res;
288 sa11x0mtd_device.num_resources = nr; 290 sa11x0mtd_device.num_resources = nr;
diff --git a/arch/arm/mach-sa1100/jornada720.c b/arch/arm/mach-sa1100/jornada720.c
index 9c363bfcf310..89af0c831e8f 100644
--- a/arch/arm/mach-sa1100/jornada720.c
+++ b/arch/arm/mach-sa1100/jornada720.c
@@ -8,6 +8,8 @@
8#include <linux/delay.h> 8#include <linux/delay.h>
9#include <linux/device.h> 9#include <linux/device.h>
10#include <linux/ioport.h> 10#include <linux/ioport.h>
11#include <linux/mtd/mtd.h>
12#include <linux/mtd/partitions.h>
11 13
12#include <asm/hardware.h> 14#include <asm/hardware.h>
13#include <asm/hardware/sa1111.h> 15#include <asm/hardware/sa1111.h>
@@ -16,6 +18,7 @@
16#include <asm/setup.h> 18#include <asm/setup.h>
17 19
18#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <asm/mach/flash.h>
19#include <asm/mach/map.h> 22#include <asm/mach/map.h>
20#include <asm/mach/serial_sa1100.h> 23#include <asm/mach/serial_sa1100.h>
21 24
@@ -108,6 +111,66 @@ static void __init jornada720_map_io(void)
108 sa1100_register_uart(1, 1); 111 sa1100_register_uart(1, 1);
109} 112}
110 113
114static struct mtd_partition jornada720_partitions[] = {
115 {
116 .name = "JORNADA720 boot firmware",
117 .size = 0x00040000,
118 .offset = 0,
119 .mask_flags = MTD_WRITEABLE, /* force read-only */
120 }, {
121 .name = "JORNADA720 kernel",
122 .size = 0x000c0000,
123 .offset = 0x00040000,
124 }, {
125 .name = "JORNADA720 params",
126 .size = 0x00040000,
127 .offset = 0x00100000,
128 }, {
129 .name = "JORNADA720 initrd",
130 .size = 0x00100000,
131 .offset = 0x00140000,
132 }, {
133 .name = "JORNADA720 root cramfs",
134 .size = 0x00300000,
135 .offset = 0x00240000,
136 }, {
137 .name = "JORNADA720 usr cramfs",
138 .size = 0x00800000,
139 .offset = 0x00540000,
140 }, {
141 .name = "JORNADA720 usr local",
142 .size = 0, /* will expand to the end of the flash */
143 .offset = 0x00d00000,
144 }
145};
146
147static void jornada720_set_vpp(int vpp)
148{
149 if (vpp)
150 PPSR |= 0x80;
151 else
152 PPSR &= ~0x80;
153 PPDR |= 0x80;
154}
155
156static struct flash_platform_data jornada720_flash_data = {
157 .map_name = "cfi_probe",
158 .set_vpp = jornada720_set_vpp,
159 .parts = jornada720_partitions,
160 .nr_parts = ARRAY_SIZE(jornada720_partitions),
161};
162
163static struct resource jornada720_flash_resource = {
164 .start = SA1100_CS0_PHYS,
165 .end = SA1100_CS0_PHYS + SZ_32M - 1,
166 .flags = IORESOURCE_MEM,
167};
168
169static void __init jornada720_mach_init(void)
170{
171 sa11x0_set_flash_data(&jornada720_flash_data, &jornada720_flash_resource, 1);
172}
173
111MACHINE_START(JORNADA720, "HP Jornada 720") 174MACHINE_START(JORNADA720, "HP Jornada 720")
112 /* Maintainer: Michael Gernoth <michael@gernoth.net> */ 175 /* Maintainer: Michael Gernoth <michael@gernoth.net> */
113 .phys_ram = 0xc0000000, 176 .phys_ram = 0xc0000000,
@@ -117,4 +180,5 @@ MACHINE_START(JORNADA720, "HP Jornada 720")
117 .map_io = jornada720_map_io, 180 .map_io = jornada720_map_io,
118 .init_irq = sa1100_init_irq, 181 .init_irq = sa1100_init_irq,
119 .timer = &sa1100_timer, 182 .timer = &sa1100_timer,
183 .init_machine = jornada720_mach_init,
120MACHINE_END 184MACHINE_END
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index f4496813615a..fd079ff1fc53 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -363,20 +363,16 @@ static void __init bootmem_init(struct meminfo *mi)
363 363
364 memcpy(&meminfo, mi, sizeof(meminfo)); 364 memcpy(&meminfo, mi, sizeof(meminfo));
365 365
366#ifdef CONFIG_XIP_KERNEL
367#error needs fixing
368 p->pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & PMD_MASK);
369 p->virtual = (unsigned long)&_stext & PMD_MASK;
370 p->length = ((unsigned long)&_etext - p->virtual + ~PMD_MASK) & PMD_MASK;
371 p->type = MT_ROM;
372 p ++;
373#endif
374
375 /* 366 /*
376 * Clear out all the mappings below the kernel image. 367 * Clear out all the mappings below the kernel image.
377 * FIXME: what about XIP?
378 */ 368 */
379 for (addr = 0; addr < PAGE_OFFSET; addr += PGDIR_SIZE) 369 for (addr = 0; addr < MODULE_START; addr += PGDIR_SIZE)
370 pmd_clear(pmd_off_k(addr));
371#ifdef CONFIG_XIP_KERNEL
372 /* The XIP kernel is mapped in the module area -- skip over it */
373 addr = ((unsigned long)&_etext + PGDIR_SIZE - 1) & PGDIR_MASK;
374#endif
375 for ( ; addr < PAGE_OFFSET; addr += PGDIR_SIZE)
380 pmd_clear(pmd_off_k(addr)); 376 pmd_clear(pmd_off_k(addr));
381 377
382 /* 378 /*
@@ -436,6 +432,18 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
436 pmd_clear(pmd_off_k(addr)); 432 pmd_clear(pmd_off_k(addr));
437 433
438 /* 434 /*
435 * Map the kernel if it is XIP.
436 * It is always first in the modulearea.
437 */
438#ifdef CONFIG_XIP_KERNEL
439 map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & PGDIR_MASK);
440 map.virtual = MODULE_START;
441 map.length = ((unsigned long)&_etext - map.virtual + ~PGDIR_MASK) & PGDIR_MASK;
442 map.type = MT_ROM;
443 create_mapping(&map);
444#endif
445
446 /*
439 * Map the cache flushing regions. 447 * Map the cache flushing regions.
440 */ 448 */
441#ifdef FLUSH_BASE 449#ifdef FLUSH_BASE