diff options
author | Alex Waterman <alexw@nvidia.com> | 2012-10-11 11:10:02 -0700 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-10-25 11:16:23 -0700 |
commit | 23fc7dd5a06d15bec976df82f8a892648d79d8b9 (patch) | |
tree | 5cd854c31f05a0d7c1f9755f359c8caeaf9802b1 /arch/arm/mach-tegra/mcerr-t11.c | |
parent | db127b14d8318a9257b91cfaeb4c00357a2dbaa8 (diff) |
arm: tegra: Update MC error reporting
The error reporting done by the kernel needed updating from T30
to support new T11x specific features and additions.
BUG 1156719
Change-Id: Iffdedfec54f2a673d97cfe42186b71fe4842c64b
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/143813
(cherry-picked from 18272401c76a80b49c3f1af1ada61209cd944d89)
Reviewed-on: http://git-master/r/145772
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/mcerr-t11.c')
-rw-r--r-- | arch/arm/mach-tegra/mcerr-t11.c | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/mcerr-t11.c b/arch/arm/mach-tegra/mcerr-t11.c new file mode 100644 index 000000000000..dd438de86d01 --- /dev/null +++ b/arch/arm/mach-tegra/mcerr-t11.c @@ -0,0 +1,126 @@ +/* + * arch/arm/mach-tegra/mcerr-t11.c + * + * Tegra 11x SoC-specific mcerr code. + * + * Copyright (c) 2010-2012, NVIDIA Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "mcerr.h" + +#define dummy_client client("dummy/unknown (BUG?)") + +static char unknown_buf[30]; + +struct mc_client mc_clients[] = { + client("ptc"), + client("display0_wina"), client("display1_wina"), + client("display0_winb"), client("display1_winb"), + client("display0_winc"), client("display1_winc"), + dummy_client, dummy_client, + client("epp"), + client("gr2d_pat"), client("gr2d_src"), + dummy_client, dummy_client, + dummy_client, client("avp"), + client("display0_cursor"), client("display1_cursor"), + client("gr3d_fdc0"), client("gr3d_fdc1"), + client("gr2d_dst"), + client("hda"), + client("host1x_dma"), client("host1x_generic"), + client("gr3d0_idx"), dummy_client, + dummy_client, dummy_client, + client("msenc"), + client("ahb_dma"), client("ahb_slave"), + dummy_client, client("gr3d0_tex"), + dummy_client, + client("vde_bsev"), client("vde_mbe"), + client("vde_mce"), client("vde_tpe"), + client("cpu_lp"), client("cpu"), + client("epp_u"), + client("epp_v"), + client("epp_y"), + client("msenc"), + client("vi_sb"), client("vi_u"), + client("vi_v"), client("vi_y"), + client("gr2d_dst"), + dummy_client, + client("avp"), + client("gr3d_fdc0"), client("gr3d_fdc1"), + client("hda"), + client("host1x"), + client("isp"), + client("cpu_lp"), client("cpu"), + dummy_client, + client("ahb_dma"), client("ahb_slave"), + dummy_client, + client("vde_bsev"), client("vde_dbg"), + client("vde_mbe"), client("vde_tpm"), + dummy_client, dummy_client, + dummy_client, dummy_client, + dummy_client, dummy_client, + dummy_client, dummy_client, + client("xusb_host"), client("xusb_host"), + client("xusb_dev"), client("xusb_dev"), + client("gr3d_fdc2"), client("gr3d_fdc2"), + client("gr3d_fdc3"), client("gr3d_fdc3"), + client("emucif"), client("emucif"), + client("tsec"), client("tsec"), +}; + +static const char *mcerr_t11x_info(u32 stat) +{ + if (stat & MC_INT_DECERR_EMEM) + return "MC_DECERR"; + else if (stat & MC_INT_SECURITY_VIOLATION) + return "MC_SECURITY_ERR"; + else if (stat & MC_INT_INVALID_SMMU_PAGE) + return "MC_SMMU_ERR"; + else if (stat & MC_INT_DECERR_VPR) + return "MC_DECERR_VPR"; + else if (stat & MC_INT_SECERR_SEC) + return "MC_DECERR_SEC"; + + /* Otherwise we have an unknown type... */ + snprintf(unknown_buf, 30, "unknown - 0x%02x", stat); + return unknown_buf; +} + +/* + * T11x reports addresses in a 32 byte range thus we can only give an + * approximate location for the invalid memory request, not the exact address. + */ +static void mcerr_t11x_print(const char *mc_type, u32 err, u32 addr, + const struct mc_client *client, int is_secure, + int is_write, const char *mc_err_info) +{ + pr_err("%s (0x%08X): [0x%p -> 0x%p] %s (%s %s %s)\n", mc_type, + err, (void *)(addr & ~0x1f), (void *)(addr | 0x1f), + (client) ? client->name : "unknown", + (is_secure) ? "secure" : "non-secure", + (is_write) ? "write" : "read", + mc_err_info); +} + +/* + * Specify special functions for dealing with the T11x mcerr handling. + */ +void mcerr_chip_specific_setup(struct mcerr_chip_specific *spec) +{ + spec->mcerr_info = mcerr_t11x_info; + spec->mcerr_print = mcerr_t11x_print; + return; +} |