]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
memory: tegra: Apply interrupts mask per SoC
authorDmitry Osipenko <digetx@gmail.com>
Mon, 9 Apr 2018 19:28:29 +0000 (22:28 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 1 Mar 2019 13:20:49 +0000 (14:20 +0100)
BugLink: http://bugs.launchpad.net/bugs/1815234
[ Upstream commit 1c74d5c0de0c2cc29fef97a19251da2ad6f579bd ]

Currently we are enabling handling of interrupts specific to Tegra124+
which happen to overlap with previous generations. Let's specify
interrupts mask per SoC generation for consistency and in a preparation
of squashing of Tegra20 driver into the common one that will enable
handling of GART faults which may be undesirable by newer generations.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/memory/tegra/mc.c
drivers/memory/tegra/mc.h
drivers/memory/tegra/tegra114.c
drivers/memory/tegra/tegra124.c
drivers/memory/tegra/tegra210.c
drivers/memory/tegra/tegra30.c
include/soc/tegra/mc.h

index d2005b99582193879c0722a6cd3d47cbc7ed5c53..1d49a8dd4a374df623a7bfdddda4874ddeaf47ee 100644 (file)
 #include "mc.h"
 
 #define MC_INTSTATUS 0x000
-#define  MC_INT_DECERR_MTS (1 << 16)
-#define  MC_INT_SECERR_SEC (1 << 13)
-#define  MC_INT_DECERR_VPR (1 << 12)
-#define  MC_INT_INVALID_APB_ASID_UPDATE (1 << 11)
-#define  MC_INT_INVALID_SMMU_PAGE (1 << 10)
-#define  MC_INT_ARBITRATION_EMEM (1 << 9)
-#define  MC_INT_SECURITY_VIOLATION (1 << 8)
-#define  MC_INT_DECERR_EMEM (1 << 6)
 
 #define MC_INTMASK 0x004
 
@@ -248,13 +240,11 @@ static const char *const error_names[8] = {
 static irqreturn_t tegra_mc_irq(int irq, void *data)
 {
        struct tegra_mc *mc = data;
-       unsigned long status, mask;
+       unsigned long status;
        unsigned int bit;
 
        /* mask all interrupts to avoid flooding */
-       mask = mc_readl(mc, MC_INTMASK);
-       status = mc_readl(mc, MC_INTSTATUS) & mask;
-
+       status = mc_readl(mc, MC_INTSTATUS) & mc->soc->intmask;
        if (!status)
                return IRQ_NONE;
 
@@ -349,7 +339,6 @@ static int tegra_mc_probe(struct platform_device *pdev)
        const struct of_device_id *match;
        struct resource *res;
        struct tegra_mc *mc;
-       u32 value;
        int err;
 
        match = of_match_node(tegra_mc_of_match, pdev->dev.of_node);
@@ -417,11 +406,7 @@ static int tegra_mc_probe(struct platform_device *pdev)
 
        WARN(!mc->soc->client_id_mask, "Missing client ID mask for this SoC\n");
 
-       value = MC_INT_DECERR_MTS | MC_INT_SECERR_SEC | MC_INT_DECERR_VPR |
-               MC_INT_INVALID_APB_ASID_UPDATE | MC_INT_INVALID_SMMU_PAGE |
-               MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM;
-
-       mc_writel(mc, value, MC_INTMASK);
+       mc_writel(mc, mc->soc->intmask, MC_INTMASK);
 
        return 0;
 }
index ddb16676c3af4d99b59e62b84d77d0bdb30b5158..24e020b4609be7c571c0be7616491f46cb945994 100644 (file)
 
 #include <soc/tegra/mc.h>
 
+#define MC_INT_DECERR_MTS (1 << 16)
+#define MC_INT_SECERR_SEC (1 << 13)
+#define MC_INT_DECERR_VPR (1 << 12)
+#define MC_INT_INVALID_APB_ASID_UPDATE (1 << 11)
+#define MC_INT_INVALID_SMMU_PAGE (1 << 10)
+#define MC_INT_ARBITRATION_EMEM (1 << 9)
+#define MC_INT_SECURITY_VIOLATION (1 << 8)
+#define MC_INT_DECERR_EMEM (1 << 6)
+
 static inline u32 mc_readl(struct tegra_mc *mc, unsigned long offset)
 {
        return readl(mc->regs + offset);
index ba8fff3d66a655d0875a50f4abb7ea863ea0099c..6d2a5a849d928b1d25ee712ddf1e1535fb203ed7 100644 (file)
@@ -930,4 +930,6 @@ const struct tegra_mc_soc tegra114_mc_soc = {
        .atom_size = 32,
        .client_id_mask = 0x7f,
        .smmu = &tegra114_smmu_soc,
+       .intmask = MC_INT_INVALID_SMMU_PAGE | MC_INT_SECURITY_VIOLATION |
+                  MC_INT_DECERR_EMEM,
 };
index 5a58e440f4a7bd58ec87cd2cbaa4b60993b74667..9f68a56f2727b9d045d5b7ac6076df7e9bf932ad 100644 (file)
@@ -1020,6 +1020,9 @@ const struct tegra_mc_soc tegra124_mc_soc = {
        .smmu = &tegra124_smmu_soc,
        .emem_regs = tegra124_mc_emem_regs,
        .num_emem_regs = ARRAY_SIZE(tegra124_mc_emem_regs),
+       .intmask = MC_INT_DECERR_MTS | MC_INT_SECERR_SEC | MC_INT_DECERR_VPR |
+                  MC_INT_INVALID_APB_ASID_UPDATE | MC_INT_INVALID_SMMU_PAGE |
+                  MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM,
 };
 #endif /* CONFIG_ARCH_TEGRA_124_SOC */
 
@@ -1042,5 +1045,8 @@ const struct tegra_mc_soc tegra132_mc_soc = {
        .atom_size = 32,
        .client_id_mask = 0x7f,
        .smmu = &tegra132_smmu_soc,
+       .intmask = MC_INT_DECERR_MTS | MC_INT_SECERR_SEC | MC_INT_DECERR_VPR |
+                  MC_INT_INVALID_APB_ASID_UPDATE | MC_INT_INVALID_SMMU_PAGE |
+                  MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM,
 };
 #endif /* CONFIG_ARCH_TEGRA_132_SOC */
index 5e144abe4c181eea8fb330ec9f68acb9735fe46f..47c78a6d8f00926d51d5724432a172938f36a2a9 100644 (file)
@@ -1077,4 +1077,7 @@ const struct tegra_mc_soc tegra210_mc_soc = {
        .atom_size = 64,
        .client_id_mask = 0xff,
        .smmu = &tegra210_smmu_soc,
+       .intmask = MC_INT_DECERR_MTS | MC_INT_SECERR_SEC | MC_INT_DECERR_VPR |
+                  MC_INT_INVALID_APB_ASID_UPDATE | MC_INT_INVALID_SMMU_PAGE |
+                  MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM,
 };
index b44737840e70c188344c3d51e5edc08ffb02b256..d0689428ea1a5b932e8b071508ec4de43d3f3b39 100644 (file)
@@ -952,4 +952,6 @@ const struct tegra_mc_soc tegra30_mc_soc = {
        .atom_size = 16,
        .client_id_mask = 0x7f,
        .smmu = &tegra30_smmu_soc,
+       .intmask = MC_INT_INVALID_SMMU_PAGE | MC_INT_SECURITY_VIOLATION |
+                  MC_INT_DECERR_EMEM,
 };
index 44202ff897fd93a75e7bc7029d9733ffff2b20ec..f759e0918037baa4286328281cc9efcd416be61d 100644 (file)
@@ -99,6 +99,8 @@ struct tegra_mc_soc {
        u8 client_id_mask;
 
        const struct tegra_smmu_soc *smmu;
+
+       u32 intmask;
 };
 
 struct tegra_mc {