diff options
Diffstat (limited to 'arch/sandbox')
-rw-r--r-- | arch/sandbox/cpu/spl.c | 6 | ||||
-rw-r--r-- | arch/sandbox/cpu/state.c | 6 | ||||
-rw-r--r-- | arch/sandbox/dts/Makefile | 2 | ||||
-rw-r--r-- | arch/sandbox/dts/test.dts | 4 | ||||
-rw-r--r-- | arch/sandbox/include/asm/io.h | 19 | ||||
-rw-r--r-- | arch/sandbox/include/asm/state.h | 1 |
6 files changed, 32 insertions, 6 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; diff --git a/arch/sandbox/dts/Makefile b/arch/sandbox/dts/Makefile index 1c9fb4a4566..0d7b0b80e21 100644 --- a/arch/sandbox/dts/Makefile +++ b/arch/sandbox/dts/Makefile @@ -11,4 +11,4 @@ dtb-$(CONFIG_CMD_EXTENSION) += overlay0.dtbo overlay1.dtbo include $(srctree)/scripts/Makefile.dts # Add any required device tree compiler flags here -DTC_FLAGS += -R 4 -p 0x1000 +DTC_FLAGS += -R 4 diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 7026c73bc69..bb696c5ef7f 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -2150,6 +2150,10 @@ }; }; }; + + aes-engine { + compatible = "software-aes-engine"; + }; }; #include "sandbox_pmic.dtsi" diff --git a/arch/sandbox/include/asm/io.h b/arch/sandbox/include/asm/io.h index f656f361cd5..6e3f9547fee 100644 --- a/arch/sandbox/include/asm/io.h +++ b/arch/sandbox/include/asm/io.h @@ -74,7 +74,14 @@ void sandbox_write(void *addr, unsigned int val, enum sandboxio_size_t size); #define in_be32(a) in_arch(l,be32,a) #define in_be16(a) in_arch(w,be16,a) +#define out_64(a,v) writeq(v,a) +#define out_32(a,v) writel(v,a) +#define out_16(a,v) writew(v,a) #define out_8(a,v) writeb(v,a) + +#define in_64(a) readq(a) +#define in_32(a) readl(a) +#define in_16(a) readw(a) #define in_8(a) readb(a) #define clrbits(type, addr, clear) \ @@ -106,6 +113,18 @@ void sandbox_write(void *addr, unsigned int val, enum sandboxio_size_t size); #define setbits_8(addr, set) setbits(8, addr, set) #define clrsetbits_8(addr, clear, set) clrsetbits(8, addr, clear, set) +#define clrbits_16(addr, clear) clrbits(16, addr, clear) +#define setbits_16(addr, set) setbits(16, addr, set) +#define clrsetbits_16(addr, clear, set) clrsetbits(16, addr, clear, set) + +#define clrbits_32(addr, clear) clrbits(32, addr, clear) +#define setbits_32(addr, set) setbits(32, addr, set) +#define clrsetbits_32(addr, clear, set) clrsetbits(32, addr, clear, set) + +#define clrbits_64(addr, clear) clrbits(64, addr, clear) +#define setbits_64(addr, set) setbits(64, addr, set) +#define clrsetbits_64(addr, clear, set) clrsetbits(64, addr, clear, set) + /* I/O access functions */ int _inl(unsigned int addr); int _inw(unsigned int addr); diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index dc21a623106..9dea0980bfc 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -75,6 +75,7 @@ struct sandbox_state { char **argv; /* Command line arguments */ const char *jumped_fname; /* Jumped from previous U-Boot */ const char *prog_fname; /* U-Boot executable filename */ + uint8_t *mmap_addr; /* Memory allocated via mmap */ uint8_t *ram_buf; /* Emulated RAM buffer */ unsigned long ram_size; /* Size of RAM buffer */ const char *ram_buf_fname; /* Filename to use for RAM buffer */ |