Build SECO BSP for i.MX and Rockchip boards

In embedded systems, the Board Support Package (BSP) is the layer of the software that contains hardware-specific drivers and other routines that allow a particular operating system to work in a specific hardware environment, integrated with the software itself.
BSPs are typically customizable, allowing the user to specify which drivers and routines should be included in the build based on their selection of hardware and software options.
SECO also provides a toolchain to build programs to run on the embedded system and other utilities needed to configure the device (while running) along with the BSP.

To perform the following procedure, you will need to install Docker Engine on Ubuntu according to these instructions https://docs.docker.com/engine/install/ubuntu/.

For further information on Docker platform, visit https://docs.docker.com/get-started/overview/.

INDEX

Source code for linux kernel, u-boot and yocto seco layers is available here.


How can I configure my environment with Docker?

To avoid the time consuming setup of the building environment, we distribute it inside a Docker container.

The following table contains the instructions to create the building environment from the Docker container, depending on the product family of the device used.

Product Family

Environment Setup

i.MX6

  1. Download Docker image using:

    docker pull secodocker/seco-builder:latest
  2. Run previously downloaded Docker image:

    docker run --rm -it -v ${PWD}:/workdir --workdir=/workdir secodocker/seco-builder:latest
  3. Source 32-bit i.MX6 build environment:

    source /toolchain/scripts/setup-bsp9-imx6

i.MX8

  1. Download Docker image using:

  2. Run previously downloaded Docker image:

  3. Source 64-bit i.MX8 build environment:

Rockchip

  1. Download Docker image using:

  2. Run previously downloaded Docker image:

  3. Source 64-bit Rockchip build environment:


How can I build SECO U-Boot?

Clone SECO U-Boot from SECO repository

In the following paragraphs, the procedures for selecting the correct defconfig file are different for i.MX6 and i.MX8 based boards. Be careful to follow the right one according to your device.

Procedure for i.MX6-based boards

For i.MX6 Quad, DualLite and Solo CPUs there’s a specific defconfig file for each RAM configuration.
i.MX6 SoloX, on the other hand, has dynamic RAM setup implemented in U-Boot.
U-boot will allocate the RAM memory based on your board configuration with the correct default defconfig file.

The table below shows the correct association RAM Configuration/defconfig file.

Choose the right defconfig file from table below using the following command. After having chosen the right defconfig file, you can build SECO U-Boot.

Device

RAM Configuration

defconfig file

Device

RAM Configuration

defconfig file

μQ7-962

RAM Size=1GB

RAM Configuration=4x256 MB

mx6qdl_seco_uQ7_962_1G_4x256M_defconfig

RAM Size=2GB

RAM Configuration=4x512 MB

mx6qdl_seco_uQ7_962_2G_4x512M_defconfig

RAM Size=512 MB

RAM Configuration=2x256 MB

mx6qdl_seco_uQ7_962_512M_2x256M_defconfig

Q7-928

RAM Size=1GB

RAM Configuration=4x256 MB

mx6qdl_seco_Q7_928_1G_4x256M_defconfig

RAM Size=2GB

RAM Configuration=4x512 MB

mx6qdl_seco_Q7_928_2G_4x512M_defconfig

RAM Size=512 MB

RAM Configuration=2x256 MB

mx6qdl_seco_Q7_928_512M_2x256M_defconfig

RAM Size=4GB

RAM Configuration=8x512 MB

mx6qdl_seco_Q7_928_4G_8x512M_defconfig

μQ7-A75-J

RAM Size=1GB

RAM Configuration=4x256 MB

mx6qdl_seco_uQ7_J_A75_1G_4x256M_defconfig

RAM Size=256MB

RAM Configuration=1x256 MB

mx6qdl_seco_uQ7_J_A75_256B_1x256M_defconfig

RAM Size=512 MB

RAM Configuration=2x256 MB

mx6qdl_seco_uQ7_J_A75_512M_2x256M_defconfig

SBC-A62-J

RAM Size=1GB

RAM Configuration=4x256 MB

mx6qdl_seco_SBC_A62_1G_4x256M_defconfig

RAM Size=2GB

RAM Configuration=4x512 MB

mx6qdl_seco_SBC_A62_2G_4x512M_defconfig

RAM Size=512 MB

RAM Configuration=2x256 MB

mx6qdl_seco_SBC_A62_512M_2x256M_defconfig

SBC-C23

RAM Size=dynamic

RAM Configuration=512MB and 1GB

mx6sx_seco_SBC_C23_defconfig

SBC-B08

RAM Size=dynamic

RAM Configuration=512MB and 1GB

mx6sx_seco_SBC_B08_defconfig

SYS-A62-J

RAM Size=1GB

RAM Configuration=4x256 MB

mx6qdl_seco_SYS_A62_10_1G_4x256M_defconfig

RAM Size=2GB

RAM Configuration=4x512 MB

mx6qdl_seco_SYS_A62_10_2G_4x512M_defconfig

RAM Size=512 MB

RAM Configuration=2x256 MB

mx6qdl_seco_SYS_A62_10_512M_2x256M_defconfig

SYS-B08-7

RAM Size=dynamic

RAM Configuration=512MB and 1GB

mx6sx_seco_SYS_B08_defconfig

Procedure for i.MX8-based boards

