From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rohit Hagargundgi Date: Thu, 26 Feb 2009 18:01:30 +0530 Subject: [U-Boot] [PATCH] Fix OneNAND ipl to read 256KB In-Reply-To: <20090226081323.GC25043@game.jcrosoft.org> References: <49A645E0.9060608@samsung.com> <20090226081323.GC25043@game.jcrosoft.org> Message-ID: <49A68BA2.80807@samsung.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, Jean-Christophe PLAGNIOL-VILLARD wrote: >> #define ONENAND_BLOCK_SIZE 2048 >> +#define ONENAND_BOOTLOADER_SIZE 0x40000 > why hardcoded value? Is it possible to get image size instead of hard value. Then we can read exactly u-boot image size on boot up. >> + /* Check for invalid block mark*/ >> + if (page < 2) { >> + unsigned int mark = onenand_readw(THIS_ONENAND(ONENAND_SPARERAM)); > please add a empty line > > and why not do this > if (page < 2 && (onenand_readw(THIS_ONENAND(ONENAND_SPARERAM)) != 0xffff)) > return 1; okay. >> - for (page = ONENAND_START_PAGE; >> - page < ONENAND_PAGES_PER_BLOCK; page++) { >> - >> - onenand_read_page(0, page, buf + offset, pagesize); >> - offset += pagesize; >> - } >> + for (page = ONENAND_START_PAGE; block < nblocks; page = 0, block++) > please add the {} and move the page = 0 to the second 'for' it will be easier > to read and understand okay. Thanks, Rohit