0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include <linux/linkage.h>
0022 #include <linux/init.h>
0023 #include <linux/pgtable.h>
0024 #include <asm/assembler.h>
0025 #include <asm/asm-offsets.h>
0026 #include <asm/hwcap.h>
0027 #include <asm/pgtable-hwdef.h>
0028 #include <asm/ptrace.h>
0029
0030 #include "proc-macros.S"
0031
0032
0033
0034
0035
0036
0037
0038 ENTRY(cpu_arm720_dcache_clean_area)
0039 ENTRY(cpu_arm720_proc_init)
0040 ret lr
0041
0042 ENTRY(cpu_arm720_proc_fin)
0043 mrc p15, 0, r0, c1, c0, 0
0044 bic r0, r0, #0x1000 @ ...i............
0045 bic r0, r0, #0x000e @ ............wca.
0046 mcr p15, 0, r0, c1, c0, 0 @ disable caches
0047 ret lr
0048
0049
0050
0051
0052
0053
0054 ENTRY(cpu_arm720_do_idle)
0055 ret lr
0056
0057
0058
0059
0060
0061
0062
0063 ENTRY(cpu_arm720_switch_mm)
0064 #ifdef CONFIG_MMU
0065 mov r1, #0
0066 mcr p15, 0, r1, c7, c7, 0 @ invalidate cache
0067 mcr p15, 0, r0, c2, c0, 0 @ update page table ptr
0068 mcr p15, 0, r1, c8, c7, 0 @ flush TLB (v4)
0069 #endif
0070 ret lr
0071
0072
0073
0074
0075
0076
0077
0078 .align 5
0079 ENTRY(cpu_arm720_set_pte_ext)
0080 #ifdef CONFIG_MMU
0081 armv3_set_pte_ext wc_disable=0
0082 #endif
0083 ret lr
0084
0085
0086
0087
0088
0089
0090 .pushsection .idmap.text, "ax"
0091 ENTRY(cpu_arm720_reset)
0092 mov ip, #0
0093 mcr p15, 0, ip, c7, c7, 0 @ invalidate cache
0094 #ifdef CONFIG_MMU
0095 mcr p15, 0, ip, c8, c7, 0 @ flush TLB (v4)
0096 #endif
0097 mrc p15, 0, ip, c1, c0, 0 @ get ctrl register
0098 bic ip, ip, #0x000f @ ............wcam
0099 bic ip, ip, #0x2100 @ ..v....s........
0100 mcr p15, 0, ip, c1, c0, 0 @ ctrl register
0101 ret r0
0102 ENDPROC(cpu_arm720_reset)
0103 .popsection
0104
0105 .type __arm710_setup, #function
0106 __arm710_setup:
0107 mov r0, #0
0108 mcr p15, 0, r0, c7, c7, 0 @ invalidate caches
0109 #ifdef CONFIG_MMU
0110 mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4)
0111 #endif
0112 mrc p15, 0, r0, c1, c0 @ get control register
0113 ldr r5, arm710_cr1_clear
0114 bic r0, r0, r5
0115 ldr r5, arm710_cr1_set
0116 orr r0, r0, r5
0117 ret lr @ __ret (head.S)
0118 .size __arm710_setup, . - __arm710_setup
0119
0120
0121
0122
0123
0124
0125
0126 .type arm710_cr1_clear, #object
0127 .type arm710_cr1_set, #object
0128 arm710_cr1_clear:
0129 .word 0x0f3f
0130 arm710_cr1_set:
0131 .word 0x013d
0132
0133 .type __arm720_setup, #function
0134 __arm720_setup:
0135 mov r0, #0
0136 mcr p15, 0, r0, c7, c7, 0 @ invalidate caches
0137 #ifdef CONFIG_MMU
0138 mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4)
0139 #endif
0140 adr r5, arm720_crval
0141 ldmia r5, {r5, r6}
0142 mrc p15, 0, r0, c1, c0 @ get control register
0143 bic r0, r0, r5
0144 orr r0, r0, r6
0145 ret lr @ __ret (head.S)
0146 .size __arm720_setup, . - __arm720_setup
0147
0148
0149
0150
0151
0152
0153
0154 .type arm720_crval, #object
0155 arm720_crval:
0156 crval clear=0x00002f3f, mmuset=0x0000213d, ucset=0x00000130
0157
0158 __INITDATA
0159 @ define struct processor (see <asm/proc-fns.h> and proc-macros.S)
0160 define_processor_functions arm720, dabort=v4t_late_abort, pabort=legacy_pabort
0161
0162 .section ".rodata"
0163
0164 string cpu_arch_name, "armv4t"
0165 string cpu_elf_name, "v4"
0166 string cpu_arm710_name, "ARM710T"
0167 string cpu_arm720_name, "ARM720T"
0168
0169 .align
0170
0171
0172
0173
0174
0175 .section ".proc.info.init", "a"
0176
0177 .macro arm720_proc_info name:req, cpu_val:req, cpu_mask:req, cpu_name:req, cpu_flush:req
0178 .type __\name\()_proc_info,#object
0179 __\name\()_proc_info:
0180 .long \cpu_val
0181 .long \cpu_mask
0182 .long PMD_TYPE_SECT | \
0183 PMD_SECT_BUFFERABLE | \
0184 PMD_SECT_CACHEABLE | \
0185 PMD_BIT4 | \
0186 PMD_SECT_AP_WRITE | \
0187 PMD_SECT_AP_READ
0188 .long PMD_TYPE_SECT | \
0189 PMD_BIT4 | \
0190 PMD_SECT_AP_WRITE | \
0191 PMD_SECT_AP_READ
0192 initfn \cpu_flush, __\name\()_proc_info @ cpu_flush
0193 .long cpu_arch_name @ arch_name
0194 .long cpu_elf_name @ elf_name
0195 .long HWCAP_SWP | HWCAP_HALF | HWCAP_THUMB @ elf_hwcap
0196 .long \cpu_name
0197 .long arm720_processor_functions
0198 .long v4_tlb_fns
0199 .long v4wt_user_fns
0200 .long v4_cache_fns
0201 .size __\name\()_proc_info, . - __\name\()_proc_info
0202 .endm
0203
0204 arm720_proc_info arm710, 0x41807100, 0xffffff00, cpu_arm710_name, __arm710_setup
0205 arm720_proc_info arm720, 0x41807200, 0xffffff00, cpu_arm720_name, __arm720_setup