Skip to content

Commit cefd3e7

Browse files
author
Russell King
committed
Merge branch 'mach_memory_h' of git://git.linaro.org/people/nico/linux into devel-stable
2 parents a26bce1 + 0cdc8b9 commit cefd3e7

File tree

117 files changed

+347
-1168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+347
-1168
lines changed

arch/arm/Kconfig

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ config VECTORS_BASE
196196
The base address of exception vectors.
197197

198198
config ARM_PATCH_PHYS_VIRT
199-
bool "Patch physical to virtual translations at runtime"
199+
bool "Patch physical to virtual translations at runtime" if EMBEDDED
200+
default y
200201
depends on !XIP_KERNEL && MMU
201202
depends on !ARCH_REALVIEW || !SPARSEMEM
202203
help
@@ -205,16 +206,25 @@ config ARM_PATCH_PHYS_VIRT
205206
kernel in system memory.
206207

207208
This can only be used with non-XIP MMU kernels where the base
208-
of physical memory is at a 16MB boundary, or theoretically 64K
209-
for the MSM machine class.
209+
of physical memory is at a 16MB boundary.
210210

211-
config ARM_PATCH_PHYS_VIRT_16BIT
212-
def_bool y
213-
depends on ARM_PATCH_PHYS_VIRT && ARCH_MSM
211+
Only disable this option if you know that you do not require
212+
this feature (eg, building a kernel for a single machine) and
213+
you need to shrink the kernel to the minimal size.
214+
215+
config NEED_MACH_MEMORY_H
216+
bool
217+
help
218+
Select this when mach/memory.h is required to provide special
219+
definitions for this platform. The need for mach/memory.h should
220+
be avoided when possible.
221+
222+
config PHYS_OFFSET
223+
hex "Physical address of main memory"
224+
depends on !ARM_PATCH_PHYS_VIRT && !NEED_MACH_MEMORY_H
214225
help
215-
This option extends the physical to virtual translation patching
216-
to allow physical memory down to a theoretical minimum of 64K
217-
boundaries.
226+
Please provide the physical address corresponding to the
227+
location of main memory in your system.
218228

219229
source "init/Kconfig"
220230

@@ -247,6 +257,7 @@ config ARCH_INTEGRATOR
247257
select GENERIC_CLOCKEVENTS
248258
select PLAT_VERSATILE
249259
select PLAT_VERSATILE_FPGA_IRQ
260+
select NEED_MACH_MEMORY_H
250261
help
251262
Support for ARM's Integrator platform.
252263

@@ -262,6 +273,7 @@ config ARCH_REALVIEW
262273
select PLAT_VERSATILE_CLCD
263274
select ARM_TIMER_SP804
264275
select GPIO_PL061 if GPIOLIB
276+
select NEED_MACH_MEMORY_H
265277
help
266278
This enables support for ARM Ltd RealView boards.
267279

@@ -302,7 +314,6 @@ config ARCH_AT91
302314
select ARCH_REQUIRE_GPIOLIB
303315
select HAVE_CLK
304316
select CLKDEV_LOOKUP
305-
select ARM_PATCH_PHYS_VIRT if MMU
306317
help
307318
This enables support for systems based on the Atmel AT91RM9200,
308319
AT91SAM9 and AT91CAP9 processors.
@@ -323,6 +334,7 @@ config ARCH_CLPS711X
323334
bool "Cirrus Logic CLPS711x/EP721x-based"
324335
select CPU_ARM720T
325336
select ARCH_USES_GETTIMEOFFSET
337+
select NEED_MACH_MEMORY_H
326338
help
327339
Support for Cirrus Logic 711x/721x based boards.
328340

@@ -363,6 +375,7 @@ config ARCH_EBSA110
363375
select ISA
364376
select NO_IOPORT
365377
select ARCH_USES_GETTIMEOFFSET
378+
select NEED_MACH_MEMORY_H
366379
help
367380
This is an evaluation board for the StrongARM processor available
368381
from Digital. It has limited hardware on-board, including an
@@ -378,6 +391,7 @@ config ARCH_EP93XX
378391
select ARCH_REQUIRE_GPIOLIB
379392
select ARCH_HAS_HOLES_MEMORYMODEL
380393
select ARCH_USES_GETTIMEOFFSET
394+
select NEED_MEMORY_H
381395
help
382396
This enables support for the Cirrus EP93xx series of CPUs.
383397

