Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OS
U-Boot.Mirror
提交
9241265f
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,发现更多精彩内容 >>
提交
9241265f
编写于
9月 26, 2017
作者:
T
Tom Rini
浏览文件
操作
浏览文件
下载
差异文件
Merge
git://www.denx.de/git/u-boot-cfi-flash
上级
f66bc0e0
72443c7f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
6 deletion
+25
-6
drivers/mtd/cfi_flash.c
drivers/mtd/cfi_flash.c
+19
-6
include/flash.h
include/flash.h
+5
-0
include/mtd/cfi_flash.h
include/mtd/cfi_flash.h
+1
-0
未找到文件。
drivers/mtd/cfi_flash.c
浏览文件 @
9241265f
...
...
@@ -111,11 +111,9 @@ static void cfi_flash_init_dm(void)
}
}
static
phys_addr_t
cfi_flash_base
[
CFI_MAX_FLASH_BANKS
];
phys_addr_t
cfi_flash_bank_addr
(
int
i
)
{
return
cfi_flash_base
[
i
]
;
return
flash_info
[
i
].
base
;
}
#else
__weak
phys_addr_t
cfi_flash_bank_addr
(
int
i
)
...
...
@@ -546,7 +544,16 @@ static int flash_is_busy (flash_info_t * info, flash_sect_t sect)
#ifdef CONFIG_FLASH_CFI_LEGACY
case
CFI_CMDSET_AMD_LEGACY
:
#endif
retval
=
flash_toggle
(
info
,
sect
,
0
,
AMD_STATUS_TOGGLE
);
if
(
info
->
sr_supported
)
{
flash_write_cmd
(
info
,
sect
,
info
->
addr_unlock1
,
FLASH_CMD_READ_STATUS
);
retval
=
!
flash_isset
(
info
,
sect
,
0
,
FLASH_STATUS_DONE
);
}
else
{
retval
=
flash_toggle
(
info
,
sect
,
0
,
AMD_STATUS_TOGGLE
);
}
break
;
default:
retval
=
0
;
...
...
@@ -1687,6 +1694,7 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info)
{
ushort
bankId
=
0
;
uchar
manuId
;
uchar
lsbits
;
flash_write_cmd
(
info
,
0
,
0
,
AMD_CMD_RESET
);
flash_unlock_seq
(
info
,
0
);
...
...
@@ -1702,6 +1710,9 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info)
}
info
->
manufacturer_id
=
manuId
;
lsbits
=
flash_read_uchar
(
info
,
FLASH_OFFSET_LOWER_SW_BITS
);
info
->
sr_supported
=
lsbits
&
BIT
(
0
);
switch
(
info
->
chipwidth
){
case
FLASH_CFI_8BIT
:
info
->
device_id
=
flash_read_uchar
(
info
,
...
...
@@ -2458,10 +2469,12 @@ static int cfi_flash_probe(struct udevice *dev)
while
(
idx
<
len
)
{
addr
=
fdt_translate_address
((
void
*
)
blob
,
node
,
cell
+
idx
);
cfi_flash_base
[
cfi_flash_num_flash_banks
++
]
=
addr
;
flash_info
[
cfi_flash_num_flash_banks
].
dev
=
dev
;
flash_info
[
cfi_flash_num_flash_banks
].
base
=
addr
;
cfi_flash_num_flash_banks
++
;
idx
+=
addrc
+
sizec
;
}
gd
->
bd
->
bi_flashstart
=
cfi_flash_base
[
0
]
;
gd
->
bd
->
bi_flashstart
=
flash_info
[
0
].
base
;
return
0
;
}
...
...
include/flash.h
浏览文件 @
9241265f
...
...
@@ -42,11 +42,16 @@ typedef struct {
ushort
cfi_offset
;
/* offset for cfi query */
ulong
addr_unlock1
;
/* unlock address 1 for AMD flash roms */
ulong
addr_unlock2
;
/* unlock address 2 for AMD flash roms */
uchar
sr_supported
;
/* status register supported */
const
char
*
name
;
/* human-readable name */
#endif
#ifdef CONFIG_MTD
struct
mtd_info
*
mtd
;
#endif
#ifdef CONFIG_CFI_FLASH
/* DM-specific parts */
struct
udevice
*
dev
;
phys_addr_t
base
;
#endif
}
flash_info_t
;
extern
flash_info_t
flash_info
[];
/* info for FLASH chips */
...
...
include/mtd/cfi_flash.h
浏览文件 @
9241265f
...
...
@@ -62,6 +62,7 @@
#define FLASH_OFFSET_MANUFACTURER_ID 0x00
#define FLASH_OFFSET_DEVICE_ID 0x01
#define FLASH_OFFSET_LOWER_SW_BITS 0x0C
#define FLASH_OFFSET_DEVICE_ID2 0x0E
#define FLASH_OFFSET_DEVICE_ID3 0x0F
#define FLASH_OFFSET_CFI 0x55
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录