u-boot/test/image
Tom Rini e2a9edc0ce Merge patch series "fs: fat: calculate FAT type based on cluster count"
To quote the author:

This series fixes an issue where the FAT type (FAT12, FAT16) is not
correctly detected, e.g. when the BPB field BS_FilSysType contains the
valid value "FAT     ".

This issue occures, for example, if a partition is formatted by
swupdate using its diskformat handler. swupdate uses the FAT library
from http://elm-chan.org/fsw/ff/ internally.

See https://groups.google.com/g/swupdate/c/7Yc3NupjXx8 for a
discussion in the swupdate mailing list.

Please refer to the commit messages for more details.

1. Added bootsector checks

Most tests from https://www.win.tue.nl/~aeb/linux/fs/fat/fat-2.html
are added in the commit 'fs: fat: add bootsector validity check'.
Only the tests VIII, IX and X are not implemented.

I also checked the Linux kernel code (v6.6) and did not find any
checks on 'vistart->fs_type'. This is the reason why is skipped them
here.

See section '2. Size comparisons' for the impact on the binary size.

2. Size comparisons

I executed bloat-o-meter from the Linux kernel for an arm64
target (config xilinx_zynqmp_mini_emmc0_defconfig):

Comparison of the binary spl/u-boot-spl between master (rev
e17d174773) and this patch
series (including the added validity checks of the boot sector):

add/remove: 0/0 grow/shrink: 1/1 up/down: 100/-12 (88)
Function                                     old     new   delta
read_bootsectandvi                           308     408    +100
fat_itr_root                                 444     432     -12
Total: Before=67977, After=68065, chg +0.13%

When compare the size of the binary spl/u-boot-spl between master this
series without the the validity checks of the boot sector:

add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-24 (-24)
Function                                     old     new   delta
read_bootsectandvi                           308     296     -12
fat_itr_root                                 444     432     -12
Total: Before=67977, After=67953, chg -0.04%

So the size of the spl on this arm64 target increases by 88 bytes for
this series. When i remove the validity check the size decreases by 24 bytes.
2023-11-28 20:10:36 -05:00
..
Kconfig spl: Only support bl_len when we have to 2023-11-16 13:49:14 -05:00
Makefile test: spl: Add a test for NAND 2023-11-16 12:43:49 -05:00
spl_load.c test: spl: Support testing LEGACY_LZMA filesystem images 2023-11-16 13:49:14 -05:00
spl_load_fs.c Merge patch series "fs: fat: calculate FAT type based on cluster count" 2023-11-28 20:10:36 -05:00
spl_load_nand.c spl: Convert nand to spl_load 2023-11-16 13:49:14 -05:00
spl_load_net.c spl: Convert net to spl_load 2023-11-16 13:49:14 -05:00
spl_load_nor.c spl: Convert nor to spl_load 2023-11-16 13:49:14 -05:00
spl_load_os.c spl: Only support bl_len when we have to 2023-11-16 13:49:14 -05:00
spl_load_spi.c spl: Convert spi to spl_load 2023-11-16 13:49:14 -05:00
test-imagetools.sh test: Update test-imagetools.sh to match new syntax 2019-03-08 11:31:44 -05:00