PHYTEC's EEPROM Flashtool was designed to simplify the configuration of phyCORE-AM57x SoM variants. This is achieved by using the SoM's EEPROM device to store it's configuration, which is used at boot to configure the target's device tree binary, RAM settings, etc. accordingly. This allows OEMs to deploy a single image that supports multiple hardware targets.
This How to details the use of the PHYTEC EEPROM Flashtool with PHYTEC AM572x SOMs. The structure, content, and process for using the EEPROM data is described and examples of how PHYTEC uses the EEPROM data to facilitate hardware bring-up are provided.
If using BSP-Yocto-TISDK-AM57xx-PD18.1.0 pre-built images and your kernel build timestamp is older than:
"Linux version 4.9.41-ga962b18-BSP-Yocto-TISDK-AM57xx-PD18.1.0 (jenkins@jenkins1-build-machine) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #1 SMP PREEMPT Thu Jan 25 20:39:40 PST 2018"
you must upgrade the PHYTEC EEPROM Flashtool on the target before following this guide. Click here to manually update the tool.
Configuration Files Format
The EEPROM Flashtool configuration files are text files comprised of sections, properties, and values. For this How to, we will use the PCM-057.ini configuration file to detail the function and population options of each section. A section is indicated by a set of square brackets that enclose the name of that section. A property and value pair in any given section is formed as 'property: value'. A general example is given below:
Required Configuration File Sections:
In each required section below, a description of the section is given and its options follow.
This section and all of the following properties are required for all configuration files to specify the basic configuration of the SOM and how to properly parse the rest of the configuration file.
- i2c_bus: This is the I2C bus on which the EEPROM resides in decimal format.
- i2c_dev: This is the I2C device ID for the EEPROM in hex format.
- eeprom_offset: This is the offset at which the EEPROM data will be written. This should be set to zero for use with PHYTEC BSPs. Decimal format.
- kit_options: This is the number of possible kit options for any given PHYTEC SOM. AM572x-based PHYTEC SOMs have nine kit options. Decimal format.
mod_version: This is the number associated with the module type (see table below). AM572x-based PHYTEC SOMs are of the PCM type. Decimal format.
Module Type Value PCM 0 PFL 1 PCA 2
This section is required for all configuration files to specify the names of the kit options for each given configuration file. The number of properties in this section should match the number specified in the kit_options property of the PHYTEC section above. Each property in this section must be a number that corresponds to the zero-based index of the kit options specified by the BOM. The value for each property corresponds to the plain-text name for a kit option. Kit options and their value pair for AM572x-based PHYTEC SOMs are listed in the table below.
|Kit Option Index (property)||Kit Option Name (value)|
This section is required for all configuration files to specify the known (and allowed) kit options and BOM revisions to be used with the EEPROM Flashtool. Each property in this section is a string that represents a set of kit options and the value for each property represents the maximum known BOM revision for that set of kit options. A property in this section can be a KSP number, such as KSP01, but the following KSP section must be populated with the same KSP number or the EEPROM Flashtool will fail.
This section is required for all configuration files that have KSP properties in the above Known section. Each property in this section is a string that corresponds to the KSP number and the value for each property is a string that represents the kit options for the KSP. The value for all properties in this section should exactly match with a property in the Known section.
Kit-specific Configuration File Sections:
One section must be added to the configuration file for each entry in the above Kit section. An added section name must exactly match the value of a property in the Kit section. Each kit-specific configuration file section will describe the kits listed in the 'Kits' section.
EEPROM Data Layout
The PHYTEC EEPROM data layout is a 32-byte structure located at offset 0 on the EEPROM. The following table details each entry in the structure for the PHYTEC AM572x SOM EEPROM layout.
|1-4||header||PHYTEC EEPROM header. Unsigned 4-byte integer.|
|5||api_version||PHYTEC EEPROM layout API version. Unsigned 1-byte integer.|
|6||mod_version||0: PCM, 1: PFL, 2: PCA. Unsigned 1-byte integer.|
|7||som_pcb_revision||PHYTEC SOM PCB revision. Unsigned 1-byte integer.|
|8-13||mac||MAC ID for primary ethernet port. Six unsigned 1-byte hex values.|
|14||ksp||0: No KSP, 1: KSP, 2: KSM. Unsigned 1-byte integer.|
|15||kspno||Number for KSP/KSM module. Unsigned 1-byte integer.|
|16-26||kit_opt||Set of kit options. For the AM572x, this is an 11-character ASCII string with no null termination.|
|27-31||reserved||Reserved bytes that may be utilized by customers or by PHYTEC in a newer PHYTEC EEPROM API version.|
|32||bs||The number of bits set in all of the preceding bytes. Unsigned 1-byte integer.|
If you would like to utilize the reserved space for your own identification purposes, feel free to do so but be aware that the PHYTEC EEPROM Layout API may change in the future. Additionally, the PHYTEC EEPROM Flashtool will need to be modified to accommodate the reading, writing, and display of this new data.
Using the EEPROM Flashtool
If you are working with a custom SOM or a SOM with an EEPROM that hasn't been programmed, you will want to flash your EEPROM using the EEPROM Flashtool. This section will detail where the EEPROM Flashtool and default configuration files are located and how to properly use the tool.
In the PHYTEC Linux BSP filesystem, the EEPROM Flashtool is located in /usr/bin/phytec-eeprom-flashtool/ and its configuration files are located in /usr/bin/phytec-eeprom-flashtool/configs/. By default, the EEPROM Flashtool directory is not present in the root user's path. Run the following command to add the EEPROM Flashtool directory to your path:
The use of the EEPROM Flashtool is simple. From the README:
Supported SoM PCB revisions can be found in the BSP's Release Notes.
In the above examples, the read, display, and write commands all look to the configuration file specified by the SOM argument or the first seven characters of the BOM argument. This configuration file is PCM-057.ini for the above examples because of the given arguments. This configuration file may be edited to suit your needs, or a new configuration file may be created by referring to the section and then used by modifying the example commands.
Using the EEPROM Data
Once the EEPROM has been programmed with the correct options for your SOM using the EEPROM Flashtool, you may use the stored data to configure the board as you see fit. Currently, PHYTEC uses the EEPROM data to configure the RAM size and timings, whether ECC support is enabled, and to set the board name. Examples of the use of the EEPROM data can be found in the uboot-phytec Git repo. The following links will provide relevant commits for reference:
- PHYTEC EEPROM reading and writing functions
- RAM size, timing, and ECC support detection
- Set board name dynamically
Getting the Script
PHYTEC's EEPROM Flashtool script can be downloaded at the following address: