1 /* The head-file for the Shark
5 * - get the memory layout from firmware. This can only be done as long as the mmu
7 * - switch the mmu off, so we have physical addresses
8 * - copy the kernel to 0x08508000. This is done to have a fixed address where the
9 * C-parts (misc.c) are executed. This address must be known at compile-time,
10 * but the load-address of the kernel depends on how much memory is installed.
11 * - Jump to this location.
12 * - Set r8 with 0, r7 with the architecture ID for head.S
15 #include <linux/linkage.h>
17 #include <asm/assembler.h>
19 .section ".start", "ax"
23 __ofw_data: .long 0 @ the number of memory blocks
24 .space 128 @ (startaddr,size) ...
28 __beginning: mov r4, r0 @ save the entry to the firmware
30 mov r0, #0xC0 @ disable irq and fiq
37 mov r0, r4 @ get the Memory layout from firmware
44 adr r2, __mmu_off @ calculate physical address
45 sub r2, r2, #0xf0000000 @ openprom maps us at f000 virt, 0e50 phys
49 add r2, r2, #0x00500000
51 mrc p15, 0, r3, c1, c0
52 bic r3, r3, #0xC @ Write Buffer and DCache
53 bic r3, r3, #0x1000 @ ICache
54 mcr p15, 0, r3, c1, c0 @ disabled
57 mcr p15, 0, r0, c7, c7 @ flush I,D caches on v4
58 mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4
59 mcr p15, 0, r0, c8, c7 @ flush I,D TLBs on v4
61 bic r3, r3, #0x1 @ MMU
62 mcr p15, 0, r3, c1, c0 @ disabled
66 __copy_target: .long 0x08508000
67 __copy_end: .long 0x08608000
73 __temp_stack: .space 128
78 orr r0, r0, #0x00600000
83 /* r0 = 0x0e600000 (current end of kernelcode)
84 * r3 = 0x08508000 (where it should begin)
85 * r1 = 0x08608000 (end of copying area, 1MB)
86 * The kernel is compressed, so 1 MB should be enough.
87 * copy the kernel to the beginning of physical memory
88 * We start from the highest address, so we can copy
89 * from 0x08500000 to 0x08508000 if we have only 8MB
93 __Copy: ldr r2, [r0], #-4
102 sub r2, r2, #0x00500000
103 ldr r0, __copy_target