[[PageOutline]] = Newport Board Support Package (BSP) = Gateworks provides a Board Support Package for Newport which provides source code and an easy mechanism to build different images, including Ubuntu and OpenWrt. Gateworks uses the term 'BSP' to describe one 'image' file, that contains everything, including all boot firmware, operating system (rootfs and kernel). 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. * [#kernel Gateworks Newport Linux Kernel] * [wiki:newport/boot Gateworks Newport Boot Firmware] [=#images] == BSP Pre-Built Firmware Images == Pre-built firmware images can be found on http://dev.gateworks.com/newport. A sampling includes: * ''' Entire Board Software (recommended), including boot firmware, bootloader, OS, kernel, etc: ''' * [http://dev.gateworks.com/newport/images/xenial-newport.img.gz xenial-newport.img.gz] - Compressed Disk Image containing Firmware and Ubuntu 16.04 Xenial * [http://dev.gateworks.com/newport/images/openwrt-newport.img.gz openwrt-newport.img.gz] - Compressed Disk Image containing Firmware and !OpenWrt * ''' Newport GSC ''' * [http://dev.gateworks.com/newport/images/gsc_630x.txt GSC firmware image] * '''Only Boot Firmware ''' * [http://dev.gateworks.com/newport/boot_firmware/firmware-newport.img firmware-newport.img] - Boot Firmware (everything up to and including the bootloader stored on the embedded FLASH boot device) (see [wiki:newport/boot newport/boot] for details) * '''Only Newport Kernel ''' * [http://dev.gateworks.com/newport/kernel/linux-newport.tar.xz linux-newport.tar.xz] - Compressed TAR archive of pre-built Linux kernel ''' Installation ''' instructions are at the following URL: [wiki:/newport/firmware#UpdateFirmwareviaSerialConsoleandEthernetfromBootloader Newport Flashing Instructions] [=#source] == BSP Source Code == Newport 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 Newport: * [https://github.com/Gateworks/bsp-newport] - Newport BSP support scripts and Makefile ([https://github.com/Gateworks/bsp-newport/subscription watch]) * [https://github.com/Gateworks/manifest-newport] - Newport BSP repo Manifest ([https://github.com/Gateworks/manifest-newport/subscription watch]) * [https://github.com/Gateworks/uboot-newport uboot-newport] - Newport Bootloader ([https://github.com/Gateworks/uboot-newport/subscription watch)] * [https://github.com/Gateworks/linux-newport linux-newport] - Newport Linux Kernel ([https://github.com/Gateworks/linux-newport/subscription watch)] * [https://github.com/Gateworks/dts-newport dts-newport] - Newport Linux Device-Tree ([https://github.com/Gateworks/dts-newport/subscription watch)] * [https://github.com/Gateworks/bdk-newport bdk-newport] - Newport BDK (used as Secondary Program Loader) ([https://github.com/Gateworks/bdk-newport/subscription watch)] * [https://github.com/Gateworks/atf-newport atf-newport] - Newport ATF (ARM Trusted Firmware) ([https://github.com/Gateworks/atf-newport/subscription watch)] * [https://github.com/Gateworks/openwrt openwrt] - Gateworks OpenWrt ([https://github.com/Gateworks/openwrt/subscription watch)] [=#build] == Building the BSP from source == Below are instructions for building the entire BSP, which includes all of the bootloader components and Linux kernel and Ubuntu or OpenWrt. Pre-built images are available [#images above]. The Gateworks Newport Board Support Package uses the Google {{{repo}}} tool to manage multiple code repositories. The following pre-requisites are needed to build the Newport BSP: * Linux Development host (desktop or laptop computer) (Ubuntu 16.04 is used by Gateworks and tested) * Python 2.x (required by the 'repo' tool) * Git (used for source code repositories) To obtain the code: 1. Get repo tool (download latest version of tool and put it in your path) {{{#!bash sudo apt-get install repo }}} 1. Initialize repo (fetch the repo manifest) {{{#!bash mkdir $HOME/newport cd $HOME/newport repo init -u https://github.com/Gateworks/manifest-newport.git }}} 1. Sync repositories (repeat this when you want to fetch the latest code updates) {{{#!bash repo sync }}} * This will fetch/update the source repos described [#source above]. The first time it can take several minutes depending on your Internet connection and will take approximately ~2.5GB of disk space 1. Setup build environment (***repeat this each time you open shell***) {{{#!bash source newport/setup-environment }}} 1. Build desired software target as definied below. For example: {{{#!bash make -j8 openwrt-image # build openwrt-newport.img.gz or change to any of below build targets }}} The '''build targets''' supported by the Newport BSP include: * **ubuntu-image** - builds ubuntu-newport.img.gz: A Compressed Disk Image which includes the 16MB [wiki:newport/boot Boot Firmware] (BDK/ATF/U-Boot and Device-Tree images) as well as the Kernel and Ubuntu root filesystem. * [wiki:newport/firmware#serial-ethernet-uboot Installation Instructions] * **openwrt-image** - builds openwrt-newport.img.gz: A Compressed Disk Image which includes the 16MB [wiki:newport/boot Boot Firmware] (BDK/ATF/U-Boot and Device-Tree images) as well as the !OpenWrt Kernel and root filesystem * [wiki:newport/firmware#serial-ethernet-uboot Installation Instructions] * **firmware-image** - builds 'firmware-newport.img': 16MB [wiki:newport/boot Boot Firmware] which includes the BDK/ATF/U-Boot and Device-Tree images - (takes about 2 mins on a modern development system). * **kernel_image** - builds linux-newport.tar.xz - A compressed tarball of the kernel (boot/Image) and kernel modules (lib/modules/*) which can be used on top of any compatible root filesystem General installation instructions: * [wiki:newport/firmware Flashing / Updating software on Newport SBC] * [wiki:/newport/boot#BuildingaBootableDiskImages Creating Entire Disk Images for Booting] [=#kernel] == Building or Modifying the Linux Kernel for Newport == The Gateworks Newport 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): * Modify Kernel configuration (enabling modules etc): {{{#!bash cd linux make newport_defconfig # start with the Newport kernel configuration make menuconfig # modify as desired make # build Image and modules }}} * Build kernel tarball: {{{#!bash cd linux make # build Image and modules mkdir -p install/boot # create install and install/boot directories cp arch/arm64/boot/Image install/boot # copy kernel Image make INSTALL_MOD_PATH=install modules_install # install modules tar -cvJf /tftpboot/newport/linux-newport.tar.xz --numeric-owner -C install . # create tarball }}} While the resulting kernel modules must be placed on the root filesystem the kernel image must be placed in a partition readable by the U-Boot Bootloader. Therefore placing the kernel within the root filesystem as above does not work if you use a filesystem that U-Boot does not natively support (like F2FS or BTRFS for example). U-Boot only supports FAT and EXT (and UBI for NAND devices) natively. == Building Ubuntu Operating System - rootfs == You can build an entire Ubuntu image from the BSP noted above (which will boot on a Newport SBC), but it does not include building the isolated rootfs. The actual building of the Ubuntu rootfs does not happen in the Gateworks BSP instructions described above. Information for manually building Ubuntu rootfs can be found here: [wiki:newport/ubuntu]