Patchwork [U-Boot] fix s3c2410_nand timing default values

login
register
mail settings
Submitter David Müller (ELSOFT AG)
Date Nov. 29, 2010, 3:49 p.m.
Message ID <4CF3CB7F.6080001@elsoft.ch>
Download mbox | patch
Permalink /patch/73437/
State Accepted
Commit 2111cb44a7937bf8ea5168dd65963f68f8bf3345
Delegated to: Scott Wood
Headers show

Comments

David Müller (ELSOFT AG) - Nov. 29, 2010, 3:49 p.m.
Hello

The attached patch fixes wrong timing default values and adds the
possibility to specify board specific timing value in the board config file.

Dave
Signed-off-by: David Mueller <d.mueller@elsoft.ch>
Scott Wood - Dec. 7, 2010, 12:32 a.m.
On Mon, Nov 29, 2010 at 05:49:19AM -0000, =?utf-8?q?David_M=C3=BCller_=28ELSOFT_AG=29_=3Cd=2Emueller=40elsoft?==?utf-8?q?=2Ech=3E?= wrote:
> Hello
> 
> The attached patch fixes wrong timing default values and adds the
> possibility to specify board specific timing value in the board config file.
> 
> Dave
> Signed-off-by: David Mueller <d.mueller@elsoft.ch>

Applied to u-boot-nand-flash.

In the future, please put anything you don't want in the git commit log
(e.g. greetings) below a --- line.

-Scott

Patch

diff --git a/drivers/mtd/nand/s3c2410_nand.c b/drivers/mtd/nand/s3c2410_nand.c
index f70daef..27351fb 100644
--- a/drivers/mtd/nand/s3c2410_nand.c
+++ b/drivers/mtd/nand/s3c2410_nand.c
@@ -133,9 +133,15 @@  int board_nand_init(struct nand_chip *nand)
 	writel(readl(&clk_power->clkcon) | (1 << 4), &clk_power->clkcon);
 
 	/* initialize hardware */
-	twrph0 = 3;
-	twrph1 = 0;
-	tacls = 0;
+#if defined(CONFIG_S3C24XX_CUSTOM_NAND_TIMING)
+	tacls  = CONFIG_S3C24XX_TACLS;
+	twrph0 = CONFIG_S3C24XX_TWRPH0;
+	twrph1 =  CONFIG_S3C24XX_TWRPH1;
+#else
+	tacls = 4;
+	twrph0 = 8;
+	twrph1 = 8;
+#endif
 
 	cfg = S3C2410_NFCONF_EN;
 	cfg |= S3C2410_NFCONF_TACLS(tacls - 1);