Second level bootloader for Atmel AT91SAM SoC
ehristev Makefile: prepare 3.8.11-rc3
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Latest commit 0eea0e5 Sep 13, 2018
Permalink
Failed to load latest commit information.
board Merge branch 'v3.8.11/qspi' into 'at91bootstrap-3.x' Sep 13, 2018
config config/Makefile: only link with ncurses lib if needed Jun 7, 2017
contrib driver: act8865: use console_printf to print error messages May 30, 2018
driver driver: sdhc: check if DDR and ADMA2 are supported before using Sep 11, 2018
fs disk_initialize(): do not call sdcard_initialize() again if alredy su… May 8, 2017
host-utilities Add SCM information when generate binary May 31, 2013
include driver: sdhc: check if DDR and ADMA2 are supported before using Sep 11, 2018
lib Add support for second memory bank on AT91SAM9G45 boards. May 7, 2018
scripts script: addpmecchead: sama5d2_ptc_ek: fix nand configuration Dec 4, 2017
.dir-locals.el Add .dir-locals.el for emacs May 8, 2017
.gitignore .gitignore: Ignore *.pyc files Jun 17, 2016
Config.in Config.in: fix typo in trustzone May 15, 2018
Config.in.app-image Config.in: split all load strategies into dedicated Config.in files Jul 3, 2015
Config.in.kernel Merge pull request #77 from JochenFriedrich/master May 7, 2018
Config.in.secure Merge pull request #46 from baruchsiach/secure-endianness Oct 31, 2016
Config.in.u-boot Config.in.u-boot: Increase IMG_SIZE for U-Boot Apr 11, 2017
KNOWN_ISSUES KNOWN_ISSUES: add warning for older toolchains Sep 5, 2018
Makefile Makefile: prepare 3.8.11-rc3 Sep 13, 2018
README.md README: create README.md as symlink to README.txt May 8, 2018
README.txt KNOWN_ISSUES: add warning for older toolchains Sep 5, 2018
crt0_gnu.S crt0: initial clock through c code Dec 3, 2014
elf32-littlearm-tz.lds Makefile: improve the ChkFileSize operation Oct 15, 2014
elf32-littlearm.lds Makefile: improve the ChkFileSize operation Oct 15, 2014
main.c backup mode: add a trace to inform if backup mode is enabled Aug 16, 2017
toplevel_cpp.mk Add support for second memory bank on AT91SAM9G45 boards. May 7, 2018

README.md

AT91Bootstrap Project

AT91Bootstrap is the 2nd level bootloader for Atmel SMART microprocessors (aka AT91). It providing a set of algorithms to manage the hardware initialization such as clock speed configuration, PIO settings, DRAM initialization, to download your main application from specified boot media: NAND FLASH, serial FLASH (both AT25-compatible of DataFlash), serial EEPROM, SD Card, etc. to main memory and to start it.

1 GNU ARM Toolchain

AT91Bootstrap has been compiled and tested under Linux using the following GNU ARM Toolchain:

  • gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  • gcc version 4.7.3 (Sourcery CodeBench Lite 2013.05-24)
  • gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
  • gcc version 4.8.3 (Sourcery CodeBench Lite 2014.05-29)
  • gcc version 4.9.3 (Linaro GCC 2014.11)
  • gcc version 5.1.1 (Linaro GCC 5.1-2015.08)
  • gcc version 7.2.1 (Linaro GCC 7.2-2017.11)
  • gcc version 7.3.1 (Linaro GCC 7.2-2018.05)

WARNING: check KNOWN_ISSUES for issues with older gcc versions. We recommend using a toolchain newer than 6.0.

2 Compile AT91Bootstrap

2.1 Compile DataFlashBoot

Let's use at91sam9x5ek as an example.

2.1.1 Compile booting u-boot image from DataFlash

$ cd <project directory>
$ make mrproper
$ make at91sam9x5ekdf_uboot_defconfig
$ make

If the building process is successful, the final .bin image can be found under binaries/

2.1.2 Compile booting kernel image from DataFlash

