* [U-Boot] [PATCH 1/2] Fix test failure caused by bad handling of ramdisk
@ 2014-08-22 20:26 Simon Glass
2014-08-22 20:26 ` [U-Boot] [PATCH 2/2] Correct sandbox filesystem commands in FIT image test Simon Glass
2014-08-29 14:41 ` [U-Boot] [U-Boot, 1/2] Fix test failure caused by bad handling of ramdisk Tom Rini
0 siblings, 2 replies; 4+ messages in thread
From: Simon Glass @ 2014-08-22 20:26 UTC (permalink / raw)
To: u-boot
Commit e3a5bbce broke the FIT image tests by not loading a ramdisk even if
a load address is provided in the FIT. The rationale was that a load address
of 0 should be considered to mean 'do not load'.
Add a new load operation which supports this feature, so that the ramdisk
will be loaded if a non-zero load address is provided.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
common/image-fit.c | 2 +-
common/image.c | 3 ++-
include/image.h | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/common/image-fit.c b/common/image-fit.c
index c61be65..255c4ca 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1656,7 +1656,7 @@ int fit_image_load(bootm_headers_t *images, ulong addr,
bootstage_error(bootstage_id + BOOTSTAGE_SUB_LOAD);
return -EBADF;
}
- } else {
+ } else if (load_op != FIT_LOAD_OPTIONAL_NON_ZERO || load) {
ulong image_start, image_end;
ulong load_end;
void *dst;
diff --git a/common/image.c b/common/image.c
index a2999c0..d0af597 100644
--- a/common/image.c
+++ b/common/image.c
@@ -951,7 +951,8 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,
&fit_uname_config, arch,
IH_TYPE_RAMDISK,
BOOTSTAGE_ID_FIT_RD_START,
- FIT_LOAD_IGNORED, &rd_data, &rd_len);
+ FIT_LOAD_OPTIONAL_NON_ZERO,
+ &rd_data, &rd_len);
if (rd_noffset < 0)
return 1;
diff --git a/include/image.h b/include/image.h
index ca2fe86..f58e9ff 100644
--- a/include/image.h
+++ b/include/image.h
@@ -412,6 +412,7 @@ void genimg_print_time(time_t timestamp);
enum fit_load_op {
FIT_LOAD_IGNORED, /* Ignore load address */
FIT_LOAD_OPTIONAL, /* Can be provided, but optional */
+ FIT_LOAD_OPTIONAL_NON_ZERO, /* Optional, a value of 0 is ignored */
FIT_LOAD_REQUIRED, /* Must be provided */
};
--
2.1.0.rc2.206.gedb03e5
^ permalink raw reply related [flat|nested] 4+ messages in thread* [U-Boot] [PATCH 2/2] Correct sandbox filesystem commands in FIT image test
2014-08-22 20:26 [U-Boot] [PATCH 1/2] Fix test failure caused by bad handling of ramdisk Simon Glass
@ 2014-08-22 20:26 ` Simon Glass
2014-08-29 14:41 ` [U-Boot] [U-Boot, " Tom Rini
2014-08-29 14:41 ` [U-Boot] [U-Boot, 1/2] Fix test failure caused by bad handling of ramdisk Tom Rini
1 sibling, 1 reply; 4+ messages in thread
From: Simon Glass @ 2014-08-22 20:26 UTC (permalink / raw)
To: u-boot
The host filesystem name has changed, so update the tests. The tests now
run again correctly:
$ make O=b/sandbox sandbox_defconfig all
...
$ test/image/test-fit.py -u b/sandbox/u-boot
FIT Tests
=========
Kernel load
Kernel + FDT load
Kernel + FDT + Ramdisk load
Tests passed
Caveat: this is only a sanity check - test coverage is poor
Signed-off-by: Simon Glass <sjg@chromium.org>
---
test/image/test-fit.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/test/image/test-fit.py b/test/image/test-fit.py
index 7394df7..b065fcb 100755
--- a/test/image/test-fit.py
+++ b/test/image/test-fit.py
@@ -93,13 +93,13 @@ base_fdt = '''
# then do the 'bootm' command, then save out memory from the places where
# we expect 'bootm' to write things. Then quit.
base_script = '''
-sb load host 0 %(fit_addr)x %(fit)s
+sb load hostfs 0 %(fit_addr)x %(fit)s
fdt addr %(fit_addr)x
bootm start %(fit_addr)x
bootm loados
-sb save host 0 %(kernel_out)s %(kernel_addr)x %(kernel_size)x
-sb save host 0 %(fdt_out)s %(fdt_addr)x %(fdt_size)x
-sb save host 0 %(ramdisk_out)s %(ramdisk_addr)x %(ramdisk_size)x
+sb save hostfs 0 %(kernel_out)s %(kernel_addr)x %(kernel_size)x
+sb save hostfs 0 %(fdt_out)s %(fdt_addr)x %(fdt_size)x
+sb save hostfs 0 %(ramdisk_out)s %(ramdisk_addr)x %(ramdisk_size)x
reset
'''
--
2.1.0.rc2.206.gedb03e5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [U-Boot, 1/2] Fix test failure caused by bad handling of ramdisk
2014-08-22 20:26 [U-Boot] [PATCH 1/2] Fix test failure caused by bad handling of ramdisk Simon Glass
2014-08-22 20:26 ` [U-Boot] [PATCH 2/2] Correct sandbox filesystem commands in FIT image test Simon Glass
@ 2014-08-29 14:41 ` Tom Rini
1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2014-08-29 14:41 UTC (permalink / raw)
To: u-boot
On Fri, Aug 22, 2014 at 02:26:43PM -0600, Simon Glass wrote:
> Commit e3a5bbce broke the FIT image tests by not loading a ramdisk even if
> a load address is provided in the FIT. The rationale was that a load address
> of 0 should be considered to mean 'do not load'.
>
> Add a new load operation which supports this feature, so that the ramdisk
> will be loaded if a non-zero load address is provided.
>
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
Applied to u-boot/master, thanks!
--
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/20140829/1bf49975/attachment.pgp>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-08-29 14:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-22 20:26 [U-Boot] [PATCH 1/2] Fix test failure caused by bad handling of ramdisk Simon Glass
2014-08-22 20:26 ` [U-Boot] [PATCH 2/2] Correct sandbox filesystem commands in FIT image test Simon Glass
2014-08-29 14:41 ` [U-Boot] [U-Boot, " Tom Rini
2014-08-29 14:41 ` [U-Boot] [U-Boot, 1/2] Fix test failure caused by bad handling of ramdisk Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox