Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos A
提交
66c91a00
K
Kernel Liteos A
项目概览
OpenHarmony
/
Kernel Liteos A
1 年多 前同步成功
通知
461
Star
414
Fork
55
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos A
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
66c91a00
编写于
2月 08, 2021
作者:
O
openharmony_ci
提交者:
Gitee
2月 08, 2021
浏览文件
操作
浏览文件
下载
差异文件
!69 增加对QEMU arm 'virt' CFI flash的支持
Merge pull request !69 from laokz/testqemu
上级
71144b4a
9404c997
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
54 addition
and
10 deletion
+54
-10
fs/vfs/multi_partition/src/mtd_partition.c
fs/vfs/multi_partition/src/mtd_partition.c
+16
-3
kernel/common/los_rootfs.c
kernel/common/los_rootfs.c
+33
-3
tools/build/config/debug/qemu_arm_virt_ca7_clang.config
tools/build/config/debug/qemu_arm_virt_ca7_clang.config
+5
-4
未找到文件。
fs/vfs/multi_partition/src/mtd_partition.c
浏览文件 @
66c91a00
...
...
@@ -71,10 +71,18 @@ static VOID MtdNorParamAssign(partition_param *spinorParam, const struct MtdDev
* you can change the SPIBLK_NAME or SPICHR_NAME to NULL.
*/
spinorParam
->
flash_mtd
=
(
struct
MtdDev
*
)
spinorMtd
;
#ifndef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
spinorParam
->
flash_ops
=
GetDevSpinorOps
();
spinorParam
->
char_ops
=
GetMtdCharFops
();
spinorParam
->
blockname
=
SPIBLK_NAME
;
spinorParam
->
charname
=
SPICHR_NAME
;
#else
extern
struct
block_operations
*
GetCfiBlkOps
(
void
);
spinorParam
->
flash_ops
=
GetCfiBlkOps
();
spinorParam
->
char_ops
=
NULL
;
spinorParam
->
blockname
=
"/dev/cfiflash"
;
spinorParam
->
charname
=
NULL
;
#endif
spinorParam
->
partition_head
=
g_spinorPartitionHead
;
spinorParam
->
block_size
=
spinorMtd
->
eraseSize
;
}
...
...
@@ -88,7 +96,12 @@ static VOID MtdDeinitSpinorParam(VOID)
static
partition_param
*
MtdInitSpinorParam
(
partition_param
*
spinorParam
)
{
#ifndef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
struct
MtdDev
*
spinorMtd
=
GetMtd
(
"spinor"
);
#else
extern
struct
MtdDev
*
GetCfiMtdDev
(
void
);
struct
MtdDev
*
spinorMtd
=
GetCfiMtdDev
();
#endif
if
(
spinorMtd
==
NULL
)
{
return
NULL
;
}
...
...
@@ -121,7 +134,7 @@ static partition_param *MtdInitSpinorParam(partition_param *spinorParam)
/* According the flash-type to init the param of the partition. */
static
INT32
MtdInitFsparParam
(
const
CHAR
*
type
,
partition_param
**
fsparParam
)
{
if
(
strcmp
(
type
,
"spinor"
)
==
0
)
{
if
(
strcmp
(
type
,
"spinor"
)
==
0
||
strcmp
(
type
,
"cfi-flash"
)
==
0
)
{
g_spinorPartParam
=
MtdInitSpinorParam
(
g_spinorPartParam
);
*
fsparParam
=
g_spinorPartParam
;
}
else
{
...
...
@@ -138,7 +151,7 @@ static INT32 MtdInitFsparParam(const CHAR *type, partition_param **fsparParam)
/* According the flash-type to deinit the param of the partition. */
static
INT32
MtdDeinitFsparParam
(
const
CHAR
*
type
)
{
if
(
strcmp
(
type
,
"spinor"
)
==
0
)
{
if
(
strcmp
(
type
,
"spinor"
)
==
0
||
strcmp
(
type
,
"cfi-flash"
)
==
0
)
{
MtdDeinitSpinorParam
();
g_spinorPartParam
=
NULL
;
}
else
{
...
...
@@ -356,7 +369,7 @@ static INT32 DeleteParamCheck(UINT32 partitionNum,
const
CHAR
*
type
,
partition_param
**
param
)
{
if
(
strcmp
(
type
,
"spinor"
)
==
0
)
{
if
(
strcmp
(
type
,
"spinor"
)
==
0
||
strcmp
(
type
,
"cfi-flash"
)
==
0
)
{
*
param
=
g_spinorPartParam
;
}
else
{
PRINT_ERR
(
"type error
\n
"
);
...
...
kernel/common/los_rootfs.c
浏览文件 @
66c91a00
...
...
@@ -31,7 +31,7 @@
#include "los_base.h"
#include "los_typedef.h"
#include "string.h"
#if
def LOSCFG_PLATFORM_HI3518EV300
#if
defined(LOSCFG_PLATFORM_HI3518EV300) || defined(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7)
#include "mtd_partition.h"
#endif
#ifdef LOSCFG_DRIVERS_MMC
...
...
@@ -181,6 +181,24 @@ STATIC const CHAR *GetDevName(const CHAR *rootType, INT32 rootAddr, INT32 rootSi
rootDev
=
AddEmmcRootfsPart
(
rootAddr
,
rootSize
);
}
else
#endif
#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
#define CFIFLASH_CAPACITY 64 * 1024 * 1024
INT32
ret
;
if
(
strcmp
(
rootType
,
"cfi-flash"
)
==
0
)
{
ret
=
add_mtd_partition
(
"cfi-flash"
,
rootAddr
,
rootSize
,
0
);
if
(
ret
!=
LOS_OK
)
{
PRINT_ERR
(
"Failed to add cfi-flash root partition!
\n
"
);
}
else
{
rootDev
=
"/dev/cfiflash0"
;
ret
=
add_mtd_partition
(
"cfi-flash"
,
(
rootAddr
+
rootSize
),
CFIFLASH_CAPACITY
-
rootAddr
-
rootSize
,
1
);
if
(
ret
!=
LOS_OK
)
{
PRINT_ERR
(
"Failed to add cfi-flash storage partition!
\n
"
);
}
}
}
else
#endif
{
PRINT_ERR
(
"Failed to find root dev type: %s
\n
"
,
rootType
);
}
...
...
@@ -239,8 +257,7 @@ STATIC INT32 GetArgs(CHAR **args)
* bootloader it will pass DTB by default.
*/
(
void
)
ret
;
PRINT_ERR
(
"Fetching bootargs unimplemented.
\n
"
);
goto
ERROUT
;
cmdLine
=
"bootargs=root=cfi-flash fstype=jffs2 rootaddr=0xA00000 rootsize=27M"
;
#endif
for
(
i
=
0
;
i
<
COMMAND_LINE_SIZE
;
i
+=
len
+
1
)
{
...
...
@@ -471,6 +488,19 @@ STATIC INT32 OsMountRootfsAndUserfs(const CHAR *rootDev, const CHAR *fsType)
PRINT_ERR
(
"Failed to mount /storage, errno %d: %s
\n
"
,
err
,
strerror
(
err
));
}
}
#endif
#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
ret
=
mkdir
(
"/storage"
,
DEFAULT_STORAGE_MOUNT_DIR_MODE
);
if
(
ret
!=
LOS_OK
)
{
err
=
get_errno
();
PRINT_ERR
(
"Failed to reserve inode /storage, errno %d: %s
\n
"
,
err
,
strerror
(
err
));
}
else
{
ret
=
mount
(
"/dev/cfiflash1"
,
"/storage"
,
fsType
,
0
,
NULL
);
if
(
ret
!=
LOS_OK
)
{
err
=
get_errno
();
PRINT_ERR
(
"Failed to mount /storage, errno %d: %s
\n
"
,
err
,
strerror
(
err
));
}
}
#endif
}
return
LOS_OK
;
...
...
tools/build/config/debug/qemu_arm_virt_ca7_clang.config
浏览文件 @
66c91a00
...
...
@@ -34,6 +34,7 @@ LOSCFG_ARCH_CPU="cortex-a7"
#
# LOSCFG_ARCH_FPU_DISABLE is not set
LOSCFG_IRQ_USE_STANDALONE_STACK
=
y
LOSCFG_PLATFORM_ROOTFS
=
y
#
# Kernel
...
...
@@ -43,7 +44,7 @@ LOSCFG_KERNEL_EXTKERNEL=y
# LOSCFG_KERNEL_CPPSUPPORT is not set
LOSCFG_KERNEL_CPUP
=
y
LOSCFG_CPUP_INCLUDE_IRQ
=
y
# LOSCFG_KERNEL_DYNLOAD is not set
LOSCFG_KERNEL_DYNLOAD
=
y
# LOSCFG_KERNEL_VDSO is not set
# LOSCFG_KERNEL_TICKLESS is not set
# LOSCFG_KERNEL_TRACE is not set
...
...
@@ -72,7 +73,7 @@ LOSCFG_FILE_MODE=y
# LOSCFG_FS_FAT is not set
LOSCFG_FS_RAMFS
=
y
LOSCFG_FS_PROC
=
y
# LOSCFG_FS_JFFS is not set
LOSCFG_FS_JFFS
=
y
#
# Net
...
...
@@ -97,7 +98,7 @@ LOSCFG_SHELL=y
# LOSCFG_SHELL_LK is not set
# LOSCFG_SHELL_EXCINFO is not set
# LOSCFG_EXC_INTERACTION is not set
# LOSCFG_USER_INIT_DEBUG is not set
LOSCFG_USER_INIT_DEBUG
=
y
# LOSCFG_SHELL_CMD_DEBUG is not set
# LOSCFG_MEM_DEBUG is not set
# LOSCFG_NULL_ADDRESS_PROTECT is not set
...
...
@@ -125,7 +126,7 @@ LOSCFG_DRIVERS_HDF_PLATFORM=y
# LOSCFG_DRIVERS_HDF_USB is not set
LOSCFG_DRIVERS_MEM
=
y
# LOSCFG_DRIVERS_MMC is not set
# LOSCFG_DRIVERS_MTD is not set
LOSCFG_DRIVERS_MTD
=
y
# LOSCFG_DRIVERS_RANDOM is not set
# LOSCFG_DRIVERS_VIDEO is not set
# LOSCFG_DRIVERS_HIEVENT is not set
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录