For i.MX8 CPUs, dynamic RAM management has been implemented at U-Boot level.

Choose the right defconfig file from table below using the following command for BSP9:

Choose the right defconfig file from table below using the following command for BSP10:

Device

BSP

RAM Configuration

defconfig for i.MX8

Device

BSP

RAM Configuration

defconfig for i.MX8

SM-C12

BSP 9

Dynamic RAM

seco_imx8mq_c12_defconfig

SM-D16

BSP 10

Dynamic RAM

seco_imx8qxp_d16_defconfig

Q7-C25

BSP 9

Dynamic RAM

seco_imx8mq_c25_defconfig

Q7-C26

BSP 9

Dynamic RAM

seco_imx8qm_c26_defconfig

Q7-C58

BSP 9

To be defined

 

μQ7-C72

BSP 9 / BSP 10

Dynamic RAM for i.MX8MM

seco_imx8mm_c72_defconfig

BSP 10

Dynamic RAM for i.MX8MN

seco_imx8mn_c72_defconfig

SBC-C20

BSP 9

Dynamic RAM

seco_imx8mq_c20_defconfig

SBC-C43

BSP 9

Dynamic RAM

seco_imx8qm_c43_defconfig

SBC-C57

BSP 9

Dynamic RAM

seco_imx8qxp_c57_defconfig

SBC-C61

BSP 9

Dynamic RAM

seco_imx8mm_c61_defconfig

SM-D18

BSP 10

Dynamic RAM

seco_imx8mp_d18_defconfig

u-boot.bin and spl/u-boot-spl.bin will be available as outputs.

 

Now you are ready to combine U-boot with other firmware to build the final binary.

Go in the same folder level of U-Boot and execute following command:

Move inside the imx-mkimage folder:

You can build the binary flash.bin launching the script:

The table below summarizes the eligible values to insert in the script, according to the device used.

Device

flash.bin eligible values

Device

flash.bin eligible values

SM-C12

./mk_imximage c12

SBC-C20 with DP Video Output

./mk_imximage c20 dp

SBC-C20 with HDMI

./mk_imximage c20 hdmi

Q7-C25 with DP Video Output

./mk_imximage c25 dp

Q7-C25 with HDMI

./mk_imximage c25 hdmi

Q7-C26

./mk_imximage c26

SBC-C61

./mk_imximage c61

μQ7-C72

./mk_imximage c72

μQ7-C72n

./mk_imximage c72n

SBC-C57

./mk_imximage c57

SBC-C43

./mk_imximage c43

SM-D16

./mk_imximage d16

SM-D18

./mk_imximage d18

 

Procedure for Rockchip RK3399 based boards

For Rockchip RK3399 based boards:

For Rockchip RK3399 Flexy boards:

For Rockchip RK3399 IPC boards:

 

Now jump inside u-boot folder and modify in make.sh script the TOOLCHAIN_ARM64 variable with the right toolchain path from this:

To this path if you use docker:

Then build it using the following command:


How can I build SECO Kernel?

First, clone SECO Kernel from SECO repository executing one of the following command:

  • for i.MX6 and i.MX8-based boards:

  • for Rockchip PX30 based boards:

  • for Rockchip RK3399 based boards:

  • for Rockchip RK3399 Flexy boards:

  • for Rockchip RK3399 IPC boards:

 

Now, depending on your device, choose the right defconfig from Kernel configs folder and build it using the following command:

For Rockchip RK3399 based boards:

For NXP i.MX6 based boards:

For NXP i.MX8 based boards:

Device

BSP

defconfig

Device

BSP

defconfig

i.MX6

BSP 9

imx_v7_defconfig

i.MX8

BSP 9

seco_imx8_defconfig

BSP 10

seco_imx8_linux_defconfig

Rockchip PX30

-

seco_px30_d23-linux_defconfig

Rockchip RK3399

-

seco_rk3399_c31-linux_defconfig

The compiled files are inside of the following folder:

Device

Files & path

Device

Files & path

i.MX6

zImage (kernel image) → arch/arm/boot

.dtb(device tree blob) → arch/arm/boot/dts/

.dtbo (device tree overlay) → arch/arm/boot/dts/overlays

modules (kernel modules) -> modules/

i.MX8

Image kernel image) → arch/arm64/boot

.dtb(device tree blob) → arch/arm64/boot/dts/seco

.dtbo (device tree overlay) → arch/arm64/boot/dts/seco/overlays

modules (kernel modules) -> modules/

Rockchip

Image kernel image) → arch/arm64/boot

.dtb(device tree blob) → arch/arm64/boot/dts/seco

.dtbo (device tree overlay) → arch/arm64/boot/dts/seco/overlays

modules (kernel modules) -> modules/


How can I setup my BSP?

To setup the custom hardware configuration, please follow https://secospa.atlassian.net/wiki/spaces/SECOTech/blog/2021/09/20/770703361 .


How can I build Buildroot filesystem image for Rockchip RK3399?

To build Rockchip RK3399 Buildroot Image please follow these steps inside an ubuntu 18.04:

  • first fetch the rk_rockchip tarball and prepare the environment:

  • then cd into rk_rockchip folder and start the filesystem build:

How can I build Yocto image?

To build the Yocto Image, for i.MX soc based board please follow:

To build the Yocto Image, for Rockchip soc based board please follow: