Skip to content

Commit 6aae2dd

Browse files
committed
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]>
1 parent 7057726 commit 6aae2dd

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
From fd6c1631c9075161df703e7928063f4acf498113 Mon Sep 17 00:00:00 2001
2+
From: RickyWu-wiwynn <[email protected]>
3+
Date: Mon, 8 Apr 2024 18:07:34 +0800
4+
Subject: [PATCH] cmd: mem: set test result of mtest to enviroment variable
5+
6+
---
7+
cmd/mem.c | 16 ++++++++++++++++
8+
1 file changed, 16 insertions(+)
9+
10+
diff --git a/cmd/mem.c b/cmd/mem.c
11+
index 5f4e865462..4dee413fea 100644
12+
--- a/cmd/mem.c
13+
+++ b/cmd/mem.c
14+
@@ -1204,6 +1204,15 @@ static ulong mem_test_quick(vu_long *buf, ulong start_addr, ulong end_addr,
15+
static int do_mem_mtest(struct cmd_tbl *cmdtp, int flag, int argc,
16+
char *const argv[])
17+
{
18+
+ char *is_done;
19+
+ is_done = env_get("memtest_result");
20+
+ if (is_done != NULL) {
21+
+ env_set("memtest_result", "");
22+
+ env_set("preboot", "");
23+
+ env_save();
24+
+ return 0;
25+
+ }
26+
+
27+
ulong start, end;
28+
vu_long scratch_space;
29+
vu_long *buf, *dummy = &scratch_space;
30+
@@ -1273,6 +1282,13 @@ static int do_mem_mtest(struct cmd_tbl *cmdtp, int flag, int argc,
31+
32+
printf("\nTested %d iteration(s) with %lu errors.\n", iteration, count);
33+
34+
+ if (errs == 0) {
35+
+ env_set("memtest_result", "pass");
36+
+ } else {
37+
+ env_set("memtest_result", "fail");
38+
+ }
39+
+ env_save();
40+
+
41+
return errs != 0;
42+
}
43+
#endif /* CONFIG_CMD_MEMTEST */
44+
--
45+
2.25.1
46+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
2+
3+
SRC_URI:append = " file://0100-cmd-mem-set-test-result-of-mtest-to-enviroment-varia.patch"
4+

0 commit comments

Comments
 (0)