Project

General

Profile

Das U-Boot Port

git://support.criticallink.com/home/git/u-boot-mityarm-335x.git

Please familiarize yourself with the TI port of u-boot described here
as the Critical Link MitySOM-335X port is based on the TI port, and many of the AM335X processor specifics are detailed on the TI wiki.

Branch Description

  • u-boot-2013.10 Notes: Extensions to the mainline 2013.10 denx.de branch supporting both the MitySOM-3359 SOMs containing DDR2 and MitySOM-3354/2 SOMs containing DDR3. This is currently the suggested branch as it is most up to date and has best support for all our SOMs.
  • AM335XPSP_04.06.00.08 : Extensions to the TI AM335XPSP_04.06.00.08 branch supporting both the MitySOM-3359 SOMs containing DDR2 and MitySOM-3354 SOMs containing DDR3.
  • AM335XPSP_04.06.00.03 : Extensions to the TI AM335XPSP_04.06.00.03 branch supporting the MitySOM-3359 SOMs containing DDR2, used on the TI AM335x SDK version 05.03.02.00. This branch is deprecated by the AM335XPSP_04.06.00.08 branch.

Note: The u-boot-2013.10 branch is required for the latest MitySOM DevKit Part number: 80-000458RH-6

Environment Settings for DevKit

The following u-Boot minimal environment settings / commands are necessary to utilize the full features of the DevKit Linux port. You'll need to add additional options to the bootargs to specify you're boot media. See the examples for booting your kernel up from various boot devices on TI's PSP wiki page.

UBoot# setenv bootargs console=ttyO0,115200n8 mem=256M

In order to use the DVI/HDMI port (via the TFP410) and get the boot splash screen, you'll need to power it up and configure it for the DevKit configuration. The commands below will issue the proper register settings. Note: eventually this should go away as soon as a TFP410 driver is integrated into the kernel.

UBoot# i2c mw 38 8 3D
UBoot# i2c mw 38 33 00

Modification Summary

The following general extensions have been added to the basic u-Boot image from TI:

  • #define CONFIG_MITYARM335X for the MitySOM-335X SoM
  • configure DDR2 DRAM for modules with DDR2 RAM
  • configure DDR3 DRAM for modules with DDR3 RAM
  • disable autoload by default
  • Added prompt for memory type if valid factory configuration is not found.

Importance of Factory Configuration EEPROM

The MLO is dependent on a proper load of factory configuration data on the on-board I2C EEPROM. The factory configuration data includes the serial number, model number, a version number and a checksum. You can inspect and modify (though you should not need to do this) the factory configuration data using the u-Boot "factoryconfig" command provided with CL ported u-Boot code.

Under the new AM335XPSP_04.06.00.08 branch, the u-Boot MLO (first stage bootloader) will read the MitySOM-335X model number from the I2C factory configuration I2C EEPROM at start up. Based on the model number read in, the SPL will configure the external DDR2 or DDR3 appropriately, and setup the default memory parameters for loading a linux kernel. If an invalid factory configuration file is detected, then the MLO will prompt the user (via the console port) for the SOM memory configuration in order to proceed with the boot procedure. This was done in order to allow a common build image to support any MitySOM-335X SOM. However, if the there are problems with the I2C bus or the factory configuration, the boot sequence will be stopped until the user intercedes and provides the u-Boot software with the information needed to continue the boot.

There are some implications with this approach. If you program, using the CL provided "factoryconfig set", the wrong model number into the factory configuration prom, the MLO will attempt to configure the device with the wrong DDR configuration and you will effectively brick your board. Normally, this should not be an issue as the factory configuration PROM should be programmed at factory and there should be no need to modify this PROM. However, if the PROM is modified with an incorrect model you can recover by using an MLO that has been compiled to prompt for a valid DDR configuration all the time, or one that has been configured specifically for your model. There compile options are described below. There are some pre-built images included on this wiki page (below) as well.

If you desire to disable this feature, you can rebuild this branch with the following #defines place in config.h in order to force the DRAM configuration to be consistent with your production module configuration.

/* define this to indicate that the SPL should not prompt 
 * for a memory setting if it can't find a valid one
 */
#define CONFIG_OVERRIDE_EEPROM 
/* Select *one* of these defines based on your module type,
 * if none are selected, the MLO will always prompt for 
 * DDR configuruation */
#define CONFIG_DDR3_256MB
#define CONFIG_DDR3_512MB
#define CONFIG_DDR3_1GB
#define CONFIG_DDR2_256MB

NOTE: 2013 - If you have received a DDR3 module and installed it into an older DevKit originally shipped with a DDR2 module installed, YOU WILL NEED TO INSTALL A NEWER MLO ONTO YOUR SD-CARD TO BOOT THE NEWER DDR3 BASED MODULE.

Building u-Boot

To download your own copy of u-boot run:

#bash> git clone git://support.criticallink.com/home/git/u-boot-mityarm-335x.git u-boot-mityarm-335x
#bash> cd u-boot-mityarm-335x
#bash> git checkout -b  u-boot-2013.10 origin/u-boot-2013.10

This will download the repository and check out the u-boot-2013.10 branch from the server. Please note that if you intend to make changes, etc., you will need to become moderately familiar with the git tool (see Information on git).

To compile u-boot you will need to install the ARM cross tools (which get generated from the open-embedded Cross Tools step, or you may use tools from places like CodeSourcery) and ensure that the gcc ports are available on your $PATH.

MDK Release September 2015 or Newer (Yocto)

user@host: . /opt/criticallink/mitysom-335x_20151118/environment-setup-cortexa8t2hf-vfp-neon-criticallink-linux-gnueabi
user@host: unset LDFLAGS
user@host: alias makearm='make ARCH=arm CROSS_COMPILE=arm-criticallink-linux-gnueabi-'
Older TI SDK Release
user@host: . /usr/local/ti-sdk-am335x-evm-05.03.02.00/linux-devkit/environment-setup    # establish proper toolchain
[linux-devkit]:~> alias makearm='make ARCH=arm CROSS_COMPILE=arm-arago-linux-gnueabi-'

Now you are ready to configure and compile the u-boot image.
In u-boot-2013.10 branch three configs are available:
  • mityarm335x - Config for 3359 modules and 3354/2 modules with 256MB of NAND.
  • mityarm335x_askram - Config set to ask user for ram config on boot.
  • mityarm335x_4kpage - Config for 335x modules with 512MB of NAND.
  • mityarm335x_1gb_nand - Config for 335x modules with 1GB of NAND

Example shown for mityarm335x config option

#bash> make distclean
#bash> makearm mityarm335x

If successful, there will be several files created under the mityarm335x directory.
  • spl/u-boot-spl.bin - The second-stage bootloader (a stripped down version of u-boot that fits in SRAM).
  • MLO - spl/u-boot-spl.bin with a GP image header prepended to it.
  • u-boot.img - The full-fledged u-boot image.

NAND

This section outlines the configuration of the NAND device in u-boot (which corresponds to the NAND MTD parts in the default Critical Link built Linux kernel).

Note: Offset fields must be aligned with 0x800 (2048) bytes. On writing 3000 (0xbb8) bytes, len field can be aligned to 0x1000 ie 4096 bytes.
Offset field should be aligned to page start address, multiple of 2048 bytes.

Note: The MLO and U-Boot images shipped with the MitySOM-3359 Development kit currently (7/15/2012) do not support booting from NAND. Updated images can be found in the files section under Dev Kit SD Card - 3.2 Kernel.

NAND Layout

See UBIFS_Nand_Boot

Reflashing U-Boot

If you need to reflash the u-boot image to your board, you can follow the instructions below. WARNING: failure to perform this step correctly will "brick" your board. The procedure for recovering a bricked module is dependent on the carrier board setup (or you can return it to Critical Link for servicing).

If you are using the Critical Link dev board, u-boot and the MLO are stored on the SD card, and can simply be updated on the card. Check the TI AM335x U-Boot User's Guide if you are booting from flash or other external boot devices.

