Changes between Initial Version and Version 1 of newport/bsp

02/08/2018 08:49:09 PM (5 years ago)
Tim Harvey

moved section from newport page


  • newport/bsp

    v1 v1  
     3= Newport Board Support Package (BSP) =
     4Gateworks provides a Board Support Package for Newport which provides source code and an easy mechanism to build:
     5 * [wiki:#kernel Gateworks Newport Linux Kernel]
     6 * [wiki:newport/boot Gateworks Newport Boot Firmware]
     7 * [wiki:#openwrt Gateworks Newport OpenWrt]
     10== BSP Source Code ==
     11Newport 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].
     13The following !GitHub repos are used for Newport:
     14 * [] - Newport BSP support scripts and Makefile  ([ watch])
     15 * [] - Newport BSP repo Manifest  ([ watch])
     16 * [ images-newport] - Newport pre-built firmware Firmware Images ([ watch])
     17 * [ uboot-newport] - Newport Bootloader ([ watch)]
     18 * [ linux-newport] - Newport Linux Kernel ([ watch)]
     19 * [ dts-newport] - Newport Linux Device-Tree ([ watch)]
     20 * [ bdk-newport] - Newport BDK (used as Secondary Program Loader) ([ watch)]
     21 * [ atf-newport] - Newport ATF (ARM Trusted Firmware) ([ watch)]
     22 * [ openwrt] - Gateworks OpenWrt ([ watch)]
     26== Pre-built Firmware Images ==
     27The [ images-newport] !GitHub repository hosts various pre-built firmware images used for Newport:
     28 * [ GSC firmware image]
     29 * [ boot firmware image] (everything up to and including the bootloader stored on the embedded FLASH boot device) (see [wiki:newport/boot newport/boot] for details)
     30 * Download linux-newport.tar.xz from [ latest Newport kernel release] - Compressed TAR archive of pre-built Linux kernel
     31 * Download xenial-newport.img.gz from [ latest Newport Ubuntu release] - Compressed Disk Image containing Firmware and Ubuntu 16.04 Xenial
     32 * Download openwrt-newport.img.gz from [ latest Newport OpenWrt build] - Compressed Disk Image containing Firmware and OpenWrt
     33 * [ xenial-newport.tar.xz] - Compressed TAR archive of Ubuntu 16.04 Xenial arm64 root filesystem
     37== Building BSP from source ==
     38Below are instructions for building all of the bootloader components and Linux kernel. This does not include Ubuntu or any other operating systems. Pre-built images are available [#images above].
     40The Gateworks Newport Board Support Package uses the Google {{{repo}}} tool to manage multiple code repositories.
     42The following pre-requisites are needed to build the Newport BSP:
     43 * Linux Development host (desktop or laptop computer) (Ubuntu 16.04 is used by Gateworks and tested)
     44 * Python 2.x (required by the 'repo' tool)
     45 * Git (used for source code repositories)
     47To obtain the code:
     48 1. Get repo tool (download latest version of tool and put it in your path)
     50mkdir $HOME/.bin/
     51echo "PATH=\$PATH:$HOME/.bin/repo" >> $HOME/.profile
     52curl > $HOME/.bin/repo
     53chmod a+x $HOME/.bin/repo
     55 1. Initialize repo (fetch the repo manifest)
     57mkdir $HOME/newport
     58cd $HOME/newport
     59repo init -u
     61 1. Sync repositories (repeat this when you want to fetch the latest code updates)
     63repo sync
     65  * 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
     66 1. Setup build environment (***repeat this each time you open shell***)
     68source newport/setup-environment
     70 1. Build desired targets and images. For example:
     72make -j8 openwrt-image # build openwrt-newport.img.gz
     75The build targets supported by the Newport BSP include:
     76  * **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).
     77  * **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
     78  * **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 Kenrel and Ubuntu root filesystem
     79  * **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 Kenrel and root filesystem
     81The resulting images can be installed to boot media (see [wiki:newport#firmware-update newport/firmware-update])
     85== Building or modifying the Linux Kernel ==
     86The Gateworks Newport BSP instructions [#bsp above] create an environment for building the Linux kernel among other targets.
     88Here are some additional instructions for common actions (make sure you have installed the BSP and setup your shell environment as specified above):
     89 * Modify Kernel configuration (enabling modules etc):
     91cd linux
     92make newport_defconfig # start with the Newport kernel configuration
     93make menuconfig # modify as desired
     94make # build Image and modules
     96 * Build kernel tarball:
     98cd linux
     99make # build Image and modules
     100mkdir -p install/boot # create install and install/boot directories
     101cp arch/arm64/boot/Image install/boot # copy kernel Image
     102make INSTALL_MOD_PATH=install modules_install # install modules
     103tar -cvJf /tftpboot/newport/linux-newport.tar.xz --numeric-owner -C install . # create tarball
     106While 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.
     109== Building Ubuntu Operating System - rootfs ==
     110This is not part of the Gateworks BSP described above.
     112Information for building Ubuntu rootfs can be found here: [wiki:newport/ubuntu]