[Armadeus-commitlog] armadeus branch, master, updated. armadeus-5.2-366-gaf4084b
Brought to you by:
sszy
|
From: jorasse <jo...@us...> - 2013-08-09 09:20:53
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "armadeus".
The branch, master has been updated
via af4084b890cb33e45c7403e9935f37b331ddf046 (commit)
from 4db8e87f77180c2d706e004a23d3fe3e93d5a156 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit af4084b890cb33e45c7403e9935f37b331ddf046
Author: Eric Jarrige <eri...@ar...>
Date: Fri Aug 9 11:30:05 2013 +0200
[UBOOT] apf51: fix nand lock/unlock page alignement and access to IP registers
-----------------------------------------------------------------------
Summary of changes:
patches/u-boot/2013.04/420-apf51-nand-spl-NG.patch | 36 ++++++++++++++-----
1 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/patches/u-boot/2013.04/420-apf51-nand-spl-NG.patch b/patches/u-boot/2013.04/420-apf51-nand-spl-NG.patch
index 900533e..db96176 100644
--- a/patches/u-boot/2013.04/420-apf51-nand-spl-NG.patch
+++ b/patches/u-boot/2013.04/420-apf51-nand-spl-NG.patch
@@ -328,7 +328,7 @@ Signed-off-by: Eric Jarrige <eri...@ar...>
OBJS := $(addprefix $(obj),$(COBJS))
--- uboot-custom/drivers/mtd/nand/mxc_nand.c
+++ uboot-custom/drivers/mtd/nand/mxc_nand.c
-@@ -1108,7 +1108,53 @@ void mxc_nand_command(struct mtd_info *m
+@@ -1108,7 +1108,65 @@ void mxc_nand_command(struct mtd_info *m
break;
#ifdef CONFIG_CMD_NAND_LOCK_UNLOCK
@@ -336,39 +336,51 @@ Signed-off-by: Eric Jarrige <eri...@ar...>
+#if defined(MXC_NFC_V3_2)
+ case NAND_CMD_LOCK:
+ /* Lock Block whole NAND only supported */
++ writenfc(NFC_V3_IPC_CREQ, &host->ip_regs->ipc);
++ while (!(readnfc(&host->ip_regs->ipc) & NFC_V3_IPC_CACK));
+ writenfc(NFC_V3_WRPROT_BLS_UNLOCK | NFC_V3_WRPROT_LOCK,
+ &host->ip_regs->wrprot);
++ writenfc(0, &host->ip_regs->ipc);
+ return;
+ case NAND_CMD_LOCK_TIGHT:
+ /* Lock Tight whole NAND only supported */
++ writenfc(NFC_V3_IPC_CREQ, &host->ip_regs->ipc);
++ while (!(readnfc(&host->ip_regs->ipc) & NFC_V3_IPC_CACK));
+ writenfc(NFC_V3_WRPROT_BLS_UNLOCK | NFC_V3_WRPROT_LOCKTIGHT,
+ &host->ip_regs->wrprot);
++ writenfc(0, &host->ip_regs->ipc);
+ return;
+ case NAND_CMD_UNLOCK1:
+ /* 64 pages per block only */
-+ writenfc(page_addr>>6,
++ writenfc(NFC_V3_IPC_CREQ, &host->ip_regs->ipc);
++ while (!(readnfc(&host->ip_regs->ipc) & NFC_V3_IPC_CACK));
++ writenfc(page_addr>>7,
+ &host->ip_regs->wrprot_unlock_blkaddr);
++ writenfc(0, &host->ip_regs->ipc);
+ return;
+ case NAND_CMD_UNLOCK2:{
-+ int temp = readnfc(&host->ip_regs->wrprot_unlock_blkaddr)
-+ & 0x0000FFFF;
-+ writenfc(((page_addr>>6)<<16) | temp ,
++ int temp;
++ writenfc(NFC_V3_IPC_CREQ, &host->ip_regs->ipc);
++ while (!(readnfc(&host->ip_regs->ipc) & NFC_V3_IPC_CACK));
++ temp = readnfc(&host->ip_regs->wrprot_unlock_blkaddr)
++ & 0x0000FFFF;
++ writenfc(((page_addr>>7)<<16) | temp ,
+ &host->ip_regs->wrprot_unlock_blkaddr);
+ /* Unlock Block Command for given address range */
+ writenfc(NFC_V3_WRPROT_BLS_UNLOCK | NFC_V3_WRPROT_UNLOCK,
+ &host->ip_regs->wrprot);
++ writenfc(0, &host->ip_regs->ipc);
+ }
+ return;
+ case NAND_CMD_LOCK_STATUS:{
+ void __iomem *main_buf = host->regs->main_area[0];
+ host->col_addr = 0;
+ host->spare_only = false;
-+ MTDDEBUG(MTD_DEBUG_LEVEL3,"get_lock_status %x\n", readnfc(&host->ip_regs->wrprot));
+
+ if (((readnfc(&host->ip_regs->wrprot)>>8) & NFC_WRPR_US)
+ && !((readnfc(&host->ip_regs->wrprot)>>8) & NFC_WRPR_LTS)
-+ && (((readnfc(&host->ip_regs->wrprot_unlock_blkaddr)>>16) >= page_addr>>6)
-+ && ((readnfc(&host->ip_regs->wrprot_unlock_blkaddr)& 0x0000FFFF) <= page_addr>>6))) {
++ && (((readnfc(&host->ip_regs->wrprot_unlock_blkaddr)>>16) >= page_addr>>7)
++ && ((readnfc(&host->ip_regs->wrprot_unlock_blkaddr)& 0x0000FFFF) <= page_addr>>7))) {
+ writew(NFC_WRPR_US, main_buf);
+ } else if ((readnfc(&host->ip_regs->wrprot)>>8) & NFC_WRPR_LTS) {
+ writew((readnfc(&host->ip_regs->wrprot)>>8), main_buf);
@@ -383,7 +395,7 @@ Signed-off-by: Eric Jarrige <eri...@ar...>
/* Blocks to be unlocked */
writew(-1, &host->regs->unlockstart_blkaddr);
writew(-1, &host->regs->unlockend_blkaddr);
-@@ -1150,6 +1182,7 @@ void mxc_nand_command(struct mtd_info *m
+@@ -1150,6 +1208,7 @@ void mxc_nand_command(struct mtd_info *m
writew(readw(&host->regs->nf_wrprst) & ~NFC_WRPR_US, &host->regs->main_area[0][0]);
}
return;
@@ -393,7 +405,7 @@ Signed-off-by: Eric Jarrige <eri...@ar...>
--- uboot-custom/drivers/mtd/nand/mxc_nand.h
+++ uboot-custom/drivers/mtd/nand/mxc_nand.h
-@@ -207,6 +207,8 @@ struct mxc_nand_ip_regs {
+@@ -207,9 +207,12 @@ struct mxc_nand_ip_regs {
#define NFC_V3_CONFIG3_NO_SDMA (1 << 20)
#define NFC_V3_WRPROT_UNLOCK (1 << 2)
@@ -402,3 +414,7 @@ Signed-off-by: Eric Jarrige <eri...@ar...>
#define NFC_V3_WRPROT_BLS_UNLOCK (2 << 6)
#define NFC_V3_IPC_CREQ (1 << 0)
++#define NFC_V3_IPC_CACK (1 << 1)
+ #define NFC_V3_IPC_INT (1 << 31)
+
+ #if defined(MXC_NFC_V1) || defined(MXC_NFC_V2_1)
hooks/post-receive
--
armadeus
|