1 #include <linux/linkage.h>
3 #include <asm/asm-offsets.h>
8 #define MMU_BASE 8 /* MMU flags base in cpu_mmu_flags */
12 ENTRY(relocate_new_kernel)
13 movel %sp@(4),%a0 /* a0 = ptr */
14 movel %sp@(8),%a1 /* a1 = start */
15 movel %sp@(12),%d1 /* d1 = cpu_mmu_flags */
16 movew #PAGE_MASK,%d2 /* d2 = PAGE_MASK */
20 btst #MMU_BASE + MMUB_68851,%d1
23 1: /* 68851 or 68030 */
26 2: addl #0x00000000,%a4 /* virt_to_phys() */
28 .section ".m68k_fixup","aw"
29 .long M68K_FIXUP_MEMOFFSET, 2b+2
33 pmove %tc,%d0 /* Disable MMU */
36 jmp %a4@ /* Jump to physical .Lcopy */
40 btst #MMU_BASE + MMUB_68030,%d1
43 btst #MMU_BASE + MMUB_68040,%d1
46 4: /* 68040 or 68060 */
48 lea %pc@(.Lcont040),%a4
49 5: addl #0x00000000,%a4 /* virt_to_phys() */
51 .section ".m68k_fixup","aw"
52 .long M68K_FIXUP_MEMOFFSET, 5b+2
57 orw #0xe020,%d0 /* Map 16 MiB, enable, cacheable */
62 jmp %a4@ /* Jump to physical .Lcont040 */
67 movec %d0,%tc /* Disable MMU */
76 btst #MMU_BASE + MMUB_68060,%d1
80 movel %a0@+,%d0 /* d0 = entry = *ptr */
83 btst #2,%d0 /* entry & IND_DONE? */
86 btst #1,%d0 /* entry & IND_INDIRECTION? */
89 movel %d0,%a0 /* ptr = entry & PAGE_MASK */
93 btst #0,%d0 /* entry & IND_DESTINATION? */
96 movel %d0,%a2 /* a2 = dst = entry & PAGE_MASK */
100 btst #3,%d0 /* entry & IND_SOURCE? */
104 movel %d0,%a3 /* a3 = src = entry & PAGE_MASK */
105 movew #PAGE_SIZE/32 - 1,%d0 /* d0 = PAGE_SIZE/32 - 1 */
107 movel %a3@+,%a2@+ /* *dst++ = *src++ */
108 movel %a3@+,%a2@+ /* *dst++ = *src++ */
109 movel %a3@+,%a2@+ /* *dst++ = *src++ */
110 movel %a3@+,%a2@+ /* *dst++ = *src++ */
111 movel %a3@+,%a2@+ /* *dst++ = *src++ */
112 movel %a3@+,%a2@+ /* *dst++ = *src++ */
113 movel %a3@+,%a2@+ /* *dst++ = *src++ */
114 movel %a3@+,%a2@+ /* *dst++ = *src++ */
119 /* Flush all caches */
124 1: /* 68020 or 68030 */
139 3: /* 68040 or 68060 */
156 relocate_new_kernel_end:
158 ENTRY(relocate_new_kernel_size)
159 .long relocate_new_kernel_end - relocate_new_kernel