From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Schwarz Date: Thu, 30 Jun 2011 13:01:29 +0200 Subject: [U-Boot] [4/5]devkit8000 nand_spl: Add SPL NAND support to omap_gpmc driver In-Reply-To: <4E0AE934.1000006@gmail.com> References: <1309270480-31918-1-git-send-email-schwarz@corscience.de> <1309270480-31918-5-git-send-email-schwarz@corscience.de> <4E0AE934.1000006@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Andreas, > You also set some special ECC handling in this patch, please honour this > in your commit message! will do. >> + >> +/** >> + * nand_read_buf16 - [DEFAULT] read chip data into buffer >> + * @mtd: ? ?MTD device structure >> + * @buf: ? ?buffer to store date >> + * @len: ? ?number of bytes to read >> + * >> + * Default read function for 16bit buswith >> + * >> + * This function is based on nand_read_buf16 from nand_base.c. This version >> + * reads 32bit not 16bit although the bus only has 16bit. >> + */ >> +static void gpmc_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len) >> +{ >> + ? ? int i; >> + ? ? struct nand_chip *chip = mtd->priv; >> + ? ? u32 *p = (u32 *) buf; >> + ? ? len >>= 2; >> + >> + ? ? for (i = 0; i < len; i++) >> + ? ? ? ? ? ? p[i] = readl(chip->IO_ADDR_R); >> +} >> +#endif >> + >> ?/* >> ? * omap_hwecc_init - Initialize the Hardware ECC for NAND flash in >> ? * ? ? ? ? ? ? ? ? ? GPMC controller >> @@ -278,7 +312,9 @@ void omap_nand_switch_ecc(int32_t hardware) >> ? ? ? /* Update NAND handling after ECC mode switch */ >> ? ? ? nand_scan_tail(mtd); >> >> + ? ? #ifndef CONFIG_SPL >> ? ? ? nand->options &= ~NAND_OWN_BUFFERS; >> + ? ? #endif >> ?} >> >> ?/* >> @@ -337,8 +373,23 @@ int board_nand_init(struct nand_chip *nand) >> ? ? ? ? ? ? ? nand->options |= NAND_BUSWIDTH_16; >> >> ? ? ? nand->chip_delay = 100; >> + ? ? nand->dev_ready = omap_dev_ready; >> ? ? ? /* Default ECC mode */ >> +#ifndef CONFIG_PRELOADER > > should't this some CONFIG_USE_SOFT_ECC (or whatever config variable > define that behaviour)? Its the default ECC setting this is software for standard U-Boot. Just for the Preloader it is HW. So i think using CONFIG_PRELOADER is ok here. >> + ? ? nand->ecc.size = 512; >> + ? ? nand->ecc.bytes = 24; > > Ouch, these two values are extremely HW spwcific and need to be > configurable then. will change. > >> + ? ? nand->ecc.hwctl = omap_enable_hwecc; >> + ? ? nand->ecc.correct = omap_correct_data; >> + ? ? nand->ecc.calculate = omap_calculate_ecc; > > Isn't that some kind of CONFIG_NAND_BUSWDITH (or whatever config > variable define that behaviour) related setting? Sorry don't understand that. These three functions are not related to the bus width IMHO. Thank you for the feedback! Simon