This document serves as a technical reference document on how to build the Board Support
Package (
already provided by NXP[1, 2].
The TrustBox features a QorIQ LS1012A processor[3] that contains a single Arm Cortex-A53 core.
NXP provides two flavours of
Software Development Kit (
introduced Layerscape Software Development Kit (
Yocto Project [4], whilst the
This document assumes the reader has a basic knowledge of platform software and deployment,
and it will not go into too much detail of the actions performed to build the
currently only describes building the BSP through the
information on the Yocto based
however this document only focusses on a specific release version. Contact Scalys when updates
are desired.
BSP
) for the Scalys TrustBox. It is meant to supplement the available documentation
BSP
for this specific processor. The first being the Yocto based Linux
SDK
) for QorIQ processors and the second flavour is the more recently
LSDK
). The QorIQ Linux SDK is based upon the
LSDK
is based on a more disaggregated flex-building environment [5].
BSP
s. This document
LSDK
method. Contact Scalys for more
SDK
. Additionally, NXP intends to update the
LSDK
regularly,
RevDateDescription
1.429thMay,
2019
1.34thMay, 2019Updated in accordance with new lsdk19.03
The following stepwise guide primarily follows the steps given in the
depth information regarding the LSDK flexbuild environment can be found in the NXP manual[2] and
the REAMDE.md file found in step 6 below. For compatibility reasons we will choose to use an
Ubuntu 18.04 Docker container in the flex-build environment, which allows for the use of Linux
distros other than Ubuntu 18.04 on the host machine.
In the this section we will build our LSDK Root File System (
and device tree. Note that only a subset of the default
TrustBox.
1. Begin with creating a working directory in your home directory:
mkdir -p ~/trustbox/ && cd ~/trustbox
2.
Setup Docker on the host machine. If not already installed, then do so from your package
manager. Add your user to the docker group.
sudo addgroup --system docker
sudo usermod -aG docker <accountname>
sudo gpasswd -a <accountname> docker
sudo service docker restart
Make sure to logout once to apply the changes to your user.
3. Clone bsp-lsdk repository from the Scalys github page to your working directory:
git clone https://github.com/Scalys/bsp-lsdk.git
RFS
LSDK
LSDK
documentation. More in-
) which includes the Linux kernel
commands is supported for the
4. Switch to the release branch:
cd bsp-lsdk && git checkout trustbox-1903
5.
Manually download the flexbuild_lsdk1903.tgz tar-ball[6] from the NXP webpage and put it
into the bsp-lsdk directory:
• Source: Layerscape Software Development Kit (rev 19.03)86.1 KB
Alternatively, append the ’-B menuconfig’ argument to modify the default configuration or
use ’-B fragment:"defconfig <custom.config>"’ to specify custom configuration files.
10. The next step is compiling apps:
flex-builder -c apps -m trustbox
11. Merge components into the RFS:
flex-builder -i merge-component -m trustbox
12. Leave the docker environment
exit
Now that we have a
RFS
prepared, we have the option to go directly to section 5.1 in order to
prepare the SD card for the TrustBox or continue with the following sections to build and modify
U-boot and the Linux kernel.
Modifying the Linux kernel to your requirements is recommended to do within the flexbuild. Refer
to the official NXP guide[2] to get more details on how to accomplish this. In this section we will
show how to build a Linux kernel in a stand-alone fashion.
Start by cloning the correct Linux kernel repository (with the appropriate branch) from the Scalys
github page. For this example we take the kernel used in the
make sure you also use the associated RFSfor it to work.
git clone https://github.com/Scalys/linux-qoriq.git -b trustbox-1903 && cd linux-qoriq/
Configure the kernel:
CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 make defconfig lsdk.config trustbox.config
Optionally, we can now configure and modify the kernel manually with:
CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 make menuconfig
Build the kernel:
CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 make -j 8
LSDK
with the TrustBox patches, so
Convert the kernel image to the uImage format:
CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 mkimage -A arm64 -O linux -T kernel -C gzip \
-a 0x80080000 -e 0x80080000 -n Linux -d arch/arm64/boot/Image.gz uImage
Install the generated files in the RFS, e.g. on the SD card:
Composite firmware consists of rcw, pbi, u-boot, Ethernet MAC/PHY firmware and PPA image. To
generate LSDK composite firmware for Layerscape platform, directly run the following command:
flex-builder -i mkfw -m trustbox -b qspi
Finally you can find composite firmware at build/images/trustbox/. This image can be programmed
at offset 0x0 in flash device manually or by using the special command that implemented in
U-boot environment (see section 5.2). Standalone firmware components also can be found at
build/images/trustbox/components.
The LS1012A processor requires a valid Reset Configuration Word Reset Configuration Word (
in order to be successfully initialized at boot time. The current revisions of the processor support
reading the
hardcoded source. The TrustBox by default selects the QSPI device as the
is a set of 64 bytes, which define how the LS1012A and its interfaces are configured. The Pre-Boot
Loader (
Instructions (PBI) from the chosen source.
The TrustBox by default comes with an RCW configuration with the following main features:
• SATA configuration on the M.2. port;
• I2C and DSPI configured on the 26-pins header.
3.1.1Building RCW binary
To build the RCW binary in LSDK, direclty run the following command:
flex-builder -c rcw -m trustbox
Then you can find binaries at build/firmware/rcw/trustbox/. Directory N_SSNH_3308 contains the
RCW binaries that configure M.2 in compilance with SATA, binaries from N_SSNP_3305 configure
M.2 as PCI-e. Digits in the file names mean maximal processor frequency. For example file located
at N_SSNH_3308/rcw_800.bin.swapped configures M.2 connector as SATA and sets maximal
LS1012A frequency at 800MHz.
Note: Only files marked as swapped are suitable for RCW rewriting!
RCW
from two sources only. Namely an external QSPI flash device and an internal
RCW
source. The
PBL
) reads these 64 bytes along with any appended Pre-Boot Instructions Pre-Boot
RCW
RCW
)
3.1.2Modifying the Reset Configuration Word
When the two default RCW options are not sufficient we can modify it using the following steps:
1. Clone rcw repository from the Scalys github page:
git clone https://github.com/Scalys/rcw.git -b trustbox 1903 && cd rcw/trustbox
2.
Create your own
from rcw/trustbox/N_SSN* may be used as example.
3. Add RCW source path to rcw/qspi_swap_list.txt file.
4. Then enter rcw/trustbox directory and run the following command:
make
5.
On success you will get two RCW binaries. Remember that the only swapped binaries are
suitable for rewriting.
The rescue flash is read-only by default and contains a U-boot binary to recover the Tustbox
primary flash. It also holds unique board configuration data, such as MAC addresses and manufacturing data. Contact Scalys for more information regarding the rescue flash memory.
By default the TrustBox will attempt to boot the Linux kernel from an SD card. Without modification
it requires the first partition to be formatted into a ext4 filesystem. You can accomplish this with,
for instance, the fdisk+mkfs.ext4 command line tools or the gparted tool.
Mount the SD card and go to your flexbuild folder and enter the following commands:
cd build/rfs/rootfs_lsdk_19.03_LS_arm64/
sudo rsync -avx --progress ./ </mount/location/of/sdcard/>
#This will take several minutes depending on your system and sdcard.
sync
Wait for complete synchronisation before unmounting the SD card. Alternatively, if we have a
compressed RFS image we can also simply extract the file onto the empty prepared SD card.
5.2Updating partitions on the primary flash
The default U-boot image on the TrustBox has a set of environment variables to update the
partition data in the primary flash memor y from external sources. The default supported sources
are:
tftp
Refer to section 6.1 to setup the TFTP server.
mmc
By default the variables expect the first partition on the SD card to be formatted with an ext4
filesystem.
usb
By default the variables expect the first partition on the USB memory stick to be formatted
with a fat32 filesystem.
If the updated files are put in a subdirectory on the source then you have to ensure that the
’update_files_path’ U-boot environment variable is matched correctly. By default this variable is
set to ’.’. It can be modified using the ’editenv’ command in U-boot.
Updating the u-boot target partition requires the file named ’u-boot-with-pbl.bin’ to be available
on the chosen file source. The ppa target partition requires the file named ’ppa.itb’, and the pfe
target partition requires the file named ’pfe_fw_sbl.itb’[7]. The image target reques the file named
trustbox_qspi_fw.itb, it consists of a composite firmware (contains u-boot, pfe and ppa partitions)
that could be generated in LSDK.
Each of these variables can be executed using the following command:
Chapter 5. Installing and updating imageswww.scalys.com
run update_<source>_<target>_qspi_nor
These variables can be modified to change the partition index or filesystem type using the U-boot
editenv <variable> command.
5.3Recovering from the rescue flash
The primary flash memory data may become corrupted during usage. The TrustBox therefore
includes a back-up U-boot image on a read-only rescue flash memory, that may be used to write
correct data onto the primary flash memor y1. To boot from this rescue flash the following two
steps should be performed:
1. Connect the TrustBox to your host PC and open the terminal application.
2. Press and hold switch ’S2’ on the TrustBox.
3. Power-up (or reset with switch ’S1’) the TrustBox.
4.
Release switch ’S2’ once U-boot prints the message: ’Please release the rescue mode button
(S2) to enter the recovery mode’. Note that this will take a few seconds as this rescue flash
is slower.
After performing these steps the user should be able to program the primary flash memory using
the commands described in the previous section 5.2.
1
Note that when burning specific secure boot fuses that this feature will become inaccessible unless the contents of
Chapter 6. Configuration necessary for a TFTP bootwww.scalys.com
6.2DHCP Server installation and configuration
Install the DHCP server (if not already done):
sudo apt-get install isc-dhcp-server
edit the ’/etc/network/interfaces’ file, where ’eth1’ is the chosen interface to the board:
# Make sure the network ranges match your host system!
auto <interface>
allow-hotplug <interface>
iface <interface> inet static
address 192.168.1.1
netmask 255.255.255.0
and edit the ’/etc/dhcp/dhcpd.conf’ file:
default-lease-time 600;
max-lease-time 7200;
# Optionally, we can assign static addresses for the targets
host <target_hostname> {
7.1What is the default login of the LSDK/QorIQ SDK?
BSP User guide
May 29, 2019
For the LSDK built
default login is simply root. It is recommended to change the password after your initial login!
RFS
the default login is root with the password root. For the QorIQ SDK
RFS
the
7.2How to connect to the TrustBox?
7.2.1Serial por t connection
Connect the TrustBox to your host PC with the micro usb port. Verify that a serial device
has been successfully added. Note that for Windows 10 based hosts you may have to manually install the drivers from: https://www.silabs.com/products/development-tools/software/
usb-to-uart-bridge-vcp-drivers. Using your favourite terminal program, e.g. PuTTY for Windows
or Minicom/Kermit for Linux, you have to open the connection with the serial device with the
following settings: 115200 8N1 with no flow control.
7.2.2SSH connection
There are several ways to achieve this, but for simplicity we will chose a setup without a DHCP
server in the network. Note that by default this connection does not allow access to the U-boot
bootloader.
Using the serial connection described subsection 7.2.1 you should configure the ethernet
interface on your TrustBox with a static IP in the address range of your dedicated network port on
your host PC. To do this we can add the following lines in the ’/etc/network/interfaces’ file:
Now configure the network interface of your host PC with the 192.168.1.1 address and connect
it directly to the TrustBox. Verify that it works by pinging the TrustBox’s address. Note that it
may takes several seconds for the TrustBox to boot completely before the SSH service become
available. Once successfully connected we can open the SSH connection using PuTTY (under
Windows) or the SSH command under Linux with the chosen TrustBox’s address.
7.3Why doesn’t my TrustBox seem to accept my commands on the serial
port?
As mentioned in subsection 7.2.1, make sure to have the correct serial settings and ensure that
you have flow control set to none. For instance, in PuTTY you can achieve this as shown in figure
7.4Why doesn’t my TrustBox produce any output data on the serial
interface?
Firstly make sure you have the correct power supply for the TrustBox, or else it might not boot
fully. Even though the green power LED is lit it might not be enough for all the interfaces on the
TrustBox. Refer to the TrustBox User manual for specific information on the power supply.
Next we should also rule out any problem with the serial interface configuration. Refer to
subsection 7.2.1 for more information.
One last option would be to verify that the rescue boot mode doesn’t produce any output either.
Refer to section 5.3 on how to achieve this. If this works then try reprogramming the primary flash
from this rescue boot.
If none of these steps work then contact Scalys to resolve your issue.
7.5The ethernet interfaces of the PFE are not working?
The
PFE
on the LS1012A processor requires firmware to operate. For U-boot it requires the ’pfe_fw_-sbl.itb’ image (see section 5.2 on how to program it) and under Linux the ’ppfe_class_ls1012a.elf’
and ’ppfe_tmu_ls1012a.elf’ files in the ’/lib/firmware/’ directory. These files can be retrieved from
the
LSDK
github page[6].
before booting a Linux kernel
of the TrustBox.
Note that it is required to execute the command ’pfe stop’ in U-boot
. This has already been included for the default boot command(s)
7.6Bluetooth can’t find any devices?
The default bluetooth kernel driver doesn’t initialize the RF-component of the combined WiFi/BT
module properly. You first need to initialize it through the WiFi driver, e.g.:
Note that the LSDK kernel expects a valid ppa firmware to be available to boot succesfully. You
can generate a default LS1012A ppa binary in the LSDK flexbuild environment using:
flex-builder -c ppa-generic -m trustbox
You can then find the binary under build/firmware/ppa/soc-ls1012/ppa.itb, which may be programmed in the primary flash under U-boot.