bootmode: remove build warnings
[profile/mobile/platform/kernel/u-boot-tm1.git] / property / android_boot.c
1 #include <common.h>
2 #include <android_boot.h>
3 #include <asm/mach-types.h>
4 void MMU_InvalideICACHEALL(void);
5 void creat_atags(unsigned taddr, const char *cmdline,unsigned raddr, unsigned rsize)
6 {
7         unsigned n = 0;
8         unsigned *tags = (unsigned *)taddr;
9
10         //ATAG_CORE
11         tags[n++] = 2;
12         tags[n++] = 0x54410001;
13
14         if(rsize) {
15                 //ATAG_INITRD2
16                 tags[n++] = 4;
17                 tags[n++] = 0x54420005;
18                 tags[n++] = raddr;
19                 tags[n++] = rsize;
20         }
21         if(cmdline && cmdline[0]) {
22                 const char *src;
23                 char *dst;
24                 unsigned len = 0;
25                                                                         
26                 dst = (char*) (tags + n + 2);
27                 src = cmdline;
28                 while((*dst++ = *src++)) len++;
29                                 
30                 len++;
31                 len = (len + 3) & (~3);
32
33                 // ATAG_CMDLINE
34                  tags[n++] = 2 + (len / 4);
35                  tags[n++] = 0x54410009;
36
37                  n += (len / 4);
38          }
39                                  
40                  // ATAG_NONE
41                  tags[n++] = 0;
42                  tags[n++] = 0;
43 }
44
45 void boot_linux(unsigned kaddr, unsigned taddr)
46 {
47         void (*entry)(unsigned,unsigned,unsigned) = (void*) kaddr;
48
49 #ifndef CONFIG_SC8810
50     MMU_InvalideICACHEALL();
51 #endif
52         entry(0, machine_arch_type, taddr);
53 }