Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
c176d0ca
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c176d0ca
编写于
10月 16, 2008
作者:
D
Dmitry Baryshkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[MTD] sharpsl-nand: cleanup partitions support
Signed-off-by:
N
Dmitry Baryshkov
<
dbaryshkov@gmail.com
>
上级
a4e4f29c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
18 addition
and
4 deletion
+18
-4
drivers/mtd/nand/sharpsl.c
drivers/mtd/nand/sharpsl.c
+18
-4
未找到文件。
drivers/mtd/nand/sharpsl.c
浏览文件 @
c176d0ca
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
* drivers/mtd/nand/sharpsl.c
* drivers/mtd/nand/sharpsl.c
*
*
* Copyright (C) 2004 Richard Purdie
* Copyright (C) 2004 Richard Purdie
* Copyright (C) 2008 Dmitry Baryshkov
*
*
* Based on Sharp's NAND driver sharp_sl.c
* Based on Sharp's NAND driver sharp_sl.c
*
*
...
@@ -52,12 +53,12 @@ struct sharpsl_nand {
...
@@ -52,12 +53,12 @@ struct sharpsl_nand {
#define FLCLE (1 << 1)
#define FLCLE (1 << 1)
#define FLCE0 (1 << 0)
#define FLCE0 (1 << 0)
#ifdef CONFIG_MTD_PARTITIONS
/*
/*
* Define partitions for flash device
* Define partitions for flash device
*/
*/
#define DEFAULT_NUM_PARTITIONS 3
#define DEFAULT_NUM_PARTITIONS 3
static
int
nr_partitions
;
static
struct
mtd_partition
sharpsl_nand_default_partition_info
[]
=
{
static
struct
mtd_partition
sharpsl_nand_default_partition_info
[]
=
{
{
{
.
name
=
"System Area"
,
.
name
=
"System Area"
,
...
@@ -75,6 +76,7 @@ static struct mtd_partition sharpsl_nand_default_partition_info[] = {
...
@@ -75,6 +76,7 @@ static struct mtd_partition sharpsl_nand_default_partition_info[] = {
.
size
=
MTDPART_SIZ_FULL
,
.
size
=
MTDPART_SIZ_FULL
,
},
},
};
};
#endif
/*
/*
* hardware specific access to control-lines
* hardware specific access to control-lines
...
@@ -151,7 +153,7 @@ static int sharpsl_nand_calculate_ecc(struct mtd_info *mtd, const u_char * dat,
...
@@ -151,7 +153,7 @@ static int sharpsl_nand_calculate_ecc(struct mtd_info *mtd, const u_char * dat,
}
}
#ifdef CONFIG_MTD_PARTITIONS
#ifdef CONFIG_MTD_PARTITIONS
const
char
*
part_probes
[]
=
{
"cmdlinepart"
,
NULL
};
static
const
char
*
part_probes
[]
=
{
"cmdlinepart"
,
NULL
};
#endif
#endif
/*
/*
...
@@ -160,7 +162,10 @@ const char *part_probes[] = { "cmdlinepart", NULL };
...
@@ -160,7 +162,10 @@ const char *part_probes[] = { "cmdlinepart", NULL };
static
int
__devinit
sharpsl_nand_probe
(
struct
platform_device
*
pdev
)
static
int
__devinit
sharpsl_nand_probe
(
struct
platform_device
*
pdev
)
{
{
struct
nand_chip
*
this
;
struct
nand_chip
*
this
;
#ifdef CONFIG_MTD_PARTITIONS
struct
mtd_partition
*
sharpsl_partition_info
;
struct
mtd_partition
*
sharpsl_partition_info
;
int
nr_partitions
;
#endif
struct
resource
*
r
;
struct
resource
*
r
;
int
err
=
0
;
int
err
=
0
;
struct
sharpsl_nand
*
sharpsl
;
struct
sharpsl_nand
*
sharpsl
;
...
@@ -229,10 +234,11 @@ static int __devinit sharpsl_nand_probe(struct platform_device *pdev)
...
@@ -229,10 +234,11 @@ static int __devinit sharpsl_nand_probe(struct platform_device *pdev)
/* Register the partitions */
/* Register the partitions */
sharpsl
->
mtd
.
name
=
"sharpsl-nand"
;
sharpsl
->
mtd
.
name
=
"sharpsl-nand"
;
#ifdef CONFIG_MTD_PARTITIONS
nr_partitions
=
parse_mtd_partitions
(
&
sharpsl
->
mtd
,
part_probes
,
&
sharpsl_partition_info
,
0
);
nr_partitions
=
parse_mtd_partitions
(
&
sharpsl
->
mtd
,
part_probes
,
&
sharpsl_partition_info
,
0
);
if
(
nr_partitions
<=
0
)
{
if
(
nr_partitions
<=
0
)
{
nr_partitions
=
DEFAULT_NUM_PARTITIONS
;
nr_partitions
=
ARRAY_SIZE
(
sharpsl_nand_default_partition_info
)
;
sharpsl_partition_info
=
sharpsl_nand_default_partition_info
;
sharpsl_partition_info
=
sharpsl_nand_default_partition_info
;
if
(
machine_is_poodle
())
{
if
(
machine_is_poodle
())
{
sharpsl_partition_info
[
1
].
size
=
22
*
1024
*
1024
;
sharpsl_partition_info
[
1
].
size
=
22
*
1024
*
1024
;
...
@@ -249,11 +255,19 @@ static int __devinit sharpsl_nand_probe(struct platform_device *pdev)
...
@@ -249,11 +255,19 @@ static int __devinit sharpsl_nand_probe(struct platform_device *pdev)
}
}
}
}
add_mtd_partitions
(
&
sharpsl
->
mtd
,
sharpsl_partition_info
,
nr_partitions
);
err
=
add_mtd_partitions
(
&
sharpsl
->
mtd
,
sharpsl_partition_info
,
nr_partitions
);
#else
err
=
add_mtd_device
(
&
sharpsl
->
mtd
);
#endif
if
(
err
)
goto
err_add
;
/* Return happy */
/* Return happy */
return
0
;
return
0
;
err_add:
nand_release
(
&
sharpsl
->
mtd
);
err_scan:
err_scan:
platform_set_drvdata
(
pdev
,
NULL
);
platform_set_drvdata
(
pdev
,
NULL
);
iounmap
(
sharpsl
->
io
);
iounmap
(
sharpsl
->
io
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录