• Menu
  • Product
  • Email
  • PDF
  • Order now
  • Using ARM ROM Bootloader on Keystone II Devices

    • SPRACN3 September   2019 66AK2E05 , 66AK2H06 , 66AK2H12 , 66AK2H14 , 66AK2L06 , AM5K2E02 , AM5K2E04

       

  • CONTENTS
  • SEARCH
  • Using ARM ROM Bootloader on Keystone II Devices
  1.   Using ARM ROM Bootloader on Keystone II Devices
    1.     Trademarks
    2. 1  Keystone2 Boot loader Overview
    3. 2  Boot Examples Package Download
    4. 3  Software Dependencies
    5. 4  Supported Hardware
    6. 5  Software Features
    7. 6  Directory Structure
    8. 7  Building the Examples
    9. 8  Description of the Examples
      1. 8.1 Single Stage Boot Examples
      2. 8.2 Multi-Stage Boot Example
      3. 8.3 Boot Media-Specific Details
        1. 8.3.1 SPI Boot Example
        2. 8.3.2 I2C Boot Examples
        3. 8.3.3 NAND Examples
        4. 8.3.4 UART Boot Examples
        5. 8.3.5 Ethernet boot examples
        6. 8.3.6 K2E Ethernet Boot Errata Workaround
      4. 8.4 Flashing and Running Boot Examples
        1. 8.4.1 Dip Switch Settings
        2. 8.4.2 Running I2C EEPROM example
        3. 8.4.3 Running SPI NOR Example
        4. 8.4.4 Running NAND Example
        5. 8.4.5 Running UART Example
        6. 8.4.6 Running Ethernet Examples
    10. 9  Boot Utilities
    11. 10 Frequently Asked Questions (FAQ)
    12. 11 References
  2. IMPORTANT NOTICE
search No matches found.
  • Full reading width
    • Full reading width
    • Comfortable reading width
    • Expanded reading width
  • Card for each section
  • Card with all content

 

APPLICATION NOTE

Using ARM ROM Bootloader on Keystone II Devices

Using ARM ROM Bootloader on Keystone II Devices

The application report is a comprehensive technical manual to leverage the ROM bootloader to boot applications or secondary bootloaders on Keystone II devices like 66AK2H14 and 66AK2E05. This document provides boot examples along with description of boot utilities and setting up TI supported evaluation platforms to test the sample software.

Additionally, some of the frequently asked questions are addressed around this topic along with additional references to Processor SDK in the SDK documentation on ti.com to design your system boot.

The document is meant to be used as an addendum document to ARM Bootloader User Guide for KeyStone II Devices. The Processor SDK also provides secondary bootloaders that enable developers to enable two stage application booting, which allows for customization of the system boot beyond the capabilities of the ARM® ROM bootloader

Trademarks

Code Composer Studio is a registered trademark of Texas Instruments.

ARM is a registered trademark of Arm Limited (or its subsidiaries) in the US and/or elsewhere.

Linux is a registered trademark of Linus Torvalds in the U.S. and other countries.

All other trademarks are the property of their respective owners.

1 Keystone2 Boot loader Overview

Keystone II bootloader overview and details are covered in the collateral and training slides mentioned below:

  • KeyStone II Architecture ARM Bootloader User's Guide
  • Keystone Boot loader Training slides

It is recommended that you review the material provided above before getting started with building the boot examples.

2 Boot Examples Package Download

GIT Repo for Boot Examples

In order to download the software, execute the following in the git bash environment:

git clone git@git.ti.com:keystone2_boot_examples/keystone2_boot_examples.git boot_examples

3 Software Dependencies

Processor SDK RTOS or MCSDK 3.x (Legacy SDK)

MinGW for Windows with msys and make tools installed. OR Linux® machine with Ubuntu 12.04 LTS with wine utility.

TI Arm compiler (typically packaged with Code composer Studio).

4 Supported Hardware

  • K2H EVM rev 1.1 and later
  • K2E EVMs rev 1.0.2.0 and later

NOTE

Ensure that the EVM has the latest UCD and BMC updates as described in the Setup Hardware section.

5 Software Features

  • Boot Utilities to create and format boot images
  • Examples that demonstrate booting K2H and K2E devices from Serial Peripheral Interface (SPI), Inter-Integrated Circuit (I2C), Universal Asynchronous Receiver/Transmitter (UART), Ethernet and NAND. Examples also demonstrate the following features of the BootROM
    • Single and Multi-Stage booting
    • Using Boot Parameter tables to speed up booting from a boot media
    • Using Boot Configuration tables to initialize DDR
  • Examples to demonstrate formatting uboot for above mentioned boot modes

6 Directory Structure

Figure 1 shows the directory structure for the software package. The examples directory is organized to follow the convention.

Boot-examples_dir_struct.gifFigure 1. Boot Example Directory Structure
Device Name (k2h, k2e) ---> Boot Mode (eth, i2c,nand,spi, uart) ---> Example Type (singleStage, multiStage).

