2 * linux/arch/m32r/boot/compressed/head.S
4 * Copyright (c) 2001-2003 Hiroyuki Kondo, Hirokazu Takata,
5 * Hitoshi Yamamoto, Takeo Takahashi
6 * Copyright (c) 2004 Hirokazu Takata
10 #include <linux/config.h>
11 #include <linux/linkage.h>
12 #include <asm/addrspace.h>
14 #include <asm/assembler.h>
19 ldi r0, #0x0000 /* SPI, disable EI */
23 * Clear BSS first so that there are no surprises...
25 #ifdef CONFIG_ISA_DUAL_ISSUE
27 LDIMM (r2, __bss_start)
29 sub r3, r2 ; BSS size in bytes
30 ; R4 = BSS size in longwords (rounded down)
31 mv r4, r3 || ldi r1, #0
32 srli r4, #4 || addi r2, #-4
35 #ifndef CONFIG_CHIP_M32310
36 ; Touch memory for the no-write-allocating cache.
39 st r1, @+r2 || addi r4, #-1
42 st r1, @+r2 || cmpeq r1, r4 ; R4 = 0?
49 stb r1, @r2 || addi r4, #-1
54 #else /* not CONFIG_ISA_DUAL_ISSUE */
56 LDIMM (r2, __bss_start)
58 sub r3, r2 ; BSS size in bytes
60 srli r4, #2 ; R4 = BSS size in longwords (rounded down)
61 ldi r1, #0 ; clear R1 for longwords store
62 addi r2, #-4 ; account for pre-inc store
63 beqz r4, .Lendloop1 ; any more to go?
65 st r1, @+r2 ; yep, zero out another longword
66 addi r4, #-1 ; decrement count
67 bnez r4, .Lloop1 ; go do some more
69 and3 r4, r3, #3 ; get no. of remaining BSS bytes to clear
70 addi r2, #4 ; account for pre-inc store
71 beqz r4, .Lendloop2 ; any more to go?
73 stb r1, @r2 ; yep, zero out another byte
74 addi r2, #1 ; bump address
75 addi r4, #-1 ; decrement count
76 bnez r4, .Lloop2 ; go do some more
79 #endif /* not CONFIG_ISA_DUAL_ISSUE */
81 seth r0, #shigh(stack_start)
82 ld sp, @(r0, low(stack_start)) /* set stack point */
85 * decompress the kernel
89 #if defined(CONFIG_CHIP_M32700)
92 ldi r1, 0xd0 ; invalidate i-cache, copy back d-cache
95 #error "put your cache flush function, please"
97 seth r0, #high(CONFIG_MEMORY_START)
102 fake_headers_as_bzImage: