diff options
author | Kory Maincent <kory.maincent@bootlin.com> | 2021-05-04 19:31:23 +0200 |
---|---|---|
committer | Han Gao <gaohan@iscas.ac.cn> | 2023-10-20 13:38:37 +0800 |
commit | cccf006cae8e64b9c499ea3cd498604e9ae35172 (patch) | |
tree | a0e19ea09fdcf0010762c93535f331368233007a /board | |
parent | c86cc5402a3f1147e40367658e33c29dbf0d0d2b (diff) |
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')
-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 0c3d245d..197a321e 100644 --- a/board/sandbox/sandbox.c +++ b/board/sandbox/sandbox.c @@ -12,6 +12,9 @@ #include <os.h> #include <asm/test.h> #include <asm/u-boot-sandbox.h> +#include <malloc.h> + +#include <extension_board.h> /* * Pointer to initial global data area @@ -58,6 +61,26 @@ int board_init(void) return 0; } +#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) { |