20 #include <linux/kernel.h>
21 #include <linux/module.h>
27 #define DRV_NAME "tegra20-mc"
29 #define MC_INTSTATUS 0x0
30 #define MC_INTMASK 0x4
32 #define MC_INT_ERR_SHIFT 6
33 #define MC_INT_ERR_MASK (0x1f << MC_INT_ERR_SHIFT)
34 #define MC_INT_DECERR_EMEM BIT(MC_INT_ERR_SHIFT)
35 #define MC_INT_INVALID_GART_PAGE BIT(MC_INT_ERR_SHIFT + 1)
36 #define MC_INT_SECURITY_VIOLATION BIT(MC_INT_ERR_SHIFT + 2)
37 #define MC_INT_ARBITRATION_EMEM BIT(MC_INT_ERR_SHIFT + 3)
39 #define MC_GART_ERROR_REQ 0x30
40 #define MC_DECERR_EMEM_OTHERS_STATUS 0x58
41 #define MC_SECURITY_VIOLATION_STATUS 0x74
43 #define SECURITY_VIOLATION_TYPE BIT(30)
45 #define MC_CLIENT_ID_MASK 0x3f
47 #define NUM_MC_REG_BANKS 2
60 else if (offs < 0x400)
70 else if (offs < 0x400)
74 static const char *
const tegra20_mc_client[] = {
129 static void tegra20_mc_decode(
struct tegra20_mc *mc,
int n)
132 const char *
client =
"Unknown";
143 .message =
"MC_DECERR",
148 .message =
"MC_GART_ERR",
154 .message =
"MC_SECURITY_ERR",
168 client = tegra20_mc_client[cid];
173 reg[idx].message, req, addr, client,
174 (req &
BIT(
reg[idx].write_bit)) ?
"write" :
"read",
177 "carveout" :
"trustzone") :
"");
181 { .compatible =
"nvidia,tegra20-mc", },
195 while ((bit =
ffs(mask)) != 0)
196 tegra20_mc_decode(mc, bit - 1);
227 err = devm_request_irq(&pdev->
dev, irq->
start, tegra20_mc_isr,
232 platform_set_drvdata(pdev, mc);
241 .probe = tegra20_mc_probe,
245 .of_match_table = tegra20_mc_of_match,