aboutsummaryrefslogtreecommitdiff
path: root/cmd/x86
diff options
context:
space:
mode:
authorSimon Glass2020-07-17 08:48:31 -0600
committerBin Meng2020-07-20 09:46:48 +0800
commit2a3d9a7af9b3f7abad4d1bc4d40f1d665a54da8f (patch)
tree4546d038f3daf513996fa0590f83274c01c3c501 /cmd/x86
parentc6efee503103f0e210cdd82653aca6c10814198d (diff)
x86: mtrr: Enhance 'mtrr' command to list MTRRs on any CPU
Update this command so it can list the MTRRs on a selected CPU. If '-c all' is used, then all CPUs are listed. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'cmd/x86')
-rw-r--r--cmd/x86/mtrr.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/cmd/x86/mtrr.c b/cmd/x86/mtrr.c
index d8a7e56d5a4..e118bba5a2a 100644
--- a/cmd/x86/mtrr.c
+++ b/cmd/x86/mtrr.c
@@ -131,7 +131,27 @@ static int do_mtrr(struct cmd_tbl *cmdtp, int flag, int argc,
}
}
if (cmd == 'l') {
- return do_mtrr_list(cpu_select);
+ bool first;
+ int i;
+
+ i = mp_first_cpu(cpu_select);
+ if (i < 0) {
+ printf("Invalid CPU (err=%d)\n", i);
+ return CMD_RET_FAILURE;
+ }
+ first = true;
+ for (; i >= 0; i = mp_next_cpu(cpu_select, i)) {
+ if (!first)
+ printf("\n");
+ printf("CPU %d:\n", i);
+ ret = do_mtrr_list(i);
+ if (ret) {
+ printf("Failed to read CPU %d (err=%d)\n", i,
+ ret);
+ return CMD_RET_FAILURE;
+ }
+ first = false;
+ }
} else {
switch (cmd) {
case 'e':