/dra7xx-hello

Minimal firmware for DRA7 SoC to print "Hello world" in serial console

Primary LanguageCGNU General Public License v2.0GPL-2.0

Description
-----------

This is bare-metal firmware intended for DRA752 ES1.0 SoC.
It contains minimal code to initialize system and write some text to
serial console (via UART1, but it can be changed to UART6).

Just insert SD card with MLO file from this project and boot from it
(press "Reset" button or something like this).

Note that in case of NOR boot you can't modify .data and .bss sections from
code, because you can't just write to NOR flash using STR instruction.


UART number
-----------

One can choose which UART module to use in include/config.h.
Change CONSOLE constant appropriately.


Toolchain
---------

To build this application, bare-metal toolchain must be used
(like "arm-none-eabi").

How to configure toolchain:
 - export CROSS_COMPILE environment variable with corresponding prefix in it
   (e.g. "arm-none-eabi-")
 - append absolute path for toolchain's "bin" directory to PATH environment
   variable


mkimage
-------

In order to boot from SD card or eMMC chip, MLO file must be created
and placed into first partition (which must be formatted as FAT32).

"mkimage" tool should be used to create MLO file. This tool can be
found inside of your built "u-boot" directory or it can be installed like this:

    $ sudo aptitude install u-boot-tools


Build
-----

1. Build for boot from SD card or eMMC chip:

   $ make MLO


2. Build for boot from NOR flash (XIP):

   $ make BOOT=2


Uploading images
----------------

1. For boot from SD card or eMMC chip:
   just copy "MLO" file to the root directory of first partition (which must be
   formatted as FAT32).

2. For boot from NOR flash (XIP):
   write "dra7xx-hello.bin" file into beginning of NOR flash. It can be done
   for example from u-boot shell using next procedure:

   # protect off all
   # erase 0x08000000 +0x80000
   # mmc rescan
   # load mmc 0 ${loadaddr} dra7xx-hello.bin
   # cp.b ${loadaddr} 0x08000000 ${filesize}

   In this example:
     - "dra7xx-hello.bin" file must reside on SD card from which u-boot was boot
     - NOR flash mapped to 0x08000000 address


Porting
-------

This code can be easily adopted to use with any of OMAP-based SoCs:
 - check include/config.h addresses
 - check addresses in src/serial.c
 - check addresses in src/board.c
 - check clocks setup and pins muxing in src/board.c
   (look into s_init() function in your u-boot for insights)


Credits and licensing
---------------------

Project author: Sam Protsenko <joe.skb7@gmail.com>.
Most of code was borrowed from "u-boot" project, from omapzoom.org (GPLv2),
so this project license is GPLv2.