From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Date: Sat, 09 May 2015 14:51:23 +0100 Subject: [U-Boot] [PATCH 1/5] nand: sunxi: change BLOCK_SIZE in mksunxiboot to match NAND block size In-Reply-To: <87383bv1mc.fsf@hellsgate.pl> References: <1430319781-15375-1-git-send-email-dkochmanski@turtle-solutions.eu> <1430319781-15375-2-git-send-email-dkochmanski@turtle-solutions.eu> <1430575710.15640.127.camel@hellion.org.uk> <87383bv1mc.fsf@hellsgate.pl> Message-ID: <1431179483.15640.306.camel@hellion.org.uk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, 2015-05-05 at 11:02 +0200, Daniel Kochma?ski wrote: > Ian Campbell writes: > > > On Wed, 2015-04-29 at 17:02 +0200, Daniel Kochma?ski wrote: > >> This change is necessary to calculate correct checksum for NAND > >> boot. Works both for MMC and NAND. Without it BROM rejects boot image > >> as invalid (bad checksum). (Changes block size from 0x200 to 0x2000). > > > > I'm inferring here that for MMC boot this checksum is ignored by the > > BROM? If that is the case then I think it should be explicitly > > mentioned. > > It isn't ignored, just larger block is taken into checksum and put in > header (which is read by BROM). I think, that in NAND case BROM just > ignores length field in header, and calculates checksum for whole page > (8KB), while on MMC it respects this field, hence 0x2000 works for > both. OK, please add an explanation along these lines to the commit message. > I've tried to put garbage into checksum field, and MMC doesn't boot if > checksum isn't correct. > > > > As well as the checksum this also changes the header's length field, > > FWIW. > > > > Yes, this is true. Should I change it to set block size conditionally > depending on defines - if it's SPL NAND boot, then use 0x2000, in other > occasion use 0x200? I don't think that is necessary assuming... > Whole `u-boot-sunxi-with-spl.bin` size doesn't > increase tough (probably because of space between spl and proper > u-boot). ... this is actually the case, then you could just say it in the commit log.