Show memory information on fastboot screen
Add ddr Manufacturer ID to smem SMEM_ID_VENDOR2 in sbl1
for showing memory and manufacturer info on fastboot screen
Change-Id: Iabc97c0d40f6f4bd7f104e9346b0e5e329705912
diff --git a/platform/msm_shared/display_menu.c b/platform/msm_shared/display_menu.c
index 3e09755..72a836c 100755
--- a/platform/msm_shared/display_menu.c
+++ b/platform/msm_shared/display_menu.c
@@ -42,6 +42,7 @@
#include <sys/types.h>
#include <../../../app/aboot/devinfo.h>
#include <../../../app/aboot/recovery.h>
+#include <mmu.h>
#define TITLE_MSG "<!>\n\n"
@@ -507,6 +508,43 @@
snprintf(msg, sizeof(msg), "SERIAL NUMBER - %s\n", msg_buf);
display_fbcon_menu_message(msg, FBCON_COMMON_MSG, common_factor, 0);
+ dprintf(CRITICAL,"smem_get_ddr_size=%llu\n", smem_get_ddr_size());
+ if (smem_get_ddr_size() == MEM_3GB) {
+ snprintf(msg, sizeof(msg), "INTERNAL STORAGE SIZE - 32G\n");
+ } else if (smem_get_ddr_size() > MEM_3GB) {
+ if (smem_get_ddr_size() < MEM_4GB)
+ {
+ snprintf(msg, sizeof(msg), "INTERNAL STORAGE SIZE - 64G\n");
+ }
+ else
+ {
+ snprintf(msg, sizeof(msg), "INTERNAL STORAGE SIZE - \n");
+ }
+ } else {
+ snprintf(msg, sizeof(msg), "INTERNAL STORAGE SIZE - UNKNOWN\n");
+ }
+ display_fbcon_menu_message(msg, FBCON_COMMON_MSG, common_factor, 0);
+
+ memset(msg_buf, 0, sizeof(msg_buf));
+ smem_get_ddr_manufacturer_id((unsigned char *) msg_buf);
+ dprintf(CRITICAL,"smem_get_ddr_size=%llu\n", smem_get_ddr_size());
+ if (smem_get_ddr_size() == MEM_3GB) {
+ snprintf(msg, sizeof(msg), "MAIN MEMORY SIZE AND VENDOR - 3G\n");
+ } else if (smem_get_ddr_size() > MEM_3GB) {
+ if (smem_get_ddr_size() < MEM_4GB)
+ {
+ snprintf(msg, sizeof(msg), "MAIN MEMORY SIZE AND VENDOR - 4G %s\n", msg_buf);
+ }
+ else
+ {
+ snprintf(msg, sizeof(msg), "MAIN MEMORY SIZE AND VENDOR - %s\n", msg_buf);
+ }
+ } else {
+ snprintf(msg, sizeof(msg), "MAIN MEMORY SIZE AND VENDOR - %s\n", msg_buf);
+ }
+ display_fbcon_menu_message(msg, FBCON_COMMON_MSG, common_factor, 0);
+
+
snprintf(msg, sizeof(msg), "SECURE BOOT - %s\n",
is_secure_boot_enable()? "enabled":"disabled");
display_fbcon_menu_message(msg, FBCON_COMMON_MSG, common_factor, 0);
diff --git a/platform/msm_shared/smem.h b/platform/msm_shared/smem.h
old mode 100644
new mode 100755
index de285d7..6891583
--- a/platform/msm_shared/smem.h
+++ b/platform/msm_shared/smem.h
@@ -548,6 +548,8 @@
SMEM_BOARD_INFO_LOCATION = 137,
+ SMEM_ID_VENDOR2 = 136,
+
SMEM_SMD_FIFO_BASE_ID = 338,
SMEM_USABLE_RAM_PARTITION_TABLE = 402,
@@ -722,5 +724,6 @@
void* smem_get_alloc_entry(smem_mem_type_t type, uint32_t* size);
uint32_t get_ddr_start();
uint64_t smem_get_ddr_size();
+void smem_get_ddr_manufacturer_id(unsigned char *buf);
size_t smem_get_hw_platform_name(void *buf, uint32 buf_size);
#endif /* __PLATFORM_MSM_SHARED_SMEM_H */
diff --git a/platform/msm_shared/smem_ptable.c b/platform/msm_shared/smem_ptable.c
old mode 100644
new mode 100755
index 4ed47b7..c6c2883
--- a/platform/msm_shared/smem_ptable.c
+++ b/platform/msm_shared/smem_ptable.c
@@ -347,3 +347,64 @@
return size;
}
+
+//BOOT.BF.3.3.2\boot_images\core\api\boot\ddr_common.h
+/** DDR manufacturers. */
+typedef enum
+{
+ RESERVED_0, /**< Reserved for future use. */
+ SAMSUNG, /**< Samsung. */
+ QIMONDA, /**< Qimonda. */
+ ELPIDA, /**< Elpida Memory, Inc. */
+ ETRON, /**< Etron Technology, Inc. */
+ NANYA, /**< Nanya Technology Corporation. */
+ HYNIX, /**< Hynix Semiconductor Inc. */
+ MOSEL, /**< Mosel Vitelic Corporation. */
+ WINBOND, /**< Winbond Electronics Corp. */
+ ESMT, /**< Elite Semiconductor Memory Technology Inc. */
+ RESERVED_1, /**< Reserved for future use. */
+ SPANSION, /**< Spansion Inc. */
+ SST, /**< Silicon Storage Technology, Inc. */
+ ZMOS, /**< ZMOS Technology, Inc. */
+ INTEL, /**< Intel Corporation. */
+ NUMONYX = 254, /**< Numonyx, acquired by Micron Technology, Inc. */
+ MICRON = 255, /**< Micron Technology, Inc. */
+ DDR_MANUFACTURES_MAX = 0x7FFFFFFF /**< Forces the enumerator to 32 bits. */
+} DDR_MANUFACTURES;
+
+//uint32_t smem_get_ddr_manufacturer_id()
+void smem_get_ddr_manufacturer_id(unsigned char *buf)
+{
+ uint32_t manufacturer_id = -1;
+ uint32_t manufacturer_id_len = sizeof(manufacturer_id);
+ unsigned ret;
+
+ ret = smem_read_alloc_entry(SMEM_ID_VENDOR2,
+ &manufacturer_id,
+ manufacturer_id_len);
+ if (ret)
+ {
+ dprintf(CRITICAL, "Failed to read SMEM_ID_VENDOR2 (%d)", ret);
+ }
+
+ switch(manufacturer_id)
+ {
+ case SAMSUNG:
+ snprintf((char *)buf, 64, "SAMSUNG");
+ break;
+ case ELPIDA:
+ snprintf((char *)buf, 64, "ELPIDA");
+ break;
+ case HYNIX:
+ snprintf((char *)buf, 64, "HYNIX");
+ break;
+ case MICRON:
+ snprintf((char *)buf, 64, "MICRON");
+ break;
+ default:
+ snprintf((char *)buf, 64, "OTHERS");
+ break;
+ }
+
+ dprintf(CRITICAL,"manufacturer_id=%d, %s\n", manufacturer_id, buf);
+}