[[PageOutline]] = Malibu Board Support Package (BSP) Gateworks provides a Board Support Package (BSP) for the Malibu product family which provides source code and an easy mechanism to build different images. 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 using the bsp Makefile as a guide. [=#images] == BSP Pre-Built Firmware Images Pre-built firmware images can be found on http://dev.gateworks.com/malibu/images. Installation instructions: - [wiki:/malibu/firmware Malibu Flashing Instructions for updating from U-Boot or Linux] - [wiki:jtag_instructions JTAG instructions for updating Boot Firmware] [=#source] == BSP Source Code Source code for the 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]. The following !GitHub repos are used for Malibu: * [https://github.com/Gateworks/malibu-bsp malibu-bsp] - Malibu BSP support scripts and Makefile ([https://github.com/Gateworks/bsp-malibu/subscription watch]) * [https://github.com/Gateworks/atf-malibu atf-malibu] - ARM Trusted Firmware ([https://github.com/Gateworks/atf-malibu/subscription watch)] * [https://github.com/Gateworks/mv_ddr-malibu mv_ddr-malibu] - Marvell DDR configuration ([https://github.com/Gateworks/mv_ddr-malibu/subscription watch)] * [https://github.com/Gateworks/uboot-malibu uboot-malibu] - Malibu Bootloader ([https://github.com/Gateworks/uboot-malibu/subscription watch)] * [https://github.com/Gateworks/linux-malibu linux-malibu] - Malibu Linux Kernel ([https://github.com/Gateworks/linux-malibu/subscription watch)] [=#build] == Building the BSP from source 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]. The following pre-requisites are needed to build the Malibu BSP: * Linux Development host (desktop or laptop computer) (Ubuntu is used by Gateworks and tested) * Git (used for source code repositories) Installing pre-requisites: {{{#!bash # install packages sudo apt update sudo apt install build-essential git sudo apt install wget bison flex libssl-dev libncurses-dev bc ncurses-dev liblzo2-dev lzop cpio rsync e2tools fdisk sudo apt install gcc-aarch64-linux-gnu # configure git git config --global user.email "you@example.com" git config --global user.name "Your Name" git config --global color.ui true }}} To obtain the code: 1. Clone repo (fetch the repo manifest) '''Note the --recurse-submodules option which instructs git to pull the submodules''' {{{#!bash git clone --recurse-submodules https://github.com/Gateworks/malibu-bsp.git cd bsp-malibu }}} * A github account is required. If the command line prompt during the git clone requests user name and password, it may be required to use the username as your git user name and the password is the custom generated token here: [https://github.com/settings/tokens] 1. Setup build environment (***repeat this each time you open a shell***) {{{#!bash source setup-environment }}} 1. Build desired software target as defined below. For example: {{{#!bash make -j8 ubuntu-image }}} The following build targets are useful: - firmware-image: builds boot firmware: * firmware-malibu-gw8901-jtag.bin - JTAG image * firmware-malibu-gw8901.bin - for updating boot firmware only (no U-Boot env) from Linux/U-Boot * firmware-malibu-gw8901.img - for updating boot firmware and U-Boot env from Linux/U-Boot * malibu.env.bin - U-Boot environment - kernel_image: builds linux-malibu.tar.xz kernel tarball containing modules and boot dir with kernel/dtb/script - jammy-malibu.ext4: builds ext4 filesystem containing ubuntu rootfs plus gateworks kernel - ubuntu-image: builds ubuntu disk image including partition table and ext4 fs [=#kernel] === Modifying the stand-alone Linux Kernel The Gateworks Malibu BSP instructions [#build above] create an environment for building the Linux kernel among other targets. Some additional instructions for common actions (make sure you have already installed the BSP and setup your shell environment as specified above): * Make standard Gateworks Malibu kernel with Gateworks malibu_linux_defconfig {{{#!bash make linux # first build the kernel with the standard malibu_linux_defconfig }}} * Modify Kernel configuration (enabling modules etc): {{{#!bash make -C linux menuconfig # make your changes make -C linux savedefconfig # create a minimal 'defconfig' file in the linux kernel dir diff linux/defconfig linux/arch/arm64/configs/malibu_linux_defconfig # show diffs (optional) cp linux/defconfig linux/arch/arm64/configs/malibu_linux_defconfig . # copy the modified defconfig }}} * Build kernel tarball: {{{#!bash make uboot # builds uboot, a requirement to build the kernel and modules and tarball make kernel_image # builds the kernel and modules and tarball }}} * Build new disk image using the updated kernel tarball: {{{#!bash make ubuntu-image }}}