fix: Provide a separate configuration macro for boot environment in RAM.

Provide a separate configuration macro for boot environment in RAM.
Depends on: Need to copy boot environment data to the specified ram by boot.

Closes #I3OADR

Change-Id: Ie36a92c0a44f245482d1602c3a6851395944776d
This commit is contained in:
boxi 2021-04-26 19:29:34 +08:00
parent 806ce4eb26
commit f13b90e430
4 changed files with 23 additions and 8 deletions

View File

@ -115,9 +115,9 @@ __exception_handlers:
.global reset_vector
.type reset_vector,function
#ifdef LOSCFG_QUICK_START
#ifdef LOSCFG_BOOTENV_RAM
__quickstart_args_start:
.fill 512,1,0
.fill LOSCFG_BOOTENV_RAMSIZE,1,0
__quickstart_args_end:
.global OsGetArgsAddr

View File

@ -28,8 +28,23 @@ endchoice
config BOOTENV_ADDR
int "Address of boot command line (KB)"
depends on PLATFORM_ROOTFS
depends on PLATFORM_ROOTFS && (STORAGE_SPINOR || STORAGE_SPINAND || STORAGE_EMMC)
range 0 1024
default 512
help
Boot command line addr, range from 0 to 1MB.
config BOOTENV_RAM
bool "Storage bootenv in RAM"
default n
depends on PLATFORM_ROOTFS
help
Answer Y to read bootenv from ram. Need boot copy to RAM.
config BOOTENV_RAMSIZE
int "Size of boot environment in RAM (Byte)"
depends on PLATFORM_ROOTFS && BOOTENV_RAM
range 128 1024
default 512
help
Boot environment in Ram space size, range from 128 to 1024 byte.

View File

@ -219,7 +219,7 @@ STATIC const CHAR *GetDevName(const CHAR *rootType, INT32 rootAddr, INT32 rootSi
#ifndef LOSCFG_SECURITY_BOOT
STATIC INT32 GetArgs(CHAR **args)
{
#ifdef LOSCFG_QUICK_START
#ifdef LOSCFG_BOOTENV_RAM
*args = OsGetArgsAddr();
return LOS_OK;
@ -387,7 +387,7 @@ STATIC INT32 GetRootType(CHAR **rootType, CHAR **fsType, INT32 *rootAddr, INT32
PRINT_ERR("Cannot get bootargs!\n");
return LOS_NOK;
}
#ifndef LOSCFG_QUICK_START
#ifndef LOSCFG_BOOTENV_RAM
CHAR *argsBak = NULL;
argsBak = args;
#endif
@ -399,7 +399,7 @@ STATIC INT32 GetRootType(CHAR **rootType, CHAR **fsType, INT32 *rootAddr, INT32
p = strsep(&args, " ");
}
if ((*fsType != NULL) && (*rootType != NULL)) {
#ifndef LOSCFG_QUICK_START
#ifndef LOSCFG_BOOTENV_RAM
free(argsBak);
#endif
return LOS_OK;
@ -415,7 +415,7 @@ ERROUT:
free(*fsType);
*fsType = NULL;
}
#ifndef LOSCFG_QUICK_START
#ifndef LOSCFG_BOOTENV_RAM
free(argsBak);
#endif
return LOS_NOK;

View File

@ -76,7 +76,7 @@ INT32 OsMountRootfs(VOID);
VOID OsSetCmdLineAddr(UINT64 addr);
UINT64 OsGetCmdLineAddr(VOID);
#ifdef LOSCFG_QUICK_START
#ifdef LOSCFG_BOOTENV_RAM
CHAR *OsGetArgsAddr(VOID);
#endif
#endif /* _LOS_ROOTFS_H */