sandbox: Minor Fixes in various areas
Subsystems (2)
cover sandbox: Minor Fixes in various areas
This series contains some minor tweaks and fixes to sandbox-related code.
Simon Glass (5):
sandbox: Show a message when writing out the ram buffer
sandbox: Add the handoff header for spl
sandbox: Open host file for read-only access if needed
sandbox: Slow down the LCD sync rate
sandbox: test: Tidy up spl_test_load() calls
arch/sandbox/cpu/spl.c | 1 + arch/sandbox/cpu/state.c | 3 ++- drivers/block/sandbox.c | 11 ++++++++--- drivers/video/video-uclass.c | 2 +- test/image/spl_load.c | 6 +----- 5 files changed, 13 insertions(+), 10 deletions(-)
Signature · 1 line
2.35.1.574.g5d30c73bfb-goog
PATCH 1/5 sandbox: Show a message when writing out the ram buffer
If state is not being written, but RAM is, we should still show a message, so it is clear that this is happening.
---
arch/sandbox/cpu/state.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/sandbox/cpu/state.c +2 -1
@@ -421,7 +421,8 @@ int state_uninit(void) {int err; -log_info ("Writing sandbox state\n" ); +if (state->write_ram_buf || state->write_state) +log_info ("Writing sandbox state\n" ); state = &main_state;/* Finish the bloblist, so that it is correct before writing memory */
Signature · 1 line
2.35.1.574.g5d30c73bfb-goog
PATCH 2/5 sandbox: Add the handoff header for spl
In reply to Simon GlassThis defines a function declared in handoff.h so add the header.
---
arch/sandbox/cpu/spl.c | 1 + 1 file changed, 1 insertion(+)
arch/sandbox/cpu/spl.c +1 -0
@@ -6,6 +6,7 @@#include <common.h> #include <dm.h> #include <hang.h> +#include <handoff.h> #include <init.h> #include <log.h> #include <os.h>
Signature · 1 line
2.35.1.574.g5d30c73bfb-goog
PATCH 3/5 sandbox: Open host file for read-only access if needed
In reply to Simon GlassSome files cannot be written but read-only access is still useful for tests. Add a fallback to read-only access when needed.
This is useful in CI when opening a large data file provided by docker, where read/write access would result in copying the file, thus needing a lot of extra disk space.
---
drivers/block/sandbox.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/block/sandbox.c +8 -3
@@ -125,9 +125,14 @@ int host_dev_bind(int devnum, char *filename, bool removable) fd =os_open (filename,OS_O_RDWR );if (fd ==-1 ) { -printf ("Failed to access host backing file '%s'\n" , filename); - ret = -ENOENT ; - goto err; +printf ("Failed to access host backing file '%s', trying read-only\n" , + filename); + fd =os_open (filename,OS_O_RDONLY ); +if (fd ==-1 ) { +printf ("- still failed\n" ); + ret = -ENOENT ; + goto err; + } } ret = blk_create_device(gd->dm_root, "sandbox_host_blk", str, IF_TYPE_HOST, devnum, 512,
Signature · 1 line
2.35.1.574.g5d30c73bfb-goog
PATCH 4/5 sandbox: Slow down the LCD sync rate
In reply to Simon GlassThere is seldom a need to refresh at 100Hz and it uses a lot of CPU. Reduce the rate to 10Hz which seems to be adequate.
---
drivers/video/video-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/video-uclass.c +1 -1
@@ -204,7 +204,7 @@ int video_sync(struct udevice *vid, bool force)struct video_priv *priv =dev_get_uclass_priv (vid);static ulong last_sync; -if (force ||get_timer (last_sync) >10 ) { +if (force ||get_timer (last_sync) >100 ) {sandbox_sdl_sync (priv->fb); last_sync =get_timer (0 ); }
Signature · 1 line
2.35.1.574.g5d30c73bfb-goog
PATCH 5/5 sandbox: test: Tidy up spl_test_load() calls
In reply to Simon GlassUse the new sandbox_find_next_phase() function, which does what is needed here.
---
test/image/spl_load.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
test/image/spl_load.c +1 -5
@@ -56,7 +56,6 @@ struct image_header *spl_get_load_buffer(ssize_t offset, size_t size)static int spl_test_load (struct unit_test_state *uts) { -const char *cur_prefix, *next_prefix;struct spl_image_info image;struct image_header *header;struct text_ctx text_ctx;
@@ -69,10 +68,7 @@ static int spl_test_load(struct unit_test_state *uts) load.bl_len =512 ; load.read = read_fit_image; - cur_prefix =spl_phase_prefix (spl_phase ()); - next_prefix =spl_phase_prefix (spl_next_phase ()); - ret =os_find_u_boot (fname,sizeof (fname), true, cur_prefix, - next_prefix); + ret =sandbox_find_next_phase (fname,sizeof (fname), true);if (ret) {printf ("(%s not found, error %d)\n" , fname, ret);return ret;
Signature · 1 line
2.35.1.574.g5d30c73bfb-goog