提交 7e698f4b 编写于 作者: O openharmony_ci 提交者: Gitee

!189 添加BOOTENV存放在RAM中的单独配置宏

Merge pull request !189 from boxi/master
...@@ -115,9 +115,9 @@ __exception_handlers: ...@@ -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 ...@@ -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 "Read bootenv from 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 ...@@ -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 ...@@ -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 ...@@ -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: ...@@ -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); ...@@ -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 */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册