History log of /u-boot/test/image/spl_load_fs.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# d678a59d 18-May-2024 Tom Rini <trini@konsulko.com>

Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""

When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay
Ethernet"' I failed to notice that b4 noticed it was based on next and
so took that as the base commit and merged that part of next to master.

This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing
changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 752ed086 27-Apr-2024 Tom Rini <trini@konsulko.com>

test: Remove <common.h> and add needed includes

Remove <common.h> from all "test/" files and when needed add
missing include files directly.

Signed-off-by: Tom Rini <trini@konsulko.com>

# e2a9edc0 28-Nov-2023 Tom Rini <trini@konsulko.com>

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
e17d174773e9ba9447596708e702b7382e47a6cf) 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.


# 601d33f3 15-Nov-2023 Christian Taedcke <christian.taedcke@weidmueller.com>

test: spl: Remove usage of FAT32_SIGN

FAT32_SIGN is removed in the following commits.

Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>

# 6029a0e1 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

spl: Convert NVMe to spl_load

This converts the blk load method (used exclusively by NVMe) to use
spl_load. As a consequence, it also adds support for LOAD_FIT_FULL and
IMX images.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d3401a4 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

spl: Convert mmc to spl_load

This converts the mmc loader to spl_load. Legacy images are handled by
spl_load (via spl_parse_image_header), so mmc_load_legacy can be
omitted. To accurately determine whether mmc_load_image_raw_sector is used
(which might not be the case if SYS_MMCSD_FS_BOOT is enabled), we introduce
a helper config SYS_MMCSD_RAW_MODE. This ensures we can inline spl_load
correctly when a board only boots from filesystems. We still need to check
for SPL_MMC, since some boards enable configure raw mode even without MMC
support.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 682184e9 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

spl: Convert fat to spl_load

This converts the fat loader to use spl_load. Some platforms are very
tight on space, so we take care to only include the code we really need.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# b8ed7225 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

spl: Convert ext to use spl_load

This converts the ext load method to use spl_load. As a consequence, it
also adds support for FIT and IMX images.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5b3debc6 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Support testing LEGACY_LZMA filesystem images

These will soon be supported, so we need to be able to test it. Export the
lzma data and generally use the same process in spl_test_mmc_fs as
do_spl_test_load. If we end up needing this in third place in the future,
it would probably be good to refactor things out.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6ba8ecaa 14-Oct-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Add a test for the MMC load method

Add a test for the MMC load method. This shows the general shape of tests
to come: The main test function calls do_spl_test_load with an appropriate
callback to write the image to the medium.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c5d0d93 14-Oct-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Add a test for spl_blk_load_image

Add a test for spl_blk_load_image, currently used only by NVMe. Because
there is no sandbox NVMe driver, just use MMC instead. Avoid falling back
to raw images to make failures more obvious.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 59b36334 14-Oct-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Add functions to create filesystems

Add some functions for creating fat/ext2 filesystems with a single file and
a test for them. Filesystems require block devices, and it is easiest to
just use MMC for this. To get an MMC, we must also pull in the test device
tree. SPL_TIMER is necessary for SPL_MMC, perhaps because it uses a timeout.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 752ed086 27-Apr-2024 Tom Rini <trini@konsulko.com>

test: Remove <common.h> and add needed includes

Remove <common.h> from all "test/" files and when needed add
missing include files directly.

Signed-off-by: Tom Rini <trini@konsulko.com>

# e2a9edc0 28-Nov-2023 Tom Rini <trini@konsulko.com>

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
e17d174773e9ba9447596708e702b7382e47a6cf) 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.


# 601d33f3 15-Nov-2023 Christian Taedcke <christian.taedcke@weidmueller.com>

test: spl: Remove usage of FAT32_SIGN

FAT32_SIGN is removed in the following commits.

Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>

# 6029a0e1 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

spl: Convert NVMe to spl_load

This converts the blk load method (used exclusively by NVMe) to use
spl_load. As a consequence, it also adds support for LOAD_FIT_FULL and
IMX images.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d3401a4 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

spl: Convert mmc to spl_load

This converts the mmc loader to spl_load. Legacy images are handled by
spl_load (via spl_parse_image_header), so mmc_load_legacy can be
omitted. To accurately determine whether mmc_load_image_raw_sector is used
(which might not be the case if SYS_MMCSD_FS_BOOT is enabled), we introduce
a helper config SYS_MMCSD_RAW_MODE. This ensures we can inline spl_load
correctly when a board only boots from filesystems. We still need to check
for SPL_MMC, since some boards enable configure raw mode even without MMC
support.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 682184e9 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

spl: Convert fat to spl_load

This converts the fat loader to use spl_load. Some platforms are very
tight on space, so we take care to only include the code we really need.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# b8ed7225 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

