[U-Boot] [U-BOOT] nand merge problem

Hi I have try to merge Ingenic U-boot (1.1.6) with upstream. but I have some problem 1. there is no -- NAND_CTL_SETNCE: NAND_CTL_CLRNCE: NAND_CTL_SETCLE: NAND_CTL_CLRCLE: NAND_CTL_SETALE: NAND_CTL_CLRALE: instead of : -- NAND_NCE: NAND_CLE: NAND_ALE: NAND_CTRL_CLE: NAND_CTRL_ALE: NAND_CTRL_CHANGE:
I use the NAND_CTL_SETNCE... in the jz_hwcontrol function. i use "nand->hwcontrol = jz_hwcontrol" in the u-boot 1.1.6 but in the U-boot V2009-06 the nand_chip structure does not have "hwcontrol" function.
what am I gonna do?
thanks for help.
--
Best Regards Xiangfu Liu
jabber : xiangfu.z@gmail.com skype : xiangfu.z
Please avoid sending me Word or PowerPoint attachments. See http://www.gnu.org/philosophy/no-word-attachments.html

xiangfu_gmail wrote:
Hi I have try to merge Ingenic U-boot (1.1.6) with upstream. but I have some problem
Hi I rewrite the jz_hwcontrol to : -- static void jz_hwcontrol(......) { ...... if (ctrl & NAND_CTRL_CHANGE) { if (ctrl & NAND_NCE) REG_EMC_NFCSR |= EMC_NFCSR_NFCE1; else REG_EMC_NFCSR &= ~EMC_NFCSR_NFCE1;
if (ctrl & NAND_CLE) ...... } } and " nand->cmd_ctrl = jz_hwcontrol; " in board_nand_init
but it's still not work: the error message: -- NAND: nand_get_flash_type: second ID read did not match ff,ff against 00,00 No NAND device found!!!
0 MiB --
what can cause this problem?
thanks

On Tue, May 26, 2009 at 05:12:01PM +0800, xiangfu_gmail wrote:
xiangfu_gmail wrote:
Hi I have try to merge Ingenic U-boot (1.1.6) with upstream. but I have some problem
Hi I rewrite the jz_hwcontrol to :
static void jz_hwcontrol(......) { ...... if (ctrl & NAND_CTRL_CHANGE) { if (ctrl & NAND_NCE) REG_EMC_NFCSR |= EMC_NFCSR_NFCE1; else REG_EMC_NFCSR &= ~EMC_NFCSR_NFCE1;
if (ctrl & NAND_CLE) ......
} } and " nand->cmd_ctrl = jz_hwcontrol; " in board_nand_init
but it's still not work: the error message: -- NAND: nand_get_flash_type: second ID read did not match ff,ff against 00,00 No NAND device found!!!
0 MiB
what can cause this problem?
It would be helpful if you were to post the entire hwcontrol, so we can see what's hiding behind those "......"s.
Posting the original legacy NAND defines for this board would be helpful as well.
-Scott

Hi Scott
thanks for the reply Scott Wood wrote:
On Tue, May 26, 2009 at 05:12:01PM +0800, xiangfu_gmail wrote:
xiangfu_gmail wrote:
Hi I have try to merge Ingenic U-boot (1.1.6) with upstream. but I have some problem
Hi I rewrite the jz_hwcontrol to :
static void jz_hwcontrol(......) { ...... } and " nand->cmd_ctrl = jz_hwcontrol; " in board_nand_init
but it's still not work: the error message: -- NAND: nand_get_flash_type: second ID read did not match ff,ff against 00,00 No NAND device found!!!
0 MiB
what can cause this problem?
It would be helpful if you were to post the entire hwcontrol, so we can see what's hiding behind those "......"s.
here is the entire hwontrol static void jz_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) { struct nand_chip *this = (struct nand_chip *)(mtd->priv);
if (ctrl & NAND_CTRL_CHANGE) { if (ctrl & NAND_NCE) REG_EMC_NFCSR |= EMC_NFCSR_NFCE1; else REG_EMC_NFCSR &= ~EMC_NFCSR_NFCE1;
if (ctrl & NAND_CLE) this->IO_ADDR_W = (void __iomem *) ((unsigned long)(this->IO_ADDR_W) | 0x00008000); else this->IO_ADDR_W = (void __iomem *) ((unsigned long)(this->IO_ADDR_W) & ~0x00008000);
if (ctrl & NAND_ALE) this->IO_ADDR_W = (void __iomem *) ((unsigned long)(this->IO_ADDR_W) | 0x00010000); else this->IO_ADDR_W = (void __iomem *) ((unsigned long)(this->IO_ADDR_W) & ~0x00010000);
} }
Posting the original legacy NAND defines for this board would be helpful as well.
I don't know which code should I post. so I post the git URL: http://github.com/xiangfu/pi-u-boot/tree/xiangfu
-Scott
thanks

xiangfu_gmail wrote:
static void jz_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) { struct nand_chip *this = (struct nand_chip *)(mtd->priv);
if (ctrl & NAND_CTRL_CHANGE) { if (ctrl & NAND_NCE) REG_EMC_NFCSR |= EMC_NFCSR_NFCE1; else REG_EMC_NFCSR &= ~EMC_NFCSR_NFCE1;
if (ctrl & NAND_CLE) this->IO_ADDR_W = (void __iomem *) ((unsigned long)(this->IO_ADDR_W) | 0x00008000); else this->IO_ADDR_W = (void __iomem *) ((unsigned long)(this->IO_ADDR_W) & ~0x00008000); if (ctrl & NAND_ALE) this->IO_ADDR_W = (void __iomem *) ((unsigned long)(this->IO_ADDR_W) | 0x00010000); else this->IO_ADDR_W = (void __iomem *) ((unsigned long)(this->IO_ADDR_W) & ~0x00010000);
} }
Nowhere in this function do you issue the command... See cpu/ppc4xx/ndfc.c for a simple hwcontrol function.
-Scott
participants (2)
-
Scott Wood
-
xiangfu_gmail