From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Mon, 8 Apr 2013 19:59:01 -0500 Subject: [U-Boot] [PATCH 7/8] mtd: nand: add driver for diskonchip g4 nand flash In-Reply-To: <201304080825.01859.marex@denx.de> (from marex@denx.de on Mon Apr 8 01:25:01 2013) Message-ID: <1365469141.28843.31@snotra> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 04/08/2013 01:25:01 AM, Marek Vasut wrote: > Dear Mike Dunn, > > > This patch adds a driver for the diskonchip G4 nand flash device. > It is > > based on the driver from the linux kernel. > > > > This also includes a separate SPL driver. A separate SPL driver is > used > > because the device operates in a different mode (reliable mode) when > > loading a boot image, and also because the storage format of the > boot > > image is different from normal data (pages are stored > redundantly). The > > SPL driver basically mimics how a typical IPL reads data from the > device. > > The special operating mode and storage format are used to > compensate for > > the fact that the IPL does not contain the BCH ecc decoding > algorithm (due > > to size constraints). Although the u-boot SPL *could* use ecc, it > > operates like an IPL for the sake of simplicity and uniformity, > since the > > IPL and SPL share the task of loading the u-boot image. As a side > benefit, > > the SPL driver is very small. > > > > Signed-off-by: Mike Dunn > > Try #ifdef U_BOOT instead of #if 0, no? Just remove the code that would be hidden by #if 0. Besides making the U-Boot code easier to read, we *want* to get a conflict marker if we try to merge in a new upstream version, and those lines were changed in Linux. This would give us an opportunity to see if similar changes are needed to the U-Boot version of the code. Another option would be to introduce for_each_set_bit in U-Boot. -Scott