$ cd <project directory>
$ make mrproper
$ make at91sam9x5ekdf_linux_defconfig
$ make

If the building process is successful, the final .bin image can be found under binaries/

2.1.3 Compile booting kernel & dt image from DataFlash

$ cd <project directory>
$ make mrproper
$ make at91sam9x5ekdf_linux_dt_defconfig
$ make

If the building process is successful, the final .bin image can be found under binaries/

2.2 Compile NandFlashBoot

Let's use at91sam9m10g45ek as an example.

2.2.1 Compile booting u-boot image from NandFlash

$ cd <project directory>
$ make mrproper
$ make at91sam9m10g45eknf_uboot_defconfig
$ make

If the building process is successful, the final .bin image can be found under binaries/

2.2.2 Compile booting kernel image from NandFlash

$ cd <project directory>
$ make mrproper
$ make at91sam9m10g45eknf_linux_defconfig
$ make

If the building process is successful, the final .bin image can be found under binaries/

2.2.3 Compile booting kernel & dt image from NandFlash

$ cd <project directory>
$ make mrproper
$ make at91sam9m10g45eknf_linux_dt_defconfig
$ make

If the building process is successful, the final .bin image can be found under binaries/

2.3 Compile SDCardBoot

Let's use at91sam9m10g45ek as an example,

2.3.1 Compile booting u-boot image from SDCard

$ cd <project directory>
$ make mrproper
$ make at91sam9m10g45eksd_uboot_defconfig
$ make

If the building process is successful, the final .bin image can be found under binaries/

2.3.2 Compile booting linux image from SDCard

$ cd <project directory>
$ make mrproper
$ make at91sam9m10g45eksd_linux_defconfig
$ make

If the building process is successful, the final .bin image can be found under binaries/

2.3.3 Compile booting linux & dt image from SDCard

$ cd <project directory>
$ make mrproper
$ make at91sam9m10g45eksd_linux_dt_defconfig
$ make

If the building process is successful, the final .bin image can be found under binaries/

3 Release

If you plan to release the project, you can use the command as below

$ cd <project directory>
$ make tarball

If the command is successful, the .tar.gz tar package can be found under the project top directory.

4 Others

4.1 About booting from NOR flash.

4.1.1 ROM Code version

Booting from the external NOR flash is supported in ROM code v2.1 for SAMA5D3x. Bootstrap relocates the binary to the internal SRAM and run.

4.1.2 SAM-BA

Using SAM-BA to program the binary to the NOR flash is a little different from other booting mode. Namely, there is no 'Send Boot File' command for NOR flash.

You should use 'Send File' command to send the binary file the same like for a normal file, with 'Address' selected to 0.

5 Contributing your own board

If the system board that you have is not listed, then you will need to port AT91Bootstrap to your hardware platform. To do this, follow these steps:

1. Create a new directory to hold your board specific code under contrib/board/ directory. Add any files you need.
In your board directory, you will need at least the "board.mk", a ".c", ".h", "Config.in.board", and "Config.in.boardname".
2. Create the necessary default configuration files such as "df_uboot_defconfig" in your new board directory.
3. Add(source) your board's "Config.in.board" in "contrib/board/Config.in.board" file.
4. Add(source) your board's "Config.in.boardname" in the "contrib/board/Config.in.boardname" file.
5. Add your board's ".h" in the "contrib/include/contrib_board.h" file.
6. Run "make df_uboot_defconfig" with your new name.
7. Type "make", and you should get the final .bin image can be found under the binaries/ directory.

6 Contributing

To contribute to AT91Bootstrap you should submit the patches for review to the github pull-request facility directly or the forum. And don't forget to Cc the maintainers.

AT91 Forum:

http://www.at91.com/discussions/

Maintainers:

Eugen Hristev eugen.hristev@microchip.com

Nicolas Ferre nicolas.ferre@microchip.com

When creating patches insert the [at91bootstrap] tag in the subject, for example use something like:

git format-patch -s --subject-prefix='at91bootstrap][PATCH' <origin>

-End-