Skip to content

rafaello7/bl1-nanopi-m3

 
 

Repository files navigation

Boot loader for NanoPi M3

First stage boot loader, loaded by s5p6818 boot ROM. Loads u-boot.

To update bl1 on NanoPi it is recommended to use nano-blembed utility from nanopi-boot-tools.

Compilation

A gcc cross-compiler is needed. I'm using gcc-linaro 6.x available on Ubuntu, in gcc-aarch64-linux-gnu package. To build, run make. The make command builds out/bl1-nanopi.bin binary. This is the bl1 binary for NanoPi.

Boot process on NanoPi

Kernel loading on this board is performed in a few stages, namely:

  • S5P6818 boot ROM loads image, a first stage loader, to static RAM. The RAM is named "static" in opposite to "dynamic" RAM used as the main memory of the device. Dynamic RAM needs some initialization before use. Static RAM does not need any initialization. It is available immediately and it is the only memory available at startup. This board has only 64 kilobytes of static RAM. The static memory starts at address 0xffff0000 and ends at 0xffffffff. Boot ROM loads the first stage loader at address 0xffff0000.
  • First stage loader initializes main memory and then loads u-boot to main memory. The u-boot is loaded at address chosen by programmer. The 32-bit u-boot provided by FriendlyARM should be loaded at address 0x42c00000. On the other hand, u-boot for Samsung ARTIK (from which the u-boot-nanopi-m3 is forked) should be loaded at address 0x43c00000.
  • The u-boot loads Linux kernel and initrd image (initial ramdisk) to memory and boots the kernel. On arm64 platform also a device tree image must be loaded. The device tree image contains information about the SOC layout: what hardware it contains and how the hardware components are connected together. More information about device tree may be found at elinux.org.

The images are normally loaded from SD card. But NanoPi may be also connected to PC USB port and all the images may be loaded using USB connection. The device must be plugged through micro-usb port, such used for powering the device. Images may be loaded using nanopi-load tool.

The nanopi-load tool needs libusb-1.0 library. To compile the tool on Debian or Ubuntu, libusb-1.0-0-dev and pkg-config packages should be installed.

About

BL1 source for NanoPi M3

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 96.1%
  • C++ 2.1%
  • Assembly 1.3%
  • Other 0.5%