From: Simon Glass Date: Wed, 12 Nov 2014 22:42:20 -0700 Subject: [U-Boot] [PATCH v3 17/26] x86: ivybridge: Check BIST value on boot In-Reply-To: <1415857349-14653-1-git-send-email-sjg@chromium.org> References: <1415857349-14653-1-git-send-email-sjg@chromium.org> Message-ID: <1415857349-14653-18-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de The built-in self test value should be checked before we continue booting. Refuse to continue if there is something wrong. Signed-off-by: Simon Glass --- Changes in v3: None Changes in v2: None arch/x86/cpu/ivybridge/cpu.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/x86/cpu/ivybridge/cpu.c b/arch/x86/cpu/ivybridge/cpu.c index ab708dd..6a242d7 100644 --- a/arch/x86/cpu/ivybridge/cpu.c +++ b/arch/x86/cpu/ivybridge/cpu.c @@ -179,10 +179,26 @@ int arch_cpu_init(void) return 0; } +static int report_bist_failure(void) +{ + if (gd->arch.bist != 0) { + printf("BIST failed: %08x\n", gd->arch.bist); + return -EFAULT; + } + + return 0; +} + int print_cpuinfo(void) { char processor_name[CPU_MAX_NAME_LEN]; const char *name; + int ret; + + /* Halt if there was a built in self test failure */ + ret = report_bist_failure(); + if (ret) + return ret; /* Print processor name */ name = cpu_get_name(processor_name); -- 2.1.0.rc2.206.gedb03e5