S3C24xx NAND: Correct tacls_max for S3C2410

Submitted by Harald Welte on Oct. 20, 2008, 9:09 a.m.

Details

Message ID 20081020090947.GZ1048@prithivi.gnumonks.org
State New, archived
Headers show

Commit Message

Harald Welte Oct. 20, 2008, 9:09 a.m.
At least according to my S3C2410X manual, the maximum tacls setting
for the 2410 is 8, not 4.  S3C2410 is therefore like the S3C2412 (and 2443),
not like 2440 and 2442.

Signed-of-by: Harald Welte <laforge@openmoko.org>

Comments

Matthieu CASTET Oct. 21, 2008, 10:13 a.m.
Hi,

Harald Welte a écrit :
> At least according to my S3C2410X manual, the maximum tacls setting
> for the 2410 is 8, not 4.  S3C2410 is therefore like the S3C2412 (and 2443),
> not like 2440 and 2442.
> 
Funny a similar patch has been posted more than 1 year ago :
http://thread.gmane.org/gmane.linux.drivers.mtd/17363

But like other patches from different people (some are really bug fix),
there were never merged...


Matthieu

Patch hide | download patch | download mbox

diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index 4413d76..251f7a3 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -183,10 +183,20 @@  static int s3c2410_nand_inithw(struct s3c2410_nand_info *info,
 {
 	struct s3c2410_platform_nand *plat = to_nand_plat(pdev);
 	unsigned long clkrate = clk_get_rate(info->clk);
-	int tacls_max = (info->cpu_type == TYPE_S3C2412) ? 8 : 4;
+	int tacls_max;
 	int tacls, twrph0, twrph1;
 	unsigned long cfg = 0;
 
+	switch (info->cpu_type) {
+	case TYPE_S3C2410:
+	case TYPE_S3C2412:
+		tacls_max = 8;
+		break;
+	default:
+		tacls_max = 4;
+		break;
+	}
+
 	/* calculate the timing information for the controller */
 
 	clkrate /= 1000;	/* turn clock into kHz for ease of use */