summaryrefslogtreecommitdiff
path: root/drivers/soc
diff options
context:
space:
mode:
authorTom <support@vamrs.com>2021-02-13 17:25:17 +0300
committerEmil Renner Berthing <kernel@esmil.dk>2021-06-07 02:11:17 +0300
commitcfa6ef69ae308f119c6c5763aa29569622d1ea1c (patch)
tree31a704742088b43d6c2eb2bf92d8aaae095cc8b0 /drivers/soc
parentf1c032d6c0ce86525b4655e22eb0d15db067ec3b (diff)
downloadlinux-cfa6ef69ae308f119c6c5763aa29569622d1ea1c.tar.xz
sifive/sifive_l2_cache: Add disabling IRQ option (workaround)
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/sifive/Kconfig4
-rw-r--r--drivers/soc/sifive/sifive_l2_cache.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/soc/sifive/Kconfig b/drivers/soc/sifive/Kconfig
index 4d0fdab56e81..4cccaad9e943 100644
--- a/drivers/soc/sifive/Kconfig
+++ b/drivers/soc/sifive/Kconfig
@@ -22,4 +22,8 @@ config SIFIVE_L2_FLUSH_SIZE
endif # SIFIVE_L2_FLUSH
+config SIFIVE_L2_IRQ_DISABLE
+ bool "Disable Level 2 Cache Controller interrupts"
+ default y if SOC_STARFIVE_VIC7100
+
endif
diff --git a/drivers/soc/sifive/sifive_l2_cache.c b/drivers/soc/sifive/sifive_l2_cache.c
index 5f2b295fc5ef..be4e141f5a0e 100644
--- a/drivers/soc/sifive/sifive_l2_cache.c
+++ b/drivers/soc/sifive/sifive_l2_cache.c
@@ -40,7 +40,9 @@
#define SIFIVE_L2_FLUSH64_LINE_LEN 64
static void __iomem *l2_base = NULL;
+#if !IS_ENABLED(CONFIG_SIFIVE_L2_IRQ_DISABLE)
static int g_irq[SIFIVE_L2_MAX_ECCINTR];
+#endif
static struct riscv_cacheinfo_ops l2_cache_ops;
enum {
@@ -188,6 +190,7 @@ static const struct attribute_group *l2_get_priv_group(struct cacheinfo *this_le
return NULL;
}
+#if !IS_ENABLED(CONFIG_SIFIVE_L2_IRQ_DISABLE)
static irqreturn_t l2_int_handler(int irq, void *device)
{
unsigned int add_h, add_l;
@@ -231,12 +234,15 @@ static irqreturn_t l2_int_handler(int irq, void *device)
return IRQ_HANDLED;
}
+#endif
static int __init sifive_l2_init(void)
{
struct device_node *np;
struct resource res;
+#if !IS_ENABLED(CONFIG_SIFIVE_L2_IRQ_DISABLE)
int i, rc, intr_num;
+#endif
np = of_find_matching_node(NULL, sifive_l2_ids);
if (!np)
@@ -249,6 +255,7 @@ static int __init sifive_l2_init(void)
if (!l2_base)
return -ENOMEM;
+#if !IS_ENABLED(CONFIG_SIFIVE_L2_IRQ_DISABLE)
intr_num = of_property_count_u32_elems(np, "interrupts");
if (!intr_num) {
pr_err("L2CACHE: no interrupts property\n");
@@ -263,6 +270,7 @@ static int __init sifive_l2_init(void)
return rc;
}
}
+#endif
l2_config_read();