Commit b0138984 authored by Angus Ainslie's avatar Angus Ainslie

Merge branch 'for-master' into 'master'

Add devkit target

See merge request !51
parents be26f191 a40332c8
Pipeline #2381 passed with stage
in 14 seconds
......@@ -145,9 +145,9 @@ set +x
echo "gitrev: $(git log --format=format:%H -1)" >> files/meta.yml
if [ "${pureos_board}" == "imx8" ] || [ "${pureos_board}" == "ec-som" ]; then
if [ "${arch}" == "arm64" ]; then
if [ ! -f "files/uboot-${uboot_type}/m4.bin" ]; then
wget -Pfiles/uboot-${uboot_type}/ "${kernel_url}/uboot-${pureos_board}/m4.bin"
wget -Pfiles/uboot-${uboot_type}/ "${kernel_url}/uboot-${uboot_type}/m4.bin"
fi
loop=$(setup_loop "${bootimg}")
......
node {
gitUrl = 'https://source.puri.sm/librem5/image-builder.git'
artifacts = 'files/linux-*.deb,kernel-git*.txt'
artifacts = 'files/linux-*.deb,kernel-git*.txt,files/rsi_*.tar'
branch = 'master'
parameters {
......
......@@ -63,7 +63,7 @@ case ${pureos_board} in
DTS_FILE=""
;;
ec-som)
KERNEL_BRANCH=imx8-4.18
KERNEL_BRANCH=imx8-4.18-wip
KERNEL_REPO=https://source.puri.sm/Librem5/linux-emcraft.git
CROSS_COMPILER=aarch64-linux-gnu-
DOT_CONFIG=librem5-evk_defconfig
......@@ -112,6 +112,22 @@ cp ../*${COMPILER_ARCH}.deb ${KERNEL_OUTPUT}
cd ${CWD}
RSI_VER=RS9116.NB0.NL.PURISM_FW_UPGRADE.LNX.1.0
tar -xf files/${RSI_VER}.tgz
RSI_BUILD_PATH=${RSI_VER}/rsi/
ESCAPED_KERNEL_DIR=$(echo "${LINUX_DIR}" | sed 's/\//\\\//g')
sed "s/KERNELDIR=.*/KERNELDIR=${ESCAPED_KERNEL_DIR}/" -i ${RSI_BUILD_PATH}/Makefile
cd ${RSI_BUILD_PATH}
make ${MAKE_OPTS} ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILER} -C ${CWD}/${LINUX_DIR} M=$PWD modules
cd ${CWD}/${RSI_BUILD_PATH} && tar -cf ${CWD}/../files/rsi_upgrade.tar *.ko
cd ${CWD}/${RSI_VER}/Firmware && tar -cf ${CWD}/../files/rsi_firmware.tar *
cd ${CWD}
echo ${KERNEL_REPO} > kernel-git-${ARCH}.txt
git log | head -n 1 | awk '{ print $2 };' >> kernel-git-${ARCH}.txt
......
......@@ -20,7 +20,7 @@ CWD=`pwd`
usage() {
echo "Usage : $1 "
echo " -h Display this help message."
echo " -b [imx6|imx8] select the board type."
echo " -b [imx6|imx8|ec-som|devkit-recovery] select the board type."
echo " -c don't make clean."
}
......@@ -115,6 +115,15 @@ function combine_uboot_bins()
fi
cd ${ATF_DIR}
git checkout ${ATF_BRANCH}
set +e
case ${pureos_board} in
ec-som|devkit-recovery)
patch -N -p1 < ${CWD}/files/imx-atf-disable-lpddr4-init.patch
;;
esac
set -e
make PLAT=${ATF_PLAT} CROSS_COMPILE=${CROSS_COMPILER} bl31
fi
......@@ -241,6 +250,22 @@ case ${pureos_board} in
ARCH=arm
COPY_UBOOT=copy_uboot
;;
devkit-recovery)
ATF_REPO=https://source.codeaurora.org/external/imx/imx-atf
ATF_BRANCH=imx_4.9.51_imx8m_ga
ATF_PLAT=imx8mq
DDR_FILE=files/imx-mkimage-emcraft.tar.gz
MKIMAGE_REPO=https://source.codeaurora.org/external/imx/imx-mkimage
MKIMAGE_BRANCH=imx_4.9.51_imx8m_ga
UBOOT_REPO=git@source.puri.sm:Librem5/uboot-imx.git
HW_DEFCONFIG=imx8m_lpddr4_3gb_som_defconfig
CROSS_COMPILER=aarch64-linux-gnu-
UBOOT_BRANCH=devkit-wip
UBOOT_BIN=iMX8M/flash.bin
UBOOT_DTB=librem5-evk.dtb
ARCH=arm
COPY_UBOOT=copy_uboot
;;
*)
echo "unrecognized board type ${pureos_board}"
exit 1
......@@ -253,13 +278,16 @@ build_uboot ${pureos_board} ${ARCH} ${CROSS_COMPILER} ${HW_DEFCONFIG} ${make_cle
cd ${CWD}
if [ ${pureos_board} == "imx8" -o ${pureos_board} == "ec-som" ]; then
build_cortex_m4 ${UBOOT_OUTPUT}
combine_uboot_bins ${pureos_board}
cd imx-mkimage
else
cd u-boot-${pureos_board}
fi
case ${pureos_board} in
imx8|ec-som|devkit-recovery)
build_cortex_m4 ${UBOOT_OUTPUT}
combine_uboot_bins ${pureos_board}
cd imx-mkimage
;;
*)
cd u-boot-${pureos_board}
;;
esac
${COPY_UBOOT} ${pureos_board} ${UBOOT_OUTPUT} ${UBOOT_BIN}
......
......@@ -54,7 +54,7 @@ case ${pureos_board} in
kernel_arch=arm64
kernel_version=4.18.0-g231e3e21_4.18.0-g231e3e21-1
board_type=unknown
fdt_file=librem5-evk.dtb
fdt_file=emcraft-imx8-som.dtb
qemu=/usr/bin/qemu-aarch64-static
kernel_deb=linux-image-${kernel_version}_${kernel_arch}.deb
uboot_bin=u-boot-ec-som.imx
......@@ -69,6 +69,25 @@ case ${pureos_board} in
--arch="${arch}"
)
;;
devkit)
arch=arm64
kernel_arch=arm64
kernel_version=4.18.11-g73af4578_4.18.11-g73af4578-1
board_type=unknown
fdt_file=librem5-evk.dtb
qemu=/usr/bin/qemu-aarch64-static
kernel_deb=linux-image-${kernel_version}_${kernel_arch}.deb
uboot_bin=u-boot-devkit-recovery.imx
uboot_type=devkit-recovery
vmdebootstrap_opts=(--foreign="${qemu}"
--bootsize 200M
--boottype ext2
--bootoffset 5MiB
--custom-package "files/${kernel_deb}"
--no-kernel
--arch="${arch}"
)
;;
qemu-x86_64)
board_type=x86
arch=x86_64
......
......@@ -11,7 +11,7 @@ dtbname=##DTBNAME##
console=ttymxc0
dtype=mmc
rfspart=2
rfspart=##RFSPART##
disk=1
root=/dev/mmcblk${disk}p${rfspart}
......
......@@ -47,12 +47,7 @@ function setup_kernel()
imx6)
fdt_source="${basedir}"/usr/lib/linux-image-*/"${fdt_file}"
;;
imx8)
fdt_source="${basedir}"/usr/lib/linux-image-*/freescale/"${fdt_file}"
cp "${basedir}/boot/${link}" "${basedir}/boot/Image.gz"
gunzip "${basedir}/boot/Image.gz"
;;
ec-som)
ec-som|devkit|imx8)
fdt_source="${basedir}"/usr/lib/linux-image-*/freescale/"${fdt_file}"
cp "${basedir}/boot/${link}" "${basedir}/boot/Image.gz"
gunzip "${basedir}/boot/Image.gz"
......@@ -67,10 +62,16 @@ function setup_kernel()
function setup_uboot()
{
sed -e "s/##DTBNAME##/${fdt_file}/" "data/boot-${pureos_board}.txt.in" > "${basedir}/boot/boot.txt"
mkimage -A arm -T script -O linux -d "${basedir}/boot/boot.txt" "${basedir}/boot/boot.scr"
sed -e "s/##DTBNAME##/${fdt_file}/" "data/boot-${pureos_board}.txt.in" > "${basedir}/boot/boot_emmc.txt"
sed -e "s/##RFSPART##/0/" -i "${basedir}/boot/boot_emmc.txt"
mkimage -A arm -T script -O linux -d "${basedir}/boot/boot_emmc.txt" "${basedir}/boot/boot_emmc.scr"
sed -e "s/##DTBNAME##/${fdt_file}/" "data/boot-${pureos_board}.txt.in" > "${basedir}/boot/boot_sd.txt"
sed -e "s/##RFSPART##/1/" -i "${basedir}/boot/boot_sd.txt"
mkimage -A arm -T script -O linux -d "${basedir}/boot/boot_sd.txt" "${basedir}/boot/boot_sd.scr"
if [ "${pureos_board}" == "imx6" ]; then
ln -fs boot.scr "${basedir}/boot/6x_bootscript"
else
ln -fs "${basedir}/boot/boot_sd.scr" boot.scr
fi
[ ! -d "files/uboot-${pureos_board}" ] || cp -a "files/uboot-${pureos_board}/"* "${basedir}/boot/"
......@@ -204,6 +205,11 @@ EOF
function setup_network()
{
cat << EOF > "${basedir}/etc/modprobe.d/rsi_91x.conf"
# This is for wlan sta + BT
options dev_oper_mode=13 rsi_zone_enabled=1
EOF
cat << EOF > "${basedir}/etc/hosts"
127.0.0.1 pureos localhost
::1 localhost ip6-localhost ip6-loopback
......@@ -268,7 +274,7 @@ setup_sshd
# Skip setup until we have hardware, not needed for qemu
case "${pureos_board}" in
imx6|imx8|ec-som)
imx6|imx8|ec-som|devkit)
setup_kernel
setup_uboot
;;
......
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