提交 82810b7b 编写于 作者: A Artem Bityutskiy 提交者: David Woodhouse

[MTD] NAND: nandsim: support subpage write

As flash cannot do 0->1 bit transitions when programming, do not do this in
the simulator too. This makes nandsim able to accept subpage writes.
Signed-off-by: NArtem Bityutskiy <dedekind@infradead.org>
Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
上级 a86aaa6d
...@@ -852,6 +852,7 @@ static void erase_sector(struct nandsim *ns) ...@@ -852,6 +852,7 @@ static void erase_sector(struct nandsim *ns)
*/ */
static int prog_page(struct nandsim *ns, int num) static int prog_page(struct nandsim *ns, int num)
{ {
int i;
union ns_mem *mypage; union ns_mem *mypage;
u_char *pg_off; u_char *pg_off;
...@@ -867,7 +868,8 @@ static int prog_page(struct nandsim *ns, int num) ...@@ -867,7 +868,8 @@ static int prog_page(struct nandsim *ns, int num)
} }
pg_off = NS_PAGE_BYTE_OFF(ns); pg_off = NS_PAGE_BYTE_OFF(ns);
memcpy(pg_off, ns->buf.byte, num); for (i = 0; i < num; i++)
pg_off[i] &= ns->buf.byte[i];
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册