Commit a0f760f5 authored by Rabeeh Khoury's avatar Rabeeh Khoury

updated documentation and ubuntu version

1. moved from ubuntu disco to focal
2. updated documentation on the unified image that auto-detects boot
device
Signed-off-by: default avatarRabeeh Khoury <rabeeh@solid-run.com>
parent 2b032eb9
......@@ -3,7 +3,7 @@
## Introduction
Main intention of this repository is to provide build scripts that are easy to handle than NXP's flexbuild build environment.
They are used in SolidRun quickly build images for development where those images can be SD or SPI booted or network TFTP (kernel) or used for root NFS
They are used in SolidRun to quickly build images for development where those images can be SD or SPI booted or network TFTP (kernel) or used for root NFS
The sources are pulled from NXP's codeaurora repository and patched after being clone using the patches in the patches/ directory
......@@ -22,13 +22,13 @@ A docker image providing a consistent build environment can be used as below. Si
## Build with host tools
Simply running ./runme.sh will check for required tools, clone and build images and place results in images/ directory.
We enhanced the NXP PBI scripting tools to accomodate auto detection of boot device, due to that the boot images are now unified for SD, eMMC and SPI.
## Customize
By default the script will create an image bootable from SD (ready to use .img file) with DDR4 SO-DIMMs 3200Mtps, SERDES configuration 8/5/2 (SERDES1 = 8, SERDES2 = 5, SERDES = 2) and u-boot as boot loader.
Following are the environment variables that can be modified -
Selecting boot device - *BOOT=sd,xspi*
Selecting DDR4 SO-DIMM speed - *DDR_SPEED=2400,2600,2900,3200*
Selecting SERDES configuration - *SERDES=SD1_SD2_SD3*
......@@ -37,15 +37,17 @@ Selecting boot loader - *BOOT_LOADER=u-boot,uefi*
### Examples:
generate *images/lx2160acex7_2000_700_3200_8_5_2_sd.img*:
- `./runme.sh` **or**
- `docker run --cap-add SYS_ADMIN --device /dev/loop0 --device /dev/loop-control -i -t -v "$PWD":/work lx2160a_build $(id -u) $(id -g)`
generate *images/lx2160acex7_2000_700_3200_8_5_2_xspi.img*:
- `BOOT=xspi ./runme` **or**
- `docker run --cap-add SYS_ADMIN --device /dev/loop0 --device /dev/loop-control -i -t -v "$PWD":/work -e BOOT=xspi lx2160a_build $(id -u) $(id -g)`
generates *images/lx2160acex7_2000_700_3200_8_5_2.img* which is an image ready to be deployed on micro SD card and *images/lx2160acex7_xspi_2000_700_3200_8_5_2.img* which is an image ready to be deployed on the COM SPI flash.
## Deploying
For SD card bootable images, plug in a micro SD into your machine and run the following, where sdX is the location of the SD card got probed into your machine -
`sudo dd if=images/lx2160acex7_2000_700_3200_8_5_2_sd.img of=/dev/sdX`
For SPI boot, boot thru SD card and then load the _xspi_ images to system memory and flash it using the `sf probe` and `sf update` commands. An example below loads the image through TFTP prototocl, flashes and then verifies the image -
`sf probe; setenv ipaddr 192.168.15.223; setenv serverip 192.168.15.3; tftp 0xa0000000 lx2160acex7_xspi_2000_700_2600_8_5_2_xspi.img;sf update 0xa0000000 0 $filesize; sf read 0xa4000000 0 $filesize; cmp 0xa0000000 0xa4000000 $filesize`
......@@ -143,7 +143,7 @@ addimportant=false
packages=$PACKAGES
source=http://ports.ubuntu.com/
keyring=ubuntu-keyring
suite=disco
suite=focal
components=main universe multiverse
EOF
sudo multistrap -a arm64 -d ubuntu -f ubuntu.conf
......@@ -393,10 +393,10 @@ parted --script $ROOTDIR/images/${IMG} mklabel msdos mkpart primary 64MiB 464MiB
truncate -s 400M $ROOTDIR/images/tmp/boot.part
mkfs.ext4 -b 4096 -F $ROOTDIR/images/tmp/boot.part
e2cp -G 0 -O 0 $ROOTDIR/images/tmp/ubuntu-core.img $ROOTDIR/images/tmp/boot.part:/
\rm -rf $ROOTDIR/images/xspi_header.img
truncate -s 128K $ROOTDIR/images/xspi_header.img
dd if=$ROOTDIR/build/atf/build/lx2160acex7/release/bl2_auto.pbl of=$ROOTDIR/images/xspi_header.img bs=512 conv=notrunc
e2cp -G 0 -O 0 $ROOTDIR/images/xspi_header.img $ROOTDIR/images/tmp/boot.part:/
\rm -rf $ROOTDIR/images/tmp/xspi_header.img
truncate -s 128K $ROOTDIR/images/tmp/xspi_header.img
dd if=$ROOTDIR/build/atf/build/lx2160acex7/release/bl2_auto.pbl of=$ROOTDIR/images/tmp/xspi_header.img bs=512 conv=notrunc
e2cp -G 0 -O 0 $ROOTDIR/images/tmp/xspi_header.img $ROOTDIR/images/tmp/boot.part:/
dd if=$ROOTDIR/images/tmp/boot.part of=$ROOTDIR/images/${IMG} bs=1M seek=64
# PFE firmware at 0x100
......@@ -438,7 +438,7 @@ dd if=$ROOTDIR/build/linux/kernel-lx2160acex7.itb of=images/${IMG} bs=512 seek=3
# Ramdisk at 0x10000
# RCW+PBI+BL2 at block 8
dd if=$ROOTDIR/images/${IMG} of=$ROOTDIR/images/xspi.img bs=1M count=64
dd if=$ROOTDIR/build/atf/build/lx2160acex7/release/bl2_auto.pbl of=images/xspi.img bs=512 conv=notrunc
dd if=$ROOTDIR/images/${IMG} of=$ROOTDIR/images/lx2160acex7_xspi_${SPEED}_${SERDES}.img bs=1M count=64
dd if=$ROOTDIR/build/atf/build/lx2160acex7/release/bl2_auto.pbl of=images/lx2160acex7_xspi_${SPEED}_${SERDES}.img bs=512 conv=notrunc
dd if=$ROOTDIR/build/atf/build/lx2160acex7/release/bl2_auto.pbl of=images/${IMG} bs=512 seek=8 conv=notrunc
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment