lkml.org 
[lkml]   [2020]   [Nov]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/3] EDAC/sifive: Add support for SiFive BEU in SiFive platform EDAC
Date
Register for ECC error events from SiFive BEU in SiFive platform EDAC
driver.

Signed-off-by: Yash Shah <yash.shah@sifive.com>
---
drivers/edac/Kconfig | 2 +-
drivers/edac/sifive_edac.c | 13 +++++++++++--
2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig
index 7a47680..8f662ff 100644
--- a/drivers/edac/Kconfig
+++ b/drivers/edac/Kconfig
@@ -469,7 +469,7 @@ config EDAC_ALTERA_SDMMC

config EDAC_SIFIVE
bool "Sifive platform EDAC driver"
- depends on EDAC=y && SIFIVE_L2
+ depends on EDAC=y && (SIFIVE_L2 || SIFIVE_BEU)
help
Support for error detection and correction on the SiFive SoCs.

diff --git a/drivers/edac/sifive_edac.c b/drivers/edac/sifive_edac.c
index 3a3dcb1..0f6d457 100644
--- a/drivers/edac/sifive_edac.c
+++ b/drivers/edac/sifive_edac.c
@@ -11,6 +11,7 @@
#include <linux/platform_device.h>
#include "edac_module.h"
#include <soc/sifive/sifive_l2_cache.h>
+#include <soc/sifive/sifive_beu.h>

#define DRVNAME "sifive_edac"

@@ -67,7 +68,11 @@ static int ecc_register(struct platform_device *pdev)
goto err;
}

- register_sifive_l2_error_notifier(&p->notifier);
+ if (IS_ENABLED(CONFIG_SIFIVE_L2))
+ register_sifive_l2_error_notifier(&p->notifier);
+
+ if (IS_ENABLED(CONFIG_SIFIVE_BEU))
+ register_sifive_beu_error_notifier(&p->notifier);

return 0;

@@ -81,7 +86,11 @@ static int ecc_unregister(struct platform_device *pdev)
{
struct sifive_edac_priv *p = platform_get_drvdata(pdev);

- unregister_sifive_l2_error_notifier(&p->notifier);
+ if (IS_ENABLED(CONFIG_SIFIVE_L2))
+ unregister_sifive_l2_error_notifier(&p->notifier);
+ if (IS_ENABLED(CONFIG_SIFIVE_BEU))
+ unregister_sifive_beu_error_notifier(&p->notifier);
+
edac_device_del_device(&pdev->dev);
edac_device_free_ctl_info(p->dci);

--
2.7.4
\
 
 \ /
  Last update: 2020-11-12 13:02    [W:0.329 / U:1.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site