Skip to content

Commit

Permalink
Update RUN.sh to OPTEE 4.1.0 & ATF lts-v2.10.2
Browse files Browse the repository at this point in the history
  • Loading branch information
0mniteck authored Feb 25, 2024
1 parent 9acc06a commit 66d6237
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions RUN.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,35 @@
git remote remove origin && git remote add origin git@UBoot:0mniteck/U-Boot.git
rm -f spi_combined.zip
pushd /tmp/
apt update && apt install build-essential bc zip unzip bison flex libssl-dev gcc-arm-none-eabi device-tree-compiler swig python3-pyelftools python3-setuptools python3-dev parted dosfstools -y
wget https://github.com/ARM-software/arm-trusted-firmware/archive/refs/tags/v2.10.zip
echo 'f5188111df54d7f9a2f178e2d57fda765a874d2f7a24710c569abaf30dca7b44e48bf1180df52c690f569929993bbd8e732824a0afaa73377ff963535c2fc2a8 v2.10.zip' > v2.zip.sum
if [[ $(sha512sum -c v2.zip.sum) == 'v2.10.zip: OK' ]]; then sleep 0; else exit 1; fi;
wget https://github.com/u-boot/u-boot/archive/refs/tags/v2023.07.02.zip
echo '3293f165ea9b381d4c1e86a40585a9e5b242da2a37f19b592e23983c9a92ba76a3e4c9b8c56dfd4faa324c4c66bda681cc7510e0ba42202486baa8d0ed4b6182 v2023.07.02.zip' > v2023.zip.sum
if [[ $(sha512sum -c v2023.zip.sum) == 'v2023.07.02.zip: OK' ]]; then sleep 0; else exit 1; fi;
apt update && apt install build-essential bc zip unzip bison flex libssl-dev gcc-arm-none-eabi gcc-arm-linux-gnueabihf device-tree-compiler swig python3-pyelftools python3-setuptools python3-dev parted dosfstools libncurses-dev -y
wget https://github.com/OP-TEE/optee_os/archive/refs/tags/4.1.0.zip
echo '68fc9a141abb491ca82928cf128f91ace94b74012281618bcb389b0c2947f495c8d2938cad6ab3028981ba36fb4f0be12eb8ec8011d53291a02566236d707a11 4.1.0.zip' > 4.zip.sum
if [[ $(sha512sum -c 4.zip.sum) == '4.1.0.zip: OK' ]]; then echo 'OP-TEE Checksum Matched!'; else exit 1; fi;
wget https://github.com/ARM-software/arm-trusted-firmware/archive/refs/tags/lts-v2.10.2.zip
echo '56288e2d6f4d105ae18a0a07cbf7d8dae7cb868e486a992bb7f168115b823bf111f51cdfecfc97b769747374676e9de74e66ba4277889d6292a3617a1f82f656 lts-v2.10.2.zip' > v2.zip.sum
if [[ $(sha512sum -c v2.zip.sum) == 'lts-v2.10.2.zip: OK' ]]; then echo 'ATF Checksum Matched!'; else exit 1; fi;
wget https://github.com/u-boot/u-boot/archive/refs/tags/v2024.01.zip
echo '309afe5cc234a70c4f7addacd6e10df2945587a87d1f0844261f4ca973ec2970e6e50f210cdbf8179f5b029869ee92132683a26764ec8d44f6f0f17e6a300084 v2024.01.zip' > v2024.zip.sum
if [[ $(sha512sum -c v2024.zip.sum) == 'v2024.01.zip: OK' ]]; then echo 'U-Boot Checksum Matched!'; else exit 1; fi;
unzip 4.*.*.zip
unzip v202*.zip
unzip v2.*.zip
unzip lts*.zip
cd optee_os-*
echo "Entering OP-TEE ------"
make -j$(nproc) PLATFORM=rockchip-rk3399 CFG_ARM64_core=y
export TEE=/tmp/optee_os-4.1.0/out/arm-plat-rockchip/core/tee.bin
cd ..
cd arm-trusted-firmware-*
echo "Entering TF-A ------"
make realclean
make PLAT=rk3399 bl31
export BL31=/tmp/arm-trusted-firmware-2.10/build/rk3399/release/bl31/bl31.elf
export BL31=/tmp/arm-trusted-firmware-lts-v2.10.2/build/rk3399/release/bl31/bl31.elf
cd ..
cd u-boot-202*
echo "Entering U-Boot ------"
sed -i 's/CONFIG_BAUDRATE=1500000/CONFIG_BAUDRATE=115200/' configs/rockpro64-rk3399_defconfig
make rockpro64-rk3399_defconfig && make -j$(nproc) all
make rockpro64-rk3399_defconfig
make -j$(nproc) all
image_name="spi_idbloader.img"
combined_name="spi_combined.img"
tools/mkimage -n rk3399 -T rkspi -d tpl/u-boot-tpl.bin:spl/u-boot-spl.bin "${image_name}"
Expand All @@ -37,7 +47,7 @@ dd if=/dev/zero of="${image_name}" conv=notrunc bs=1 count=1 seek=${padsize}
cat ${image_name} u-boot.itb > "${combined_name}"
read -p "Insert any SD Card, Then Press Enter to Continue"
dd if=/dev/zero of=/dev/mmcblk1 bs=1M count=2000 status=progress
parted /dev/mmcblk1 mktable gpt mkpart P1 fat32 16MB 1G -s
parted /dev/mmcblk1 mktable gpt mkpart P1 fat32 16MB 1G -s && sleep 3
mkfs.fat /dev/mmcblk1p1
mount /dev/mmcblk1p1 /mnt
sha512sum spi_combined.img
Expand All @@ -59,8 +69,8 @@ popd
cp /tmp/spi_combined.zip spi_combined.zip
git status && git add -A && git status
read -p "Continue -->"
git commit -a -S -m "Successful Build of U-Boot W/ TF-A For The RockPro64"
git commit -a -S -m "Successful Build of U-Boot W/ TF-A & OP-TEE For The RockPro64"
git push --set-upstream origin RP64-rk3399-A
cd ..
apt remove --purge build-essential bc zip unzip bison flex libssl-dev gcc-arm-none-eabi device-tree-compiler swig python3-pyelftools python3-setuptools python3-dev parted dosfstools -y && apt autoremove -y
rm -f -r /tmp/u-boot* && rm -f /tmp/lts-* && rm -f /tmp/v2* && rm -f -r /tmp/arm-trusted-firmware-* && rm -f /tmp/spi_*
apt remove --purge build-essential bc zip unzip bison flex libssl-dev gcc-arm-none-eabi gcc-arm-linux-gnueabihf device-tree-compiler swig python3-pyelftools python3-setuptools python3-dev parted dosfstools libncurses-dev -y && apt autoremove -y
rm -f -r /tmp/u-boot* && rm -f /tmp/4.* && rm -f /tmp/v2* && rm -f -r /tmp/arm-trusted-firmware-* && rm -f -r /tmp/optee_os-* && rm -f /tmp/spi_* && rm -f /tmp/rk*

0 comments on commit 66d6237

Please sign in to comment.