[Version]svn408

Change-Id: Ib2e6d37049b7db86cb95176cfbe11617fec1528b
diff --git a/meta/meta-mediatek-ivt/recipes-core/base-files/base-files/fstab b/meta/meta-mediatek-ivt/recipes-core/base-files/base-files/fstab
old mode 100644
new mode 100755
index 99555fc..6875918
--- a/meta/meta-mediatek-ivt/recipes-core/base-files/base-files/fstab
+++ b/meta/meta-mediatek-ivt/recipes-core/base-files/base-files/fstab
@@ -25,5 +25,7 @@
 /STATE/system/etc/security	/system/etc/security    none       noauto,x-systemd.automount,bind    0  0
 /STATE/etc/adr       		/etc/adr                none       noauto,x-systemd.automount,bind    0  0
 /STATE/usr/share/gps		/usr/share/gps          none       noauto,x-systemd.automount,bind    0  0
+/STATE/var/log		        /var/log                   none       bind    0  0
+/STATE/log		            /log                   none       bind    0  0
 
 /dev/disk/by-partlabel/sncfg              /mnt/sncfg           auto      defaults          1  2
diff --git a/meta/meta-mediatek-ivt/recipes-core/base-files/base-files/fstab-nand b/meta/meta-mediatek-ivt/recipes-core/base-files/base-files/fstab-nand
old mode 100644
new mode 100755
index 91dd286..2b08177
--- a/meta/meta-mediatek-ivt/recipes-core/base-files/base-files/fstab-nand
+++ b/meta/meta-mediatek-ivt/recipes-core/base-files/base-files/fstab-nand
@@ -26,5 +26,7 @@
 /STATE/system/etc/security	/system/etc/security    none       noauto,x-systemd.automount,bind    0  0
 /STATE/etc/adr       		/etc/adr                none       noauto,x-systemd.automount,bind    0  0
 /STATE/usr/share/gps		/usr/share/gps          none       noauto,x-systemd.automount,bind    0  0
+/STATE/var/log		        /var/log                   none       bind    0  0
+/STATE/log		            /log                   none       bind    0  0
 
 ubi5_0               /mnt/sncfg           ubifs      nosuid,nodev          1  2
diff --git a/meta/meta-mediatek-mt2731/conf/machine/auto2731evb-ivt-main-user.conf b/meta/meta-mediatek-mt2731/conf/machine/auto2731evb-ivt-main-user.conf
old mode 100644
new mode 100755
index 3259349..a87dcd1
--- a/meta/meta-mediatek-mt2731/conf/machine/auto2731evb-ivt-main-user.conf
+++ b/meta/meta-mediatek-mt2731/conf/machine/auto2731evb-ivt-main-user.conf
@@ -57,7 +57,8 @@
 SINGLE_BIN_MODEM_SUPPORT = "yes"
 
 # secure boot
-SECURE_BOOT_ENABLE ?= "no"
+SECURE_BOOT_ENABLE ?= "yes"  
+SECURE_BOOT_TYPE = "avb"
 MTK_KEY_DIR = "${TOPDIR}/../meta/meta-mediatek/conf/machine/keys"
 SBC_RSA_ALGO = "rsa2048"
 SBC_HASH_ALGO = "sha256"
@@ -65,7 +66,10 @@
 SBC_KEY = "sbc_key"
 SBC_KEY_RSA3072 = "sbc_key_3072"
 SBC_KEY_RSA4096 = "sbc_key_4096"
-VERIFIED_KEY = "verified_key"
+#VERIFIED_KEY = "verified_key"
+VB_HASH_ALGO = "sha256"
+VB_RSA_ALGO = "rsa2048"
+VERIFIED_KEY = "verified_${VB_RSA_ALGO}_key"
 MTEE_KEY = "mtee_key"
 
 MD_VERIFY = "no"
@@ -75,14 +79,16 @@
 
 # AB update
 AB_OTA_UPDATER = "yes"
-AB_OTA_PARTITIONS = "boot system"
+AB_OTA_PARTITIONS = "boot system bl2 bl33 md1img tee vbmeta"
 # LK
