U-Boot Porting

From Linux/Xtensa
Jump to navigation Jump to search

WORK IN PROGRESS

Adding a new Platform (Board)

  1. add a line for the name of board and cpu to $UBOOT/boards.cfg
  2. create a configuration file for the board


Edit boards.cfg

Add a line to the bottom of the boards.cfg file describing the new board and processor.

  • BOARD-NAME: Name of the board. This name is usually also used for the target name.
  • CPU-NAME: Name of the processor (Xtensa configuration); must match the directory name cpu-CPU-NAME.
  • VENDOR-NAME:
BOARD-NAME                  CPU-NAME    xtensa      BOARD-NAME          VENDOR-NAME
#Target                     ARCH        CPU         Board name          Vendor         SoC         Options

Create a configuration file for the board

include/configs/ directory, which is typically named after the board: <board>.h . This file contains various board-specific macro definitions, such as FLASH location, device registers, etc.

You should include addrspace.h from the Xtensa include directory. This file provides macros to

#include <asm/addrspace.h>


OLD INFORMATION

The easiest way to add new platform to U-Boot is usually to start from a similar board and modify the files as needed. The first step is to add the board to the main Makefile in the root directory.

Unlike other architectures, the processor configurations (variants) are defined inside the Xtensa include directory.

The following version allows for arbitrary Xtensa processor configuration. Instead of make <board>_config , it requires an additional name to specify the <variant>. This is the name of the processor configuration. The configuration make variant_board_config , for example, the following command will configure U-Boot for the xtav60 board with a dc232l processor configuration: make dc232l_xtav60_config

%<board>_config: unconfig
       @$(MKCONFIG) xtensa xtensa xtav60 avnet NULL $(*:_=)
       @echo "VARIANT = $(*:_=)" >> $(obj)include/config.mk


<board>_config: unconfig
       @$(MKCONFIG) xtensa xtensa <board> <vendor> NULL variant


All board specific files are concentrated in one directory (the <vendor> sub-directory is optional):

board/[<vendor>]/<board>

This directory typically contains a README file describing the board and features, files for the build system ( Makefile and config.mk ), and one or more source files to initialize the board.


There is one additional configuration file in the include/configs/ directory, which is typically named after the board: <board>.h . This file contains various board-specific macro definitions, such as FLASH location, device registers, etc.


You should include addrspace.h from the Xtensa include directory. This file provides macros to

#include <asm/addrspace.h>


Adding a new Processor Configuration