Skip to content
Snippets Groups Projects
Commit 9017d932 authored by TsiChung Liew's avatar TsiChung Liew Committed by John Rigby
Browse files

ColdFire: Fix M5329EVB and M5373EVB nand issue


The Nand flash was unable to read and write properly
due to Nand Chip Select (nCE) setup was in reverse
order. Also, increase the Nand time out value to 60.

Signed-off-by: default avatarTsiChung Liew <Tsi-Chung.Liew@freescale.com>
parent 42b68af1
No related branches found
No related tags found
No related merge requests found
...@@ -47,10 +47,12 @@ static void nand_hwcontrol(struct mtd_info *mtdinfo, int cmd, unsigned int ctrl) ...@@ -47,10 +47,12 @@ static void nand_hwcontrol(struct mtd_info *mtdinfo, int cmd, unsigned int ctrl)
ulong IO_ADDR_W = (ulong) this->IO_ADDR_W; ulong IO_ADDR_W = (ulong) this->IO_ADDR_W;
IO_ADDR_W &= ~(SET_ALE | SET_CLE); IO_ADDR_W &= ~(SET_ALE | SET_CLE);
*nCE &= 0xFFFB;
if (ctrl & NAND_NCE) if (ctrl & NAND_NCE)
*nCE &= 0xFFFB;
else
*nCE |= 0x0004; *nCE |= 0x0004;
if (ctrl & NAND_CLE) if (ctrl & NAND_CLE)
IO_ADDR_W |= SET_CLE; IO_ADDR_W |= SET_CLE;
if (ctrl & NAND_ALE) if (ctrl & NAND_ALE)
...@@ -78,7 +80,7 @@ int board_nand_init(struct nand_chip *nand) ...@@ -78,7 +80,7 @@ int board_nand_init(struct nand_chip *nand)
gpio->pclrr_timer = 0; gpio->pclrr_timer = 0;
gpio->podr_timer = 0; gpio->podr_timer = 0;
nand->chip_delay = 50; nand->chip_delay = 60;
nand->ecc.mode = NAND_ECC_SOFT; nand->ecc.mode = NAND_ECC_SOFT;
nand->cmd_ctrl = nand_hwcontrol; nand->cmd_ctrl = nand_hwcontrol;
......
...@@ -47,10 +47,12 @@ static void nand_hwcontrol(struct mtd_info *mtdinfo, int cmd, unsigned int ctrl) ...@@ -47,10 +47,12 @@ static void nand_hwcontrol(struct mtd_info *mtdinfo, int cmd, unsigned int ctrl)
ulong IO_ADDR_W = (ulong) this->IO_ADDR_W; ulong IO_ADDR_W = (ulong) this->IO_ADDR_W;
IO_ADDR_W &= ~(SET_ALE | SET_CLE); IO_ADDR_W &= ~(SET_ALE | SET_CLE);
*nCE &= 0xFFFB;
if (ctrl & NAND_NCE) if (ctrl & NAND_NCE)
*nCE &= 0xFFFB;
else
*nCE |= 0x0004; *nCE |= 0x0004;
if (ctrl & NAND_CLE) if (ctrl & NAND_CLE)
IO_ADDR_W |= SET_CLE; IO_ADDR_W |= SET_CLE;
if (ctrl & NAND_ALE) if (ctrl & NAND_ALE)
...@@ -82,7 +84,7 @@ int board_nand_init(struct nand_chip *nand) ...@@ -82,7 +84,7 @@ int board_nand_init(struct nand_chip *nand)
gpio->pclrr_timer = 0; gpio->pclrr_timer = 0;
gpio->podr_timer = 0; gpio->podr_timer = 0;
nand->chip_delay = 50; nand->chip_delay = 60;
nand->ecc.mode = NAND_ECC_SOFT; nand->ecc.mode = NAND_ECC_SOFT;
nand->cmd_ctrl = nand_hwcontrol; nand->cmd_ctrl = nand_hwcontrol;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment