
Hi Thomas, all,
On Sun, Oct 5, 2014 at 7:43 PM, thomas.langer@lantiq.com 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.
Best regards, Thomas
Sent from my phone.
Maxime Hadjinlian maxime.hadjinlian@gmail.com hat geschrieben:
This patch adds [+]len handler for the all the commands that will automatically round up the requested erase length to the flash's sector_size. It was previously only available for the erase command.
Signed-off-by: Maxime Hadjinlian maxime.hadjinlian@gmail.com
common/cmd_sf.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/common/cmd_sf.c b/common/cmd_sf.c index c60e8d1..d5af3fe 100644 --- a/common/cmd_sf.c +++ b/common/cmd_sf.c @@ -245,8 +245,8 @@ static int do_spi_flash_read_write(int argc, char * const argv[]) offset = simple_strtoul(argv[2], &endp, 16); if (*argv[2] == 0 || *endp != 0) return -1;
len = simple_strtoul(argv[3], &endp, 16);
if (*argv[3] == 0 || *endp != 0)
len = sf_parse_len_arg(argv[3], &len);
if (ret != 1) return -1; /* Consistency checking */
@@ -529,15 +529,15 @@ usage: U_BOOT_CMD( sf, 5, 1, do_spi_flash, "SPI flash sub-system",
"Note: `+len' round up `len' to block size\n" "probe [[bus:]cs] [hz] [mode] - init flash device on given SPI bus\n" " and chip select\n"
"sf read addr offset len - read `len' bytes starting at\n"
"sf read addr offset [+]len - read `len' bytes starting at\n" " `offset' to memory at `addr'\n"
"sf write addr offset len - write `len' bytes from memory\n"
"sf write addr offset [+]len - write `len' bytes from memory\n" " at `addr' to flash at `offset'\n" "sf erase offset [+]len - erase `len' bytes from `offset'\n"
" `+len' round up `len' to block size\n"
"sf update addr offset len - erase and write `len' bytes from memory\n"
"sf update addr offset [+]len - erase and write `len' bytes from memory\n" " at `addr' to flash at `offset'" SF_TEST_HELP
);
2.1.1
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot