build: kvim3: add vim3l in build-kvim3 script 30/248330/1
authorJaehoon Chung <jh80.chung@samsung.com>
Wed, 25 Nov 2020 09:20:58 +0000 (18:20 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 25 Nov 2020 09:23:42 +0000 (18:23 +0900)
There is no reason not to reuse build-kvim3 script.
If one wants to build vim3 or vim3l, pass the argument as target name.
- ./build-kvim3.sh vim3 or vim3l

Change-Id: I645e52f8dc97269e2048c0a2357755029dcfe7d9
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
tizen/build-kvim3.sh

index dc7f938..c25a585 100755 (executable)
@@ -14,18 +14,39 @@ check_ccache()
 
 build_uboot()
 {
-       if [ -d output ]; then
-               rm output/vim3/*
-               rm output/*
-       fi
+       echo "Build $1"
+       if [ "$1" = "vim3" ]; then
+               if [ -d output ]; then
+                       rm output/vim3/*
+                       rm output/*
+               fi
+
+               [ -d output/vim3 ] || mkdir -p output/vim3
+
+               if ! [ -e .config ] ; then
+                       make ARCH=arm64 khadas-vim3_defconfig
+               fi
+               make CROSS_COMPILE="$CCACHE $CROSS_COMPILE" $JOBS
+               ./tools/mkimage -A arm64 -T script -C none -n "Tizen KVIM3 u-boot helper" -d ./board/amlogic/w400/tizen-boot-khadas-vim3-64b.scr ./output/vim3/boot.scr.uimg
+       elif [ "$1" = "vim3l" ]; then
+               if [ -d output ]; then
+                       rm output/vim3l/*
+                       rm output/*
+               fi
 
-       [ -d output/vim3 ] || mkdir -p output/vim3
+               [ -d output/vim3l ] || mkdir -p output/vim3l
 
-       if ! [ -e .config ] ; then
-               make ARCH=arm64 khadas-vim3_defconfig
+               if ! [ -e .config ] ; then
+                       make ARCH=arm64 khadas-vim3l_defconfig
+               fi
+               make CROSS_COMPILE="$CCACHE $CROSS_COMPILE" $JOBS
+               ./tools/mkimage -A arm64 -T script -C none -n "Tizen KVIM3L u-boot helper" -d ./board/amlogic/w400/tizen-boot-khadas-vim3l-64b.scr ./output/vim3l/boot.scr.uimg
+       else
+               echo "Usage ./build_vim3.sh [TARGET]"
+               echo "  - TARGET : vim3 or vim3l"
+               echo "  - e.g) ./build_vim3.sh vim3 or ./build_vim3.sh vim3l"
+               exit 1;
        fi
-       make CROSS_COMPILE="$CCACHE $CROSS_COMPILE" $JOBS
-       ./tools/mkimage -A arm64 -T script -C none -n "Tizen KVIM3 u-boot helper" -d ./board/amlogic/w400/tizen-boot-khadas-vim3-64b.scr ./output/vim3/boot.scr.uimg
 
 }
 
@@ -70,8 +91,45 @@ build_vim3()
        cd ..
 }
 
+build_vim3l()
+{
+       if [ -e u-boot.bin ] ; then
+               cp u-boot.bin output/bl33.bin
+       fi
+
+       ./fip/aml_encrypt_g12a --bl3sig --input output/bl33.bin --compress lz4 \
+                                       --output output/bl33.bin.enc \
+                                       --level v3 --type bl33 --compress lz4
+       ./fip/aml_encrypt_g12a --bootmk \
+               --output output/u-boot-kvim3l.bin \
+               --bl2 fip/kvim3l/bl2.n.bin.sig \
+               --bl30 fip/kvim3l/bl30_new.bin.enc \
+               --bl31 fip/kvim3l/bl31.img.enc \
+               --bl33 output/bl33.bin.enc \
+               --ddrfw1 fip/kvim3l/ddr4_1d.fw \
+               --ddrfw2 fip/kvim3l/ddr4_2d.fw \
+               --ddrfw3 fip/kvim3l/ddr3_1d.fw \
+               --ddrfw4 fip/kvim3l/piei.fw \
+               --ddrfw5 fip/kvim3l/lpddr4_1d.fw \
+               --ddrfw6 fip/kvim3l/lpddr4_2d.fw \
+               --ddrfw7 fip/kvim3l/diag_lpddr4.fw \
+               --ddrfw8 fip/kvim3l/aml_ddr.fw \
+               --ddrfw9 fip/kvim3l/lpddr3_ld.fw \
+               --level v3
+
+       cp params.bin output/vim3l/
+       cd ./output/
+       tar cvf kvim3l_bootloader.tar u-boot-kvim3l.bin vim3l/boot.scr.uimg vim3l/params.bin
+       cd ..
+}
+
+
 check_ccache
-build_uboot
+build_uboot $*
 generate_param
 
-build_vim3
+if [ $1 = "vim3" ]; then
+       build_vim3
+elif [ $1 = "vim3l" ]; then
+       build_vim3l
+fi