2014/10/06

U-Boot boot image


Command "bootm" will boot the image. 

// entry point to handle bootm command
do_bootm() 
  // get the boot image meta data information
  // image header info are in structure image_header
  bootm_start
    // entry point address
    images.ep = image_get_ep(&images.legacy_hdr_os_copy);
    // os load address, after unzip
    images.os.load = image_get_load(os_hdr);
  // load os image
  bootm_load_os
    // un-compress image to os.load address
    gunzip
  // when booting linux, boot_fn points to do_bootm_linux, 
  // for ARM, function implemented in arch/arm/lib/boom.c
  boot_fn
    // jump to the linux kernel
    boot_jump_linux
      kernel_entry = (void (*)(int, int, uint))images->ep;
      kernel_entry(0, machid, r2);

2014/10/02

U-Boot SPL

What is SPL?

SPL: Secondary Program Loader

Unlike NOR flash, many boot sources are not directly memory mapped.

On-chip ROM or other mechanism loads a binary into an SRAM.
  – This SRAM is often very small, sometimes 4 KiB or less.
  – The ROM can't load us into main system RAM yet, since initialization is too complex and must be handled by U-Boot.

SPL (Secondary Program Loader) is a small binary, generated from U-Boot source, that fits in the SRAM and loads the main U-Boot into system RAM.

Configured by a parallel set of makefile config symbols
  –  CONFIG_SPL_I2C_SUPPORT, CONFIG_SPL_NAND_SUPPORT, etc.
  – Normal CONFIG symbols also used, but not to control the differences between the SPL and the main U-Boot.
  – SPL also relies heavily on toolchain garbage collection.

Reference
http://www.denx.de/wiki/pub/U-Boot/MiniSummitELCE2013/tpl-presentation.pdf

Post Code on Blogger

Simplest way to post code to blogger for me: <pre style="background: #f0f0f0; border: 1px dashed #CCCCCC; color: black;overflow-x:...