1
2
3
4
5
6
7
8#include <common.h>
9
10#define NIOS_MAGIC 0x534f494e
11
12int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *images)
13{
14 void (*kernel)(int, int, int, char *) = (void *)images->ep;
15 char *commandline = getenv("bootargs");
16 ulong initrd_start = images->rd_start;
17 ulong initrd_end = images->rd_end;
18 char *of_flat_tree = NULL;
19#if defined(CONFIG_OF_LIBFDT)
20
21 if (images->ft_len)
22 of_flat_tree = images->ft_addr;
23#endif
24 if (!of_flat_tree && argc > 1)
25 of_flat_tree = (char *)simple_strtoul(argv[1], NULL, 16);
26 if (of_flat_tree)
27 initrd_end = (ulong)of_flat_tree;
28
29
30
31
32 if (flag & BOOTM_STATE_OS_PREP)
33 return 0;
34
35 if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
36 return 1;
37
38
39 disable_interrupts();
40 flush_dcache_all();
41
42 debug("bootargs=%s @ 0x%lx\n", commandline, (ulong)&commandline);
43 debug("initrd=0x%lx-0x%lx\n", (ulong)initrd_start, (ulong)initrd_end);
44
45
46
47
48
49
50
51
52
53 kernel(NIOS_MAGIC, initrd_start, initrd_end, commandline);
54
55
56 return 1;
57}
58