ramdump: check chipid for ramdump function in fip script. [1/1]

PD#SWPL-62880

Problem:
The compiled firmware may be burned to a different SOC.

Solution:
mk script add argv --chipid, and bl2 will check this id.

Verify:
verified on sc2_ah212

Change-Id: Ia347bbda6c6240efc3c8aaba9debfd9ea35e93be
diff --git a/mk_script.sh b/mk_script.sh
index 13834ef..9e3f130 100755
--- a/mk_script.sh
+++ b/mk_script.sh
@@ -215,6 +215,12 @@
 	if [ "y" == "${CONFIG_AML_CRYPTO_IMG}" ]; then
 		cp ${FIP_BUILD_FOLDER}boot.img.encrypt ${BUILD_FOLDER}boot.img.encrypt
 	fi
+
+	if [ ! -z ${CONFIG_CHIPID_SUPPORT} ]; then
+		mv ${BUILD_FOLDER}/u-boot.bin.signed 	${BUILD_FOLDER}/u-boot.bin.${CONFIG_RAMDUMP_CHIPID}.signed
+		mv ${BUILD_FOLDER}/u-boot.bin.sd.bin.signed 	${BUILD_FOLDER}/u-boot.bin.${CONFIG_RAMDUMP_CHIPID}.sd.bin.signed
+		mv ${BUILD_FOLDER}/u-boot.bin.usb.signed 	${BUILD_FOLDER}/u-boot.bin.${CONFIG_RAMDUMP_CHIPID}.usb.signed
+	fi
 }
 
 function update_bin_path() {
@@ -342,6 +348,9 @@
         ./$(basename $0) [config_name] --update-bl[x] --cov
         ./$(basename $0) [config_name] --update-bl[x] --cov-high [path]
 
+    8. build uboot with ramdump function
+        ./$(basename $0) [config_name] --update-bl[x] --chipid [cpu_id]
+
     Example:
     1) ./$(basename $0) gxb_p200_v1
       build gxb_p200_v1 config
@@ -358,6 +367,9 @@
     5) ./$(basename $0) --check-compile skt
       check all skt board compile status
 
+    6) ./$(basename $0) --update-bl2 --chipid 1c35ea385f52ea56 --update-bl2e
+       build uboot with ramdump function
+
     Remark:
     bl[x].bin/img priority:
     1. uboot will use binaries under bl[x]/bin/ folder by default, bl[x] version specified in .repo/manifest.xml
@@ -410,6 +422,13 @@
 				export PATTERN_PATH
 				check_coverity $@
 				exit ;;
+			--chipid)
+				CONFIG_CHIPID_SUPPORT=1
+				export CONFIG_CHIPID_SUPPORT
+				CONFIG_RAMDUMP_CHIPID="${argv[$i]}"
+				export CONFIG_RAMDUMP_CHIPID
+				echo "SET CHIP ID: ${CONFIG_RAMDUMP_CHIPID} "
+				continue ;;
 			clean|distclean|-distclean|--distclean)
 				clean
 				exit ;;