Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
7529b444
U
U-Boot.Mirror
项目概览
OS
/
U-Boot.Mirror
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
U-Boot.Mirror
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7529b444
编写于
9月 30, 2009
作者:
W
Wolfgang Denk
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://git.denx.de/u-boot-nand-flash
上级
9e2032aa
d44e9c17
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
42 addition
and
23 deletion
+42
-23
Makefile
Makefile
+4
-5
board/micronas/vct/ebi_onenand.c
board/micronas/vct/ebi_onenand.c
+0
-1
drivers/mtd/nand/davinci_nand.c
drivers/mtd/nand/davinci_nand.c
+1
-2
onenand_ipl/onenand_boot.c
onenand_ipl/onenand_boot.c
+0
-1
onenand_ipl/onenand_ipl.h
onenand_ipl/onenand_ipl.h
+3
-2
onenand_ipl/onenand_read.c
onenand_ipl/onenand_read.c
+34
-12
未找到文件。
Makefile
浏览文件 @
7529b444
...
...
@@ -285,6 +285,7 @@ endif
ifeq
($(CONFIG_ONENAND_U_BOOT),y)
ONENAND_IPL
=
onenand_ipl
U_BOOT_ONENAND
=
$(obj)
u-boot-onenand.bin
ONENAND_BIN
?=
$(obj)
onenand_ipl/onenand-ipl-2k.bin
endif
__OBJS
:=
$(
subst
$(obj)
,,
$(OBJS)
)
...
...
@@ -378,8 +379,7 @@ $(ONENAND_IPL): $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
$(MAKE)
-C
onenand_ipl/board/
$(BOARDDIR)
all
$(U_BOOT_ONENAND)
:
$(ONENAND_IPL) $(obj)u-boot.bin
cat
$(obj)
onenand_ipl/onenand-ipl-2k.bin
$(obj)
u-boot.bin
>
$(obj)
u-boot-onenand.bin
cat
$(obj)
onenand_ipl/onenand-ipl-4k.bin
$(obj)
u-boot.bin
>
$(obj)
u-boot-flexonenand.bin
cat
$(ONENAND_BIN)
$(obj)
u-boot.bin
>
$(obj)
u-boot-onenand.bin
$(VERSION_FILE)
:
@
(
printf
'#define U_BOOT_VERSION "U-Boot %s%s"\n'
"
$(U_BOOT_VERSION)
"
\
...
...
@@ -3210,8 +3210,6 @@ zylonite_config :
#########################################################################
apollon_config
:
unconfig
@
mkdir
-p
$(obj)
include
@
mkdir
-p
$(obj)
onenand_ipl/board/apollon
@
echo
"#define CONFIG_ONENAND_U_BOOT"
>
$(obj)
include/config.h
@
$(MKCONFIG)
$
(
@:_config
=)
arm arm1136 apollon NULL omap24xx
@
echo
"CONFIG_ONENAND_U_BOOT = y"
>>
$(obj)
include/config.mk
...
...
@@ -3693,7 +3691,8 @@ clean:
$(obj)
cpu/blackfin/bootrom-asm-offsets.[chs]
@
rm
-f
$(obj)
include/bmp_logo.h
@
rm
-f
$(obj)
nand_spl/
{
u-boot.lds,u-boot-spl,u-boot-spl.map,System.map
}
@
rm
-f
$(obj)
onenand_ipl/onenand-
{
ipl,ipl.bin,ipl-2k.bin,ipl-4k.bin,ipl.map
}
@
rm
-f
$(obj)
onenand_ipl/onenand-
{
ipl,ipl.bin,ipl.map
}
@
rm
-f
$(ONENAND_BIN)
@
rm
-f
$(obj)
onenand_ipl/u-boot.lds
@
rm
-f
$(TIMESTAMP_FILE)
$(VERSION_FILE)
@
find
$(OBJTREE)
-type
f
\
...
...
board/micronas/vct/ebi_onenand.c
浏览文件 @
7529b444
...
...
@@ -193,6 +193,5 @@ void onenand_board_init(struct mtd_info *mtd)
chip
->
write_word
=
ebi_nand_write_word
;
chip
->
read_bufferram
=
ebi_read_bufferram
;
chip
->
read_spareram
=
ebi_read_bufferram
;
chip
->
write_bufferram
=
ebi_write_bufferram
;
}
drivers/mtd/nand/davinci_nand.c
浏览文件 @
7529b444
...
...
@@ -202,7 +202,6 @@ static struct nand_ecclayout nand_davinci_4bit_layout_oobfirst = {
},
#endif
};
#endif
static
void
nand_davinci_4bit_enable_hwecc
(
struct
mtd_info
*
mtd
,
int
mode
)
{
...
...
@@ -289,7 +288,6 @@ static int nand_davinci_4bit_calculate_ecc(struct mtd_info *mtd,
static
int
nand_davinci_4bit_correct_data
(
struct
mtd_info
*
mtd
,
uint8_t
*
dat
,
uint8_t
*
read_ecc
,
uint8_t
*
calc_ecc
)
{
struct
nand_chip
*
this
=
mtd
->
priv
;
unsigned
short
ecc_10bit
[
8
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
int
i
;
unsigned
int
hw_4ecc
[
4
]
=
{
0
,
0
,
0
,
0
},
iserror
=
0
;
...
...
@@ -441,6 +439,7 @@ static int nand_davinci_4bit_correct_data(struct mtd_info *mtd, uint8_t *dat,
return
numerrors
;
}
#endif
/* CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST */
static
int
nand_davinci_dev_ready
(
struct
mtd_info
*
mtd
)
{
...
...
onenand_ipl/onenand_boot.c
浏览文件 @
7529b444
...
...
@@ -24,7 +24,6 @@
*/
#include <common.h>
#include <version.h>
#include "onenand_ipl.h"
...
...
onenand_ipl/onenand_ipl.h
浏览文件 @
7529b444
...
...
@@ -28,8 +28,9 @@
#define THIS_ONENAND(a) (CONFIG_SYS_ONENAND_BASE + (a))
#define READ_INTERRUPT() \
onenand_readw(THIS_ONENAND(ONENAND_REG_INTERRUPT))
#define READ_INTERRUPT() onenand_readw(ONENAND_REG_INTERRUPT)
extern
int
(
*
onenand_read_page
)(
ulong
block
,
ulong
page
,
u_char
*
buf
,
int
pagesize
);
extern
int
onenand_read_block
(
unsigned
char
*
buf
);
#endif
onenand_ipl/onenand_read.c
浏览文件 @
7529b444
/*
* (C) Copyright 2005-200
8 Samsung Electroni
s
* (C) Copyright 2005-200
9 Samsung Electronic
s
* Kyungmin Park <kyungmin.park@samsung.com>
*
* See file CREDITS for list of people who contributed to this
...
...
@@ -37,8 +37,10 @@
extern
void
*
memcpy32
(
void
*
dest
,
void
*
src
,
int
size
);
#endif
int
(
*
onenand_read_page
)(
ulong
block
,
ulong
page
,
u_char
*
buf
,
int
pagesize
);
/* read a page with ECC */
static
in
line
int
onenand_read_page
(
ulong
block
,
ulong
page
,
static
in
t
generic_
onenand_read_page
(
ulong
block
,
ulong
page
,
u_char
*
buf
,
int
pagesize
)
{
unsigned
long
*
base
;
...
...
@@ -89,9 +91,25 @@ static inline int onenand_read_page(ulong block, ulong page,
return
0
;
}
#define ONENAND_START_PAGE 1
#ifndef CONFIG_ONENAND_START_PAGE
#define CONFIG_ONENAND_START_PAGE 1
#endif
#define ONENAND_PAGES_PER_BLOCK 64
static
void
onenand_generic_init
(
int
*
page_is_4KiB
,
int
*
page
)
{
int
dev_id
,
density
;
if
(
onenand_readw
(
ONENAND_REG_TECHNOLOGY
))
*
page_is_4KiB
=
1
;
dev_id
=
onenand_readw
(
ONENAND_REG_DEVICE_ID
);
density
=
dev_id
>>
ONENAND_DEVICE_DENSITY_SHIFT
;
density
&=
ONENAND_DEVICE_DENSITY_MASK
;
if
(
density
>=
ONENAND_DEVICE_DENSITY_4Gb
&&
!
(
dev_id
&
ONENAND_DEVICE_IS_DDP
))
*
page_is_4KiB
=
1
;
}
/**
* onenand_read_block - Read CONFIG_SYS_MONITOR_LEN from begining
* of OneNAND, skipping bad blocks
...
...
@@ -99,24 +117,28 @@ static inline int onenand_read_page(ulong block, ulong page,
*/
int
onenand_read_block
(
unsigned
char
*
buf
)
{
int
block
;
int
page
=
ONENAND_START_PAGE
,
offset
=
0
;
int
pagesize
=
0
,
erase_shift
=
0
;
int
erasesize
=
0
,
nblocks
=
0
;
int
block
,
nblocks
;
int
page
=
CONFIG_ONENAND_START_PAGE
,
offset
=
0
;
int
pagesize
,
erasesize
,
erase_shift
;
int
page_is_4KiB
=
0
;
onenand_read_page
=
generic_onenand_read_page
;
onenand_generic_init
(
&
page_is_4KiB
,
&
page
);
if
(
onenand_readw
(
ONENAND_REG_TECHNOLOGY
)
)
{
pagesize
=
4096
;
/*
MLC
OneNAND has 4KiB pagesize */
if
(
page_is_4KiB
)
{
pagesize
=
4096
;
/* OneNAND has 4KiB pagesize */
erase_shift
=
18
;
}
else
{
pagesize
=
2048
;
pagesize
=
2048
;
/* OneNAND has 2KiB pagesize */
erase_shift
=
17
;
}
erasesize
=
ONENAND_PAGES_PER_BLOCK
*
pagesize
;
erasesize
=
(
1
<<
erase_shift
)
;
nblocks
=
(
CONFIG_SYS_MONITOR_LEN
+
erasesize
-
1
)
>>
erase_shift
;
/* NOTE: you must read page from page 1 of block 0 */
/* read the block page by page*/
/* read the block page by page
*/
for
(
block
=
0
;
block
<
nblocks
;
block
++
)
{
for
(;
page
<
ONENAND_PAGES_PER_BLOCK
;
page
++
)
{
if
(
onenand_read_page
(
block
,
page
,
buf
+
offset
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录