Skip to content

Commit daece59

Browse files
Nicolas PitreRussell King
authored andcommitted
ARM: 7013/1: P2V: Remove ARM_PATCH_PHYS_VIRT_16BIT
This code can be removed now that MSM targets no longer need the 16-bit offsets for P2V. Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 9e775ad commit daece59

4 files changed

Lines changed: 14 additions & 68 deletions

File tree

‎arch/arm/Kconfig‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,20 +205,12 @@ config ARM_PATCH_PHYS_VIRT
205205
kernel in system memory.
206206

207207
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.
208+
of physical memory is at a 16MB boundary.
210209

211210
Only disable this option if you know that you do not require
212211
this feature (eg, building a kernel for a single machine) and
213212
you need to shrink the kernel to the minimal size.
214213

215-
config ARM_PATCH_PHYS_VIRT_16BIT
216-
def_bool y
217-
depends on ARM_PATCH_PHYS_VIRT && ARCH_MSM
218-
help
219-
This option extends the physical to virtual translation patching
220-
to allow physical memory down to a theoretical minimum of 64K
221-
boundaries.
222214

223215
source "init/Kconfig"
224216

‎arch/arm/include/asm/memory.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@
160160
* so that all we need to do is modify the 8-bit constant field.
161161
*/
162162
#define __PV_BITS_31_24 0x81000000
163-
#define __PV_BITS_23_16 0x00810000
164163

165164
extern unsigned long __pv_phys_offset;
166165
#define PHYS_OFFSET __pv_phys_offset
@@ -178,19 +177,13 @@ static inline unsigned long __virt_to_phys(unsigned long x)
178177
{
179178
unsigned long t;
180179
__pv_stub(x, t, "add", __PV_BITS_31_24);
181-
#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
182-
__pv_stub(t, t, "add", __PV_BITS_23_16);
183-
#endif
184180
return t;
185181
}
186182

187183
static inline unsigned long __phys_to_virt(unsigned long x)
188184
{
189185
unsigned long t;
190186
__pv_stub(x, t, "sub", __PV_BITS_31_24);
191-
#ifdef CONFIG_ARM_PATCH_PHYS_VIRT_16BIT
192-
__pv_stub(t, t, "sub", __PV_BITS_23_16);
193-
#endif
194187
return t;
195188
}
196189
#else

‎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/head.S‎

Lines changed: 13 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -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)