Detailed description of the directory structure is given below:

  • docs - directory contains ReadMe documents and the software manifest for the package.
  • common - directory contains source and header files for helper functions that are used by the examples to configure MMU, CACHE, PLLs, UART and to set user defined entry point for their applications.
  • include - directory contains all boot header files that applies to all the devices in the Keystone family.
  • examples - directory contains source for single stage and multi stage boot examples for different boot modes.
    • k2e - directory contains boot examples for K2E devices.
      • build - directory contains linker command files that specify the memory configuration for each examples
      • cfg - directory contains header files that contain ddr configuration tables, boot parameter tables for different boot modes and tiboot.h file defined in the BootROM.
      • [peripheral] - directory contains boot example code for each peripheral (eth, i2c,nand,spi, uart)
        • [example type] - directory contains single stage/mulitstage example binaries.
      • uboot - directory contains build files required to create uboot binaries for different boot media.
    • k2h - directory contains boot examples for K2H devices.
      • build - directory contains linker command files that specify the memory configuration for each examples
      • cfg - directory contains header files that contain ddr configuration tables, boot parameter tables for different boot modes and tiboot.h file defined in the BootROM.
      • [peripheral] - directory contains boot example code for each peripheral (eth, i2c,nand,spi, uart)
        • [example type] - directory contains single stage/multi-stage example binaries.
      • uboot - directory contains build files required to create uboot binaries for different boot media.
    • src - directory contains source for sample applications that demonstrate single stage and multistage booting.
      • singleStage: directory contains source files for Single stage boot example
      • mulitStage: directory contains source files for two stage boot example
  • utils - directory contains the utilities for building boot images
    • byteswap : directory contains the source and binaries for byteswapccs utility.
    • btoccs : directory contains source and binaries for b2ccs,catccs, ccs2bin utilities
    • ccsutil: directory contains source and binaries for ccsAddGphdr,ccsAddGptlr,ccspad utilities

Source files:

  • Stage1.c
  • Stage2.c

Configuration files:

  • paramTables.h Boot Parameter table used for multi Stage boot examples are provided in this file.
  • ddrConfigTable.h: DDR configuration table used in examples initialize are provided in this file.
  • tiboot.h: BootROM header file that contains details of boot parameter structures, configuration tables and BOOTROM call table.

7 Building the Examples

  1. Setting up host environment.
  2. For Windows Environment: The top level directory in the software package contains a file setupMsysEnv that is used to set the path to the environment variables required to build the examples. Set the path to MinGW installation (TOOL_MINGW_DST), TI Arm compiler (ARM_COMPILER_FOLDER) and the platform development package (PDK_PACKAGES) and optionally to the uboot source directory.

    NOTE

    PDK_packages must point to path to the packages folder in the PDK directory.

    For Linux Environment: The top level directory in the software package contains a file setupLinuxEnv that is used to set the path to the environment variables required to build the examples. Set the path to TI Arm compiler (ARM_COMPILER_FOLDER) and the platform development package (PDK_PACKAGES) and optionally to the uboot source directory.

    NOTE

    For Linux environment, using the boot utilities requires wine utility. If you do not have this installed, install the utility by executing following instruction on your Ubuntu machine.

    sudo apt-get install wine

    PDK_packages must point to path to the packages folder in the PDK directory.

  3. In order to build the examples for all the supported keystone platforms, you can execute "make all". In order to build uboot binaries in addition to boot examples, you can execute "make k2h_uboot" or "make k2e_uboot".
  4. Top level make file supports the following targets:

    k2h_examples : Builds examples for K2H devices k2e_examples : Builds examples for K2E devices utils : Builds boot utlities k2h_uboot : Builds uboot binaries for K2H devices k2e_uboot : Builds uboot binaries for K2E devices

    NOTE

    In Linux environment, if you see errors related to environment variables, check your path to the tools. If that is accurate, ensure that you have saved the file in unix format.

    :set fileformat=unix :wq

8 Description of the Examples

The software packages contains two types of examples single stage boot examples and multistage boot examples.

8.1 Single Stage Boot Examples

Single stage boot examples demonstrate booting the K2 devices directly from the boot media specified by the boot mode pins using the default settings specified by the boot parameter loaded by the BootROM. For default boot parameter settings used by the bootROM, see the device-specific data manual. The sample application is designed to wake up the secondary Arm core upon boot and then initializes the UART to print message when each core wakes up. Each Arm core will send a message over UART: "Core n standing by..." where n is the Arm core number.

8.2 Multi-Stage Boot Example

The multistage boot example demonstrates two stage booting the K2 devices using functions in BootROM call table. The first stage is loaded from the boot media specified by the boot switches using default bootROM parameter tables. The first stage code replaces the default fields in the boot parameter table and re-enters boot to load the second stage. This process is used in-order to modify the default boot process in cases where you need to speed up the boot speeds, boot from a different offset in the flash memory, load code into DDR memory or to perform time critical application specific initialization that may be required without waiting for the entire application to load. The second stage initializes wakes up secondary Arm core and initializes the UARTs and prints messages when each Arm core wakes up.

For details regarding the organization of the boot image for specific boot mode, see the makefile in the path examples/<device>/<peripheral>/multiStage.

8.3 Boot Media-Specific Details

8.3.1 SPI Boot Example

SPI boot is a general-purpose boot mode in which the Boot ROM configures the PLL in bypass mode. The Boot ROM loads the image from the base of the SPI NOR flash. In the multi-stage boot example, the first stage loads the boot parameter table that forces the Boot ROM to configure the PLL and load the seconds stage at 100 Khz. The second stage is loaded at an offset of 0x1000 in the SPI NOR Flash.

 

Texas Instruments

© Copyright 1995-2025 Texas Instruments Incorporated. All rights reserved.
Submit documentation feedback | IMPORTANT NOTICE | Trademarks | Privacy policy | Cookie policy | Terms of use | Terms of sale