Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
b74f45e2
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,发现更多精彩内容 >>
提交
b74f45e2
编写于
4月 06, 2021
作者:
T
Tom Rini
浏览文件
操作
浏览文件
下载
差异文件
Merge
https://source.denx.de/u-boot/custodians/u-boot-cfi-flash
- Fix detection of 8-bit bus flash devices via address shift
上级
779786da
53879b17
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
35 addition
and
4 deletion
+35
-4
drivers/mtd/cfi_flash.c
drivers/mtd/cfi_flash.c
+33
-4
include/flash.h
include/flash.h
+2
-0
未找到文件。
drivers/mtd/cfi_flash.c
浏览文件 @
b74f45e2
...
...
@@ -218,7 +218,7 @@ flash_map(flash_info_t *info, flash_sect_t sect, uint offset)
{
unsigned
int
byte_offset
=
offset
*
info
->
portwidth
;
return
(
void
*
)(
info
->
start
[
sect
]
+
byte_offset
);
return
(
void
*
)(
info
->
start
[
sect
]
+
(
byte_offset
<<
info
->
chip_lsb
)
);
}
static
inline
void
flash_unmap
(
flash_info_t
*
info
,
flash_sect_t
sect
,
...
...
@@ -1918,12 +1918,27 @@ static int __flash_detect_cfi(flash_info_t *info, struct cfi_qry *qry)
flash_read_cfi
(
info
,
qry
,
FLASH_OFFSET_CFI_RESP
,
sizeof
(
struct
cfi_qry
));
info
->
interface
=
le16_to_cpu
(
qry
->
interface_desc
);
/* Some flash chips can support multiple bus widths.
* In this case, override the interface width and
* limit it to the port width.
*/
if
((
info
->
interface
==
FLASH_CFI_X8X16
)
&&
(
info
->
portwidth
==
FLASH_CFI_8BIT
))
{
debug
(
"Overriding 16-bit interface width to"
" 8-bit port width
\n
"
);
info
->
interface
=
FLASH_CFI_X8
;
}
else
if
((
info
->
interface
==
FLASH_CFI_X16X32
)
&&
(
info
->
portwidth
==
FLASH_CFI_16BIT
))
{
debug
(
"Overriding 16-bit interface width to"
" 16-bit port width
\n
"
);
info
->
interface
=
FLASH_CFI_X16
;
}
info
->
cfi_offset
=
flash_offset_cfi
[
cfi_offset
];
debug
(
"device interface is %d
\n
"
,
info
->
interface
);
debug
(
"found port %d chip %d "
,
info
->
portwidth
,
info
->
chipwidth
);
debug
(
"found port %d chip %d
chip_lsb %d
"
,
info
->
portwidth
,
info
->
chipwidth
,
info
->
chip_lsb
);
debug
(
"port %d bits chip %d bits
\n
"
,
info
->
portwidth
<<
CFI_FLASH_SHIFT_WIDTH
,
info
->
chipwidth
<<
CFI_FLASH_SHIFT_WIDTH
);
...
...
@@ -1962,10 +1977,24 @@ static int flash_detect_cfi(flash_info_t *info, struct cfi_qry *qry)
info
->
portwidth
<=
FLASH_CFI_64BIT
;
info
->
portwidth
<<=
1
)
{
for
(
info
->
chipwidth
=
FLASH_CFI_BY8
;
info
->
chipwidth
<=
info
->
portwidth
;
info
->
chipwidth
<<=
1
)
info
->
chipwidth
<<=
1
)
{
/*
* First, try detection without shifting the addresses
* for 8bit devices (16bit wide connection)
*/
info
->
chip_lsb
=
0
;
if
(
__flash_detect_cfi
(
info
,
qry
))
return
1
;
/*
* Not detected, so let's try with shifting
* for 8bit devices
*/
info
->
chip_lsb
=
1
;
if
(
__flash_detect_cfi
(
info
,
qry
))
return
1
;
}
}
debug
(
"not found
\n
"
);
return
0
;
}
...
...
include/flash.h
浏览文件 @
b74f45e2
...
...
@@ -24,6 +24,8 @@ typedef struct {
#ifdef CONFIG_SYS_FLASH_CFI
uchar
portwidth
;
/* the width of the port */
uchar
chipwidth
;
/* the width of the chip */
uchar
chip_lsb
;
/* extra Least Significant Bit in the */
/* address of chip */
ushort
buffer_size
;
/* # of bytes in write buffer */
ulong
erase_blk_tout
;
/* maximum block erase timeout */
ulong
write_tout
;
/* maximum write timeout */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录