-LK_PROJECT = "auto2731evb-ivt-mcp_nand_ab"
+LK_PROJECT = "auto2731evb-ivt-mcp_nand"
 BOOTDEV_TYPE = "nand"
 TARGET_CFLAGS += "-DMTK_BOOTDEV_TYPE=1 -Os"
 NAND_TYPE = "mcp_nand"
 #nand name should be the same with the one in nand-utils/nand_device_list.txt
-NAND_CHIP_NAME = "MT29F4G08ABBDA"
+#tianyan@2021.09.17 modify for nand+dram start
+NAND_CHIP_NAME = "MT29F4G08ABBFAH"
+#tianyan@2021.09.17 modify for nand+dram end
 #nand brom header version:
 #        1.0 or null: header sytle from Tablet SOC, which is independent of PMBR
 #        2.0: header sytle from mt2712, which is designed for GPT, and is part of PMBR
@@ -94,7 +100,7 @@
 LK_MAX_SIZE = "0x3c000"
 
 # BL33
-BL33_PROJECT = "auto2731evb-ivt-mcp_nand-bl33_ab"
+BL33_PROJECT = "auto2731evb-ivt-mcp_nand-bl33"
 BL33_LOAD_OFFSET = "0x0"
 BL33_LOADADDRESS = "0x42110000"
 BL33_ENTRYPOINT = "0x42110000"
@@ -142,8 +148,10 @@
 UBOOT_ENTRYPOINT = "0x40008000"
 UBOOT_LOADADDRESS = "0x40008000"
 
+#tianyan@2021.09.17 modify for nand+dram start
 # Scatter File
-SCATTER_PROJECT = "auto2731-ivt-mcp_nand"
+SCATTER_PROJECT = "auto2731-ivt-mcp_nand_lp4"
+#tianyan@2021.09.17 modify for nand+dram end
 
 # Image FS
 IMAGE_FSTYPES ?= "squashfs"
@@ -152,11 +160,13 @@
 EXTRA_IMAGEDEPENDS += "fbtool flashtool platform-tools scatter"
 SERIAL_CONSOLES = "921600;ttyGS1"
 
+#tianyan@2021.09.17 modify for nand+dram start
 #UBI/UBIFS ARGS
-MKUBIFS_ARGS = "-m 2048 -e 126976 -c 1400 -F"
-UBINIZE_ARGS = "-m 2048 -p 128KiB -O 2048"
+MKUBIFS_ARGS = "-m 4096 -e 253952 -c 1400 -F"
+UBINIZE_ARGS = "-m 4096 -p 256KiB -O 4096"
 
-MKUBIFS_CONFIG_ARGS = "-m 2048 -e 126976 -c 22 -F"
+MKUBIFS_CONFIG_ARGS = "-m 4096 -e 253952 -c 22 -F"
+#tianyan@2021.09.17 modify for nand+dram end
 
 # Build Load Type
 BUILD_LOAD_TYPE ?= "eng"
diff --git a/src/bsp/lk/platform/mt2731/drivers/gpio/mt_gpio.c b/src/bsp/lk/platform/mt2731/drivers/gpio/mt_gpio.c
old mode 100644
new mode 100755
index c0b9408..be3fac6
--- a/src/bsp/lk/platform/mt2731/drivers/gpio/mt_gpio.c
+++ b/src/bsp/lk/platform/mt2731/drivers/gpio/mt_gpio.c
@@ -849,7 +849,7 @@
 	{
 		GPIO_BASE + 0x0000,
 		(GPIO31_DIR << 31) | (GPIO30_DIR << 30) | (GPIO29_DIR << 29) |
-		(GPIO28_DIR << 28) | (GPIO27_DIR << 27) | (GPIO26_DIR << 26) |
+		(GPIO_DIR_IN << 28) | (GPIO27_DIR << 27) | (GPIO26_DIR << 26) |
 		(GPIO25_DIR << 25) | (GPIO24_DIR << 24) | (GPIO23_DIR << 23) |
 		(GPIO22_DIR << 22) | (GPIO21_DIR << 21) | (GPIO20_DIR << 20) |
 		(GPIO19_DIR << 19) | (GPIO18_DIR << 18) | (GPIO17_DIR << 17) |