@@ -386,6 +400,7 @@ config ARCH_FOOTBRIDGE
386400
select CPU_SA110
387401
select FOOTBRIDGE
388402
select GENERIC_CLOCKEVENTS
403+
select NEED_MACH_MEMORY_H
389404
help
390405
Support for systems based on the DC21285 companion chip
391406
("FootBridge"), such as the Simtec CATS and the Rebel NetWinder.
@@ -435,6 +450,7 @@ config ARCH_IOP13XX
435450
select PCI
436451
select ARCH_SUPPORTS_MSI
437452
select VMSPLIT_1G
453+
select NEED_MACH_MEMORY_H
438454
help
439455
Support for Intel's IOP13XX (XScale) family of processors.
440456

@@ -465,6 +481,7 @@ config ARCH_IXP23XX
465481
select CPU_XSC3
466482
select PCI
467483
select ARCH_USES_GETTIMEOFFSET
484+
select NEED_MACH_MEMORY_H
468485
help
469486
Support for Intel's IXP23xx (XScale) family of processors.
470487

@@ -474,6 +491,7 @@ config ARCH_IXP2000
474491
select CPU_XSCALE
475492
select PCI
476493
select ARCH_USES_GETTIMEOFFSET
494+
select NEED_MACH_MEMORY_H
477495
help
478496
Support for Intel's IXP2400/2800 (XScale) family of processors.
479497

@@ -567,6 +585,7 @@ config ARCH_KS8695
567585
select CPU_ARM922T
568586
select ARCH_REQUIRE_GPIOLIB
569587
select ARCH_USES_GETTIMEOFFSET
588+
select NEED_MACH_MEMORY_H
570589
help
571590
Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
572591
System-on-Chip devices.
@@ -658,6 +677,7 @@ config ARCH_SHMOBILE
658677
select SPARSE_IRQ
659678
select MULTI_IRQ_HANDLER
660679
select PM_GENERIC_DOMAINS if PM
680+
select NEED_MACH_MEMORY_H
661681
help
662682
Support for Renesas's SH-Mobile and R-Mobile ARM platforms.
663683

@@ -672,6 +692,7 @@ config ARCH_RPC
672692
select NO_IOPORT
673693
select ARCH_SPARSEMEM_ENABLE
674694
select ARCH_USES_GETTIMEOFFSET
695+
select NEED_MACH_MEMORY_H
675696
help
676697
On the Acorn Risc-PC, Linux can support the internal IDE disk and
677698
CD-ROM interface, serial and parallel port, and the floppy drive.
@@ -690,6 +711,7 @@ config ARCH_SA1100
690711
select HAVE_SCHED_CLOCK
691712
select TICK_ONESHOT
692713
select ARCH_REQUIRE_GPIOLIB
714+
select NEED_MACH_MEMORY_H
693715
help
694716
Support for StrongARM 11x0 based boards.
695717

@@ -782,6 +804,7 @@ config ARCH_S5PV210
782804
select HAVE_S3C2410_I2C if I2C
783805
select HAVE_S3C_RTC if RTC_CLASS
784806
select HAVE_S3C2410_WATCHDOG if WATCHDOG
807+
select NEED_MACH_MEMORY_H
785808
help
786809
Samsung S5PV210/S5PC110 series based systems
787810

@@ -798,6 +821,7 @@ config ARCH_EXYNOS4
798821
select HAVE_S3C_RTC if RTC_CLASS
799822
select HAVE_S3C2410_I2C if I2C
800823
select HAVE_S3C2410_WATCHDOG if WATCHDOG
824+
select NEED_MACH_MEMORY_H
801825
help
802826
Samsung EXYNOS4 series based systems
803827

