sandbox: Split bootm code out into lib/bootm
[oweals/u-boot.git] / arch / sandbox / lib / bootm.c
1 /*
2  * Copyright (c) 2011 The Chromium OS Authors.
3  * SPDX-License-Identifier:     GPL-2.0+
4  */
5
6 #include <common.h>
7 #include <asm/io.h>
8
9 DECLARE_GLOBAL_DATA_PTR;
10
11 int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
12 {
13         if (flag & (BOOTM_STATE_OS_GO | BOOTM_STATE_OS_FAKE_GO)) {
14                 bootstage_mark(BOOTSTAGE_ID_RUN_OS);
15                 printf("## Transferring control to Linux (at address %08lx)...\n",
16                        images->ep);
17                 reset_cpu(0);
18         }
19
20         return 0;
21 }