diff options
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 7 | ||||
-rw-r--r-- | arch/arm/lib/bitops.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-s3c2410/usb-simtec.c | 18 | ||||
-rw-r--r-- | arch/arm/mm/mm-armv.c | 17 | ||||
-rw-r--r-- | arch/arm/mm/proc-v6.S | 22 |
5 files changed, 45 insertions, 23 deletions
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 39a6c1b0b9a3..7152bfbee581 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -533,6 +533,13 @@ ENTRY(__switch_to) | |||
533 | ldr r3, [r2, #TI_TP_VALUE] | 533 | ldr r3, [r2, #TI_TP_VALUE] |
534 | stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack | 534 | stmia ip!, {r4 - sl, fp, sp, lr} @ Store most regs on stack |
535 | ldr r6, [r2, #TI_CPU_DOMAIN]! | 535 | ldr r6, [r2, #TI_CPU_DOMAIN]! |
536 | #if __LINUX_ARM_ARCH__ >= 6 | ||
537 | #ifdef CONFIG_CPU_MPCORE | ||
538 | clrex | ||
539 | #else | ||
540 | strex r3, r4, [ip] @ Clear exclusive monitor | ||
541 | #endif | ||
542 | #endif | ||
536 | #if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT) | 543 | #if defined(CONFIG_CPU_XSCALE) && !defined(CONFIG_IWMMXT) |
537 | mra r4, r5, acc0 | 544 | mra r4, r5, acc0 |
538 | stmia ip, {r4, r5} | 545 | stmia ip, {r4, r5} |
diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h index 2036ff15bda9..64a988c1ad44 100644 --- a/arch/arm/lib/bitops.h +++ b/arch/arm/lib/bitops.h | |||
@@ -1,4 +1,6 @@ | |||
1 | #if __LINUX_ARM_ARCH__ >= 6 | 1 | #include <linux/config.h> |
2 | |||
3 | #if __LINUX_ARM_ARCH__ >= 6 && defined(CONFIG_CPU_MPCORE) | ||
2 | .macro bitop, instr | 4 | .macro bitop, instr |
3 | mov r2, #1 | 5 | mov r2, #1 |
4 | and r3, r0, #7 @ Get bit offset | 6 | and r3, r0, #7 @ Get bit offset |
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c index 7f2b61362976..f021fd82be52 100644 --- a/arch/arm/mach-s3c2410/usb-simtec.c +++ b/arch/arm/mach-s3c2410/usb-simtec.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/arch/arm/mach-s3c2410/usb-simtec.c | 1 | /* linux/arch/arm/mach-s3c2410/usb-simtec.c |
2 | * | 2 | * |
3 | * Copyright (c) 2004 Simtec Electronics | 3 | * Copyright (c) 2004,2005 Simtec Electronics |
4 | * Ben Dooks <ben@simtec.co.uk> | 4 | * Ben Dooks <ben@simtec.co.uk> |
5 | * | 5 | * |
6 | * http://www.simtec.co.uk/products/EB2410ITX/ | 6 | * http://www.simtec.co.uk/products/EB2410ITX/ |
@@ -14,6 +14,8 @@ | |||
14 | * Modifications: | 14 | * Modifications: |
15 | * 14-Sep-2004 BJD Created | 15 | * 14-Sep-2004 BJD Created |
16 | * 18-Oct-2004 BJD Cleanups, and added code to report OC cleared | 16 | * 18-Oct-2004 BJD Cleanups, and added code to report OC cleared |
17 | * 09-Aug-2005 BJD Renamed s3c2410_report_oc to s3c2410_usb_report_oc | ||
18 | * 09-Aug-2005 BJD Ports powered only if both are enabled | ||
17 | */ | 19 | */ |
18 | 20 | ||
19 | #define DEBUG | 21 | #define DEBUG |
@@ -47,13 +49,19 @@ | |||
47 | * designed boards. | 49 | * designed boards. |
48 | */ | 50 | */ |
49 | 51 | ||
52 | static unsigned int power_state[2]; | ||
53 | |||
50 | static void | 54 | static void |
51 | usb_simtec_powercontrol(int port, int to) | 55 | usb_simtec_powercontrol(int port, int to) |
52 | { | 56 | { |
53 | pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to); | 57 | pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to); |
54 | 58 | ||
55 | if (port == 1) | 59 | power_state[port] = to; |
56 | s3c2410_gpio_setpin(S3C2410_GPB4, to ? 0:1); | 60 | |
61 | if (power_state[0] && power_state[1]) | ||
62 | s3c2410_gpio_setpin(S3C2410_GPB4, 0); | ||
63 | else | ||
64 | s3c2410_gpio_setpin(S3C2410_GPB4, 1); | ||
57 | } | 65 | } |
58 | 66 | ||
59 | static irqreturn_t | 67 | static irqreturn_t |
@@ -63,10 +71,10 @@ usb_simtec_ocirq(int irq, void *pw, struct pt_regs *regs) | |||
63 | 71 | ||
64 | if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) { | 72 | if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) { |
65 | pr_debug("usb_simtec: over-current irq (oc detected)\n"); | 73 | pr_debug("usb_simtec: over-current irq (oc detected)\n"); |
66 | s3c2410_report_oc(info, 3); | 74 | s3c2410_usb_report_oc(info, 3); |
67 | } else { | 75 | } else { |
68 | pr_debug("usb_simtec: over-current irq (oc cleared)\n"); | 76 | pr_debug("usb_simtec: over-current irq (oc cleared)\n"); |
69 | s3c2410_report_oc(info, 0); | 77 | s3c2410_usb_report_oc(info, 0); |
70 | } | 78 | } |
71 | 79 | ||
72 | return IRQ_HANDLED; | 80 | return IRQ_HANDLED; |
diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c index e33fe4229d05..3c655c54e231 100644 --- a/arch/arm/mm/mm-armv.c +++ b/arch/arm/mm/mm-armv.c | |||
@@ -383,6 +383,7 @@ static void __init build_mem_type_table(void) | |||
383 | { | 383 | { |
384 | struct cachepolicy *cp; | 384 | struct cachepolicy *cp; |
385 | unsigned int cr = get_cr(); | 385 | unsigned int cr = get_cr(); |
386 | unsigned int user_pgprot; | ||
386 | int cpu_arch = cpu_architecture(); | 387 | int cpu_arch = cpu_architecture(); |
387 | int i; | 388 | int i; |
388 | 389 | ||
@@ -408,6 +409,9 @@ static void __init build_mem_type_table(void) | |||
408 | } | 409 | } |
409 | } | 410 | } |
410 | 411 | ||
412 | cp = &cache_policies[cachepolicy]; | ||
413 | user_pgprot = cp->pte; | ||
414 | |||
411 | /* | 415 | /* |
412 | * ARMv6 and above have extended page tables. | 416 | * ARMv6 and above have extended page tables. |
413 | */ | 417 | */ |
@@ -426,11 +430,18 @@ static void __init build_mem_type_table(void) | |||
426 | mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; | 430 | mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; |
427 | mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; | 431 | mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE; |
428 | 432 | ||
433 | /* | ||
434 | * Mark the device area as "shared device" | ||
435 | */ | ||
429 | mem_types[MT_DEVICE].prot_pte |= L_PTE_BUFFERABLE; | 436 | mem_types[MT_DEVICE].prot_pte |= L_PTE_BUFFERABLE; |
430 | mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED; | 437 | mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED; |
431 | } | ||
432 | 438 | ||
433 | cp = &cache_policies[cachepolicy]; | 439 | /* |
440 | * User pages need to be mapped with the ASID | ||
441 | * (iow, non-global) | ||
442 | */ | ||
443 | user_pgprot |= L_PTE_ASID; | ||
444 | } | ||
434 | 445 | ||
435 | if (cpu_arch >= CPU_ARCH_ARMv5) { | 446 | if (cpu_arch >= CPU_ARCH_ARMv5) { |
436 | mem_types[MT_LOW_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE; | 447 | mem_types[MT_LOW_VECTORS].prot_pte |= cp->pte & PTE_CACHEABLE; |
@@ -448,7 +459,7 @@ static void __init build_mem_type_table(void) | |||
448 | 459 | ||
449 | for (i = 0; i < 16; i++) { | 460 | for (i = 0; i < 16; i++) { |
450 | unsigned long v = pgprot_val(protection_map[i]); | 461 | unsigned long v = pgprot_val(protection_map[i]); |
451 | v &= (~(PTE_BUFFERABLE|PTE_CACHEABLE)) | cp->pte; | 462 | v &= (~(PTE_BUFFERABLE|PTE_CACHEABLE)) | user_pgprot; |
452 | protection_map[i] = __pgprot(v); | 463 | protection_map[i] = __pgprot(v); |
453 | } | 464 | } |
454 | 465 | ||
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S index 352db98ee269..3429ddcf65d1 100644 --- a/arch/arm/mm/proc-v6.S +++ b/arch/arm/mm/proc-v6.S | |||
@@ -111,12 +111,6 @@ ENTRY(cpu_v6_switch_mm) | |||
111 | mcr p15, 0, r1, c13, c0, 1 @ set context ID | 111 | mcr p15, 0, r1, c13, c0, 1 @ set context ID |
112 | mov pc, lr | 112 | mov pc, lr |
113 | 113 | ||
114 | #define nG (1 << 11) | ||
115 | #define APX (1 << 9) | ||
116 | #define AP1 (1 << 5) | ||
117 | #define AP0 (1 << 4) | ||
118 | #define XN (1 << 0) | ||
119 | |||
120 | /* | 114 | /* |
121 | * cpu_v6_set_pte(ptep, pte) | 115 | * cpu_v6_set_pte(ptep, pte) |
122 | * | 116 | * |
@@ -139,24 +133,24 @@ ENTRY(cpu_v6_switch_mm) | |||
139 | ENTRY(cpu_v6_set_pte) | 133 | ENTRY(cpu_v6_set_pte) |
140 | str r1, [r0], #-2048 @ linux version | 134 | str r1, [r0], #-2048 @ linux version |
141 | 135 | ||
142 | bic r2, r1, #0x00000ff0 | 136 | bic r2, r1, #0x000007f0 |
143 | bic r2, r2, #0x00000003 | 137 | bic r2, r2, #0x00000003 |
144 | orr r2, r2, #AP0 | 2 | 138 | orr r2, r2, #PTE_EXT_AP0 | 2 |
145 | 139 | ||
146 | tst r1, #L_PTE_WRITE | 140 | tst r1, #L_PTE_WRITE |
147 | tstne r1, #L_PTE_DIRTY | 141 | tstne r1, #L_PTE_DIRTY |
148 | orreq r2, r2, #APX | 142 | orreq r2, r2, #PTE_EXT_APX |
149 | 143 | ||
150 | tst r1, #L_PTE_USER | 144 | tst r1, #L_PTE_USER |
151 | orrne r2, r2, #AP1 | nG | 145 | orrne r2, r2, #PTE_EXT_AP1 |
152 | tstne r2, #APX | 146 | tstne r2, #PTE_EXT_APX |
153 | bicne r2, r2, #APX | AP0 | 147 | bicne r2, r2, #PTE_EXT_APX | PTE_EXT_AP0 |
154 | 148 | ||
155 | tst r1, #L_PTE_YOUNG | 149 | tst r1, #L_PTE_YOUNG |
156 | biceq r2, r2, #APX | AP1 | AP0 | 150 | biceq r2, r2, #PTE_EXT_APX | PTE_EXT_AP_MASK |
157 | 151 | ||
158 | @ tst r1, #L_PTE_EXEC | 152 | @ tst r1, #L_PTE_EXEC |
159 | @ orreq r2, r2, #XN | 153 | @ orreq r2, r2, #PTE_EXT_XN |
160 | 154 | ||
161 | tst r1, #L_PTE_PRESENT | 155 | tst r1, #L_PTE_PRESENT |
162 | moveq r2, #0 | 156 | moveq r2, #0 |