diff options
author | Simon Glass | 2022-09-06 20:27:09 -0600 |
---|---|---|
committer | Tom Rini | 2022-09-29 16:09:56 -0400 |
commit | 9859d89b6e859a242d083a96950e0c05f60a5152 (patch) | |
tree | 2a325a1ef333f05acdf5f7016d9da33cdbb34dc5 /arch/sandbox/include/asm | |
parent | 73c5cb9dacbcf2e988fffa66750c4206fccc8cbc (diff) |
sandbox: Support loading the other FDT
We need an 'other' FDT which is different from the control FDT, so we can
check that the ofnode tests correctly handle them both.
Add this to the build along with a way to read it into the sandbox state.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/include/asm')
-rw-r--r-- | arch/sandbox/include/asm/state.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index 12741ee064a..fd42daad51c 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -108,6 +108,9 @@ struct sandbox_state { bool hwspinlock; /* Hardware Spinlock status */ bool allow_memio; /* Allow readl() etc. to work */ + void *other_fdt_buf; /* 'other' FDT blob used by tests */ + int other_size; /* size of other FDT blob */ + /* * This struct is getting large. * @@ -280,6 +283,19 @@ void state_show(struct sandbox_state *state); int state_get_rel_filename(const char *rel_path, char *buf, int size); /** + * state_load_other_fdt() - load the 'other' FDT into a buffer + * + * This loads the other.dtb file into a buffer. This is typically used in tests. + * + * @bufp: Place to put allocated buffer pointer. The buffer is read using + * os_read_file() which calls os_malloc(), so does affect U-Boot's own malloc() + * space + * @sizep: Returns the size of the buffer + * @return 0 if OK, -ve on error + */ +int state_load_other_fdt(const char **bufp, int *sizep); + +/** * Initialize the test system state */ int state_init(void); |