-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yosemite4n: u-boot: Add patch to set memory test result in environment
Summary: Add patch to set memory test result in environment after doing mtest in u-boot so that user can check the result in user space. This patch is needed by Wiwynn factory test. Test Plan: Set mtest command and reboot to check the memory test result. root@bmc:~# fw_setenv preboot 'mtest 0x80000000 0x9A500000 0 1' root@bmc:~# reboot root@bmc:~# fw_printenv memtest_result memtest_result=pass Signed-off-by: Marvin Lin <[email protected]>
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
...bsp/u-boot/u-boot-nuvoton/0100-cmd-mem-set-test-result-of-mtest-to-enviroment-varia.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
From fd6c1631c9075161df703e7928063f4acf498113 Mon Sep 17 00:00:00 2001 | ||
From: RickyWu-wiwynn <[email protected]> | ||
Date: Mon, 8 Apr 2024 18:07:34 +0800 | ||
Subject: [PATCH] cmd: mem: set test result of mtest to enviroment variable | ||
|
||
--- | ||
cmd/mem.c | 16 ++++++++++++++++ | ||
1 file changed, 16 insertions(+) | ||
|
||
diff --git a/cmd/mem.c b/cmd/mem.c | ||
index 5f4e865462..4dee413fea 100644 | ||
--- a/cmd/mem.c | ||
+++ b/cmd/mem.c | ||
@@ -1204,6 +1204,15 @@ static ulong mem_test_quick(vu_long *buf, ulong start_addr, ulong end_addr, | ||
static int do_mem_mtest(struct cmd_tbl *cmdtp, int flag, int argc, | ||
char *const argv[]) | ||
{ | ||
+ char *is_done; | ||
+ is_done = env_get("memtest_result"); | ||
+ if (is_done != NULL) { | ||
+ env_set("memtest_result", ""); | ||
+ env_set("preboot", ""); | ||
+ env_save(); | ||
+ return 0; | ||
+ } | ||
+ | ||
ulong start, end; | ||
vu_long scratch_space; | ||
vu_long *buf, *dummy = &scratch_space; | ||
@@ -1273,6 +1282,13 @@ static int do_mem_mtest(struct cmd_tbl *cmdtp, int flag, int argc, | ||
|
||
printf("\nTested %d iteration(s) with %lu errors.\n", iteration, count); | ||
|
||
+ if (errs == 0) { | ||
+ env_set("memtest_result", "pass"); | ||
+ } else { | ||
+ env_set("memtest_result", "fail"); | ||
+ } | ||
+ env_save(); | ||
+ | ||
return errs != 0; | ||
} | ||
#endif /* CONFIG_CMD_MEMTEST */ | ||
-- | ||
2.25.1 | ||
|
4 changes: 4 additions & 0 deletions
4
meta-facebook/meta-yosemite4/meta-yosemite4n/recipes-bsp/u-boot/u-boot-nuvoton_%.bbappend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" | ||
|
||
SRC_URI:append = " file://0100-cmd-mem-set-test-result-of-mtest-to-enviroment-varia.patch" | ||
|