summaryrefslogtreecommitdiff
path: root/arch/sandbox/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sandbox/cpu')
-rw-r--r--arch/sandbox/cpu/spl.c6
-rw-r--r--arch/sandbox/cpu/state.c6
2 files changed, 7 insertions, 5 deletions
diff --git a/arch/sandbox/cpu/spl.c b/arch/sandbox/cpu/spl.c
index ecc03785463..7ee4975523e 100644
--- a/arch/sandbox/cpu/spl.c
+++ b/arch/sandbox/cpu/spl.c
@@ -74,7 +74,7 @@ static int spl_board_load_file(struct spl_image_info *spl_image,
}
/*
- * Set up spl_image to boot from jump_to_image_no_args(). Allocate this
+ * Set up spl_image to boot from jump_to_image(). Allocate this
* outsdide the RAM buffer (i.e. don't use strdup()).
*/
spl_image->arg = os_malloc(strlen(fname) + 1);
@@ -112,7 +112,7 @@ static int load_from_image(struct spl_image_info *spl_image,
log_info("Reading from pos %lx size %lx\n", pos, size);
/*
- * Set up spl_image to boot from jump_to_image_no_args(). Allocate this
+ * Set up spl_image to boot from jump_to_image(). Allocate this
* outside the RAM buffer (i.e. don't use strdup()).
*/
fname = state->prog_fname ? state->prog_fname : state->argv[0];
@@ -159,7 +159,7 @@ void spl_board_init(void)
}
}
-void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image)
+void __noreturn jump_to_image(struct spl_image_info *spl_image)
{
switch (spl_image->flags) {
case SPL_SANDBOXF_ARG_IS_FNAME: {
diff --git a/arch/sandbox/cpu/state.c b/arch/sandbox/cpu/state.c
index 49236db99c2..6a15c8b0a18 100644
--- a/arch/sandbox/cpu/state.c
+++ b/arch/sandbox/cpu/state.c
@@ -480,7 +480,9 @@ int state_init(void)
state = &main_state;
state->ram_size = CFG_SYS_SDRAM_SIZE;
- state->ram_buf = os_malloc(state->ram_size);
+ state->mmap_addr = os_malloc(state->ram_size + SB_SDRAM_ALIGN);
+ state->ram_buf = (uint8_t *)ALIGN((uintptr_t)state->mmap_addr,
+ SB_SDRAM_ALIGN);
if (!state->ram_buf) {
printf("Out of memory\n");
os_exit(1);
@@ -533,7 +535,7 @@ int state_uninit(void)
trace_set_enabled(0);
os_free(state->state_fdt);
- os_free(state->ram_buf);
+ os_free(state->mmap_addr);
memset(state, '\0', sizeof(*state));
return 0;