cgtimx8: SMX8 and QMX8 4.14.98_2.3.2 BSP

Signed-off-by: Alejandro de-Cabo-Garcia's avatarAlex de Cabo <alejandro.de-cabo-garcia@congatec.com>
parent 88385da1
[![N|congatec AG](https://www.congatec.com/typo3conf/ext/bgm_theme_congatec/Resources/Public/Images/congatec-logo.png)](https://www.congatec.com)
# README for setting up Yocto Project 2.5 (Sumo) for conga-SMX8 and conga-QMX8 (4.14.98_2.3.2)
A x86 based Linux system with installed cross compile toolchain is required to develop Yocto based software for i.MX 8-based designs. It is possible to use a virtual machine that runs Linux but a dedicated system with Ubuntu is preferrable. Furthermore, the host should have a serial port to access the debug console and an SD card reader.
This guide shows the procedure for Yocto Project 2.5 (Sumo) as an example. Use the latest Yocto release whenever possible.
## 1. Setting up and building Yocto
### 1. Installation in Ubuntu 16.04 64 bit [Clean install]
### 2. Some packages are needed:
```
$ sudo apt-get update
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm sed cvs subversion coreutils texi2html docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc repo python3-pip
```
### 3. Config the local git:
```
$ git config --global user.email "youremail"
$ git config --global user.name "Your name"
```
A SSH key must be generated in order to fetch te software from the congatec git server, after login into git.congatec.com go to the link https://git.congatec.com/profile/keys and follow the instructions there to generate and link a key with the computer will fetch and build the Yocto BSP.
### 4. Get the yocto recipes:
```
$ mkdir ~/yocto
$ cd ~/yocto
$ repo init -u https://git.congatec.com/arm-nxp/imx8-family/yocto/manifest-imx8-family.git -b cgtimx8__sumo-4.14.98-2.3.2
$ repo sync
```
### 5. Config the build environment for the target module:
#### 5.1. **conga-SMX8**:
```
$ MACHINE='imx8qm-cgtsmx8' DISTRO=fsl-imx-wayland source fsl-setup-release.sh -b build-smx8
[ ! ] EULA accept needed for next step.
```
#### 5.2. **conga-QMX8**:
```
$ MACHINE='imx8qm-cgtqmx8' DISTRO=fsl-imx-wayland source fsl-setup-release.sh -b build-qmx8
[ ! ] EULA accept needed for next step.
```
##### 5.3. Memory
The Yocto variable MEMORY_PRESENT is included to select the different memory configurations for the different variants
Possible values of MEMORY_PRESENT are:
* "2GB"
* "4GB"
By default is set to 4GB. If the 2GB memory variant is the target, please add the following line into your conf/local.conf file with the correspoding memory size:
```
MEMORY_PRESENT = "2GB"
```
This variable is used into u-boot and imx-sc-firmware to select consistenly the memory present on the target hardware
### 6. Build the fsl-image-qt5 image use:
```
$ bitbake fsl-image-qt5
```
The process will take hours.
When it finishes the image will be located under the build folder: *tmp/deploy/images/imx8qm-cgtsmx8* or *tmp/deploy/images/imx8qm-cgtqmx8*
## 2. Transfer the root file system
In order to transfer the image to a uSD card, follow the next steps changing sdX for your detected device:
### 2.1 **conga-SMX8**
```
$ cd ~/yocto/build-smx8/tmp/deploy/images/imx8qm-cgtsmx8/
$ bzip2 -df fsl-image-qt5-imx8qm-cgtsmx8.sdcard.bz2
$ sudo dd if=fsl-image-qt5-imx8qm-cgtsmx8.sdcard of=/dev/sdX
$ sync
```
### 2.1 **conga-QMX8**
```
$ cd ~/yocto/build-qmx8/tmp/deploy/images/imx8qm-cgtqmx8/
$ bzip2 -df fsl-image-qt5-imx8qm-cgtqmx8.sdcard.bz2
$ sudo dd if=fsl-image-qt5-imx8qm-cgtqmx8.sdcard of=/dev/sdX
$ sync
```
## 3. Device tree files
### 3.1. **conga-SMX8**
Available device tree configuration
* imx8qm-cgtsmx8.dtb: LVDS graphical output
* imx8qm-cgtsmx8-hdmi.dtb: HDMI graphical output
* imx8qm-cgtsmx8-dsi.dtb: DSI ADV7533 suppport
* imx8qm-cgtsmx8-mipi-ov5640.dtb: OV5640 camera support
* imx8qm-cgtsmx8-pcieb.dtb: Enable 2nd PCIe interface (pcieb)
* imx8qm-cgtsmx8-hdmi-pcieb.dtb: HDMI graphical output and 2nd PCIe interface enabled (pcieb)
* imx8qm-cgtsmx8-lpuart2.dtb: LPuart2 enabled, disables GPIO5 and GPIO10
### 3.2. **conga-QMX8**
Available device tree configuration
* imx8qm-cgtqmx8.dtb: LVDS graphical output
* imx8qm-cgtqmx8-hdmi.dtb: HDMI graphical output
* imx8qm-cgtqmx8-dsi.dtb: DSI ADV7533 suppport
* imx8qm-cgtqmx8-mipi-ov5640.dtb: OV5640 camera support
* imx8qm-cgtqmx8-pcieb.dtb: Enable 2nd PCIe interface (pcieb)
* imx8qm-cgtqmx8-hdmi-pcieb.dtb: HDMI graphical output and 2nd PCIe interface enabled (pcieb)
### 3.3 Change the device tree
Boot the board and stop the auto-boot process, modify the fdt_file variable whit the dtb file which will be used. In this case the SMX8 HDMI devicetree will be selected:
```
$ setenv fdt_file imx8qm-cgtsmx8-hdmi.dtb
$ savee
$ boot
```
## 4. Bootcontainer
Henceforth, bootcontainer is programmed into the SPI flash
(c) 2020, Alex de Cabo, congatec AG
#@TYPE: Machine
#@NAME: conga-QMX8
#@MAINTAINER: Alex de Cabo <alejandro.de-cabo-garcia@congatec.com>
MACHINEOVERRIDES =. "mx8:mx8qm:"
require conf/machine/include/imx-base.inc
require conf/machine/include/arm/arch-arm64.inc
MACHINE_FEATURES_append = " qca6174 "
# Don't include kernels in standard images
RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""
RDEPENDS_${KERNEL_PACKAGE_NAME}-image = ""
LOADADDR = ""
# We have to disable SERIAL_CONSOLE due to auto-serial-console
SERIAL_CONSOLE = "115200 ttyAMA0"
# we do not want to have getty running on tty1 as we run
# auto-serial-console there
USE_VT = "0"
PREFERRED_PROVIDER_virtual/kernel_imx8qm-cgtqmx8 = "linux-congatec"
KERNEL_DEVICETREE = "congatec/imx8qm-cgtqmx8.dtb congatec/imx8qm-cgtqmx8-dsi.dtb congatec/imx8qm-cgtqmx8-mipi-ov5640.dtb congatec/imx8qm-cgtqmx8-hdmi.dtb congatec/imx8qm-cgtqmx8-pcieb.dtb congatec/imx8qm-cgtqmx8-hdmi-pcieb.dtb "
PREFERRED_PROVIDER_virtual/bootloader_imx8qm-cgtqmx8 = "u-boot-congatec"
UBOOT_MAKE_TARGET = "u-boot.bin"
UBOOT_SUFFIX = "bin"
UBOOT_CONFIG ??= "fspi"
UBOOT_CONFIG[sd] = "cgtqmx8_usd_defconfig,sdcard"
UBOOT_CONFIG[fspi] = "cgtqmx8_fspi_defconfig"
IMX_FIRMWARE_imx8qm-cgtqmx8 = "firmware-imx imx-sc-firmware-congatec imx-seco"
MEMORY_PRESENT ??= "4GB"
BOOT_SPACE = "65536"
IMAGE_BOOTLOADER = "imx-boot"
IMX_BOOT_SEEK = "32"
IMAGE_BOOTFILES_DEPENDS += "firmware-imx:do_deploy"
IMAGE_BOOTFILES += "hdmitxfw.bin hdmirxfw.bin dpfw.bin"
BOARD_TYPE = "mek"
IMXBOOT_TARGETS_SD = "flash"
IMXBOOT_TARGETS_FSPI = "flash_flexspi"
IMXBOOT_TARGETS = \
"${@bb.utils.contains('UBOOT_CONFIG', 'sd', '${IMXBOOT_TARGETS_SD}', \
'${IMXBOOT_TARGETS_FSPI}', d)}"
IMAGE_INSTALL_append = " kernel-modules kernel-image kernel-devicetree "
#@TYPE: Machine
#@NAME: conga-SMX8
#@MAINTAINER: Alex de Cabo <alejandro.de-cabo-garcia@congatec.com>
MACHINEOVERRIDES =. "mx8:mx8qm:"
require conf/machine/include/imx-base.inc
require conf/machine/include/arm/arch-arm64.inc
MACHINE_FEATURES_append = " qca6174 "
# Don't include kernels in standard images
RDEPENDS_${KERNEL_PACKAGE_NAME}-base = ""
RDEPENDS_${KERNEL_PACKAGE_NAME}-image = ""
LOADADDR = ""
# We have to disable SERIAL_CONSOLE due to auto-serial-console
SERIAL_CONSOLE = "115200 ttyAMA0"
# we do not want to have getty running on tty1 as we run
# auto-serial-console there
USE_VT = "0"
PREFERRED_PROVIDER_virtual/kernel_imx8qm-cgtsmx8 = "linux-congatec"
KERNEL_DEVICETREE = "congatec/imx8qm-cgtsmx8.dtb congatec/imx8qm-cgtsmx8-dsi.dtb congatec/imx8qm-cgtsmx8-mipi-ov5640.dtb congatec/imx8qm-cgtsmx8-hdmi.dtb congatec/imx8qm-cgtsmx8-pcieb.dtb congatec/imx8qm-cgtsmx8-hdmi-pcieb.dtb congatec/imx8qm-cgtsmx8-lpuart2.dtb "
PREFERRED_PROVIDER_virtual/bootloader_imx8qm-cgtsmx8 = "u-boot-congatec"
UBOOT_MAKE_TARGET = "u-boot.bin"
UBOOT_SUFFIX = "bin"
UBOOT_CONFIG ??= "fspi"
UBOOT_CONFIG[sd] = "cgtsmx8_usd_defconfig,sdcard"
UBOOT_CONFIG[fspi] = "cgtsmx8_fspi_defconfig"
IMX_FIRMWARE_imx8qm-cgtsmx8 = "firmware-imx imx-sc-firmware-congatec imx-seco"
MEMORY_PRESENT ??= "4GB"
BOOT_SPACE = "65536"
IMAGE_BOOTLOADER = "imx-boot"
IMX_BOOT_SEEK = "32"
IMAGE_BOOTFILES_DEPENDS += "firmware-imx:do_deploy"
IMAGE_BOOTFILES += "hdmitxfw.bin hdmirxfw.bin dpfw.bin"
BOARD_TYPE = "mek"
IMXBOOT_TARGETS_SD = "flash"
IMXBOOT_TARGETS_FSPI = "flash_flexspi"
IMXBOOT_TARGETS = \
"${@bb.utils.contains('UBOOT_CONFIG', 'sd', '${IMXBOOT_TARGETS_SD}', \
'${IMXBOOT_TARGETS_FSPI}', d)}"
IMAGE_INSTALL_append = " kernel-modules kernel-image kernel-devicetree linux-pcie-usb-driver-228 "
# Copyright 2017-2018 NXP
SRCREV = "bb209a0b4ccca2aa4a3a887f9606dc4a3d294adf"
COMPATIBLE_MACHINE = "(imx8qm-cgtsmx8|imx8qm-cgtqmx8)"
# Copyright (C) 2016 Freescale Semiconductor
# Copyright 2017-2018 NXP
DESCRIPTION = "i.MX System Controller Firmware"
LICENSE = "MIT"
#LIC_FILES_CHKSUM = "file://COPYING;md5=6dfb32a488e5fd6bae52fbf6c7ebb086"
SECTION = "BSP"
inherit fsl-eula2-unpack2 pkgconfig deploy
SRC_URI_imx8qm-cgtqmx8 = "git://git.congatec.com/arm-nxp/imx8-family/scfw-binary-imx8-family.git;branch=cgt__imx-scfw-porting-kit-1.3.2_scfw_export_mx8qm;protocol=http"
SRC_URI_imx8qm-cgtsmx8 = "git://git.congatec.com/arm-nxp/imx8-family/scfw-binary-imx8-family.git;branch=cgt__imx-scfw-porting-kit-1.3.2_scfw_export_mx8qm;protocol=http"
S = "${WORKDIR}/git"
SRCREV_imx8qm-cgtqmx8 = "ad61941b7be682c157862116fe91c7211bb8fdcc"
SC_FIRMWARE_NAME_imx8qm-cgtqmx8 ?= "cgtqmx8_scfw_tcm.${MEMORY_PRESENT}.B0.nxp-8f7fbfd9.f5a2241.bin"
SRCREV_imx8qm-cgtsmx8 = "ad61941b7be682c157862116fe91c7211bb8fdcc"
SC_FIRMWARE_NAME_imx8qm-cgtsmx8 ?= "cgtsmx8_scfw_tcm.${MEMORY_PRESENT}.B0.nxp-8f7fbfd9.332c3d7.bin"
symlink_name = "scfw_tcm.bin"
BOOT_TOOLS = "imx-boot-tools"
do_compile[noexec] = "1"
do_install[noexec] = "1"
do_deploy() {
install -Dm 0644 ${S}/${SC_FIRMWARE_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}/${SC_FIRMWARE_NAME}
ln -sf ${SC_FIRMWARE_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}/${symlink_name}
}
addtask deploy after do_install
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE = "(imx8qm-cgtqmx8|imx8qm-cgtsmx8)"
diff --git a/configs/cgtqmx8_fspi_defconfig b/configs/cgtqmx8_fspi_defconfig
index 809dc599d6..5d37f79c82 100644
--- a/configs/cgtqmx8_fspi_defconfig
+++ b/configs/cgtqmx8_fspi_defconfig
@@ -118,3 +118,5 @@ CONFIG_SDP_LOADADDR=0x80400000
CONFIG_BOOTAUX_RESERVED_MEM_BASE=0x88000000
CONFIG_BOOTAUX_RESERVED_MEM_SIZE=0x08000000
+
+CONFIG_CGT_QMX8_MEM_VAR_2GB
diff --git a/configs/cgtqmx8_usd_defconfig b/configs/cgtqmx8_usd_defconfig
index 76d2da6fe3..14e78179e1 100644
--- a/configs/cgtqmx8_usd_defconfig
+++ b/configs/cgtqmx8_usd_defconfig
@@ -112,3 +112,5 @@ CONFIG_SDP_LOADADDR=0x80400000
CONFIG_BOOTAUX_RESERVED_MEM_BASE=0x88000000
CONFIG_BOOTAUX_RESERVED_MEM_SIZE=0x08000000
+
+CONFIG_CGT_QMX8_MEM_VAR_2GB
diff --git a/configs/cgtsmx8_fspi_defconfig b/configs/cgtsmx8_fspi_defconfig
index 07fc2f97cc..20b2ed7494 100644
--- a/configs/cgtsmx8_fspi_defconfig
+++ b/configs/cgtsmx8_fspi_defconfig
@@ -118,3 +118,5 @@ CONFIG_SDP_LOADADDR=0x80400000
CONFIG_BOOTAUX_RESERVED_MEM_BASE=0x88000000
CONFIG_BOOTAUX_RESERVED_MEM_SIZE=0x08000000
+
+CONFIG_CGT_SMX8_MEM_VAR_2GB=y
diff --git a/configs/cgtsmx8_usd_defconfig b/configs/cgtsmx8_usd_defconfig
index de1bcaac7e..17d4c2224e 100644
--- a/configs/cgtsmx8_usd_defconfig
+++ b/configs/cgtsmx8_usd_defconfig
@@ -112,3 +112,5 @@ CONFIG_SDP_LOADADDR=0x80400000
CONFIG_BOOTAUX_RESERVED_MEM_BASE=0x88000000
CONFIG_BOOTAUX_RESERVED_MEM_SIZE=0x08000000
+
+CONFIG_CGT_SMX8_MEM_VAR_2GB=y
diff --git a/configs/cgtqmx8_fspi_defconfig b/configs/cgtqmx8_fspi_defconfig
index 809dc599d6..5d37f79c82 100644
--- a/configs/cgtqmx8_fspi_defconfig
+++ b/configs/cgtqmx8_fspi_defconfig
@@ -118,3 +118,5 @@ CONFIG_SDP_LOADADDR=0x80400000
CONFIG_BOOTAUX_RESERVED_MEM_BASE=0x88000000
CONFIG_BOOTAUX_RESERVED_MEM_SIZE=0x08000000
+
+CONFIG_CGT_QMX8_MEM_VAR_4GB
diff --git a/configs/cgtqmx8_usd_defconfig b/configs/cgtqmx8_usd_defconfig
index 76d2da6fe3..14e78179e1 100644
--- a/configs/cgtqmx8_usd_defconfig
+++ b/configs/cgtqmx8_usd_defconfig
@@ -112,3 +112,5 @@ CONFIG_SDP_LOADADDR=0x80400000
CONFIG_BOOTAUX_RESERVED_MEM_BASE=0x88000000
CONFIG_BOOTAUX_RESERVED_MEM_SIZE=0x08000000
+
+CONFIG_CGT_QMX8_MEM_VAR_4GB
diff --git a/configs/cgtsmx8_fspi_defconfig b/configs/cgtsmx8_fspi_defconfig
index 07fc2f97cc..20b2ed7494 100644
--- a/configs/cgtsmx8_fspi_defconfig
+++ b/configs/cgtsmx8_fspi_defconfig
@@ -118,3 +118,5 @@ CONFIG_SDP_LOADADDR=0x80400000
CONFIG_BOOTAUX_RESERVED_MEM_BASE=0x88000000
CONFIG_BOOTAUX_RESERVED_MEM_SIZE=0x08000000
+
+CONFIG_CGT_SMX8_MEM_VAR_4GB=y
diff --git a/configs/cgtsmx8_usd_defconfig b/configs/cgtsmx8_usd_defconfig
index de1bcaac7e..17d4c2224e 100644
--- a/configs/cgtsmx8_usd_defconfig
+++ b/configs/cgtsmx8_usd_defconfig
@@ -112,3 +112,5 @@ CONFIG_SDP_LOADADDR=0x80400000
CONFIG_BOOTAUX_RESERVED_MEM_BASE=0x88000000
CONFIG_BOOTAUX_RESERVED_MEM_SIZE=0x08000000
+
+CONFIG_CGT_SMX8_MEM_VAR_4GB=y
# Copyright (C) 2013-2016 Freescale Semiconductor
# Copyright 2017-2018 NXP
DESCRIPTION = "i.MX U-Boot suppporting i.MX reference boards."
require recipes-bsp/u-boot/u-boot.inc
inherit pythonnative
PROVIDES += "u-boot"
DEPENDS_append = " python dtc-native"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263"
UBOOT_SRC ?= "git://git.congatec.com/arm-nxp/imx8-family/uboot-imx8-family.git;protocol=http"
SRCBRANCH = "cgtimx8__imx_v2018.03_4.14.98_2.3.0"
SRC_URI = "${UBOOT_SRC};branch=${SRCBRANCH}"
SRCREV = "b4ff8ee2cb5510548c2a345259832a55d3d3c10b"
SRC_URI += "file://${MEMORY_PRESENT}.diff "
S = "${WORKDIR}/git"
inherit fsl-u-boot-localversion
LOCALVERSION ?= "-${SRCBRANCH}"
BOOT_TOOLS = "imx-boot-tools"
PACKAGE_ARCH = "${MACHINE_ARCH}"
COMPATIBLE_MACHINE = "(imx8qm-cgtqmx8|imx8qm-cgtsmx8)"
UBOOT_NAME_mx8 = "u-boot-${MACHINE}.bin-${UBOOT_CONFIG}"
# Copyright (C) 2013-2016 Freescale Semiconductor
# Copyright 2017-2018 NXP
# Released under the MIT license (see COPYING.MIT for the terms)
require recipes-kernel/linux/linux-imx.inc
require recipes-kernel/linux/linux-imx-src-${PV}.inc
SUMMARY = "Linux Kernel provided and supported by NXP"
DESCRIPTION = "Linux Kernel provided and supported by NXP with focus on \
i.MX Family Reference Boards. It includes support for many IPs such as GPU, VPU and IPU."
DEPENDS += "lzop-native bc-native"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
SRCBRANCH = "cgtimx8__imx_4.14.98_2.3.0"
LOCALVERSION = "-${SRCBRANCH}"
KERNEL_SRC = "git://git.congatec.com/arm-nxp/imx8-family/kernel-imx8-family.git;protocol=http"
SRC_URI = "${KERNEL_SRC};branch=${SRCBRANCH}"
SRCREV = "a73263209d2dfd8ca54a1916e2983f9e11be9ddb"
S = "${WORKDIR}/git"
DEFAULT_PREFERENCE = "1"
do_preconfigure_prepend_imx8qm-cgtqmx8 () {
install -d ${B}
mkdir -p ${B}
cp ${S}/arch/arm64/configs/cgtqmx8_defconfig ${B}/.config
cp ${S}/arch/arm64/configs/cgtqmx8_defconfig ${B}/../defconfig
}
do_preconfigure_prepend_imx8qm-cgtsmx8 () {
install -d ${B}
mkdir -p ${B}
cp ${S}/arch/arm64/configs/cgtsmx8_defconfig ${B}/.config
cp ${S}/arch/arm64/configs/cgtsmx8_defconfig ${B}/../defconfig
}
COMPATIBLE_MACHINE = "(imx8qm-cgtqmx8|imx8qm-cgtsmx8)"
EXTRA_OEMAKE_append = " ARCH=arm64"
......@@ -166,6 +166,8 @@ echo "BBLAYERS += \" \${BSPDIR}/sources/meta-openembedded/meta-filesystems \"" >
echo "BBLAYERS += \" \${BSPDIR}/sources/meta-qt5 \"" >> $BUILD_DIR/conf/bblayers.conf
echo "BBLAYERS += \" \${BSPDIR}/sources/meta-spb228-pcie-usb \"" >> $BUILD_DIR/conf/bblayers.conf
echo BSPDIR=$BSPDIR
echo BUILD_DIR=$BUILD_DIR
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment