blob: 28c4f96a2d9cef6d6ce97abc84890cc0c1f65615 [file] [log] [blame]
Martin Schwidefsky1844c9b2010-02-26 22:37:53 +01001/*
2 * Startup glue code to uncompress the kernel
3 *
4 * Copyright IBM Corp. 2010
5 *
6 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
7 */
8
9#include <linux/init.h>
Jan Glauber144d6342011-07-24 10:48:19 +020010#include <linux/linkage.h>
Martin Schwidefsky1844c9b2010-02-26 22:37:53 +010011#include <asm/asm-offsets.h>
12#include <asm/thread_info.h>
13#include <asm/page.h>
14#include "sizes.h"
15
16__HEAD
Jan Glauber144d6342011-07-24 10:48:19 +020017ENTRY(startup_continue)
Martin Schwidefsky1844c9b2010-02-26 22:37:53 +010018 basr %r13,0 # get base
19.LPG1:
20 # setup stack
21 lg %r15,.Lstack-.LPG1(%r13)
22 aghi %r15,-160
23 brasl %r14,decompress_kernel
Sascha Silbebf47dc52016-07-04 17:16:47 +020024 # Set up registers for memory mover. We move the decompressed image to
25 # 0x11000, starting at offset 0x11000 in the decompressed image so
26 # that code living at 0x11000 in the image will end up at 0x11000 in
27 # memory.
Martin Schwidefsky1844c9b2010-02-26 22:37:53 +010028 lgr %r4,%r2
29 lg %r2,.Loffset-.LPG1(%r13)
30 la %r4,0(%r2,%r4)
31 lg %r3,.Lmvsize-.LPG1(%r13)
32 lgr %r5,%r3
Sascha Silbebf47dc52016-07-04 17:16:47 +020033 # Move the memory mover someplace safe so it doesn't overwrite itself.
Martin Schwidefsky1844c9b2010-02-26 22:37:53 +010034 la %r1,0x200
35 mvc 0(mover_end-mover,%r1),mover-.LPG1(%r13)
Sascha Silbebf47dc52016-07-04 17:16:47 +020036 # When the memory mover is done we pass control to
37 # arch/s390/kernel/head64.S:startup_continue which lives at 0x11000 in
38 # the decompressed image.
Martin Schwidefsky1844c9b2010-02-26 22:37:53 +010039 lgr %r6,%r2
40 br %r1
41mover:
42 mvcle %r2,%r4,0
43 jo mover
44 br %r6
45mover_end:
46
47 .align 8
48.Lstack:
49 .quad 0x8000 + (1<<(PAGE_SHIFT+THREAD_ORDER))
50.Loffset:
51 .quad 0x11000
52.Lmvsize:
53 .quad SZ__bss_start