From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Thu, 21 May 2015 20:12:59 +0200 Subject: [U-Boot] [PATCH 1/2] nand: sunxi: change BLOCK_SIZE in mksunxiboot to match NAND block size In-Reply-To: <1432216765-8421-2-git-send-email-r.spliet@ultimaker.com> References: <1432216765-8421-1-git-send-email-r.spliet@ultimaker.com> <1432216765-8421-2-git-send-email-r.spliet@ultimaker.com> Message-ID: <555E202B.3040809@redhat.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, On 21-05-15 15:59, Roy Spliet wrote: > From: Daniel Kochma?ski > > 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). > > V2: Document decision in source too > > Signed-off-by: Daniel Kochma?ski > Cc: Ian Campbell > Cc: Hans De Goede > Signed-off-by: Roy Spliet Looks good: Reviewed-by: Hans de Goede Regards, Hans > --- > tools/mksunxiboot.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/tools/mksunxiboot.c b/tools/mksunxiboot.c > index 0035f6e..3361251 100644 > --- a/tools/mksunxiboot.c > +++ b/tools/mksunxiboot.c > @@ -65,7 +65,13 @@ int gen_check_sum(struct boot_file_head *head_p) > > #define SUN4I_SRAM_SIZE 0x7600 /* 0x7748+ is used by BROM */ > #define SRAM_LOAD_MAX_SIZE (SUN4I_SRAM_SIZE - sizeof(struct boot_file_head)) > -#define BLOCK_SIZE 512 > + > +/* > + * BROM (at least on A10 and A20) requires NAND-images to be explicitly aligned > + * to a multiple of 8K, and rejects the image otherwise. MMC-images are fine > + * with 512B blocks. To cater for both, align to the largest of the two. > + */ > +#define BLOCK_SIZE 0x2000 > > struct boot_img { > struct boot_file_head header; >