1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30#include <common.h>
31#include <command.h>
32#include <image.h>
33#include <u-boot/zlib.h>
34#include <asm/byteorder.h>
35
36DECLARE_GLOBAL_DATA_PTR;
37
38int do_bootm_linux(int flag, int argc, char * const argv[],
39 bootm_headers_t *images)
40{
41 void (*kernel) (unsigned int);
42 ulong rd_data_start, rd_data_end;
43
44 if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
45 return 1;
46
47 int ret;
48
49 char *of_flat_tree = NULL;
50#if defined(CONFIG_OF_LIBFDT)
51
52 if (images->ft_len)
53 of_flat_tree = images->ft_addr;
54#endif
55
56 kernel = (void (*)(unsigned int))images->ep;
57
58
59 ret = boot_get_ramdisk(argc, argv, images, IH_ARCH_OPENRISC,
60 &rd_data_start, &rd_data_end);
61 if (ret)
62 return 1;
63
64 show_boot_progress(15);
65
66 if (!of_flat_tree && argc > 3)
67 of_flat_tree = (char *)simple_strtoul(argv[3], NULL, 16);
68#ifdef DEBUG
69 printf("## Transferring control to Linux (at address 0x%08lx) " \
70 "ramdisk 0x%08lx, FDT 0x%08lx...\n",
71 (ulong) kernel, rd_data_start, (ulong) of_flat_tree);
72#endif
73 if (dcache_status() || icache_status())
74 flush_cache((ulong)kernel, max(checkdcache(), checkicache()));
75
76
77
78
79
80 kernel((unsigned int) of_flat_tree);
81
82
83 return 1;
84}
85