diff options
author | Kory Maincent <kory.maincent@bootlin.com> | 2021-05-04 19:31:23 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-05-13 13:09:09 -0400 |
commit | 95300f203f3249ffb7a08222dc4d8106c5a6ceeb (patch) | |
tree | a26fd939eccb3eca623057083a4758507041520b /board/sandbox | |
parent | 2f84e9cf06d31aa703ff31301bf811b3fcfc16cf (diff) | |
download | u-boot-95300f203f3249ffb7a08222dc4d8106c5a6ceeb.zip u-boot-95300f203f3249ffb7a08222dc4d8106c5a6ceeb.tar.gz u-boot-95300f203f3249ffb7a08222dc4d8106c5a6ceeb.tar.bz2 |
pytest: add sandbox test for "extension" command
This commit extends the sandbox to implement a dummy
extension_board_scan() function and enables the extension command in
the sandbox configuration. It then adds a test that checks the proper
functionality of the extension command by applying two Device Tree
overlays to the sandbox Device Tree.
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
[trini: Limit to running on sandbox]
Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'board/sandbox')
-rw-r--r-- | board/sandbox/sandbox.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/board/sandbox/sandbox.c b/board/sandbox/sandbox.c index 902b99e..dcd7345 100644 --- a/board/sandbox/sandbox.c +++ b/board/sandbox/sandbox.c @@ -14,6 +14,9 @@ #include <asm/global_data.h> #include <asm/test.h> #include <asm/u-boot-sandbox.h> +#include <malloc.h> + +#include <extension_board.h> /* * Pointer to initial global data area @@ -79,6 +82,26 @@ int ft_board_setup(void *fdt, struct bd_info *bd) return fdt_add_mem_rsv(fdt, 0x00d02000, 0x4000); } +#ifdef CONFIG_CMD_EXTENSION +int extension_board_scan(struct list_head *extension_list) +{ + struct extension *extension; + int i; + + for (i = 0; i < 2; i++) { + extension = calloc(1, sizeof(struct extension)); + snprintf(extension->overlay, sizeof(extension->overlay), "overlay%d.dtbo", i); + snprintf(extension->name, sizeof(extension->name), "extension board %d", i); + snprintf(extension->owner, sizeof(extension->owner), "sandbox"); + snprintf(extension->version, sizeof(extension->version), "1.1"); + snprintf(extension->other, sizeof(extension->other), "Fictionnal extension board"); + list_add_tail(&extension->list, extension_list); + } + + return i; +} +#endif + #ifdef CONFIG_BOARD_LATE_INIT int board_late_init(void) { |