| | 1 | [[PageOutline]] |
| | 2 | |
| | 3 | = Catalina Board Support Package (BSP) |
| | 4 | Gateworks provides a Board Support Package for Catalina which provides source code and an easy mechanism to build different images, including a minimal Buildroot based distro as well as an Ubuntu based distro. |
| | 5 | |
| | 6 | The Gateworks BSP is the easiest comprehensive software process because it contains everything. If a deep dive, expert path is desired, each piece of the BSP (boot firmware, rootfs, kernel) can all be built separately: |
| | 7 | * [#kernel Gateworks Catalina Linux Kernel] |
| | 8 | * [wiki:catalina/boot Gateworks Catalina Boot Firmware] |
| | 9 | |
| | 10 | Notes: |
| | 11 | - '''For pre-built images and instructions on installation see [wiki:catalina/firmware]''' |
| | 12 | - '''For details of Gateworks Ubuntu based OS for Catalina see [wiki:catalina/ubuntu]''' |
| | 13 | |
| | 14 | |
| | 15 | [=#source] |
| | 16 | == BSP Source Code |
| | 17 | Source code for the boot firmware, bootloader and kernel are hosted at !GitHub. We highly recommend you create a !GitHub account and 'Watch' these repositories to keep abreast of important feature additions, bugfixes, and firmware-releases. You can configure your !GitHub account to e-mail you when changes are made to repositories [https://github.com/settings/notifications here]. |
| | 18 | |
| | 19 | The following !GitHub repos are used for Catalina: |
| | 20 | * [https://github.com/Gateworks/bsp-catalina bsp-catalina] - Catalina BSP support scripts and Makefile ([https://github.com/Gateworks/bsp-catalina/subscription watch]) |
| | 21 | * [https://github.com/Gateworks/oei-catalina oei-catalina] - Optional Executable Image (OEI) for configuring DRAM and TCM (Tightly Coupled Memory) ([https://github.com/Gateworks/oei-catalina/subscription watch]) |
| | 22 | * [https://github.com/Gateworks/oei-catalina sm-catalina] - System Manager (SM) for configuring pinmux, clocks, and power ([https://github.com/Gateworks/sm-catalina/subscription watch]) |
| | 23 | * [https://github.com/nxp-imx/imx-atf imx-atf] - ARM Trusted Firmware ([https://github.com/nxp-imx/imx-atf/subscription watch)] (not modified by Gateworks) |
| | 24 | * [https://github.com/Gateworks/uboot-catalina uboot-catalina] - Catalina Bootloader ([https://github.com/Gateworks/uboot-catalina/subscription watch)] |
| | 25 | * [https://github.com/Gateworks/linux-catalina linux-catalina] - Catalina Linux Kernel ([https://github.com/Gateworks/linux-catalina/subscription watch)] |
| | 26 | |
| | 27 | |
| | 28 | [=#build] |
| | 29 | == Building the BSP from source |
| | 30 | Below are instructions for building the entire BSP, which includes all of the bootloader components, Linux kernel, and Ubuntu. Pre-built images are available [#images above]. |
| | 31 | |
| | 32 | The Gateworks Catalina Board Support Package uses GIT submodules to include and track the various GIT repos above. |
| | 33 | |
| | 34 | The following pre-requisites are needed to build the Catalina BSP: |
| | 35 | * Linux Development host (desktop or laptop computer) |
| | 36 | * Python 3.x |
| | 37 | * Git (used for source code repositories) |
| | 38 | * various tools |
| | 39 | |
| | 40 | Ubuntu Jammy (20.04) and Ubuntu Noble (24.04) have been verified by Gateworks for automated builds of the Catalina BSP. If using a different OS or version you may need to adjust the above packages. |
| | 41 | |
| | 42 | Installing pre-requisites: |
| | 43 | {{{#!bash |
| | 44 | # install packages |
| | 45 | sudo apt install -y build-essential git wget unzip coreutils fdisk cpio rsync file bc bison flex kmod python3-dev python3-venv python3-setuptools swig libssl-dev ncurses-dev |
| | 46 | # configure git |
| | 47 | git config --global user.email "you@example.com" |
| | 48 | git config --global user.name "Your Name" |
| | 49 | git config --global color.ui true |
| | 50 | }}} |
| | 51 | |
| | 52 | Building: |
| | 53 | 1. clone repo with git |
| | 54 | {{{#!bash |
| | 55 | mkdir $HOME/catalina |
| | 56 | cd $HOME/catalina |
| | 57 | git clone --recurse-submodules --jobs $(nproc) https://github.com/Gateworks/bsp-catalina bsp |
| | 58 | }}} |
| | 59 | - This will fetch the source repos described [#source above]. The first time it can take several minutes depending on your Internet connection and will take approximately ~9GB of disk space |
| | 60 | - Note if you have already cloned without submodules you can use 'git submodule update --init --recursive' to sync the submodule repos |
| | 61 | 1. Build desired software target as defined below. For example: |
| | 62 | {{{#!bash |
| | 63 | make -j$(nproc) boot-firmware # build boot firmware |
| | 64 | make -j$(nproc) ubuntu-image # build Ubuntu based compressed disk image |
| | 65 | }}} |
| | 66 | |
| | 67 | The following commonly used build targets exist: |
| | 68 | - arm32-toolchain - download and extract the ARM32 toolchain used for code running on the M33 (OEI, SM) |
| | 69 | - arm64-toolchain - build ARM64 buildroot toolchain |
| | 70 | - boot-firmware - entire boot firmware |
| | 71 | - kernel-image - kernel tarball (including external modules) |
| | 72 | - ubuntu-image - Ubuntu based root filesystem compressed disk image |
| | 73 | - clean-toolchain - removes both ARM32 and ARM64 toolchains |
| | 74 | - clean-kernel - removes kernel build dir and tarball |
| | 75 | - clean-boot - cleans all boot firmware components; uboot, imx-oei, imx-sm, and imx-atf (but doesn't remove ddr firmware) |
| | 76 | - clean-rootfs - cleans rootfs (ext4) as well as the buildroot build dir for the image creation |
| | 77 | - distclean - removes all built and downloaded sources |
| | 78 | |
| | 79 | [=#git] |
| | 80 | === Working with the git submodules |
| | 81 | The {{{git}}} tool supports submodules defined in {{{.gitmodules}}} to unify multiple git code repositories into a single project. |
| | 82 | |
| | 83 | ==== Updating to the latest code (repo sync) |
| | 84 | You can update to the latest code via: |
| | 85 | {{{#!bash |
| | 86 | git pull --recurse-submodules |
| | 87 | }}} |
| | 88 | |
| | 89 | |
| | 90 | === Building sub-modules by hand |
| | 91 | If you wish to do some development and build submodules like U-Boot and Linux by hand you can source the 'environment-setup' script to setup the ARM64 cross toolchain: |
| | 92 | {{{#!bash |
| | 93 | source ./setup-environment |
| | 94 | }}} |