From 524bd09097d3d04ccfb3e1281a3105782bcf0d66 Mon Sep 17 00:00:00 2001 From: Varun Wadekar Date: Mon, 18 Jul 2016 17:42:02 -0700 Subject: [PATCH] Tegra186: mce: read MCE's firmware version on "real" platforms This patch runs the MCE firmware's version check only if the underlying platform has the capability to the run the firmware. MCE firmware is not running on simulation platforms, identified by v0.3 or v0.6, read from the Tegra Chip ID value. Change-Id: I3b1788b1ee2a0d4464017bb879ac5792cb7022b8 Signed-off-by: Varun Wadekar --- plat/nvidia/tegra/soc/t186/drivers/mce/mce.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/plat/nvidia/tegra/soc/t186/drivers/mce/mce.c b/plat/nvidia/tegra/soc/t186/drivers/mce/mce.c index 981545d3..f87dfa4d 100644 --- a/plat/nvidia/tegra/soc/t186/drivers/mce/mce.c +++ b/plat/nvidia/tegra/soc/t186/drivers/mce/mce.c @@ -42,6 +42,7 @@ #include #include #include +#include /* NVG functions handlers */ static arch_mce_ops_t nvg_mce_ops = { @@ -482,7 +483,13 @@ void mce_verify_firmware_version(void) arch_mce_ops_t *ops; uint32_t cpu_ari_base; uint64_t version; - uint32_t major, minor, chip_minor, chip_major; + uint32_t major, minor; + + /* + * MCE firmware is not running on simulation platforms. + */ + if (tegra_platform_is_emulation()) + return; /* get a pointer to the CPU's arch_mce_ops_t struct */ ops = mce_get_curr_cpu_ops(); @@ -501,17 +508,6 @@ void mce_verify_firmware_version(void) INFO("MCE Version - HW=%d:%d, SW=%d:%d\n", major, minor, TEGRA_ARI_VERSION_MAJOR, TEGRA_ARI_VERSION_MINOR); - /* - * MCE firmware is not running on simulation platforms. Simulation - * platforms are identified by v0.3 from the Tegra Chip ID value. - */ - chip_major = (mmio_read_32(TEGRA_MISC_BASE + HARDWARE_REVISION_OFFSET) >> - MAJOR_VERSION_SHIFT) & MAJOR_VERSION_MASK; - chip_minor = (mmio_read_32(TEGRA_MISC_BASE + HARDWARE_REVISION_OFFSET) >> - MINOR_VERSION_SHIFT) & MINOR_VERSION_MASK; - if ((chip_major == 0) && (chip_minor == 3)) - return; - /* * Verify that the MCE firmware version and the interface header * match -- 2.30.2