diff --git a/.gitignore b/.gitignore index ac407d6900..97fa2f4a12 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ Build/ tags/ build_modulepkg.log +QcomModulePkg/Tools/elf_tools.pyc diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..5c7f00efd2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "AbmPkg"] + path = AbmPkg + url = https://github.com/Android-Boot-Manager/droidboot_generic_uefi diff --git a/AbmPkg b/AbmPkg new file mode 160000 index 0000000000..7b434cecf4 --- /dev/null +++ b/AbmPkg @@ -0,0 +1 @@ +Subproject commit 7b434cecf4d89266982b7393b644a5e654ebaeda diff --git a/AndroidBoot.mk b/AndroidBoot.mk index 2ceef7bbd2..25097db5f5 100644 --- a/AndroidBoot.mk +++ b/AndroidBoot.mk @@ -74,6 +74,17 @@ else BOARD_BOOTLOADER_PRODUCT_NAME := QC_Reference_Phone endif +ifneq ($(TARGET_BOOTLOADER_BOARD_MODEL),) + BOARD_BOOTLOADER_PRODUCT_MODEL := $(TARGET_BOOTLOADER_BOARD_MODEL) +else + BOARD_BOOTLOADER_PRODUCT_MODEL := unknown +endif +ifneq ($(TARGET_BOOTLOADER_VERSION),) + BOARD_BOOTLOADER_VERSION := $(TARGET_BOOTLOADER_VERSION) +else + BOARD_BOOTLOADER_VERSION := unknown +endif + ifneq ($(TARGET_BOARD_TYPE),auto) TARGET_BOARD_TYPE_AUTO := TARGET_BOARD_TYPE_AUTO=0 else @@ -167,4 +178,6 @@ $(TARGET_ABL): $(LOCAL_ABL_SRC_FILE) | $(ABL_OUT) $(INSTALLED_KEYSTOREIMAGE_TARG CLANG_GCC_TOOLCHAIN=$(CLANG35_GCC_TOOLCHAIN)\ TARGET_ARCHITECTURE=$(TARGET_ARCHITECTURE) \ BOARD_BOOTLOADER_PRODUCT_NAME=$(BOARD_BOOTLOADER_PRODUCT_NAME) \ + BOARD_BOOTLOADER_PRODUCT_MODEL=$(BOARD_BOOTLOADER_PRODUCT_MODEL) \ + BOARD_BOOTLOADER_VERSION=$(BOARD_BOOTLOADER_VERSION) \ USERDATAIMAGE_FILE_SYSTEM_TYPE=$(USERDATAIMAGE_FILE_SYSTEM_TYPE) diff --git a/BaseTools/Source/C/GenVtf/GenVtf.c b/BaseTools/Source/C/GenVtf/GenVtf.c index 6f66ddc842..3b12fba565 100644 --- a/BaseTools/Source/C/GenVtf/GenVtf.c +++ b/BaseTools/Source/C/GenVtf/GenVtf.c @@ -1470,7 +1470,7 @@ Routine Description: // FitStartPtr = (FIT_TABLE *) RelativeAddress; - strncpy ((CHAR8 *) &FitStartPtr->CompAddress, FIT_SIGNATURE, 8); // "_FIT_ " + memcpy ((CHAR8 *) &FitStartPtr->CompAddress, FIT_SIGNATURE, 8); // "_FIT_ " assert (((VtfInfo->CompSize & 0x00FFFFFF) % 16) == 0); FitStartPtr->CompSize = (VtfInfo->CompSize & 0x00FFFFFF) / 16; FitStartPtr->CompVersion = MAKE_VERSION (VtfInfo->MajorVer, VtfInfo->MinorVer); diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile index 8a8b2b3d70..e7f1931f80 100644 --- a/BaseTools/Source/C/Makefiles/header.makefile +++ b/BaseTools/Source/C/Makefiles/header.makefile @@ -49,9 +49,9 @@ INCLUDE = $(TOOL_INCLUDE) -I $(MAKEROOT) -I $(MAKEROOT)/Include/Common -I $(MAKE CPPFLAGS = $(INCLUDE) ifeq ($(DARWIN),Darwin) # assume clang or clang compatible flags on OS X -CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-shift-negative-value -Wno-self-assign -nostdlib -c -g +CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Wno-deprecated-declarations -Wno-shift-negative-value -Wno-self-assign -nostdlib -c -g else -CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-shift-negative-value -nostdlib -c -g +CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Wno-deprecated-declarations -Wno-shift-negative-value -nostdlib -c -g endif LFLAGS = diff --git a/Conf/tools_def.txt b/Conf/tools_def.txt index 5cf1829429..d6efcfd2cc 100755 --- a/Conf/tools_def.txt +++ b/Conf/tools_def.txt @@ -3809,7 +3809,7 @@ NOOPT_DDK3790xASL_IPF_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /LTCG /DLL /OPT:REF DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug RELEASE_*_*_OBJCOPY_ADDDEBUGFLAG = -DEFINE GCC_ALL_CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -c -include AutoGen.h +DEFINE GCC_ALL_CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Wno-array-bounds -c -include AutoGen.h DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe DEFINE GCC_X64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mno-red-zone -Wno-address -mno-stack-arg-probe DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-min-latency @@ -3846,7 +3846,7 @@ DEFINE GCC_IPF_RC_FLAGS = -I binary -O elf64-ia64-little -B ia64 DEFINE GCC_ARM_RC_FLAGS = -I binary -O elf32-littlearm -B arm --rename-section .data=.hii DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 --rename-section .data=.hii -DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings +DEFINE GCC44_ALL_CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Wno-array-bounds -ffunction-sections -fdata-sections -c -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings DEFINE GCC44_IA32_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m32 -malign-double -fno-stack-protector -D EFI32 -fno-asynchronous-unwind-tables DEFINE GCC44_X64_CC_FLAGS = DEF(GCC44_ALL_CC_FLAGS) -m64 -fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS -mno-red-zone -Wno-address -mcmodel=large -fno-asynchronous-unwind-tables DEFINE GCC44_IA32_X64_DLINK_COMMON = -nostdlib -n -q --gc-sections -z common-page-size=0x20 @@ -5009,7 +5009,7 @@ RELEASE_CLANG35_AARCH64_CC_FLAGS = DEF(CLANG35_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) *_ELFGCC_X64_VFRPP_PATH = DEF(ELFGCC_BIN)/gcc *_ELFGCC_X64_RC_PATH = DEF(ELFGCC_BIN)/objcopy -*_ELFGCC_X64_CC_FLAGS = -Os -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-address -Wno-array-bounds -c -include AutoGen.h -D_EFI_P64 +*_ELFGCC_X64_CC_FLAGS = -Os -fshort-wchar -fno-strict-aliasing -Wall -Wno-address -Wno-array-bounds -c -include AutoGen.h -D_EFI_P64 *_ELFGCC_X64_DLINK_FLAGS = -nostdlib --shared --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map *_ELFGCC_X64_SLINK_FLAGS = *_ELFGCC_X64_ASM_FLAGS = -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h @@ -5032,7 +5032,7 @@ RELEASE_CLANG35_AARCH64_CC_FLAGS = DEF(CLANG35_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) *_ELFGCC_IPF_VFRPP_PATH = DEF(ELFGCC_BIN)/gcc *_ELFGCC_IPF_RC_PATH = DEF(ELFGCC_BIN)/objcopy -*_ELFGCC_IPF_CC_FLAGS = -Os -fshort-wchar -Wall -Werror -c -include AutoGen.h -D_EFI_P64 +*_ELFGCC_IPF_CC_FLAGS = -Os -fshort-wchar -Wall -c -include AutoGen.h -D_EFI_P64 *_ELFGCC_IPF_DLINK_FLAGS = -nostdlib --shared --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map *_ELFGCC_IPF_SLINK_FLAGS = *_ELFGCC_IPF_ASM_FLAGS = -c -x assembler -imacros $(DEST_DIR_DEBUG)/AutoGen.h @@ -6441,10 +6441,10 @@ RELEASE_XCODE32_IA32_ASM_FLAGS = -arch i386 *_XCODE32_IA32_NASM_FLAGS = -f macho32 *_XCODE32_IA32_PP_FLAGS = -arch i386 -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h *_XCODE32_IA32_VFRPP_FLAGS = -arch i386 -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h - DEBUG_XCODE32_IA32_CC_FLAGS = -arch i386 -save-temps -g -O0 -combine -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h -mdynamic-no-pic -fno-stack-protector -RELEASE_XCODE32_IA32_CC_FLAGS = -arch i386 -Oz -combine -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h -mdynamic-no-pic -fno-stack-protector + DEBUG_XCODE32_IA32_CC_FLAGS = -arch i386 -save-temps -g -O0 -combine -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Wno-missing-braces -c -include AutoGen.h -mdynamic-no-pic -fno-stack-protector +RELEASE_XCODE32_IA32_CC_FLAGS = -arch i386 -Oz -combine -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h -mdynamic-no-pic -fno-stack-protector -*_XCODE32_IA32_ASLCC_FLAGS = -arch i386 -x c -save-temps -g -O0 -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h -mdynamic-no-pic +*_XCODE32_IA32_ASLCC_FLAGS = -arch i386 -x c -save-temps -g -O0 -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Wno-missing-braces -c -include AutoGen.h -mdynamic-no-pic *_XCODE32_IA32_ASLDLINK_FLAGS = -arch i386 -e _main -preload -segalign 0x20 -pie -seg1addr 0x220 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map *_XCODE32_IA32_ASLPP_FLAGS = -arch i386 -x c -E *_XCODE32_IA32_ASL_FLAGS = @@ -6473,8 +6473,8 @@ RELEASE_XCODE32_X64_ASM_FLAGS = -arch x86_64 *_XCODE32_X64_PP_FLAGS = -arch x86_64 -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h *_XCODE32_X64_VFRPP_FLAGS = -arch x86_64 -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h - DEBUG_XCODE32_X64_CC_FLAGS = -arch x86_64 -save-temps -g -O0 -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-address -fomit-frame-pointer -static -c -include AutoGen.h -fno-stack-protector -RELEASE_XCODE32_X64_CC_FLAGS = -arch x86_64 -Oz -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -Wno-address -fomit-frame-pointer -static -c -include AutoGen.h -fno-stack-protector + DEBUG_XCODE32_X64_CC_FLAGS = -arch x86_64 -save-temps -g -O0 -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Wno-missing-braces -Wno-address -fomit-frame-pointer -static -c -include AutoGen.h -fno-stack-protector +RELEASE_XCODE32_X64_CC_FLAGS = -arch x86_64 -Oz -mms-bitfields -fshort-wchar -fno-strict-aliasing -Wall -Wno-missing-braces -Wno-address -fomit-frame-pointer -static -c -include AutoGen.h -fno-stack-protector ################## # ARM definitions - (Assumes iPhone SDK installed on Snow Leopard) @@ -6502,8 +6502,8 @@ RELEASE_XCODE32_ARM_ASM_FLAGS = $(ARCHASM_FLAGS) *_XCODE32_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -E -x assembler-with-cpp -include $(DEST_DIR_DEBUG)/AutoGen.h *_XCODE32_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -x c -E -P -DVFRCOMPILE --include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h - DEBUG_XCODE32_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mthumb-interwork -g -Oz -mabi=aapcs -mapcs -fno-short-enums -save-temps -combine -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h -RELEASE_XCODE32_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mthumb-interwork -Oz -mabi=aapcs -mapcs -fno-short-enums -save-temps -combine -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h + DEBUG_XCODE32_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mthumb-interwork -g -Oz -mabi=aapcs -mapcs -fno-short-enums -save-temps -combine -fshort-wchar -fno-strict-aliasing -Wall -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h +RELEASE_XCODE32_ARM_CC_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) -mthumb-interwork -Oz -mabi=aapcs -mapcs -fno-short-enums -save-temps -combine -fshort-wchar -fno-strict-aliasing -Wall -Wno-missing-braces -fomit-frame-pointer -c -include AutoGen.h #################################################################################### @@ -6548,8 +6548,8 @@ RELEASE_XCLANG_IA32_DLINK_FLAGS = -arch i386 -u _$(IMAGE_ENTRY_POINT) -e _$ RELEASE_XCLANG_IA32_ASM_FLAGS = -arch i386 *_XCLANG_IA32_NASM_FLAGS = -f macho32 - DEBUG_XCLANG_IA32_CC_FLAGS = -arch i386 -c -g -O0 -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable -fasm-blocks -mms-bitfields -msoft-float -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -RELEASE_XCLANG_IA32_CC_FLAGS = -arch i386 -c -Os -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable -fasm-blocks -mms-bitfields -msoft-float -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang + DEBUG_XCLANG_IA32_CC_FLAGS = -arch i386 -c -g -O0 -Wall -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable -fasm-blocks -mms-bitfields -msoft-float -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang +RELEASE_XCLANG_IA32_CC_FLAGS = -arch i386 -c -Os -Wall -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -mno-sse -mno-mmx -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable -fasm-blocks -mms-bitfields -msoft-float -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang ################## @@ -6565,9 +6565,9 @@ RELEASE_XCLANG_X64_ASM_FLAGS = -arch x86_64 *_XCLANG_*_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE -include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h - DEBUG_XCLANG_X64_CC_FLAGS = -ccc-host-triple x86_64-pc-win32-macho -c -g -O0 -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -RELEASE_XCLANG_X64_CC_FLAGS = -ccc-host-triple x86_64-pc-win32-macho -c -Os -Wall -Werror -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang -*_XCLANG_*_ASLCC_FLAGS = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h -mdynamic-no-pic + DEBUG_XCLANG_X64_CC_FLAGS = -ccc-host-triple x86_64-pc-win32-macho -c -g -O0 -Wall -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang +RELEASE_XCLANG_X64_CC_FLAGS = -ccc-host-triple x86_64-pc-win32-macho -c -Os -Wall -include AutoGen.h -fno-stack-protector -fno-builtin -fshort-wchar -mdynamic-no-pic -Wno-empty-body -Wno-pointer-sign -Wno-unused-function -Wno-unused-value -Wno-missing-braces -Wno-tautological-compare -Wreturn-type -Wno-unused-variable -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang +*_XCLANG_*_ASLCC_FLAGS = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Wno-missing-braces -c -include AutoGen.h -mdynamic-no-pic *_XCLANG_*_ASLDLINK_FLAGS = -e _main -preload -segalign 0x20 -pie -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map *_XCLANG_*_ASLPP_FLAGS = -x c -E *_XCLANG_*_ASL_FLAGS = @@ -6617,9 +6617,9 @@ RELEASE_XCODE5_IA32_ASM_FLAGS = -arch i386 *_XCODE5_IA32_NASM_FLAGS = -f macho32 - DEBUG_XCODE5_IA32_CC_FLAGS = -arch i386 -c -g -Os -Wall -Werror -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fshort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS) -RELEASE_XCODE5_IA32_CC_FLAGS = -arch i386 -c -Os -Wall -Werror -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fshort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS) - NOOPT_XCODE5_IA32_CC_FLAGS = -arch i386 -c -g -O0 -Wall -Werror -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fshort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS) + DEBUG_XCODE5_IA32_CC_FLAGS = -arch i386 -c -g -Os -Wall -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fshort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS) +RELEASE_XCODE5_IA32_CC_FLAGS = -arch i386 -c -Os -Wall -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fshort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS) + NOOPT_XCODE5_IA32_CC_FLAGS = -arch i386 -c -g -O0 -Wall -include AutoGen.h -funsigned-char -fno-stack-protector -fno-builtin -fshort-wchar -fasm-blocks -mdynamic-no-pic -mno-implicit-float -mms-bitfields -msoft-float -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS) @@ -6639,11 +6639,11 @@ RELEASE_XCODE5_X64_ASM_FLAGS = -arch x86_64 *_XCODE5_*_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE -include $(DEST_DIR_DEBUG)/$(MODULE_NAME)StrDefs.h - DEBUG_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS) - NOOPT_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -O0 -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS) -RELEASE_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS) + DEBUG_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -Os -Wall -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS) + NOOPT_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -g -O0 -Wall -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS) +RELEASE_XCODE5_X64_CC_FLAGS = -target x86_64-pc-win32-macho -c -Os -Wall -Wextra -include AutoGen.h -funsigned-char -fno-ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field-initializers -Wno-tautological-compare -Wno-sign-compare -ftrap-function=undefined_behavior_has_been_optimized_away_by_clang $(PLATFORM_FLAGS) -*_XCODE5_*_ASLCC_FLAGS = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-missing-braces -c -include AutoGen.h +*_XCODE5_*_ASLCC_FLAGS = -x c -save-temps -g -O0 -fshort-wchar -fno-strict-aliasing -Wall -Wno-missing-braces -c -include AutoGen.h *_XCODE5_*_ASLDLINK_FLAGS = -e _ReferenceAcpiTable -preload -segalign 0x20 -pie -seg1addr 0x240 -read_only_relocs suppress -map $(DEST_DIR_DEBUG)/$(BASE_NAME).map *_XCODE5_*_ASLPP_FLAGS = -x c -E *_XCODE5_*_ASL_FLAGS = diff --git a/QcomModulePkg/Application/LinuxLoader/LinuxLoader.c b/QcomModulePkg/Application/LinuxLoader/LinuxLoader.c index 317b5b6154..29953e906a 100755 --- a/QcomModulePkg/Application/LinuxLoader/LinuxLoader.c +++ b/QcomModulePkg/Application/LinuxLoader/LinuxLoader.c @@ -185,10 +185,10 @@ LinuxLoaderEntry (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) Status = GetKeyPress (&KeyPressed); if (Status == EFI_SUCCESS) { - if (KeyPressed == SCAN_DOWN) - BootIntoFastboot = TRUE; - if (KeyPressed == SCAN_UP) + if ((KeyPressed == SCAN_DOWN) || (KeyPressed == SCAN_DELETE)) BootIntoRecovery = TRUE; + if ((KeyPressed == SCAN_UP) || (KeyPressed == SCAN_HOME)) + BootIntoFastboot = TRUE; if (KeyPressed == SCAN_ESC) RebootDevice (EMERGENCY_DLOAD); } else if (Status == EFI_DEVICE_ERROR) { diff --git a/QcomModulePkg/Application/LinuxLoader/LinuxLoader.inf b/QcomModulePkg/Application/LinuxLoader/LinuxLoader.inf index 82bf84f681..e14edd83e7 100644 --- a/QcomModulePkg/Application/LinuxLoader/LinuxLoader.inf +++ b/QcomModulePkg/Application/LinuxLoader/LinuxLoader.inf @@ -38,6 +38,7 @@ ArmPlatformPkg/ArmPlatformPkg.dec MdeModulePkg/MdeModulePkg.dec QcomModulePkg/QcomModulePkg.dec + AbmPkg/Abm.dec [LibraryClasses] DxeServicesTableLib @@ -61,6 +62,7 @@ EfiFileLib FastbootLib UbsanLib + AbmLib [Guids] gEfiFileInfoGuid diff --git a/QcomModulePkg/Include/Library/Board.h b/QcomModulePkg/Include/Library/Board.h index a5c5ee18d5..cb206bc90e 100644 --- a/QcomModulePkg/Include/Library/Board.h +++ b/QcomModulePkg/Include/Library/Board.h @@ -91,6 +91,8 @@ BoardPmicTarget (UINT32 PmicDeviceIndex); EFI_STATUS BoardInit (VOID); +EFI_STATUS +BoardHardwareRevision (CHAR8 *StrHardwareRev, UINT32 Len); EFI_STATUS BoardSerialNum (CHAR8 *StrSerialNum, UINT32 Len); UINT32 BoardPlatformRawChipId (VOID); diff --git a/QcomModulePkg/Include/Library/LinuxLoaderLib.h b/QcomModulePkg/Include/Library/LinuxLoaderLib.h index 1e34256e4a..8690405af3 100644 --- a/QcomModulePkg/Include/Library/LinuxLoaderLib.h +++ b/QcomModulePkg/Include/Library/LinuxLoaderLib.h @@ -144,6 +144,9 @@ LoadImageFromPartition (VOID *ImageBuffer, UINT32 *ImageSize, CHAR16 *Pname); EFI_STATUS ReadWriteDeviceInfo (vb_device_state_op_t Mode, void *DevInfo, UINT32 Sz); +EFI_STATUS +GetNandOemPartiGuid (EFI_GUID *Ptype); + EFI_STATUS GetNandMiscPartiGuid (EFI_GUID *Ptype); /** diff --git a/QcomModulePkg/Include/Library/Recovery.h b/QcomModulePkg/Include/Library/Recovery.h index e2f13025fc..0f2f77468c 100644 --- a/QcomModulePkg/Include/Library/Recovery.h +++ b/QcomModulePkg/Include/Library/Recovery.h @@ -33,6 +33,9 @@ #define FFBM_MODE_BUF_SIZE 8 +#define READ_OEM_BUF_SIZE 512 +#define READ_OEM_BUF_LEN 24 + #define RECOVERY_BOOT_RECOVERY "boot-recovery" #define RECOVERY_BOOT_FASTBOOT "boot-fastboot" @@ -92,4 +95,10 @@ EFI_STATUS SetSnapshotMergeStatus (VirtualAbMergeStatus MergeStatus); EFI_STATUS ReadFromPartition (EFI_GUID *Ptype, VOID **Msg, UINT32 Size); + +EFI_STATUS +GetOemHardwareRevision (CHAR8 *nv_hwrevision); +EFI_STATUS +GetOemSerialNum (CHAR8 *nv_serialnum); + #endif diff --git a/QcomModulePkg/Include/Library/UpdateCmdLine.h b/QcomModulePkg/Include/Library/UpdateCmdLine.h index c3a4640f97..f400b8d0ac 100644 --- a/QcomModulePkg/Include/Library/UpdateCmdLine.h +++ b/QcomModulePkg/Include/Library/UpdateCmdLine.h @@ -46,6 +46,7 @@ #define MAX_PATH_SIZE 72 #define SERIAL_NUM_SIZE 64 +#define HW_REVISION_SIZE 64 typedef struct BootInfo BootInfo; @@ -57,11 +58,13 @@ typedef struct UpdateCmdLineParamList { UINT32 CmdLineLen; UINT32 HaveCmdLine; UINT32 PauseAtBootUp; + CHAR8 *StrHardwareRev; CHAR8 *StrSerialNum; CHAR8 *SlotSuffixAscii; CHAR8 *ChipBaseBand; CHAR8 *DisplayCmdLine; CONST CHAR8 *CmdLine; + CONST CHAR8 *HardwareRevisionCmdLine; CONST CHAR8 *AlarmBootCmdLine; CONST CHAR8 *MdtpActiveFlag; CONST CHAR8 *BatteryChgPause; diff --git a/QcomModulePkg/Library/BootLib/Board.c b/QcomModulePkg/Library/BootLib/Board.c index c354f453bb..86aa8769ff 100644 --- a/QcomModulePkg/Library/BootLib/Board.c +++ b/QcomModulePkg/Library/BootLib/Board.c @@ -29,6 +29,7 @@ #include "AutoGen.h" #include #include +#include #include #include #include @@ -569,6 +570,24 @@ UfsGetSetBootLun (UINT32 *UfsBootlun, BOOLEAN IsGet) return Status; } +EFI_STATUS +BoardHardwareRevision (CHAR8 *StrHwRevision, UINT32 Len) +{ + + EFI_STATUS Status; + + Status = GetOemHardwareRevision(StrHwRevision); + if (Status != EFI_SUCCESS) { + /* use fallback hardware revision and mark as success + * to proceed bootup */ + AsciiSPrint (StrHwRevision, Len, "%d", 10000); + Status = EFI_SUCCESS; + } + DEBUG ((EFI_D_ERROR, "Got hardware revusuib from oem partition: %s\n", StrHwRevision)); + + return Status; +} + EFI_STATUS BoardSerialNum (CHAR8 *StrSerialNum, UINT32 Len) { @@ -597,6 +616,12 @@ BoardSerialNum (CHAR8 *StrSerialNum, UINT32 Len) return Status; } + Status = GetOemSerialNum (StrSerialNum); + if (Status == EFI_SUCCESS) { + DEBUG ((EFI_D_ERROR, "Got serial number from oem partition: %s\n", StrSerialNum)); + return Status; + } + if (CardInfo->GetCardInfo (CardInfo, &CardInfoData) == EFI_SUCCESS) { if (Type == UFS) { Status = gBS->CalculateCrc32 (CardInfoData.product_serial_num, diff --git a/QcomModulePkg/Library/BootLib/BootLib.inf b/QcomModulePkg/Library/BootLib/BootLib.inf index 317b40b0d6..6f09d07d32 100755 --- a/QcomModulePkg/Library/BootLib/BootLib.inf +++ b/QcomModulePkg/Library/BootLib/BootLib.inf @@ -111,6 +111,7 @@ gEfiLogFSPartitionGuid gEfiNandUserPartitionGuid gEfiMiscPartitionGuid + gEfiOemPartitionGuid gEfiRNGAlgRawGuid gEfiUfsLU0Guid gEfiUfsLU1Guid diff --git a/QcomModulePkg/Library/BootLib/DeviceInfo.c b/QcomModulePkg/Library/BootLib/DeviceInfo.c index 596bf6258c..074b9701c7 100644 --- a/QcomModulePkg/Library/BootLib/DeviceInfo.c +++ b/QcomModulePkg/Library/BootLib/DeviceInfo.c @@ -240,14 +240,7 @@ UpdateDevInfo (CHAR16 *Pname, CHAR8 *ImgVersion) { EFI_STATUS Status = EFI_SUCCESS; - if (!StrCmp ((CONST CHAR16 *)Pname, (CONST CHAR16 *)L"bootloader")) { - AsciiStrnCpyS (DevInfo.bootloader_version, MAX_VERSION_LEN, PRODUCT_NAME, - AsciiStrLen (PRODUCT_NAME)); - AsciiStrnCatS (DevInfo.bootloader_version, MAX_VERSION_LEN, "-", - AsciiStrLen ("-")); - AsciiStrnCatS (DevInfo.bootloader_version, MAX_VERSION_LEN, ImgVersion, - AsciiStrLen (ImgVersion)); - } else { + if (StrCmp ((CONST CHAR16 *)Pname, (CONST CHAR16 *)L"bootloader")) { AsciiStrnCpyS (DevInfo.radio_version, MAX_VERSION_LEN, PRODUCT_NAME, AsciiStrLen (PRODUCT_NAME)); AsciiStrnCatS (DevInfo.radio_version, MAX_VERSION_LEN, "-", @@ -279,6 +272,11 @@ EFI_STATUS DeviceInfoInit (VOID) FirstReadDevInfo = FALSE; } + AsciiStrnCpyS (DevInfo.bootloader_version, MAX_VERSION_LEN, PRODUCT_BOOTLOADER_VERSION, + AsciiStrLen (PRODUCT_BOOTLOADER_VERSION)); + + EnableChargingScreen (TRUE); + if (CompareMem (DevInfo.magic, DEVICE_MAGIC, DEVICE_MAGIC_SIZE)) { DEBUG ((EFI_D_ERROR, "Device Magic does not match\n")); gBS->SetMem (&DevInfo, sizeof (DevInfo), 0); diff --git a/QcomModulePkg/Library/BootLib/FastbootMenu.c b/QcomModulePkg/Library/BootLib/FastbootMenu.c index 61d78e504e..9865ea06e3 100644 --- a/QcomModulePkg/Library/BootLib/FastbootMenu.c +++ b/QcomModulePkg/Library/BootLib/FastbootMenu.c @@ -96,9 +96,9 @@ STATIC MENU_MSG_INFO mFastbootCommonMsgInfo[] = { COMMON, 0, NOACTION}, - {{"FastBoot Mode"}, + {{"Fastboot mode\n\n"}, COMMON_FACTOR, - BGR_RED, + BGR_YELLOW, BGR_BLACK, COMMON, 0, @@ -110,6 +110,13 @@ STATIC MENU_MSG_INFO mFastbootCommonMsgInfo[] = { COMMON, 0, NOACTION}, + {{"PRODUCT_MODEL - "}, + COMMON_FACTOR, + BGR_WHITE, + BGR_BLACK, + COMMON, + 0, + NOACTION}, {{"VARIANT - "}, COMMON_FACTOR, BGR_WHITE, @@ -138,6 +145,13 @@ STATIC MENU_MSG_INFO mFastbootCommonMsgInfo[] = { COMMON, 0, NOACTION}, + {{"HARDWARE REVISION - "}, + COMMON_FACTOR, + BGR_WHITE, + BGR_BLACK, + COMMON, + 0, + NOACTION}, {{"SECURE BOOT - "}, COMMON_FACTOR, BGR_WHITE, @@ -145,13 +159,20 @@ STATIC MENU_MSG_INFO mFastbootCommonMsgInfo[] = { COMMON, 0, NOACTION}, - {{"DEVICE STATE - "}, + {{"\nDEVICE STATE - unlocked"}, COMMON_FACTOR, BGR_RED, BGR_BLACK, COMMON, 0, NOACTION}, + {{"\nDEVICE STATE - locked"}, + COMMON_FACTOR, + BGR_GREEN, + BGR_BLACK, + COMMON, + 0, + NOACTION}, }; /** @@ -250,6 +271,12 @@ FastbootMenuShowScreen (OPTION_MENU_INFO *OptionMenuInfo) AsciiStrLen (PRODUCT_NAME)); break; case 3: + /* Get product model */ + AsciiStrnCatS (mFastbootCommonMsgInfo[i].Msg, + sizeof (mFastbootCommonMsgInfo[i].Msg), PRODUCT_MODEL, + AsciiStrLen (PRODUCT_MODEL)); + break; + case 4: /* Get variant value */ BoardHwPlatformName (StrTemp, sizeof (StrTemp)); GetRootDeviceType (StrTemp1, sizeof (StrTemp1)); @@ -264,14 +291,14 @@ FastbootMenuShowScreen (OPTION_MENU_INFO *OptionMenuInfo) sizeof (mFastbootCommonMsgInfo[i].Msg), StrTemp1, sizeof (StrTemp1)); break; - case 4: + case 5: /* Get bootloader version */ GetBootloaderVersion (VersionTemp, sizeof (VersionTemp)); AsciiStrnCatS (mFastbootCommonMsgInfo[i].Msg, sizeof (mFastbootCommonMsgInfo[i].Msg), VersionTemp, sizeof (VersionTemp)); break; - case 5: + case 6: /* Get baseband version */ ZeroMem (VersionTemp, sizeof (VersionTemp)); GetRadioVersion (VersionTemp, sizeof (VersionTemp)); @@ -279,7 +306,7 @@ FastbootMenuShowScreen (OPTION_MENU_INFO *OptionMenuInfo) sizeof (mFastbootCommonMsgInfo[i].Msg), VersionTemp, sizeof (VersionTemp)); break; - case 6: + case 7: /* Get serial number */ ZeroMem (StrTemp, sizeof (StrTemp)); BoardSerialNum (StrTemp, MAX_RSP_SIZE); @@ -287,19 +314,30 @@ FastbootMenuShowScreen (OPTION_MENU_INFO *OptionMenuInfo) sizeof (mFastbootCommonMsgInfo[i].Msg), StrTemp, sizeof (StrTemp)); break; - case 7: + case 8: + /* Get hardware revision */ + ZeroMem (StrTemp, sizeof (StrTemp)); + BoardHardwareRevision (StrTemp, MAX_RSP_SIZE); + AsciiStrnCatS (mFastbootCommonMsgInfo[i].Msg, + sizeof (mFastbootCommonMsgInfo[i].Msg), StrTemp, + sizeof (StrTemp)); + break; + case 9: /* Get secure boot value */ AsciiStrnCatS ( mFastbootCommonMsgInfo[i].Msg, sizeof (mFastbootCommonMsgInfo[i].Msg), IsSecureBootEnabled () ? "yes" : "no", IsSecureBootEnabled () ? AsciiStrLen ("yes") : AsciiStrLen ("no")); break; - case 8: - /* Get device status */ - AsciiStrnCatS ( - mFastbootCommonMsgInfo[i].Msg, sizeof (mFastbootCommonMsgInfo[i].Msg), - IsUnlocked () ? "unlocked" : "locked", - IsUnlocked () ? AsciiStrLen ("unlocked") : AsciiStrLen ("locked")); + case 10: + /* Get device status, only show when unlocked */ + if (!IsUnlocked ()) + continue; + break; + case 11: + /* Get device status, only show when locked */ + if (IsUnlocked ()) + continue; break; } diff --git a/QcomModulePkg/Library/BootLib/LinuxLoaderLib.c b/QcomModulePkg/Library/BootLib/LinuxLoaderLib.c index 5d77f34836..9159434582 100644 --- a/QcomModulePkg/Library/BootLib/LinuxLoaderLib.c +++ b/QcomModulePkg/Library/BootLib/LinuxLoaderLib.c @@ -567,6 +567,30 @@ ReadWriteDeviceInfo (vb_device_state_op_t Mode, void *DevInfo, UINT32 Sz) return Status; } +EFI_STATUS +GetNandOemPartiGuid (EFI_GUID *Ptype) +{ + EFI_STATUS Status = EFI_INVALID_PARAMETER; + EFI_NAND_PARTI_GUID_PROTOCOL *NandPartiGuid; + + Status = gBS->LocateProtocol (&gEfiNandPartiGuidProtocolGuid, NULL, + (VOID **)&NandPartiGuid); + if (Status != EFI_SUCCESS) { + DEBUG ((EFI_D_ERROR, "Unable to locate NandPartiGuid protocol: %r.debug_x\n", + Status)); + return Status; + } + + Status = NandPartiGuid->GenGuid (NandPartiGuid, (CONST CHAR16 *)L"oem", + StrLen ((CONST CHAR16 *)L"oem"), Ptype); + if (Status != EFI_SUCCESS) { + DEBUG ((EFI_D_ERROR, "NandPartiGuid GenGuid failed with: %r\n", Status)); + return Status; + } + + return Status; +} + EFI_STATUS GetNandMiscPartiGuid (EFI_GUID *Ptype) { diff --git a/QcomModulePkg/Library/BootLib/Recovery.c b/QcomModulePkg/Library/BootLib/Recovery.c index b61acc496f..49207bbd5e 100644 --- a/QcomModulePkg/Library/BootLib/Recovery.c +++ b/QcomModulePkg/Library/BootLib/Recovery.c @@ -401,3 +401,95 @@ GetFfbmCommand (CHAR8 *FfbmString, UINT32 Sz) return Status; } + +EFI_STATUS +GetOemSerialNum (CHAR8 *nv_serialnum) +{ + CONST CHAR8 *line_ind = "SN:"; + CHAR8 *oem_page_buffer = NULL; + CHAR8 *line_ptr = NULL; + EFI_STATUS Status; + EFI_GUID Ptype = gEfiOemPartitionGuid; + MemCardType CardType = UNKNOWN; + + CardType = CheckRootDeviceType (); + if (CardType == NAND) { + Status = GetNandOemPartiGuid (&Ptype); + if (Status != EFI_SUCCESS) { + return Status; + } + } + + Status = ReadFromPartition (&Ptype, (VOID **)&oem_page_buffer, READ_OEM_BUF_SIZE); + if (Status != EFI_SUCCESS) { + DEBUG ((EFI_D_ERROR, "Error Reading OEM info from oem: %r\n", Status)); + return Status; + } + + oem_page_buffer[READ_OEM_BUF_SIZE - 1] = '\0'; + //DEBUG ((EFI_D_ERROR, "Read OEM data: %s\n", oem_page_buffer)); + + line_ptr = AsciiStrStr(oem_page_buffer, line_ind); + if (line_ptr == NULL) { + Status = EFI_NOT_FOUND; + } else { + memset(nv_serialnum, 0x0, sizeof(nv_serialnum)); + AsciiStrnCpy((char *)nv_serialnum, (line_ptr + strlen(line_ind)), READ_OEM_BUF_LEN); + for (unsigned char i = 0; i < READ_OEM_BUF_LEN; i++) { + if (nv_serialnum[i] == '\r' || nv_serialnum[i] == '\n' || nv_serialnum[i] == ' ') { + nv_serialnum[i] = '\0'; + } + } + } + + FreePool (oem_page_buffer); + oem_page_buffer = NULL; + + return Status; +} + +EFI_STATUS +GetOemHardwareRevision (CHAR8 *nv_hwrevision) +{ + CONST CHAR8 *line_ind = "HW:"; + CHAR8 *oem_page_buffer = NULL; + CHAR8 *line_ptr = NULL; + EFI_STATUS Status; + EFI_GUID Ptype = gEfiOemPartitionGuid; + MemCardType CardType = UNKNOWN; + + CardType = CheckRootDeviceType (); + if (CardType == NAND) { + Status = GetNandOemPartiGuid (&Ptype); + if (Status != EFI_SUCCESS) { + return Status; + } + } + + Status = ReadFromPartition (&Ptype, (VOID **)&oem_page_buffer, READ_OEM_BUF_SIZE); + if (Status != EFI_SUCCESS) { + DEBUG ((EFI_D_ERROR, "Error Reading OEM info from oem: %r\n", Status)); + return Status; + } + + oem_page_buffer[READ_OEM_BUF_SIZE - 1] = '\0'; + //DEBUG ((EFI_D_ERROR, "Read OEM data: %s\n", oem_page_buffer)); + + line_ptr = AsciiStrStr(oem_page_buffer, line_ind); + if (line_ptr == NULL) { + Status = EFI_NOT_FOUND; + } else { + memset(nv_hwrevision, 0x0, sizeof(nv_hwrevision)); + AsciiStrnCpy((char *)nv_hwrevision, (line_ptr + strlen(line_ind)), READ_OEM_BUF_LEN); + for (unsigned char i = 0; i < READ_OEM_BUF_LEN; i++) { + if (nv_hwrevision[i] == '\r' || nv_hwrevision[i] == '\n' || nv_hwrevision[i] == ' ') { + nv_hwrevision[i] = '\0'; + } + } + } + + FreePool (oem_page_buffer); + oem_page_buffer = NULL; + + return Status; +} diff --git a/QcomModulePkg/Library/BootLib/UpdateCmdLine.c b/QcomModulePkg/Library/BootLib/UpdateCmdLine.c index ab88a5cd66..273b78da37 100644 --- a/QcomModulePkg/Library/BootLib/UpdateCmdLine.c +++ b/QcomModulePkg/Library/BootLib/UpdateCmdLine.c @@ -57,6 +57,7 @@ STATIC CONST CHAR8 *LogLevel = " quite"; STATIC CONST CHAR8 *BatteryChgPause = " androidboot.mode=charger"; STATIC CONST CHAR8 *MdtpActiveFlag = " mdtp"; STATIC CONST CHAR8 *AlarmBootCmdLine = " androidboot.alarmboot=true"; +STATIC CONST CHAR8 *HardwareRevisionCmdLine = " androidboot.hardware.revision="; STATIC CHAR8 SystemdSlotEnv[] = " systemd.setenv=\"SLOT_SUFFIX=_a\""; /*Send slot suffix in cmdline with which we have booted*/ @@ -440,6 +441,11 @@ UpdateCmdLineParams (UpdateCmdLineParamList *Param, Param->BootDevBuf = NULL; } + Src = Param->HardwareRevisionCmdLine; + AsciiStrCatS (Dst, MaxCmdLineLen, Src); + Src = Param->StrHardwareRev; + AsciiStrCatS (Dst, MaxCmdLineLen, Src); + Src = Param->UsbSerialCmdLine; AsciiStrCatS (Dst, MaxCmdLineLen, Src); Src = Param->StrSerialNum; @@ -572,6 +578,7 @@ UpdateCmdLine (CONST CHAR8 *CmdLine, CHAR8 ChipBaseBand[CHIP_BASE_BAND_LEN]; CHAR8 *BootDevBuf = NULL; BOOLEAN BatteryStatus; + CHAR8 StrHardwareRev[HW_REVISION_SIZE]; CHAR8 StrSerialNum[SERIAL_NUM_SIZE]; BOOLEAN MdtpActive = FALSE; UpdateCmdLineParamList Param = {0}; @@ -583,6 +590,12 @@ UpdateCmdLine (CONST CHAR8 *CmdLine, UINT32 LEVerityCmdLineLen = 0; CHAR8 RootDevStr[BOOT_DEV_NAME_SIZE_MAX]; + Status = BoardHardwareRevision (StrHardwareRev, sizeof (StrHardwareRev)); + if (Status != EFI_SUCCESS) { + DEBUG((EFI_D_ERROR, "Failed to get hardware revision: %r\n", Status)); + return Status; + } + Status = BoardSerialNum (StrSerialNum, sizeof (StrSerialNum)); if (Status != EFI_SUCCESS) { DEBUG ((EFI_D_ERROR, "Error Finding board serial num: %x\n", Status)); @@ -642,6 +655,9 @@ UpdateCmdLine (CONST CHAR8 *CmdLine, } } + CmdLineLen += AsciiStrLen (HardwareRevisionCmdLine); + CmdLineLen += AsciiStrLen (StrHardwareRev); + CmdLineLen += AsciiStrLen (UsbSerialCmdLine); CmdLineLen += AsciiStrLen (StrSerialNum); @@ -748,11 +764,13 @@ UpdateCmdLine (CONST CHAR8 *CmdLine, Param.CmdLineLen = CmdLineLen; Param.HaveCmdLine = HaveCmdLine; Param.PauseAtBootUp = PauseAtBootUp; + Param.StrHardwareRev = StrHardwareRev; Param.StrSerialNum = StrSerialNum; Param.SlotSuffixAscii = SlotSuffixAscii; Param.ChipBaseBand = ChipBaseBand; Param.DisplayCmdLine = DisplayCmdLine; Param.CmdLine = CmdLine; + Param.HardwareRevisionCmdLine = HardwareRevisionCmdLine; Param.AlarmBootCmdLine = AlarmBootCmdLine; Param.MdtpActiveFlag = MdtpActiveFlag; Param.BatteryChgPause = BatteryChgPause; diff --git a/QcomModulePkg/Library/avb/OEMPublicKey.h b/QcomModulePkg/Library/avb/OEMPublicKey.h index a9d54dbb55..a0e7f520dd 100644 --- a/QcomModulePkg/Library/avb/OEMPublicKey.h +++ b/QcomModulePkg/Library/avb/OEMPublicKey.h @@ -34,91 +34,71 @@ * avbtool extract_public_key --key KEY --output OUTPUT */ static const char OEMPublicKey[] = { - 0x00, 0x00, 0x10, 0x00, 0x55, 0xd9, 0x04, 0xad, 0xd8, 0x04, 0xaf, 0xe3, - 0xd3, 0x84, 0x6c, 0x7e, 0x0d, 0x89, 0x3d, 0xc2, 0x8c, 0xd3, 0x12, 0x55, - 0xe9, 0x62, 0xc9, 0xf1, 0x0f, 0x5e, 0xcc, 0x16, 0x72, 0xab, 0x44, 0x7c, - 0x2c, 0x65, 0x4a, 0x94, 0xb5, 0x16, 0x2b, 0x00, 0xbb, 0x06, 0xef, 0x13, - 0x07, 0x53, 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 0x7c, 0xb3, 0x49, 0x01, - 0x3f, 0x71, 0x55, 0x0e, 0x51, 0xba, 0x61, 0x26, 0xfa, 0xea, 0xe5, 0xb5, - 0xe8, 0xaa, 0xcf, 0xcd, 0x96, 0x9f, 0xd6, 0xc1, 0x5f, 0x53, 0x91, 0xad, - 0x05, 0xde, 0x20, 0xe7, 0x51, 0xda, 0x5b, 0x95, 0x67, 0xed, 0xf4, 0xee, - 0x42, 0x65, 0x70, 0x13, 0x0b, 0x70, 0x14, 0x1c, 0xc9, 0xe0, 0x19, 0xca, - 0x5f, 0xf5, 0x1d, 0x70, 0x4b, 0x6c, 0x06, 0x74, 0xec, 0xb5, 0x2e, 0x77, - 0xe1, 0x74, 0xa1, 0xa3, 0x99, 0xa0, 0x85, 0x9e, 0xf1, 0xac, 0xd8, 0x7e}; +0x00,0x00,0x10,0x00,0xc1,0x79,0x02,0x4f,0xb6,0x2f,0xb8,0xcf,0x39,0x70,0x38,0x48, +0x9a,0x00,0x85,0x15,0x58,0xb4,0x22,0xa1,0x44,0xdc,0x68,0xb9,0xc4,0xc8,0xfc,0xc0, +0x78,0x35,0x0a,0xd7,0x2d,0x74,0xde,0xa9,0x93,0x36,0x3d,0xe6,0xfe,0x2f,0xd7,0x75, +0x84,0x22,0x51,0x08,0xb5,0x4b,0xe4,0x9e,0x44,0xd1,0x49,0x67,0xd7,0x59,0x4a,0x50, +0x95,0xfb,0xe1,0x6d,0xb0,0xec,0xd4,0x99,0x38,0xe9,0xcb,0xae,0xe4,0xbd,0xd7,0xac, +0x92,0x96,0x72,0x89,0x3c,0xef,0x66,0xa4,0xf0,0x82,0xf6,0xdd,0x24,0x54,0xdf,0x87, +0x5a,0x91,0xe3,0x8a,0xf4,0xfe,0x8e,0x0f,0xad,0x9b,0xc0,0xe3,0xcb,0x97,0x9a,0x45, +0xf2,0xf5,0x97,0xa0,0x4f,0xc9,0x2a,0x07,0xb7,0x46,0x20,0x5f,0xf6,0x88,0x40,0xe7, +0x81,0x90,0x6d,0x4c,0x0b,0x9f,0x4f,0x42,0xd8,0xec,0xea,0x00,0x01,0xa7,0x3e,0x09, +0x47,0x58,0x4d,0x9b,0x76,0x79,0x75,0x2b,0x9b,0xf3,0x9b,0xe9,0xdc,0xdf,0xc8,0x05, +0xe0,0x8d,0x71,0x46,0xf9,0xde,0x47,0xd2,0x08,0xa9,0x27,0x91,0x51,0xa6,0x54,0xd5, +0x70,0x48,0xc2,0xd8,0x75,0x33,0x03,0x87,0x40,0xe1,0x4b,0x8a,0x84,0x4c,0x91,0x25, +0x47,0xa5,0x23,0x4b,0xcc,0x5a,0x24,0x63,0xfa,0xbf,0xb4,0x08,0xc2,0x29,0x2e,0xaf, +0x46,0xf1,0xf7,0xc3,0x4a,0x3e,0xe3,0xab,0x8e,0x0c,0x4a,0x42,0xa7,0xc2,0x19,0x86, +0x36,0x71,0x18,0x2c,0x5f,0x65,0xb1,0x5b,0x4f,0x17,0x52,0x70,0xd5,0x36,0x1b,0xc5, +0xbc,0x26,0x43,0x97,0xb7,0xf8,0x69,0xf0,0x8f,0x8a,0x62,0xc2,0x0f,0xb1,0xea,0x9a, +0x22,0x2b,0x69,0xb7,0x7d,0x1c,0x9a,0x4b,0xf4,0x64,0x96,0x6f,0x56,0xf1,0x55,0x16, +0x2d,0x93,0x80,0x0b,0xbe,0xb1,0xc1,0x95,0x68,0xe0,0x9c,0x0d,0x8f,0x55,0x99,0x85, +0x46,0x7e,0xc8,0xf6,0xcf,0xa4,0x16,0xa8,0x26,0xf8,0x5a,0x90,0x83,0xaa,0x1c,0xaf, +0x17,0x4c,0x1b,0xcf,0xaa,0xa1,0x88,0x0e,0xb4,0x79,0xad,0x78,0x02,0x1c,0xef,0x98, +0x3b,0xb5,0xb6,0x9c,0xa6,0xf8,0xe6,0xf4,0xc9,0x92,0xee,0x79,0x9c,0xf7,0x47,0x3f, +0x5e,0x59,0x9a,0x63,0x77,0xa9,0xf2,0xd1,0x2f,0xce,0xc6,0x89,0xa0,0xdd,0x97,0x3c, +0xf8,0xd4,0xd9,0xa9,0xaf,0x9b,0x1a,0x5b,0xe2,0xf5,0x4e,0x3f,0x3f,0x08,0xd5,0x2e, +0xad,0x8a,0x3f,0xc2,0xac,0x42,0x0c,0x10,0x60,0xd7,0x08,0x00,0x27,0x46,0xbe,0x55, +0x91,0xcf,0x7a,0x42,0xac,0x5f,0xf2,0xa5,0x40,0xa5,0xc7,0x11,0xb8,0xa7,0x0a,0x3b, +0xc3,0x2c,0x31,0x3d,0x5b,0x46,0xae,0x53,0xcf,0x18,0x9b,0x7b,0x0c,0x52,0xbe,0xba, +0xb9,0x67,0xc8,0x75,0x04,0x60,0x24,0xde,0xf8,0xd7,0x00,0xdc,0xe7,0x45,0xbf,0x9e, +0x4c,0x49,0x84,0x67,0x9f,0x6e,0x18,0x33,0xcb,0xc0,0x74,0x3d,0x00,0xd4,0xe2,0x97, +0xd1,0x21,0x6f,0x11,0xc1,0x98,0x54,0x51,0x2e,0xd6,0xa2,0x3a,0x76,0xa5,0xc8,0x8d, +0x67,0x8a,0xfa,0xa0,0xe3,0xa3,0x1d,0x66,0x2d,0xcd,0x05,0xbd,0xc4,0x62,0x49,0x0b, +0x59,0xc1,0xf8,0xd4,0x3c,0x44,0x6f,0xbb,0x61,0x78,0x35,0x1b,0x9d,0x45,0x6f,0x90, +0x89,0xa9,0x39,0x0b,0x13,0xf3,0x17,0x26,0x49,0x8e,0x3d,0x81,0x83,0xcd,0xf0,0x12, +0xb3,0xa6,0x2a,0xca,0xef,0xbd,0x2b,0x51,0x19,0x9d,0xb2,0xff,0xe3,0x30,0xb5,0x65, +0xad,0xf2,0x65,0x66,0x69,0x1f,0xd7,0x4d,0x2e,0xf9,0x2c,0xad,0x6c,0x92,0x93,0x72, +0x00,0x06,0x5b,0x7d,0x7f,0x97,0xd6,0x61,0x62,0xc1,0xd5,0xde,0x16,0x78,0x7e,0x35, +0x7a,0x2f,0xc3,0xa8,0xd1,0x4a,0xb1,0x9d,0x2f,0x49,0xe9,0xf0,0xcd,0x49,0x88,0xa5, +0x93,0x15,0x29,0xe3,0xb2,0x43,0x51,0x44,0x47,0xf5,0x79,0x1a,0x7e,0xc4,0xfc,0xfc, +0x93,0xd7,0x9c,0xe0,0x75,0x20,0xb6,0x74,0x77,0xa4,0x01,0x4b,0xf0,0x7c,0x5a,0x19, +0xea,0xd5,0x5e,0x40,0xf2,0xc9,0xaa,0x4c,0x70,0x10,0xa9,0x9e,0x22,0x7f,0x98,0x77, +0x97,0xde,0xc6,0x00,0xdc,0xa4,0x7d,0x5f,0x43,0x61,0xc4,0x45,0xdb,0xec,0xe6,0xa6, +0x74,0xf0,0xb7,0x98,0x50,0x5d,0x47,0x31,0x99,0x00,0x6f,0x5d,0xc7,0x48,0xc4,0x55, +0xb7,0x98,0x4a,0xaf,0xf8,0xe5,0xcf,0xe7,0xa5,0xf0,0xd2,0xe6,0xfd,0xb2,0x1d,0xcd, +0x28,0x2e,0x6a,0xb3,0x23,0x82,0x22,0x44,0x54,0xeb,0x53,0x36,0xaa,0x72,0xf2,0x78, +0xbb,0x1d,0x3a,0x01,0xa7,0xc3,0x07,0x6c,0x08,0x1a,0x2f,0x4c,0x19,0xcd,0xad,0x76, +0x99,0xa0,0x6b,0xeb,0x63,0x70,0x51,0xa4,0x5d,0x0d,0x45,0x6b,0x2b,0xa2,0x5c,0x1e, +0x81,0x5e,0xe7,0x66,0xa0,0x29,0x3c,0x2a,0x52,0x01,0x6c,0x6f,0x42,0x9e,0x8b,0xd7, +0x94,0xe4,0xbb,0xbc,0xc5,0xbc,0x1e,0x89,0x3f,0xd6,0xaa,0x91,0x5c,0xaf,0x06,0x98, +0xf8,0x31,0x79,0xe1,0xb9,0xef,0x54,0xc5,0x7b,0xbf,0x33,0x53,0x2d,0xa2,0x87,0x65, +0x0a,0xee,0x56,0xa1,0x1a,0x79,0x13,0x4c,0x72,0xa7,0x4f,0x41,0x37,0x7d,0x6a,0x07, +0x5c,0x47,0xbf,0x46,0xb2,0xf6,0x49,0xf5,0x45,0x2b,0xc4,0x48,0x54,0xd4,0xd7,0x2f, +0xa7,0x93,0x7f,0xd3,0x2d,0xe3,0x61,0x67,0x0d,0xf3,0x3b,0xc1,0x23,0x14,0x1a,0x71, +0x3d,0x1e,0x92,0xac,0x82,0xfd,0x8c,0x3d,0xad,0x62,0xe2,0x25,0xa7,0xd4,0x01,0x19, +0x71,0x11,0x5d,0xd1,0xfc,0xed,0x7e,0xdb,0xbe,0x7c,0x74,0x38,0xe0,0x40,0x16,0x4b, +0x02,0xad,0x83,0x50,0x89,0xbf,0xae,0x78,0x8b,0x7b,0x58,0xae,0xe5,0x7c,0x25,0xe8, +0x27,0x3b,0x54,0xc8,0xab,0xd5,0x32,0xfb,0x41,0x6a,0x99,0x24,0xf5,0xf2,0xc7,0xef, +0xae,0x80,0xfd,0xe4,0xaf,0xf2,0x28,0x70,0xac,0xc6,0xa7,0x77,0xef,0xb6,0xc3,0x8e, +0xa0,0xd3,0xda,0x3a,0x66,0xa4,0x7f,0x48,0x4e,0xda,0xce,0x25,0xfe,0xfe,0x4f,0xac, +0x50,0xb2,0xa1,0xb5,0x64,0xa2,0xb3,0x7c,0xd0,0xf5,0x18,0x8e,0xe4,0xea,0x5a,0xf1, +0xdd,0x74,0xf8,0x6c,0xc1,0x2e,0x5c,0x57,0xb9,0x0b,0xa9,0x01,0xad,0xea,0x19,0xd0, +0x26,0x01,0x35,0xd8,0x69,0x56,0x26,0x41,0xa6,0x3a,0x80,0x72,0x1f,0xfd,0x29,0x30, +0x22,0xc5,0xd9,0x31,0xbf,0xd7,0xb2,0xb1,0xc6,0x98,0x0d,0x15,0x7e,0x59,0x58,0x40, +0x14,0x10,0x3f,0x99,0x5a,0x5e,0x76,0x53,0xe0,0xf1,0x0e,0x38,0x0f,0x87,0x1d,0x08, +0x6b,0x50,0x89,0x68,0x23,0x3e,0x98,0x6f,0xd7,0xb6,0x6c,0x7a,0xaf,0x8e,0x54,0x68, +0xb7,0x62,0x6b,0x9f,0xdc,0x37,0xce,0xef,0xfe,0x3f,0xf8,0xe3,0x90,0x6a,0x80,0x6a, +0xa2,0x61,0x2c,0xf9,0x6f,0xf4,0xf3,0xb7 +}; #endif /* __OEM_PUBLIC_KEY_H__ */ diff --git a/QcomModulePkg/QcomModulePkg.dec b/QcomModulePkg/QcomModulePkg.dec index 78460c59cd..d9c3c417be 100644 --- a/QcomModulePkg/QcomModulePkg.dec +++ b/QcomModulePkg/QcomModulePkg.dec @@ -87,6 +87,7 @@ gEfiMdtpPartitionGuid = { 0x3878408A, 0xE263, 0x4B67, { 0xB8, 0x78, 0x63, 0x40, 0xB3, 0x5B, 0x11, 0xE3 } } gBlockIoRefreshGuid = { 0xb1eb3d10, 0x9d67, 0x40ca, { 0x95, 0x59, 0xf1, 0x48, 0x8b, 0x1b, 0x2d, 0xdb } } gEfiRNGAlgRawGuid = { 0xe43176d7, 0xb6e8, 0x4827, { 0xb7, 0x84, 0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61 } } + gEfiOemPartitionGuid = { 0x2EF88D0E, 0x0B34, 0xB6D1, { 0x52, 0x08, 0xC5, 0x59, 0x83, 0x86, 0xD1, 0xDF } } [Protocols] # SCM diff --git a/QcomModulePkg/QcomModulePkg.dsc b/QcomModulePkg/QcomModulePkg.dsc index a3f4781bf0..c1edb03b5c 100644 --- a/QcomModulePkg/QcomModulePkg.dsc +++ b/QcomModulePkg/QcomModulePkg.dsc @@ -71,12 +71,17 @@ TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf Zlib|QcomModulePkg/Library/zlib/zlib.inf - DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf DebugPrintErrorLevelLib|MdeModulePkg/Library/DxeDebugPrintErrorLevelLib/DxeDebugPrintErrorLevelLib.inf UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf PerformanceLib|MdeModulePkg/Library/DxePerformanceLib/DxePerformanceLib.inf AvbLib|QcomModulePkg/Library/avb/AvbLib.inf + LittleVglLib|AbmPkg/Library/LVGL/lvgl.inf + StrLib|AbmPkg/Library/StrLib/StrLib.inf + MallocLib|AbmPkg/Library/MallocLib/MallocLib.inf + MicroLibC|AbmPkg/Library/MicroLibC/MicroLibC.inf + lwext4Lib|AbmPkg/Library/lwext4/lwext4Lib.inf + AbmLib|AbmPkg/Library/AbmLib/AbmLib.inf [LibraryClasses.ARM] ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf @@ -95,6 +100,8 @@ GCC:*_*_*_DLINK_FLAGS = -Ttext=0x0 GCC:*_*_*_CC_FLAGS = -DZ_SOLO GCC:*_*_*_CC_FLAGS = -DPRODUCT_NAME=\"$(BOARD_BOOTLOADER_PRODUCT_NAME)\" + GCC:*_*_*_CC_FLAGS = -DPRODUCT_MODEL=\"$(BOARD_BOOTLOADER_PRODUCT_MODEL)\" + GCC:*_*_*_CC_FLAGS = -DPRODUCT_BOOTLOADER_VERSION=\"$(BOARD_BOOTLOADER_VERSION)\" !if $(VERIFIED_BOOT) GCC:*_*_*_CC_FLAGS = -DVERIFIED_BOOT @@ -117,7 +124,7 @@ !if $(USER_BUILD_VARIANT) == 0 GCC:*_*_*_CC_FLAGS = -DENABLE_UPDATE_PARTITIONS_CMDS -DENABLE_BOOT_CMD -DENABLE_DEVICE_CRITICAL_LOCK_UNLOCK_CMDS !else - GCC:*_*_*_CC_FLAGS = -DUSER_BUILD_VARIANT + GCC:*_*_*_CC_FLAGS = -DENABLE_UPDATE_PARTITIONS_CMDS -DENABLE_BOOT_CMD -DENABLE_DEVICE_CRITICAL_LOCK_UNLOCK_CMDS -DUSER_BUILD_VARIANT !endif !if $(ENABLE_LE_VARIANT) == 1 GCC:*_*_*_CC_FLAGS = -DENABLE_LE_VARIANT @@ -159,9 +166,9 @@ # ASSERT_BREAKPOINT_ENABLED 0x10 # ASSERT_DEADLOOP_ENABLED 0x20 - gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2f - gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000042 - gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x06 + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F + gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel| 0x80000047 + gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07 ################################################################################ # diff --git a/QcomModulePkg/QcomModulePkg.fdf b/QcomModulePkg/QcomModulePkg.fdf index ce0eac8f80..9d1fea7260 100644 --- a/QcomModulePkg/QcomModulePkg.fdf +++ b/QcomModulePkg/QcomModulePkg.fdf @@ -50,10 +50,10 @@ [FD.QcomModule_EFI] BaseAddress = 0x80200000|gEmbeddedTokenSpaceGuid.PcdEmbeddedFdBaseAddress #The base address of the FLASH Device. -Size = 0x00022000|gEmbeddedTokenSpaceGuid.PcdEmbeddedFdSize #The size in bytes of the FLASH Device +Size = 0x00044000|gEmbeddedTokenSpaceGuid.PcdEmbeddedFdSize #The size in bytes of the FLASH Device ErasePolarity = 1 BlockSize = 0x200 -NumBlocks = 0x110 +NumBlocks = 0x220 ################################################################################ # @@ -72,7 +72,7 @@ NumBlocks = 0x110 ################################################################################ # 512 bytes of configuration header & 8 bytes of image header -0x00000000|0x00022000 +0x00000000|0x00044000 gEmbeddedTokenSpaceGuid.PcdFlashFvMainBase|gEmbeddedTokenSpaceGuid.PcdFlashFvMainSize FV = FVMAIN_COMPACT