From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sun, 5 Oct 2014 21:45:33 +0200 Subject: [U-Boot] [PATCH] cmd_sf: add handler for +len arg for all commands In-Reply-To: References: <1412527158-32656-1-git-send-email-maxime.hadjinlian@gmail.com> <593AEF6C47F46446852B067021A273D6FB8D8BCA@MUCSE037.lantiq.com> Message-ID: <201410052145.34019.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sunday, October 05, 2014 at 09:27:00 PM, Maxime Hadjinlian wrote: > On Sun, Oct 5, 2014 at 9:19 PM, wrote: > >> On Sunday, October 05, 2014 at 08:40:26 PM, Maxime Hadjinlian wrote: > >> > Hi Thomas, all, > >> > > >> > On Sun, Oct 5, 2014 at 7:43 PM, wrote: > >> > > Hello Maxime, > >> > > > >> > > can you explain the usecase? > >> > > I think, only the erase is executed per sector, all other commands > >> > > are working fine with a byte oriented length. > >> > > >> > I need to write a file that is downloaded through TFTP. So I can get > >> > the filesize through the variable of the same name, but if it's not > >> > rounded, the write command may fail. > >> > I can save the filesize in another variable, but at next boot, when I > >> > need to read this file, I can't read the file, since I only know it's > >> > size in byte, I need to be able to round it again. > >> > >> I wonder, do all SPI flashes need to do sector-aligned writes ? > > > > All the serial flashes I have seen so far do support reading and writing > > with any length, independent from the erase size. > > Otherwise the current implementation of env_sf.c would also not work. > > Well the QSPI, I used, does not. Every read and write has to be > aligned. That's why I needed that in the first place. Aligned how exactly? Best regards, Marek Vasut