Add memory_config property
Root cause:N/A
How to fix:N/A
Feature:Add memory_config property for PCBA
RiskArea: PCBA
Change-Id: I3e4d700be41b8cc3715d1ef6d5a81d8427214557
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 0052726..018f01a 100755
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -95,6 +95,9 @@
#include <menu_keys_detect.h>
#include <display_menu.h>
#include "fastboot_test.h"
+/*[TracyChui]Add memory_config property 20200615 start */
+#include <mmu.h>
+/*[TracyChui]Add memory_config property 20200615 end */
extern bool target_use_signed_kernel(void);
extern void platform_uninit(void);
@@ -207,6 +210,10 @@
static const char *baseband_apq_nowgr = " androidboot.baseband=baseband_apq_nowgr";
static const char *androidboot_slot_suffix = " androidboot.slot_suffix=";
static const char *skip_ramfs = " skip_initramfs";
+/* [TracyChui]Add memory_config property 20200615 start */
+static const char *memory_config_3G = " androidboot.memory_config=32GB,3GB";
+static const char *memory_config_4G = " androidboot.memory_config=64GB,4GB";
+/* [TracyChui]Add memory_config property 20200615 end */
#if HIBERNATION_SUPPORT
static const char *resume = " resume=/dev/mmcblk0p";
@@ -619,6 +626,7 @@
#endif
/*[20200605][TracyChui] Implement get Serial Number end */
+
#if VERIFIED_BOOT
if (VB_M <= target_get_vb_version())
{
@@ -757,11 +765,11 @@
case 4: // MP(8901MB-008)
cmdline_len += strlen(PCBA_STAGE_4);
- break;
+ break;
case 5: // MP-8903MB_001
cmdline_len += strlen(PCBA_STAGE_5);
- break;
+ break;
default:// Reserved
cmdline_len += strlen(PCBA_STAGE_F);
@@ -769,6 +777,17 @@
}
//>20200424-michaellin
+ /* [TracyChui]Add memory_config property 20200615 start */
+ if(smem_get_ddr_size() == MEM_3GB )
+ {
+ cmdline_len += strlen(memory_config_3G);
+ }
+ else
+ {
+ cmdline_len += strlen(memory_config_4G);
+ }
+ /* [TracyChui]Add memory_config property 20200615 end */
+
#if ENABLE_DISPLAY
if (cmdline) {
if ((strstr(cmdline, DISPLAY_DEFAULT_PREFIX) == NULL) &&
@@ -978,6 +997,21 @@
}
//>20200424-michaellin
+ /* [TracyChui]Add memory_config property 20200615 start */
+ if(smem_get_ddr_size() == MEM_3GB )
+ {
+ src = memory_config_3G;
+ if (have_cmdline) --dst;
+ while ((*dst++ = *src++));
+ }
+ else
+ {
+ src = memory_config_4G;
+ if (have_cmdline) --dst;
+ while ((*dst++ = *src++));
+ }
+ /* [TracyChui]Add memory_config property 20200615 end */
+
#if VERIFIED_BOOT
if (VB_M <= target_get_vb_version())
{
@@ -3340,7 +3374,7 @@
fastboot_okay("");
}
#endif
-/*[TracyChui] Add lock unlock fastboot commnad to skip ui check 20200611 end */
+/*[TracyChui] Add lock unlock fastboot commnad to skip ui check 20200611 end */
static bool critical_flash_allowed(const char * entry)
{