@@ -809,6 +833,7 @@ config ARCH_SHARK
809833
select ZONE_DMA
810834
select PCI
811835
select ARCH_USES_GETTIMEOFFSET
836+
select NEED_MACH_MEMORY_H
812837
help
813838
Support for the StrongARM based Digital DNARD machine, also known
814839
as "Shark" (<http://www.shark-linux.de/shark.html>).
@@ -836,6 +861,7 @@ config ARCH_U300
836861
select CLKDEV_LOOKUP
837862
select HAVE_MACH_CLKDEV
838863
select GENERIC_GPIO
864+
select NEED_MACH_MEMORY_H
839865
help
840866
Support for ST-Ericsson U300 series mobile platforms.
841867

arch/arm/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ textofs-$(CONFIG_PM_H1940) := 0x00108000
128128
ifeq ($(CONFIG_ARCH_SA1100),y)
129129
textofs-$(CONFIG_SA1111) := 0x00208000
130130
endif
131+
textofs-$(CONFIG_ARCH_MSM7X30) := 0x00208000
132+
textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000
133+
textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000
131134

132135
# Machine directory name. This list is sorted alphanumerically
133136
# by CONFIG_* macro name.

arch/arm/include/asm/memory.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
#include <linux/compiler.h>
1717
#include <linux/const.h>
1818
#include <linux/types.h>
19-
#include <mach/memory.h>
2019
#include <asm/sizes.h>
2120

21+
#ifdef CONFIG_NEED_MACH_MEMORY_H
22+
#include <mach/memory.h>
23+
#endif
24+
2225
/*
2326
* Allow for constants defined here to be used from assembly code
2427
* by prepending the UL suffix only with actual C code compilation.
@@ -151,7 +154,6 @@
151154
* so that all we need to do is modify the 8-bit constant field.
152155
*/
153156
#define __PV_BITS_31_24 0x81000000
154-
#define __PV_BITS_23_16 0x00810000
155157

156158
extern unsigned long __pv_phys_offset;
157159
#define PHYS_OFFSET __pv_phys_offset
@@ -169,19 +171,13 @@ static inline unsigned long __virt_to_phys(unsigned long x)
169171
{
170172
unsigned long t;
171173
__pv_stub(x, t, "add", __PV_BITS_31_24);
172-
#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
173-
__pv_stub(t, t, "add", __PV_BITS_23_16);
174-
#endif
175174
return t;
176175
}
177176

178177
static inline unsigned long __phys_to_virt(unsigned long x)
179178
{
180179
unsigned long t;
181180
__pv_stub(x, t, "sub", __PV_BITS_31_24);
182-
#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
183-
__pv_stub(t, t, "sub", __PV_BITS_23_16);
184-
#endif
185181
return t;
186182
}
187183
#else
@@ -191,7 +187,11 @@ static inline unsigned long __phys_to_virt(unsigned long x)
191187
#endif
192188

193189
#ifndef PHYS_OFFSET
190+
#ifdef PLAT_PHYS_OFFSET
194191
#define PHYS_OFFSET PLAT_PHYS_OFFSET
192+
#else
193+
#define PHYS_OFFSET UL(CONFIG_PHYS_OFFSET)
194+
#endif
195195
#endif
196196

197197
/*

arch/arm/include/asm/module.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ struct mod_arch_specific {
3131

3232
/* Add __virt_to_phys patching state as well */
3333
#ifdef CONFIG_ARM_PATCH_PHYS_VIRT
34-
#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
35-
#define MODULE_ARCH_VERMAGIC_P2V "p2v16 "
36-
#else
3734
#define MODULE_ARCH_VERMAGIC_P2V "p2v8 "
38-
#endif
3935
#else
4036
#define MODULE_ARCH_VERMAGIC_P2V ""
4137
#endif

arch/arm/kernel/debug.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#if defined(CONFIG_DEBUG_ICEDCC)
2323
@@ debug using ARM EmbeddedICE DCC channel
2424

25-
.macro addruart, rp, rv
25+
.macro addruart, rp, rv, tmp
2626
.endm
2727

2828
#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K) || defined(CONFIG_CPU_V7)
@@ -106,7 +106,7 @@
106106

107107
#ifdef CONFIG_MMU
108108
.macro addruart_current, rx, tmp1, tmp2
109-
addruart \tmp1, \tmp2
109+
addruart \tmp1, \tmp2, \rx
110110
mrc p15, 0, \rx, c1, c0
111111
tst \rx, #1
112112
moveq \rx, \tmp1

arch/arm/kernel/head.S

Lines changed: 15 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ ENTRY(stext)
9595
sub r4, r3, r4 @ (PHYS_OFFSET - PAGE_OFFSET)
9696
add r8, r8, r4 @ PHYS_OFFSET
9797
#else
98-
ldr r8, =PLAT_PHYS_OFFSET
98+
ldr r8, =PHYS_OFFSET @ always constant in this case
9999
#endif
100100

101101
/*
@@ -234,7 +234,7 @@ __create_page_tables:
234234
* This allows debug messages to be output
235235
* via a serial console before paging_init.
236236
*/
237-
addruart r7, r3
237+
addruart r7, r3, r0
238238

239239
mov r3, r3, lsr #20
240240
mov r3, r3, lsl #2
@@ -488,13 +488,8 @@ __fixup_pv_table:
488488
add r5, r5, r3 @ adjust table end address
489489
add r7, r7, r3 @ adjust __pv_phys_offset address
490490
str r8, [r7] @ save computed PHYS_OFFSET to __pv_phys_offset
491-
#ifndef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
492491
mov r6, r3, lsr #24 @ constant for add/sub instructions
493492
teq r3, r6, lsl #24 @ must be 16MiB aligned
494-
#else
495-
mov r6, r3, lsr #16 @ constant for add/sub instructions
496-
teq r3, r6, lsl #16 @ must be 64kiB aligned
497-
#endif
498493
THUMB( it ne @ cross section branch )
499494
bne __error
500495
str r6, [r7, #4] @ save to __pv_offset
@@ -510,20 +505,8 @@ ENDPROC(__fixup_pv_table)
510505
.text
511506
__fixup_a_pv_table:
512507
#ifdef CONFIG_THUMB2_KERNEL
513-
#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
514-
lsls r0, r6, #24
515-
lsr r6, #8
516-
beq 1f
517-
clz r7, r0
518-
lsr r0, #24
519-
lsl r0, r7
520-
bic r0, 0x0080
521-
lsrs r7, #1
522-
orrcs r0, #0x0080
523-
orr r0, r0, r7, lsl #12
524-
#endif
525-
1: lsls r6, #24
526-
beq 4f
508+
lsls r6, #24
509+
beq 2f
527510
clz r7, r6
528511
lsr r6, #24
529512
lsl r6, r7
@@ -532,43 +515,25 @@ __fixup_a_pv_table:
532515
orrcs r6, #0x0080
533516
orr r6, r6, r7, lsl #12
534517
orr r6, #0x4000
535-
b 4f
536-
2: @ at this point the C flag is always clear
537-
add r7, r3
538-
#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
539-
ldrh ip, [r7]
540-
tst ip, 0x0400 @ the i bit tells us LS or MS byte
541-
beq 3f
542-
cmp r0, #0 @ set C flag, and ...
543-
biceq ip, 0x0400 @ immediate zero value has a special encoding
544-
streqh ip, [r7] @ that requires the i bit cleared
545-
#endif
546-
3: ldrh ip, [r7, #2]
518+
b 2f
519+
1: add r7, r3
520+
ldrh ip, [r7, #2]
547521
and ip, 0x8f00
548-
orrcc ip, r6 @ mask in offset bits 31-24
549-
orrcs ip, r0 @ mask in offset bits 23-16
522+
orr ip, r6 @ mask in offset bits 31-24
550523
strh ip, [r7, #2]
551-
4: cmp r4, r5
524+
2: cmp r4, r5
552525
ldrcc r7, [r4], #4 @ use branch for delay slot
553-
bcc 2b
526+
bcc 1b
554527
bx lr
555528
#else
556-
#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
557-
and r0, r6, #255 @ offset bits 23-16
558-
mov r6, r6, lsr #8 @ offset bits 31-24
559-
#else
560-
mov r0, #0 @ just in case...
561-
#endif
562-
b 3f
563-
2: ldr ip, [r7, r3]
529+
b 2f
530+
1: ldr ip, [r7, r3]
564531
bic ip, ip, #0x000000ff
565-
tst ip, #0x400 @ rotate shift tells us LS or MS byte
566-
orrne ip, ip, r6 @ mask in offset bits 31-24
567-
orreq ip, ip, r0 @ mask in offset bits 23-16
532+
orr ip, ip, r6 @ mask in offset bits 31-24
568533
str ip, [r7, r3]
569-
3: cmp r4, r5
534+
2: cmp r4, r5
570535
ldrcc r7, [r4], #4 @ use branch for delay slot
571-
bcc 2b
536+
bcc 1b
572537
mov pc, lr
573538
#endif
574539
ENDPROC(__fixup_a_pv_table)

0 commit comments

Comments
 (0)