spl: Convert ext to use spl_load

This converts the ext load method to use spl_load. As a consequence, it
also adds support for FIT and IMX images.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5b3debc6 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Support testing LEGACY_LZMA filesystem images

These will soon be supported, so we need to be able to test it. Export the
lzma data and generally use the same process in spl_test_mmc_fs as
do_spl_test_load. If we end up needing this in third place in the future,
it would probably be good to refactor things out.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6ba8ecaa 14-Oct-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Add a test for the MMC load method

Add a test for the MMC load method. This shows the general shape of tests
to come: The main test function calls do_spl_test_load with an appropriate
callback to write the image to the medium.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c5d0d93 14-Oct-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Add a test for spl_blk_load_image

Add a test for spl_blk_load_image, currently used only by NVMe. Because
there is no sandbox NVMe driver, just use MMC instead. Avoid falling back
to raw images to make failures more obvious.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 59b36334 14-Oct-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Add functions to create filesystems

Add some functions for creating fat/ext2 filesystems with a single file and
a test for them. Filesystems require block devices, and it is easiest to
just use MMC for this. To get an MMC, we must also pull in the test device
tree. SPL_TIMER is necessary for SPL_MMC, perhaps because it uses a timeout.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# e2a9edc0 28-Nov-2023 Tom Rini <trini@konsulko.com>

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
e17d174773e9ba9447596708e702b7382e47a6cf) 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.


# 601d33f3 15-Nov-2023 Christian Taedcke <christian.taedcke@weidmueller.com>

test: spl: Remove usage of FAT32_SIGN

FAT32_SIGN is removed in the following commits.

Signed-off-by: Christian Taedcke <christian.taedcke@weidmueller.com>

# 6029a0e1 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

spl: Convert NVMe to spl_load

This converts the blk load method (used exclusively by NVMe) to use
spl_load. As a consequence, it also adds support for LOAD_FIT_FULL and
IMX images.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5d3401a4 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

spl: Convert mmc to spl_load

This converts the mmc loader to spl_load. Legacy images are handled by
spl_load (via spl_parse_image_header), so mmc_load_legacy can be
omitted. To accurately determine whether mmc_load_image_raw_sector is used
(which might not be the case if SYS_MMCSD_FS_BOOT is enabled), we introduce
a helper config SYS_MMCSD_RAW_MODE. This ensures we can inline spl_load
correctly when a board only boots from filesystems. We still need to check
for SPL_MMC, since some boards enable configure raw mode even without MMC
support.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 682184e9 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

spl: Convert fat to spl_load

This converts the fat loader to use spl_load. Some platforms are very
tight on space, so we take care to only include the code we really need.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# b8ed7225 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

spl: Convert ext to use spl_load

This converts the ext load method to use spl_load. As a consequence, it
also adds support for FIT and IMX images.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 5b3debc6 08-Nov-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Support testing LEGACY_LZMA filesystem images

These will soon be supported, so we need to be able to test it. Export the
lzma data and generally use the same process in spl_test_mmc_fs as
do_spl_test_load. If we end up needing this in third place in the future,
it would probably be good to refactor things out.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6ba8ecaa 14-Oct-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Add a test for the MMC load method

Add a test for the MMC load method. This shows the general shape of tests
to come: The main test function calls do_spl_test_load with an appropriate
callback to write the image to the medium.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c5d0d93 14-Oct-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Add a test for spl_blk_load_image

Add a test for spl_blk_load_image, currently used only by NVMe. Because
there is no sandbox NVMe driver, just use MMC instead. Avoid falling back
to raw images to make failures more obvious.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 59b36334 14-Oct-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Add functions to create filesystems

Add some functions for creating fat/ext2 filesystems with a single file and
a test for them. Filesystems require block devices, and it is easiest to
just use MMC for this. To get an MMC, we must also pull in the test device
tree. SPL_TIMER is necessary for SPL_MMC, perhaps because it uses a timeout.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6ba8ecaa 14-Oct-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Add a test for the MMC load method

Add a test for the MMC load method. This shows the general shape of tests
to come: The main test function calls do_spl_test_load with an appropriate
callback to write the image to the medium.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 6c5d0d93 14-Oct-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Add a test for spl_blk_load_image

Add a test for spl_blk_load_image, currently used only by NVMe. Because
there is no sandbox NVMe driver, just use MMC instead. Avoid falling back
to raw images to make failures more obvious.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 59b36334 14-Oct-2023 Sean Anderson <seanga2@gmail.com>

test: spl: Add functions to create filesystems

Add some functions for creating fat/ext2 filesystems with a single file and
a test for them. Filesystems require block devices, and it is easiest to
just use MMC for this. To get an MMC, we must also pull in the test device
tree. SPL_TIMER is necessary for SPL_MMC, perhaps because it uses a timeout.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>