From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Beno=C3=AEt_Th=C3=A9baudeau?= Date: Tue, 14 Aug 2012 12:04:20 +0200 (CEST) Subject: [U-Boot] [PATCH 08/13] mtd mxc nand: Use _mxc_nand_enable_hwecc() In-Reply-To: <502A1140.2090307@denx.de> Message-ID: <1511206187.2391220.1344938660784.JavaMail.root@advansee.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Stefano, > On 13/08/2012 22:50, Beno?t Th?baudeau wrote: > > Use _mxc_nand_enable_hwecc() instead of duplicating its code. > > > > Signed-off-by: Beno?t Th?baudeau > > Cc: Scott Wood > > Cc: Stefano Babic > > --- > > Hi Beno?t, > > > > > +#ifdef CONFIG_MXC_NAND_HWECC > > +static void mxc_nand_enable_hwecc(struct mtd_info *mtd, int mode) > > +{ > > + /* > > + * If HW ECC is enabled, we turn it on during init. There is > > + * no need to enable again here. > > + */ > > +} > > mxc_nand_enable_hwecc is still empty after your changes... Yes, and it's normal. The change is a move of the _mxc_nand_enable_hwecc() function, not a filling of the mxc_nand_enable_hwecc() function (note the differing underscore). For some reason, the patch looks weird because it moves mxc_nand_enable_hwecc(), but the result is the same. > > + > > +#ifdef MXC_NFC_V1_1 > > static int mxc_nand_read_oob_syndrome(struct mtd_info *mtd, > > struct nand_chip *chip, > > int page, int sndcmd) > > @@ -1235,15 +1235,11 @@ int board_nand_init(struct nand_chip *this) > > host->pagesize_2k = 0; > > > > this->ecc.size = 512; > > - tmp = readw(&host->regs->config1); > > - tmp |= NFC_ECC_EN; > > - writew(tmp, &host->regs->config1); > > + _mxc_nand_enable_hwecc(mtd, 1); > > ...but you are calling it after removing the code in the init > function, > and I do not understand how ECC is enabled. It's not the same function. Best regards, Beno?t