FastbootMenu: print PRODUCT_MODEL
Change-Id: If26fcc711aa81f4e1a930c2d319cfe0b0f8b71a9
Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
diff --git a/AndroidBoot.mk b/AndroidBoot.mk
index 2ceef7b..51d2f9b 100644
--- a/AndroidBoot.mk
+++ b/AndroidBoot.mk
@@ -74,6 +74,12 @@
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_BOARD_TYPE),auto)
TARGET_BOARD_TYPE_AUTO := TARGET_BOARD_TYPE_AUTO=0
else
@@ -167,4 +173,5 @@
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) \
USERDATAIMAGE_FILE_SYSTEM_TYPE=$(USERDATAIMAGE_FILE_SYSTEM_TYPE)
diff --git a/QcomModulePkg/Library/BootLib/FastbootMenu.c b/QcomModulePkg/Library/BootLib/FastbootMenu.c
index ba061a4..6080021 100644
--- a/QcomModulePkg/Library/BootLib/FastbootMenu.c
+++ b/QcomModulePkg/Library/BootLib/FastbootMenu.c
@@ -110,6 +110,13 @@
COMMON,
0,
NOACTION},
+ {{"PRODUCT_MODEL - "},
+ COMMON_FACTOR,
+ BGR_WHITE,
+ BGR_BLACK,
+ COMMON,
+ 0,
+ NOACTION},
{{"VARIANT - "},
COMMON_FACTOR,
BGR_WHITE,
@@ -257,6 +264,12 @@
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));
@@ -271,14 +284,14 @@
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));
@@ -286,7 +299,7 @@
sizeof (mFastbootCommonMsgInfo[i].Msg), VersionTemp,
sizeof (VersionTemp));
break;
- case 6:
+ case 7:
/* Get serial number */
ZeroMem (StrTemp, sizeof (StrTemp));
BoardSerialNum (StrTemp, MAX_RSP_SIZE);
@@ -294,7 +307,7 @@
sizeof (mFastbootCommonMsgInfo[i].Msg), StrTemp,
sizeof (StrTemp));
break;
- case 7:
+ case 8:
/* Get hardware revision */
ZeroMem (StrTemp, sizeof (StrTemp));
BoardHardwareRevision (StrTemp, MAX_RSP_SIZE);
@@ -302,14 +315,14 @@
sizeof (mFastbootCommonMsgInfo[i].Msg), StrTemp,
sizeof (StrTemp));
break;
- case 8:
+ case 9:
/* Get secure boot value */
AsciiStrnCatS (
mFastbootCommonMsgInfo[i].Msg, sizeof (mFastbootCommonMsgInfo[i].Msg),
IsSecureBootEnabled () ? "yes" : "no",
IsSecureBootEnabled () ? AsciiStrLen ("yes") : AsciiStrLen ("no"));
break;
- case 9:
+ case 10:
/* Get device status */
AsciiStrnCatS (
mFastbootCommonMsgInfo[i].Msg, sizeof (mFastbootCommonMsgInfo[i].Msg),
diff --git a/QcomModulePkg/QcomModulePkg.dsc b/QcomModulePkg/QcomModulePkg.dsc
index 0d5d26e..210b274 100644
--- a/QcomModulePkg/QcomModulePkg.dsc
+++ b/QcomModulePkg/QcomModulePkg.dsc
@@ -95,6 +95,7 @@
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)\"
!if $(VERIFIED_BOOT)
GCC:*_*_*_CC_FLAGS = -DVERIFIED_BOOT