bootm.c文件参考

#include <common.h>
#include <command.h>
#include <image.h>
#include <zlib.h>
#include <asm/byteorder.h>

bootm.c包含/依赖关系图:

浏览该文件的源代码。

函数

int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[], bootm_headers_t *images)

变量

 DECLARE_GLOBAL_DATA_PTR


函数文档

void do_bootm_linux ( cmd_tbl_t cmdtp,
int  flag,
int  argc,
char *  argv[],
bootm_headers_t images 
)

在文件bootm.c64行定义。

参考 bootm_headers::autostartbd_info::bi_arch_numberbd_info::bi_boot_paramsboot_get_ramdisk()cleanup_before_linux()debugdo_bootm_linuxdo_reset()errorgetenv()IH_ARCH_ARMbootm_headers::legacy_hdr_osbootm_headers::legacy_hdr_validNULLprintfputs()return()setup_revision_tag()setup_serial_tag()show_boot_progress()simple_strtoul()udc_disconnect()void()zero.

00066 {
00067         ulong   initrd_start, initrd_end;
00068         ulong   ep = 0;
00069         bd_t    *bd = gd->bd;
00070         char    *s;
00071         int     machid = bd->bi_arch_number;
00072         void    (*theKernel)(int zero, int arch, uint params);
00073         int     ret;
00074 
00075 #ifdef CONFIG_CMDLINE_TAG
00076         char *commandline = getenv ("bootargs");
00077 #endif
00078 
00079         /* find kernel entry point */
00080         if (images->legacy_hdr_valid) {
00081                 ep = image_get_ep (images->legacy_hdr_os);
00082 #if defined(CONFIG_FIT)
00083         } else if (images->fit_uname_os) {
00084                 ret = fit_image_get_entry (images->fit_hdr_os,
00085                                         images->fit_noffset_os, &ep);
00086                 if (ret) {
00087                         puts ("Can't get entry point property!\n");
00088                         goto error;
00089                 }
00090 #endif
00091         } else {
00092                 puts ("Could not find kernel entry point!\n");
00093                 goto error;
00094         }
00095         theKernel = (void (*)(int, int, uint))ep;
00096 
00097         s = getenv ("machid");
00098         if (s) {
00099                 machid = simple_strtoul (s, NULL, 16);
00100                 printf ("Using machid 0x%x from environment\n", machid);
00101         }
00102 
00103         ret = boot_get_ramdisk (argc, argv, images, IH_ARCH_ARM,
00104                         &initrd_start, &initrd_end);
00105         if (ret)
00106                 goto error;
00107 
00108         show_boot_progress (15);
00109 
00110         debug ("## Transferring control to Linux (at address %08lx) ...\n",
00111                (ulong) theKernel);
00112 
00113 #if defined (CONFIG_SETUP_MEMORY_TAGS) || \
00114     defined (CONFIG_CMDLINE_TAG) || \
00115     defined (CONFIG_INITRD_TAG) || \
00116     defined (CONFIG_SERIAL_TAG) || \
00117     defined (CONFIG_REVISION_TAG) || \
00118     defined (CONFIG_LCD) || \
00119     defined (CONFIG_VFD)
00120         setup_start_tag (bd);
00121 #ifdef CONFIG_SERIAL_TAG
00122         setup_serial_tag (&params);
00123 #endif
00124 #ifdef CONFIG_REVISION_TAG
00125         setup_revision_tag (&params);
00126 #endif
00127 #ifdef CONFIG_SETUP_MEMORY_TAGS
00128         setup_memory_tags (bd);
00129 #endif
00130 #ifdef CONFIG_CMDLINE_TAG
00131         setup_commandline_tag (bd, commandline);
00132 #endif
00133 #ifdef CONFIG_INITRD_TAG
00134         if (initrd_start && initrd_end)
00135                 setup_initrd_tag (bd, initrd_start, initrd_end);
00136 #endif
00137 #if defined (CONFIG_VFD) || defined (CONFIG_LCD)
00138         setup_videolfb_tag ((gd_t *) gd);
00139 #endif
00140         setup_end_tag (bd);
00141 #endif
00142 
00143         if (!images->autostart)
00144                 return ;
00145 
00146         /* we assume that the kernel is in place */
00147         printf ("\nStarting kernel ...\n\n");
00148 
00149 #ifdef CONFIG_USB_DEVICE
00150         {
00151                 extern void udc_disconnect (void);
00152                 udc_disconnect ();
00153         }
00154 #endif
00155 
00156         cleanup_before_linux ();
00157 
00158         theKernel (0, machid, bd->bi_boot_params);
00159         /* does not return */
00160         return;
00161 
00162 error:
00163         if (images->autostart)
00164                 do_reset (cmdtp, flag, argc, argv);
00165         return;
00166 }

函数调用图:

int do_reset ( cmd_tbl_t cmdtp,
int  flag,
int  argc,
char *  argv[] 
)

在文件ppmc7xx.c91行定义。

00092 {
00093         printf( "Resetting...\n" );
00094 
00095         /* Disabe and invalidate cache */
00096         icache_disable();
00097         dcache_disable();
00098 
00099         /* Jump to warm start (in RAM) */
00100         _start_warm();
00101 
00102         /* Should never get here */
00103         while(1);
00104 }


变量文档

在文件bootm.c30行定义。


Document for u-boot-1.3.2-moko-linuxbj by  forum_linuxbj