| | 1 | [[PageOutline]] |
| | 2 | |
| | 3 | = Malibu Board Support Package (BSP) |
| | 4 | Gateworks provides a Board Support Package (BSP) for the Malibu product family which provides source code and an easy mechanism to build different images. |
| | 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 using the bsp Makefile as a guide. |
| | 7 | |
| | 8 | |
| | 9 | [=#images] |
| | 10 | == BSP Pre-Built Firmware Images |
| | 11 | |
| | 12 | Pre-built firmware images can be found on http://dev.gateworks.com/malibu/images. |
| | 13 | |
| | 14 | Installation instructions: |
| | 15 | - [wiki:/malibu/firmware Malibu Flashing Instructions for updating from U-Boot or Linux] |
| | 16 | - [wiki:jtag_instructions JTAG instructions for updating Boot Firmware] |
| | 17 | |
| | 18 | |
| | 19 | [=#source] |
| | 20 | == BSP Source Code |
| | 21 | 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]. |
| | 22 | |
| | 23 | The following !GitHub repos are used for Malibu: |
| | 24 | * [https://github.com/Gateworks/bsp-malibu bsp-malibu] - Malibu BSP support scripts and Makefile ([https://github.com/Gateworks/bsp-malibu/subscription watch]) |
| | 25 | * [https://github.com/Gateworks/atf-malibu atf-malibu] - ARM Trusted Firmware ([https://github.com/Gateworks/atf-malibu/subscription watch)] |
| | 26 | * [https://github.com/Gateworks/mv_ddr-malibu mv_ddr-malibu] - Marvell DDR configuration |
| | 27 | ([https://github.com/Gateworks/mv_ddr-malibu/subscription watch)] |
| | 28 | * [https://github.com/Gateworks/uboot-malibu uboot-malibu] - Malibu Bootloader ([https://github.com/Gateworks/uboot-malibu/subscription watch)] |
| | 29 | * [https://github.com/Gateworks/linux-malibu linux-malibu] - Malibu Linux Kernel ([https://github.com/Gateworks/linux-malibu/subscription watch)] |
| | 30 | |
| | 31 | |
| | 32 | [=#build] |
| | 33 | == Building the BSP from source |
| | 34 | 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]. |
| | 35 | |
| | 36 | The following pre-requisites are needed to build the Malibu BSP: |
| | 37 | * Linux Development host (desktop or laptop computer) (Ubuntu is used by Gateworks and tested) |
| | 38 | * Git (used for source code repositories) |
| | 39 | |
| | 40 | Installing pre-requisites: |
| | 41 | {{{#!bash |
| | 42 | # install packages |
| | 43 | sudo apt update |
| | 44 | sudo apt install build-essential git |
| | 45 | sudo apt install wget bison flex libssl-dev libncurses-dev bc ncurses-dev liblzo2-dev lzop cpio rsync e2tools fdisk |
| | 46 | sudo apt install gcc-aarch64-linux-gnu |
| | 47 | # configure git |
| | 48 | git config --global user.email "you@example.com" |
| | 49 | git config --global user.name "Your Name" |
| | 50 | git config --global color.ui true |
| | 51 | }}} |
| | 52 | |
| | 53 | To obtain the code: |
| | 54 | 1. Clone repo (fetch the repo manifest) '''Note the --recurse-submodules option which instructs git to pull the submodules''' |
| | 55 | |
| | 56 | {{{#!bash |
| | 57 | git clone --recurse-submodules https://github.com/Gateworks/bsp-malibu.git |
| | 58 | cd bsp-malibu |
| | 59 | }}} |
| | 60 | 1. Setup build environment (***repeat this each time you open a shell***) |
| | 61 | {{{#!bash |
| | 62 | source setup-environment |
| | 63 | }}} |
| | 64 | 1. Build desired software target as defined below. For example: |
| | 65 | {{{#!bash |
| | 66 | make -j8 ubuntu-image |
| | 67 | }}} |
| | 68 | |
| | 69 | The following build targets are useful: |
| | 70 | - firmware-image: builds boot firmware: |
| | 71 | * firmware-malibu-gw8901-jtag.bin - JTAG image |
| | 72 | * firmware-malibu-gw8901.bin - for updating boot firmware only (no U-Boot env) from Linux/U-Boot |
| | 73 | * firmware-malibu-gw8901.img - for updating boot firmware and U-Boot env from Linux/U-Boot |
| | 74 | * malibu.env.bin - U-Boot environment |
| | 75 | - kernel_image: builds linux-malibu.tar.xz kernel tarball containing modules and boot dir with kernel/dtb/script |
| | 76 | - jammy-malibu.ext4: builds ext4 filesystem containing ubuntu rootfs plus gateworks kernel |
| | 77 | - ubuntu-image: builds ubuntu disk image including partition table and ext4 fs |
| | 78 | |
| | 79 | |
| | 80 | [=#kernel] |
| | 81 | === Modifying the stand-alone Linux Kernel |
| | 82 | The Gateworks Malibu BSP instructions [#build above] create an environment for building the Linux kernel among other targets. |
| | 83 | |
| | 84 | Some additional instructions for common actions (make sure you have already installed the BSP and setup your shell environment as specified above): |
| | 85 | * Make standard Gateworks Malibu kernel with Gateworks malibu_linux_defconfig |
| | 86 | {{{#!bash |
| | 87 | make linux # first build the kernel with the standard malibu_linux_defconfig |
| | 88 | }}} |
| | 89 | * Modify Kernel configuration (enabling modules etc): |
| | 90 | {{{#!bash |
| | 91 | make -C linux menuconfig # make your changes |
| | 92 | make -C linux savedefconfig # create a minimal 'defconfig' file in the linux kernel dir |
| | 93 | diff linux/defconfig linux/arch/arm64/configs/malibu_linux_defconfig # show diffs (optional) |
| | 94 | cp linux/defconfig linux/arch/arm64/configs/malibu_linux_defconfig . # copy the modified defconfig |
| | 95 | }}} |
| | 96 | * Build kernel tarball: |
| | 97 | {{{#!bash |
| | 98 | make uboot # builds uboot, a requirement to build the kernel and modules and tarball |
| | 99 | make kernel_image # builds the kernel and modules and tarball |
| | 100 | }}} |
| | 101 | * Build new disk image using the updated kernel tarball: |
| | 102 | {{{#!bash |
| | 103 | make ubuntu-image |
| | 104 | }}} |