From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sun, 1 Apr 2012 15:43:21 +0200 Subject: [U-Boot] [PATCH] Correct corrupted NAND Flash access on KARO TX25 modules In-Reply-To: <7605B15734F74B40A124AED46B25250A4F25DE@HEFRMBX01.sofr.hefr.lan> References: <7605B15734F74B40A124AED46B25250A4F257F@HEFRMBX01.sofr.hefr.lan> <201203312031.25497.marex@denx.de> <7605B15734F74B40A124AED46B25250A4F25DE@HEFRMBX01.sofr.hefr.lan> Message-ID: <201204011543.21967.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Gachet Daniel, > Dear Marek, > > >Dear Gachet Daniel, > > > >> This short patch correct corrupted data while reading NAND flash > >> modules on the KARO TX25 module. > >> > >> The current version of the mxc_nand driver uses the symmetric mode to > >> access the NAND flash, but the devices populated on the KARO TX25 only > >> support an asymmetric mode (i.MX25: bit 8 within NAND_FLASH_CONFIG1 > >> register cleared). > >> > >> Signed-off-by: Daniel Gachet > > >> Cc: Wolfgang Denk > > >> > >> diff -upr drivers/mtd/nand/mxc_nand.c drivers/mtd/nand/mxc_nand.c > >> --- drivers/mtd/nand/mxc_nand.c 2011-12-23 20:25:35.000000000 +0100 > >> +++ drivers/mtd/nand/mxc_nand.c 2012-03-30 08:10:13.000000000 +0200 > >> @@ -1290,7 +1290,9 @@ static void mxc_setup_config1(void) > >> > >> uint16_t tmp; > >> > >> tmp = readw(&host->>regs->>nfc_config1); > >> > >> +#ifndef MACH_TYPE_TX25 > >> > >> tmp |= NFC_ONE_CYCLE; > >> > >> +#endif > >> > >> tmp |= NFC_4_8N_ECC; > >> writew(tmp, &host->>regs->>nfc_config1); > >> if (host->>pagesize_2k) > > > >Won't it be better to make this more generic rather then adding more > >machine- specific hacks please? > > > >Best regards, > >Marek Vasut > > It's really a good question. > > This modification should probably work on other i.MX25 boards, because it > relaxes the timing while accessing the NAND flash. But unfortunately I > haven't other i.MX25 boards on which I can verify this modification. Do > you have other modules to validate this modification? Not yet, but if you have one, you can do it in a generic way and if another one pops up, we can simply use it :) > Cordially, > > Daniel Best regards, Marek Vasut