wiki:newport/bsp

Version 41 (modified by Cale Collins, 3 years ago) ( diff )

fixed typo defconfig to savedefconfig

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.

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:
    • Newport Images - Compressed Disk Image containing Firmware and kernel and OS ( .img.gz files )
      • Ubuntu version details are available here
      • OpenWrt
  • Newport GSC
  • Only Boot Firmware
  • Only Newport Kernel

Installation instructions are at the following URL: Newport Flashing Instructions

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 here.

The following GitHub repos are used for Newport:

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 above.

The Gateworks Venice Board Support Package uses the Google git-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 and imaging tools)
  • Git (used for source code repositories)
  • repo (used to manage multiple git repos)
  • libssl-dev (used for signing images)

NOTE: Building images requires root privileges

Installing pre-requisites:

sudo apt-get install build-essential git python libssl-dev ncurses-dev kmod device-tree-compiler bison gettext flex -y

Install the latest version of repo (Do not rely on Ubuntu apt package being up to date):

sudo wget https://storage.googleapis.com/git-repo-downloads/repo -O /usr/local/bin/repo
sudo chmod a+rx /usr/local/bin/repo

To obtain the code:

  1. Initialize repo (fetch the repo manifest)
    mkdir $HOME/newport
    cd $HOME/newport
    repo init -u https://github.com/Gateworks/manifest-newport.git
    
  2. Sync repositories (repeat this when you want to fetch the latest code updates)
    repo sync --fail-fast -v
    
    • This will fetch/update the source repos described above. The first time it can take several minutes depending on your Internet connection and will take approximately ~2.5GB of disk space
  3. Setup build environment (*repeat this each time you open shell*)
    source newport/setup-environment
    
  4. Build the BDK (this only needs to be done once).
    make bdk
    
  5. Build desired software target as definied below. For example:
    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 Boot Firmware (BDK/ATF/U-Boot and Device-Tree images) as well as the Kernel and Ubuntu root filesystem.
  • openwrt-image - builds openwrt-newport.img.gz: A Compressed Disk Image which includes the 16MB Boot Firmware (BDK/ATF/U-Boot and Device-Tree images) as well as the OpenWrt Kernel and root filesystem. Since the release of 20.06 using the BSP is not recommended. OpenWRT can be built stand alone from its Github repo.
  • firmware-image - builds 'firmware-newport.img': 16MB 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:

Modifying the stand-alone Linux Kernel (ie for Ubuntu)

The Gateworks Newport BSP instructions 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 Newport kernel with Gateworks newport_defconfig
    make linux # first build the kernel with the standard newport_defconfig
    
  • Modify Kernel configuration (enabling modules etc):
    make -C linux menuconfig # make your changes
    make -C linux savedefconfig # once satisfied create a defconfig
    cp linux/defconfig linux/arch/arm64/configs/newport_defconfig # and copy it to the newport_defconfig
    
  • Build kernel tarball:
    make kernel_image # builds the kernel and modules and tarball
    
  • Build new disk image using the updated kernel tarball:
    make ubuntu-image
    

Modifying OpenWrt (toolchain, apps, kernel, filesystem)

The OpenWrt build system includes building its own toolchain and kernel (so the kernel and toolchain directories in the bsp directory are not used)

Modifying OpenWrt toolchain, installed applications, and general configuration:

make -C openwrt menuconfig # configure toolchain, installed applications and general configuration
  • this results in a custom .config file in the openwrt directory which you may want to save away

Modifying OpenWrt kernel:

make -C openwrt kernel_menuconfig
  • this results in modifying target/linux/octeontx/config-* in the openwrt directory which you may want to save away
  • Note that some kernel configurations get over-written by OpenWrt despite what you may select here

Build/rebuild OpenWrt (with your customizations):

make openwrt
  • results in build artifacts in {{openwrt/bin/targets/octeontx/generic/}}} including rootfs tarball, linux kernel, and squashfs filesystem

Building OpenWrt Image from Newport BSP directory:

make openwrt-image # builds OpenWrt for octeontx and compressed disk image
  • results in openwrt-newport.img - see bsp/Makefile openwrt-image target for details

If you would like to change the filesystem size for the image being created you will need to edit gen_image.sh:

https://github.com/Gateworks/openwrt/blob/20.06/target/linux/octeontx/image/gen_image.sh#L47

The path to this configuration script is established here:

https://github.com/Gateworks/openwrt/blob/20.06/target/linux/octeontx/image/Makefile

Note: See TracWiki for help on using the wiki.