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:
parent
806ce4eb26
commit
f13b90e430
|
@ -115,9 +115,9 @@ __exception_handlers:
|
||||||
.global reset_vector
|
.global reset_vector
|
||||||
.type reset_vector,function
|
.type reset_vector,function
|
||||||
|
|
||||||
#ifdef LOSCFG_QUICK_START
|
#ifdef LOSCFG_BOOTENV_RAM
|
||||||
__quickstart_args_start:
|
__quickstart_args_start:
|
||||||
.fill 512,1,0
|
.fill LOSCFG_BOOTENV_RAMSIZE,1,0
|
||||||
__quickstart_args_end:
|
__quickstart_args_end:
|
||||||
|
|
||||||
.global OsGetArgsAddr
|
.global OsGetArgsAddr
|
||||||
|
|
|
@ -28,8 +28,23 @@ endchoice
|
||||||
|
|
||||||
config BOOTENV_ADDR
|
config BOOTENV_ADDR
|
||||||
int "Address of boot command line (KB)"
|
int "Address of boot command line (KB)"
|
||||||
depends on PLATFORM_ROOTFS
|
depends on PLATFORM_ROOTFS && (STORAGE_SPINOR || STORAGE_SPINAND || STORAGE_EMMC)
|
||||||
range 0 1024
|
range 0 1024
|
||||||
default 512
|
default 512
|
||||||
help
|
help
|
||||||
Boot command line addr, range from 0 to 1MB.
|
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.
|
||||||
|
|
|
@ -219,7 +219,7 @@ STATIC const CHAR *GetDevName(const CHAR *rootType, INT32 rootAddr, INT32 rootSi
|
||||||
#ifndef LOSCFG_SECURITY_BOOT
|
#ifndef LOSCFG_SECURITY_BOOT
|
||||||
STATIC INT32 GetArgs(CHAR **args)
|
STATIC INT32 GetArgs(CHAR **args)
|
||||||
{
|
{
|
||||||
#ifdef LOSCFG_QUICK_START
|
#ifdef LOSCFG_BOOTENV_RAM
|
||||||
*args = OsGetArgsAddr();
|
*args = OsGetArgsAddr();
|
||||||
return LOS_OK;
|
return LOS_OK;
|
||||||
|
|
||||||
|
@ -387,7 +387,7 @@ STATIC INT32 GetRootType(CHAR **rootType, CHAR **fsType, INT32 *rootAddr, INT32
|
||||||
PRINT_ERR("Cannot get bootargs!\n");
|
PRINT_ERR("Cannot get bootargs!\n");
|
||||||
return LOS_NOK;
|
return LOS_NOK;
|
||||||
}
|
}
|
||||||
#ifndef LOSCFG_QUICK_START
|
#ifndef LOSCFG_BOOTENV_RAM
|
||||||
CHAR *argsBak = NULL;
|
CHAR *argsBak = NULL;
|
||||||
argsBak = args;
|
argsBak = args;
|
||||||
#endif
|
#endif
|
||||||
|
@ -399,7 +399,7 @@ STATIC INT32 GetRootType(CHAR **rootType, CHAR **fsType, INT32 *rootAddr, INT32
|
||||||
p = strsep(&args, " ");
|
p = strsep(&args, " ");
|
||||||
}
|
}
|
||||||
if ((*fsType != NULL) && (*rootType != NULL)) {
|
if ((*fsType != NULL) && (*rootType != NULL)) {
|
||||||
#ifndef LOSCFG_QUICK_START
|
#ifndef LOSCFG_BOOTENV_RAM
|
||||||
free(argsBak);
|
free(argsBak);
|
||||||
#endif
|
#endif
|
||||||
return LOS_OK;
|
return LOS_OK;
|
||||||
|
@ -415,7 +415,7 @@ ERROUT:
|
||||||
free(*fsType);
|
free(*fsType);
|
||||||
*fsType = NULL;
|
*fsType = NULL;
|
||||||
}
|
}
|
||||||
#ifndef LOSCFG_QUICK_START
|
#ifndef LOSCFG_BOOTENV_RAM
|
||||||
free(argsBak);
|
free(argsBak);
|
||||||
#endif
|
#endif
|
||||||
return LOS_NOK;
|
return LOS_NOK;
|
||||||
|
|
|
@ -76,7 +76,7 @@ INT32 OsMountRootfs(VOID);
|
||||||
VOID OsSetCmdLineAddr(UINT64 addr);
|
VOID OsSetCmdLineAddr(UINT64 addr);
|
||||||
UINT64 OsGetCmdLineAddr(VOID);
|
UINT64 OsGetCmdLineAddr(VOID);
|
||||||
|
|
||||||
#ifdef LOSCFG_QUICK_START
|
#ifdef LOSCFG_BOOTENV_RAM
|
||||||
CHAR *OsGetArgsAddr(VOID);
|
CHAR *OsGetArgsAddr(VOID);
|
||||||
#endif
|
#endif
|
||||||
#endif /* _LOS_ROOTFS_H */
|
#endif /* _LOS_ROOTFS_H */
|
||||||
|
|
Loading…
Reference in New Issue