Writing to NAND

U-Boot provides a whole set of commands for manipulating the NAND device on the MitySOM-335X SOM. The command

help nand

will detail its usage for you.

See UBIFS_Nand_Boot for full details on creating a full nand boot scenario on both the 256MB and 512MB Nand parts.

There are a number of different boot modes that the AM3359 part supports that include booting from NAND. The commands illustrated herein have been checked out using the boot mode 0x3E4 (001111100100). If you are using the Critical Link Development Kit baseboard, this corresponds to the BOOTCONFIG jumpers as follows

001001111100 (bit 0 on the left)
JJOJJOOOOOJJ (J = jumper, O = open)

The commands I used were:
U-Boot# dhcp

For the MLO:
U-Boot# mw.b 0x82000000 0xFF 0x20000
U-Boot# nfs 0x82000000 10.0.0.87:/export/home/iskander/projects/335x/u-boot-mityarm-335x/mityarm335x/MLO
U-Boot# nand erase 0x0 0x20000
U-Boot# nand write.i 0x82000000 0x0 $filesize

For u-boot img:
U-Boot# mw.b 0x82000000 0xFF 0x80000
U-Boot# nfs 0x82000000 10.0.0.87:/export/home/iskander/projects/335x/u-boot-mityarm-335x/mityarm335x/u-boot.img
U-Boot# nand erase 0x80000 0x80000
U-Boot# nand write.i 0x82000000 0x80000 $filesize

Writing to SD card

If you are booting from an SD card (as shipped from Critical Link), you can simply replace the MLO and u-boot.img files on the first partition of the SD card. This partition is a FAT partition and can be written to from linux or windows (or many others).

Preparing a new SD card

The TI web site has information on building an SD card that is bootable and contains a linux filesystem (see http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User%27s_Guide#Setting_Up_Boot_Environment_on_SD_Card )

There are also a couple of scripts in a tar file on the files section to help with this process.

These scripts are also available in the files section under Dev Kit SD Card - 3.2 Kernel. These zips have the full filesystem and boot partition files to create our devkit sd cards. popsd has been renamed to populate_am335x_dev_sd in these zips.

The mksd script will just format an SD card in a suitable fashion (a boot partition, a rootfs partition, and a spare partition).
The popsd script uses mksd to format the SD card and will then install the images on it.

Usage: mksd <MMC device>
        <MMC device> is the path to the /dev device for the SD card

Usage: popsd [opts] <MMC device>
    -h|--help        Print this help
    -b|--bootdir           Directory containing boot files
    -c|--continuous  Continue and make multiple copies
    -f|--force       Don't ask.. just do it
    -v|--verbose     Be more verbose when working
    -m|--mount=<mount point> mount the disk at mount point
    -r|--rootfs=<rootfs tarfile> Use the specified tar file for root fs
    -p|--probe       Find mmccards and exit
    -N|--noformat    skip formatting SD card
        <MMC device> is the path to the /dev device for the SD card

BE VERY CAREFUL WHICH DEVICE TO TELL THESE SCRIPTS TO WORK ON... You dont want to format your linux machine!!!

Note that you can use loadb, fatload, tftp, nfs, etc to get the images into RAM, and that the particulars of the NFS command are specific to the environment at Critical Link.


UART boot

Loading u-boot over UART: http://processors.wiki.ti.com/index.php/AM335x_U-Boot_User's_Guide#Boot_Over_UART

Pre-Built UBoot and MLO for MitySOM-335x Modules (DDR2/3)

Critical Link has made available two pre-built versions of UBoot and the MLO available for our users. One version is meant to be used with modules that have 256MB of NAND storage or LESS on the module and another version for modules with 512MB of NAND storage. In the future a single unified UBoot and MLO will be made available.

  • 256MB of NAND or LESS (DDR2/3)
  • 512MB of NAND (DDR2/3)
    • UBoot, MLO (Always prompt for DDR memory type) and MLO (Read EEPROM configuration memory type)

Go to top
Add picture from clipboard (Maximum size: 1 GB)