3 # Copyright 2022 Raptor Engineering, LLC
4 # Licensed under the terms of the GNU LGPLv3+
6 # Ensure that the LibreSoC packages and HDL tools
7 # are installed prior to running this script,
8 # as well as the kestrel repos
10 # ./install-hdl-apt-reqs
19 export PATH
=/usr
/local
/libtrellis
/bin
:$PATH
20 export PATH
=/usr
/local
/nextpnr-ecp
5/bin
:$PATH
22 export KESTREL
=/home
/$SUDO_USER/src
/kestrel
23 echo "Building ppc64el soft floating point library..."
24 cd $KESTREL/firmware
/gcc
/libgcc
/soft-fp
25 # Ignore expected errors
27 gcc
-c -O2 -msoft-float -mno-string -mno-multiple -mno-vsx \
28 -mno-altivec -mlittle-endian -mstrict-align \
29 -fno-stack-protector -m64 -mabi=elfv2
-mcmodel=small \
30 -I..
/config
/rs6000
/ -I..
/..
/include
-I..
*.c
&> /dev
/null
32 ar -crv libsoft-fp.a
*.o
33 cp -Rp libsoft-fp.a ..
/..
/..
/
35 echo "Building Zephyr..."
37 export SOURCE_ROOT_DIR
=$
(pwd)
42 export ZEPHYR_MODULES
="${SOURCE_ROOT_DIR}/zephyr-littlefs"
43 export ZEPHYR_MODULES
="${ZEPHYR_MODULES};${SOURCE_ROOT_DIR}/zephyr-mbedtls;"
44 export ZEPHYR_MODULES
="${ZEPHYR_MODULES};${SOURCE_ROOT_DIR}/zephyr-civetweb"
45 ZEPHYR_BASE
=${SOURCE_ROOT_DIR}/zephyr-rtos \
46 ZEPHYR_TOOLCHAIN_VARIANT
=host \
47 cmake
-DZEPHYR_MODULES="${ZEPHYR_MODULES}" \
48 -DBOARD=litex_kestrel
${SOURCE_ROOT_DIR}/zephyr-firmware
49 cp -Rp ..
/..
/libsoft-fp.a zephyr
/
52 echo -n "Zephyr firmware binary now in "
53 echo "$KESTREL/firmware/zephyr-rtos/build/zephyr/zephyr.bin"