fs: implement size/fatsize/ext4size
Subsystems (3)
PATCH v2 1/2 fs: implement size/fatsize/ext4size
From: Stephen Warren <[email protected]>
These commands may be used to determine the size of a file without actually reading the whole file content into memory. This may be used to determine if the file will fit into the memory buffer that will contain it. In particular, the DFU code will use it for this purpose in the next commit.
---
v2: New patch
--- common/cmd_ext4.c | 14 ++++++++++++++ common/cmd_fat.c | 13 +++++++++++++ common/cmd_fs.c | 13 +++++++++++++ fs/ext4/ext4fs.c | 5 +++++ fs/fat/fat.c | 5 +++++ fs/fs.c | 43 +++++++++++++++++++++++++++++++++++++++++++ fs/sandbox/sandboxfs.c | 5 +++++ include/ext4fs.h | 1 + include/fat.h | 1 + include/fs.h | 9 +++++++++ include/sandboxfs.h | 1 + 11 files changed, 110 insertions(+)
common/cmd_ext4.c +14 -0
@@ -42,6 +42,12 @@#include <usb.h> #endif +int do_ext4_size (cmd_tbl_t *cmdtp,int flag,int argc, +char *const argv[]) +{ +return do_size (cmdtp, flag, argc, argv,FS_TYPE_EXT ); +} +int do_ext4_load (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) {
@@ -113,6 +119,14 @@ U_BOOT_CMD(ext4write, 6, 1, do_ext4_write,#endif +U_BOOT_CMD ( + ext4size,4 ,0 , do_ext4_size, +"determine a file's size" , +"<interface> <dev[:part]> <filename>\n" +" - Find file 'filename' from 'dev' on 'interface'\n" +" and determine its size." +); +U_BOOT_CMD (ext4ls,4 ,1 , do_ext4_ls,"list files in a directory (default /)" , "<interface> <dev[:part]> [directory]\n"
common/cmd_fat.c +13 -0
@@ -18,6 +18,19 @@#include <fat.h> #include <fs.h> +int do_fat_size (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) +{ +return do_size (cmdtp, flag, argc, argv,FS_TYPE_FAT ); +} + +U_BOOT_CMD ( + fatsize,4 ,0 , do_fat_size, +"determine a file's size" , +"<interface> <dev[:part]> <filename>\n" +" - Find file 'filename' from 'dev' on 'interface'\n" +" and determine its size." +); +int do_fat_fsload (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) {return do_load (cmdtp, flag, argc, argv,FS_TYPE_FAT );
common/cmd_fs.c +13 -0
@@ -20,6 +20,19 @@#include <command.h> #include <fs.h> +int do_size_wrapper (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) +{ +return do_size (cmdtp, flag, argc, argv,FS_TYPE_ANY ); +} + +U_BOOT_CMD ( + size,4 ,0 , do_size_wrapper, +"determine a file's size" , +"<interface> <dev[:part]> <filename>\n" +" - Find file 'filename' from 'dev' on 'interface'\n" +" and determine its size." +); +int do_load_wrapper (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) {return do_load (cmdtp, flag, argc, argv,FS_TYPE_ANY );
fs/ext4/ext4fs.c +5 -0
@@ -182,6 +182,11 @@ int ext4fs_exists(const char *filename)return file_len >=0 ; } +int ext4fs_size (const char *filename) +{ +return ext4fs_open (filename); +} +int ext4fs_read (char *buf,unsigned len) {if (ext4fs_root ==NULL || ext4fs_file ==NULL )
fs/fat/fat.c +5 -0
@@ -1243,6 +1243,11 @@ int fat_exists(const char *filename)return sz >=0 ; } +int fat_size (const char *filename) +{ +return do_fat_read_at (filename,0 ,NULL ,0 ,LS_NO ,1 ); +} +long file_fat_read_at (const char *filename,unsigned long pos,void *buffer,unsigned long maxsize) {
fs/fs.c +43 -0
91 lines not on this page · raw message
fs/sandbox/sandboxfs.c +5 -0
@@ -80,6 +80,11 @@ int sandbox_fs_exists(const char *filename)return sz >=0 ; } +int sandbox_fs_size (const char *filename) +{ +return os_get_filesize (filename); +} +void sandbox_fs_close (void ) { }
include/ext4fs.h +1 -0
@@ -136,6 +136,7 @@ void ext4fs_close(void);void ext4fs_reinit_global (void );int ext4fs_ls (const char *dirname);int ext4fs_exists (const char *filename); +int ext4fs_size (const char *filename);void ext4fs_free_node (struct ext2fs_node *node,struct ext2fs_node *currroot);int ext4fs_devread (lbaint_t sector,int byte_offset,int byte_len,char *buf);void ext4fs_set_blk_dev (block_dev_desc_t *rbdd,disk_partition_t *info);
include/fat.h +1 -0
@@ -198,6 +198,7 @@ int file_cd(const char *path);int file_fat_detectfs (void );int file_fat_ls (const char *dir);int fat_exists (const char *filename); +int fat_size (const char *filename);long file_fat_read_at (const char *filename,unsigned long pos,void *buffer,unsigned long maxsize);long file_fat_read (const char *filename,void *buffer,unsigned long maxsize);
include/fs.h +9 -0
@@ -51,6 +51,13 @@ int fs_ls(const char *dirname);int fs_exists (const char *filename);/* +* Determine a file's size +* +* Returns the file's size in bytes, or a negative value if it doesn't exist. +*/ +int fs_size (const char *filename); + +/* * Read file "filename" from the partition previously set by fs_set_blk_dev(), * to address "addr", starting at byte offset "offset", and reading "len" * bytes. "offset" may be 0 to read from the start of the file. "len" may be
@@ -75,6 +82,8 @@ int fs_write(const char *filename, ulong addr, int offset, int len);* Common implementation for various filesystem commands, optionally limited * to a specific filesystem type via the fstype parameter. */ +int do_size (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[], +int fstype);int do_load (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[],int fstype); int do_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[],
include/sandboxfs.h +1 -0
@@ -26,6 +26,7 @@ long sandbox_fs_read_at(const char *filename, unsigned long pos,void sandbox_fs_close (void );int sandbox_fs_ls (const char *dirname);int sandbox_fs_exists (const char *filename); +int sandbox_fs_size (const char *filename);int fs_read_sandbox (const char *filename,void *buf,int offset,int len);int fs_write_sandbox (const char *filename,void *buf,int offset,int len);
Signature · 1 line
1.8.1.5
PATCH v2 2/2 dfu: fix some issues with reads/uploads
From: Stephen Warren <[email protected]>
DFU read support appears to rely upon dfu->read_medium() updating the passed-by-reference len parameter to indicate the remaining size available for reading.
dfu_read_medium_mmc() never does this, and the implementation of dfu_read_medium_nand() will only work if called just once; it hard-codes the value to the total size of the NAND device irrespective of read offset.
I believe that overloading dfu->read_medium() is confusing. As such, this patch introduces a new function dfu->get_medium_size() which can be used to explicitly find out the medium size, and nothing else. dfu_read() is modified to use this function to set the initial value for dfu->r_left, rather than attempting to use the side-effects of dfu->read_medium() for this purpose.
Due to this change, dfu_read() must initially set dfu->b_left to 0, since no data has been read.
dfu_read_buffer_fill() must also be modified not to adjust dfu->r_left when simply copying data from dfu->i_buf_start to the upload request buffer. r_left represents the amount of data left to be read from HW. That value is not affected by the memcpy(), but only by calls to dfu->read_medium().
After this change, I can read from either a 4MB or 1.5MB chunk of a 4MB eMMC boot partion with CONFIG_SYS_DFU_DATA_BUF_SIZE==1MB. Without this change, attempting to do that would result in DFU read returning no data at all due to r_left never being set.
---
v2:
* Fix dfu_get_medium_size_mmc() to handle DFU_FS_FAT/EXT5 layouts too, by calling the recently introduced "size" command.
--- drivers/dfu/dfu.c | 20 ++++++++++++----- drivers/dfu/dfu_mmc.c | 59 ++++++++++++++++++++++++++++++++++++++++++-------- drivers/dfu/dfu_nand.c | 7 +++++- drivers/dfu/dfu_ram.c | 11 +++++----- include/dfu.h | 3 +++ 5 files changed, 79 insertions(+), 21 deletions(-)
drivers/dfu/dfu.c +14 -6
@@ -267,7 +267,6 @@ static int dfu_read_buffer_fill(struct dfu_entity *dfu, void *buf, int size) dfu->i_buf += chunk; dfu->b_left -= chunk; - dfu->r_left -= chunk; size -= chunk; buf += chunk; readn += chunk;
@@ -313,10 +312,19 @@ int dfu_read(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)if (dfu->i_buf_start ==NULL )return -ENOMEM ; - ret = dfu->read_medium (dfu,0 , dfu->i_buf_start, &dfu->r_left); -if (ret !=0 ) { -debug ("%s: failed to get r_left\n" , __func__); -return ret; + dfu->r_left = dfu->get_medium_size (dfu); +if (dfu->r_left <0 ) +return dfu->r_left; +switch (dfu->layout) { +case DFU_RAW_ADDR : +case DFU_RAM_ADDR : +break ; +default : +if (dfu->r_left >= dfu_buf_size) { +printf ("%s: File too big for buffer\n" , + __func__); +return -EOVERFLOW ; + } }debug ("%s: %s %ld [B]\n" , __func__, dfu->name, dfu->r_left);
@@ -326,7 +334,7 @@ int dfu_read(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num) dfu->offset =0 ; dfu->i_buf_end =dfu_get_buf () + dfu_buf_size; dfu->i_buf = dfu->i_buf_start; - dfu->b_left =min (dfu_buf_size, dfu->r_left); + dfu->b_left =0 ; dfu->bad_skip =0 ;
drivers/dfu/dfu_mmc.c +50 -9
103 lines not on this page · raw message
drivers/dfu/dfu_nand.c +6 -1
@@ -114,6 +114,11 @@ static int dfu_write_medium_nand(struct dfu_entity *dfu,return ret; } +long dfu_get_medium_size_nand (struct dfu_entity *dfu) +{ +return dfu->data.nand.size; +} +static int dfu_read_medium_nand (struct dfu_entity *dfu,u64 offset,void *buf,long *len) {
@@ -121,7 +126,6 @@ static int dfu_read_medium_nand(struct dfu_entity *dfu, u64 offset, void *buf,switch (dfu->layout) {case DFU_RAW_ADDR : - *len = dfu->data.nand.size; ret =nand_block_read (dfu, offset, buf, len);break ;default :
@@ -220,6 +224,7 @@ int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s)return -1 ; } + dfu->get_medium_size = dfu_get_medium_size_nand; dfu->read_medium = dfu_read_medium_nand; dfu->write_medium = dfu_write_medium_nand; dfu->flush_medium = dfu_flush_medium_nand;
drivers/dfu/dfu_ram.c +6 -5
@@ -41,14 +41,14 @@ static int dfu_write_medium_ram(struct dfu_entity *dfu, u64 offset,return dfu_transfer_medium_ram (DFU_OP_WRITE , dfu, offset, buf, len); } +long dfu_get_medium_size_ram (struct dfu_entity *dfu) +{ +return dfu->data.ram.size; +} +static int dfu_read_medium_ram (struct dfu_entity *dfu,u64 offset,void *buf,long *len) { -if (!*len) { - *len = dfu->data.ram.size; -return 0 ; - } -return dfu_transfer_medium_ram (DFU_OP_READ , dfu, offset, buf, len); }
@@ -69,6 +69,7 @@ int dfu_fill_entity_ram(struct dfu_entity *dfu, char *s) dfu->data.ram.size =simple_strtoul (s, &s,16 ); dfu->write_medium = dfu_write_medium_ram; + dfu->get_medium_size = dfu_get_medium_size_ram; dfu->read_medium = dfu_read_medium_ram; dfu->inited =0 ;
include/dfu.h +3 -0
@@ -35,6 +35,7 @@ enum dfu_layout {enum dfu_op {DFU_OP_READ =1 ,DFU_OP_WRITE , +DFU_OP_SIZE , };struct mmc_internal_data {
@@ -96,6 +97,8 @@ struct dfu_entity {struct ram_internal_data ram; } data; +long (*get_medium_size)(struct dfu_entity *dfu); +int (*read_medium)(struct dfu_entity *dfu,u64 offset,void *buf,long *len);
Signature · 1 line
1.8.1.5
PATCH v2 2/2 dfu: fix some issues with reads/uploads
Hi Stephen,
Quoted 27 lines
From: Stephen Warren <[email protected]>
DFU read support appears to rely upon
dfu->read_medium()updating the passed-by-reference len parameter to indicate the remaining size available for reading.
dfu_read_medium_mmc()never does this, and the implementation ofdfu_read_medium_nand()will only work if called just once; it hard-codes the value to the total size of the NAND device irrespective of read offset.I believe that overloading
dfu->read_medium()is confusing. As such, this patch introduces a new functiondfu->get_medium_size()which can be used to explicitly find out the medium size, and nothing else.dfu_read()is modified to use this function to set the initial value fordfu->r_left, rather than attempting to use the side-effects ofdfu->read_medium()for this purpose.Due to this change,
dfu_read()must initially setdfu->b_leftto 0, since no data has been read.
dfu_read_buffer_fill()must also be modified not to adjustdfu->r_leftwhen simply copying data fromdfu->i_buf_startto the upload request buffer.r_leftrepresents the amount of data left to be read from HW. That value is not affected by thememcpy(), but only by calls todfu->read_medium().
Quoted 6 lines
After this change, I can read from either a 4MB or 1.5MB chunk of a 4MB eMMC boot partion with
CONFIG_SYS_DFU_DATA_BUF_SIZE==1MB. Without this change, attempting to do that would result in DFU read returning no data at all due tor_leftnever being set.Signed-off-by Stephen Warren <[email protected]>
Stephen thanks for the patch.
Test HW: Trats2 (Exynos4412):
I will pull this patch to -dfu tree when I receive Tom's and Marek's responde to the first patch in this series.
Quoted 260 lines
---
v2:
* Fixdfu_get_medium_size_mmc()to handle DFU_FS_FAT/EXT5 layouts too, by calling the recently introduced "size" command.--- drivers/dfu/dfu.c | 20 ++++++++++++----- drivers/dfu/dfu_mmc.c | 59 ++++++++++++++++++++++++++++++++++++++++++-------- drivers/dfu/dfu_nand.c | 7 +++++- drivers/dfu/dfu_ram.c | 11 +++++----- include/dfu.h | 3 +++ 5 files changed, 79 insertions(+), 21 deletions(-)drivers/dfu/dfu.c +13
-5@@ -267,7 +267,6 @@ static int dfu_read_buffer_fill(struct dfu_entity *dfu, void *buf, int size) dfu->i_buf += chunk; dfu->b_left -= chunk; - dfu->r_left -= chunk; size -= chunk; buf += chunk; readn += chunk;@@ -313,10 +312,19 @@ int dfu_read(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num) if (dfu->i_buf_start == NULL) return -ENOMEM; - ret = dfu->read_medium (dfu,0 , dfu->i_buf_start, &dfu->r_left); -if (ret !=0 ) { -debug ("%s: failed to get r_left\n" , __func__); -return ret; + dfu->r_left = dfu->get_medium_size (dfu); +if (dfu->r_left <0 ) +return dfu->r_left; +switch (dfu->layout) { +case DFU_RAW_ADDR : +case DFU_RAM_ADDR : +break ; +default : +if (dfu->r_left >= dfu_buf_size) { +printf ("%s: File too big for buffer\n", + __func__); +return -EOVERFLOW ; + }drivers/dfu/dfu.c +0
-0} debug("%s: %s %ld [B]\n", __func__, dfu->name,
dfu->r_left); @@ -326,7 +334,7 @@ intdfu_read(struct dfu_entity *dfu, void *buf, int size, int blk_seq_num)dfu->offset= 0;drivers/dfu/dfu.c +1
-1dfu->i_buf_end =dfu_get_buf () + dfu_buf_size; dfu->i_buf = dfu->i_buf_start; - dfu->b_left =min (dfu_buf_size, dfu->r_left); + dfu->b_left =0 ; dfu->bad_skip =0 ;drivers/dfu/dfu_mmc.c +5
-8@@ -12,6 +12,8 @@#include <errno.h> #include <div64.h> #include <dfu.h> +#include <ext4fs.h> +#include <fat.h> #include <mmc.h> static unsigned char __aligned(CONFIG_SYS_CACHELINE_SIZE)@@ -113,22 +115,17 @@ static int mmc_file_buffer(struct dfu_entity *dfu, void *buf, long *len) static int mmc_file_op(enum dfu_op op,struct dfu_entity *dfu,void *buf,long *len) { +const char *fsname, *opname;char cmd_buf[DFU_CMD_BUF_SIZE ];char *str_env;int ret;switch (dfu->layout) {case DFU_FS_FAT : -sprintf (cmd_buf,"fat%s mmc %d:%d 0x%x %s" , - op ==DFU_OP_READ ?"load" :"write" , - dfu->data.mmc.dev, dfu->data.mmc.part, - (unsigned int ) buf, dfu->name); + fsname ="fat" ;break ;case DFU_FS_EXT4 : -sprintf (cmd_buf,"ext4%s mmc %d:%d 0x%x /%s" , - op ==DFU_OP_READ ?"load" :"write" , - dfu->data.mmc.dev, dfu->data.mmc.part, - (unsigned int ) buf, dfu->name); + fsname ="ext4" ;break ;default : printf("%s: Layout (%s) not (yet) supported!\n",
__func__, @@ -136,6 +133,28 @@ static int mmc_file_op(enumdfu_opop, structdfu_entity*dfu, return -1;drivers/dfu/dfu_mmc.c +19
-0} +switch (op) { +case DFU_OP_READ : + opname ="load" ; +break ; +case DFU_OP_WRITE : + opname ="write" ; +break ; +case DFU_OP_SIZE : + opname ="size" ; +break ; +default : +return -1 ; + } + +sprintf (cmd_buf,"%s%s mmc %d:%d" , fsname, opname, + dfu->data.mmc.dev, dfu->data.mmc.part); + +if (op !=DFU_OP_SIZE ) + sprintf(cmd_buf + strlen(cmd_buf), " 0x%x",(unsigned int)buf); +
drivers/dfu/dfu_mmc.c +24
-1+sprintf (cmd_buf +strlen (cmd_buf)," %s" , dfu->name); +if (op ==DFU_OP_WRITE )sprintf (cmd_buf +strlen (cmd_buf)," %lx" , *len);@@ -147,7 +166,7 @@ static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu, return ret; } -if (dfu->layout !=DFU_RAW_ADDR && op ==DFU_OP_READ ) { +if (op !=DFU_OP_WRITE ) { str_env =getenv ("filesize" );if (str_env ==NULL ) {puts ("dfu: Wrong file size!\n" );@@ -196,6 +215,27 @@ int dfu_flush_medium_mmc(struct dfu_entity *dfu)return ret; } +long dfu_get_medium_size_mmc (struct dfu_entity *dfu) +{ +int ret; +long len; + +switch (dfu->layout) { +case DFU_RAW_ADDR : +return dfu->data.mmc.lba_size * dfu->data.mmc.lba_blk_size; +case DFU_FS_FAT : +case DFU_FS_EXT4 : + ret =mmc_file_op (DFU_OP_SIZE , dfu,NULL , &len); +if (ret <0 ) +return ret; +return len; +default : +printf ("%s: Layout (%s) not (yet) supported!\n" , __func__, +dfu_get_layout (dfu->layout)); +return -1 ; + } +} + int dfu_read_medium_mmc(struct dfu_entity *dfu, u64 offset, void*buf, long *len)
{drivers/dfu/dfu_mmc.c +1
-0@@ -316,6 +356,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *s) } dfu->dev_type =DFU_DEV_MMC ; + dfu->get_medium_size = dfu_get_medium_size_mmc; dfu->read_medium = dfu_read_medium_mmc; dfu->write_medium = dfu_write_medium_mmc; dfu->flush_medium = dfu_flush_medium_mmc;drivers/dfu/dfu_nand.c +6
-1@@ -114,6 +114,11 @@ static int dfu_write_medium_nand(struct dfu_entity *dfu, return ret; } +long dfu_get_medium_size_nand (struct dfu_entity *dfu) +{ +return dfu->data.nand.size; +} +static int dfu_read_medium_nand (struct dfu_entity *dfu,u64 offset,void *buf,long *len) {@@ -121,7 +126,6 @@ static int dfu_read_medium_nand(struct dfu_entity *dfu, u64 offset, void *buf, switch (dfu->layout) {case DFU_RAW_ADDR : - *len = dfu->data.nand.size; ret =nand_block_read (dfu, offset, buf, len);break ;default :@@ -220,6 +224,7 @@ int dfu_fill_entity_nand(struct dfu_entity *dfu, char *s) return -1; } + dfu->get_medium_size = dfu_get_medium_size_nand; dfu->read_medium = dfu_read_medium_nand; dfu->write_medium = dfu_write_medium_nand; dfu->flush_medium = dfu_flush_medium_nand;drivers/dfu/dfu_ram.c +6
-5@@ -41,14 +41,14 @@ static int dfu_write_medium_ram(struct dfu_entity *dfu, u64 offset, return dfu_transfer_medium_ram(DFU_OP_WRITE, dfu, offset, buf, len); } +long dfu_get_medium_size_ram (struct dfu_entity *dfu) +{ +return dfu->data.ram.size; +} +static int dfu_read_medium_ram (struct dfu_entity *dfu,u64 offset,void *buf,long *len) { -if (!*len) { - *len = dfu->data.ram.size; -return 0 ; - } -return dfu_transfer_medium_ram (DFU_OP_READ , dfu, offset, buf, len); }@@ -69,6 +69,7 @@ int dfu_fill_entity_ram(struct dfu_entity *dfu, char *s) dfu->data.ram.size = simple_strtoul(s, &s, 16); dfu->write_medium = dfu_write_medium_ram; + dfu->get_medium_size = dfu_get_medium_size_ram; dfu->read_medium = dfu_read_medium_ram; dfu->inited =0 ;include/dfu.h +3
-0@@ -35,6 +35,7 @@ enum dfu_layout {enum dfu_op {DFU_OP_READ =1 ,DFU_OP_WRITE , +DFU_OP_SIZE , };struct mmc_internal_data {@@ -96,6 +97,8 @@ struct dfu_entity {struct ram_internal_data ram; } data; +long (*get_medium_size)(struct dfu_entity *dfu); +int (*read_medium)(struct dfu_entity *dfu,u64 offset,void *buf,long *len);
Signature · 5 lines
Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
PATCH v2 2/2 dfu: fix some issues with reads/uploads
In reply to Stephen WarrenHi Stephen,
Quoted 27 lines
From: Stephen Warren <[email protected]>
DFU read support appears to rely upon
dfu->read_medium()updating the passed-by-reference len parameter to indicate the remaining size available for reading.
dfu_read_medium_mmc()never does this, and the implementation ofdfu_read_medium_nand()will only work if called just once; it hard-codes the value to the total size of the NAND device irrespective of read offset.I believe that overloading
dfu->read_medium()is confusing. As such, this patch introduces a new functiondfu->get_medium_size()which can be used to explicitly find out the medium size, and nothing else.dfu_read()is modified to use this function to set the initial value fordfu->r_left, rather than attempting to use the side-effects ofdfu->read_medium()for this purpose.Due to this change,
dfu_read()must initially setdfu->b_leftto 0, since no data has been read.
dfu_read_buffer_fill()must also be modified not to adjustdfu->r_leftwhen simply copying data fromdfu->i_buf_startto the upload request buffer.r_leftrepresents the amount of data left to be read from HW. That value is not affected by thememcpy(), but only by calls todfu->read_medium().
Quoted 6 lines
After this change, I can read from either a 4MB or 1.5MB chunk of a 4MB eMMC boot partion with
CONFIG_SYS_DFU_DATA_BUF_SIZE==1MB. Without this change, attempting to do that would result in DFU read returning no data at all due tor_leftnever being set.Signed-off-by Stephen Warren <[email protected]>
Applied to u-boot-dfu
Thanks for the patch.
Signature · 5 lines
Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
PATCH v2 1/2 fs: implement size/fatsize/ext4size
In reply to Stephen WarrenHi Stephen,
Quoted 11 lines
From: Stephen Warren <[email protected]>
These commands may be used to determine the size of a file without actually reading the whole file content into memory. This may be used to determine if the file will fit into the memory buffer that will contain it. In particular, the DFU code will use it for this purpose in the next commit.
Signed-off-by Stephen Warren <[email protected]>---
v2: New patch
Stephen thanks for the patch.
Test HW: Trats2 (Exynos4412):
Organizational issue:
File systems don't have their own trees, so if Tom or Marek don't mind I would like to take this patch to -dfu tree.
Justification:
This patch was written solely for fixing flaws of DFU, so I think that it is appropriate to take it to -dfu tree and in this way provide consistency with the following DFU patch.
Signature · 5 lines
Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
PATCH v2 1/2 fs: implement size/fatsize/ext4size
Quoted 23 lines · Lukasz Majewski
Hi Stephen,
Quoted 11 lines
From: Stephen Warren <[email protected]>
These commands may be used to determine the size of a file without actually reading the whole file content into memory. This may be used to determine if the file will fit into the memory buffer that will contain it. In particular, the DFU code will use it for this purpose in the next commit.
Signed-off-by Stephen Warren <[email protected]>---
v2: New patchStephen thanks for the patch.
Acked-by Lukasz Majewski <[email protected]>Test HW: Trats2 (Exynos4412):
Tested-by Lukasz Majewski <[email protected]>Organizational issue:
Quoted 7 lines
File systems don't have their own trees, so if Tom or Marek don't mind I would like to take this patch to -dfu tree.
Justification:
This patch was written solely for fixing flaws of DFU, so I think that it is appropriate to take it to -dfu tree and in this way provide consistency with the following DFU patch.
Works for me, thanks.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140618/b297e1ae/attachment.pgp>
PATCH v2 1/2 fs: implement size/fatsize/ext4size
In reply to Stephen WarrenHi Stephen,
Quoted 9 lines
From: Stephen Warren <[email protected]>
These commands may be used to determine the size of a file without actually reading the whole file content into memory. This may be used to determine if the file will fit into the memory buffer that will contain it. In particular, the DFU code will use it for this purpose in the next commit.
Signed-off-by Stephen Warren <[email protected]>
Applied to u-boot-dfu
Thanks for the patch.
Signature · 5 lines
Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group