ARM: tegra12: set CPU rate to 2.2GHz for sku 0x87
[linux-3.10.git] / arch / arm / mach-tegra / mcerr-t14.c
index 34d1eb9..3802501 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Tegra 14x SoC-specific mcerr code.
  *
- * Copyright (c) 2012, NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2012-2013, 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
  * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 
-#include "mcerr.h"
+#include <mach/mcerr.h>
 
-#define dummy_client   client("dummy")
+/*** Auto generated by `mcp.pl'. Do not modify! ***/
 
-static char unknown_buf[30];
+#define dummy_client   client("dummy", "dummy")
 
 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"), /* 10 */    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"), /* 20 */
-       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"), /* 30 */
-       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"), /* 40 */
-       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"), /* 50 */
-       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"), /* 60 */
-       dummy_client,
-       client("vde_bsev"),             client("vde_dbg"),
-       client("vde_mbe"),              client("vde_tpm"),
-       dummy_client,                   dummy_client,
-       client("ve_ispra"),             dummy_client,
-       client("ve_ispwa"), /* 70 */    client("ve_ispwb"),
-       dummy_client,                   dummy_client,
-       dummy_client,                   dummy_client,
-       dummy_client,                   dummy_client,
-       dummy_client,                   dummy_client,
-       dummy_client, /* 80 */          dummy_client,
-       client("emucif"),               client("emucif"),
-       client("tsec"),                 client("tsec"),
-       client("viw"),                  client("bbcr"),
-       client("bbcw"),                 client("bbcllr"),
-       client("disp_t"), /* 90 */      client("disp_d"),
+       client("ptc", "csr_ptcr"),
+       client("dc", "csr_display0a"),
+       client("dcb", "cbr_display0ab"),
+       client("dc", "csr_display0b"),
+       client("dcb", "csr_display0bb"),
+       client("dc", "csr_display0c"),
+       client("dcb", "cbr_display0cb"),
+       dummy_client,
+       dummy_client,
+       client("epp", "cbr_eppup"),
+       client("g2", "cbr_g2pr"),
+       client("g2", "cbr_g2sr"),
+       dummy_client,
+       dummy_client,
+       dummy_client,
+       client("avpc", "csr_avpcarm7r"),
+       client("dc", "csr_displayhc"),
+       client("dcb", "csr_displayhcb"),
+       client("nv", "csr_fdcdrd"),
+       client("nv", "csr_fdcdrd2"),
+       client("g2", "csr_g2dr"),
+       client("hda", "csr_hdar"),
+       client("hc", "csr_host1xdmar"),
+       client("hc", "csr_host1xr"),
+       client("nv", "csr_idxsrd"),
+       dummy_client,
+       dummy_client,
+       dummy_client,
+       client("msenc", "csr_msencsrd"),
+       client("ppcs", "csr_ppcsahbdmar"),
+       client("ppcs", "csr_ppcsahbslvr"),
+       dummy_client,
+       client("nv", "csr_texl2srd"),
+       dummy_client,
+       client("vde", "csr_vdebsevr"),
+       client("vde", "csr_vdember"),
+       client("vde", "csr_vdemcer"),
+       client("vde", "csr_vdetper"),
+       client("mpcorelp", "csr_mpcorelpr"),
+       client("mpcore", "csr_mpcorer"),
+       client("epp", "cbw_eppu"),
+       client("epp", "cbw_eppv"),
+       client("epp", "cbw_eppy"),
+       client("msenc", "csw_msencswr"),
+       client("vi", "cbw_viwsb"),
+       client("vi", "cbw_viwu"),
+       client("vi", "cbw_viwv"),
+       client("vi", "cbw_viwy"),
+       client("g2", "ccw_g2dw"),
+       dummy_client,
+       client("avpc", "csw_avpcarm7w"),
+       client("nv", "csw_fdcdwr"),
+       client("nv", "csw_fdcdwr2"),
+       client("hda", "csw_hdaw"),
+       client("hc", "csw_host1xw"),
+       client("isp", "csw_ispw"),
+       client("mpcorelp", "csw_mpcorelpw"),
+       client("mpcore", "csw_mpcorew"),
+       dummy_client,
+       client("ppcs", "csw_ppcsahbdmaw"),
+       client("ppcs", "csw_ppcsahbslvw"),
+       dummy_client,
+       client("vde", "csw_vdebsevw"),
+       client("vde", "csw_vdedbgw"),
+       client("vde", "csw_vdembew"),
+       client("vde", "csw_vdetpmw"),
+       dummy_client,
+       dummy_client,
+       client("isp", "csr_ispra"),
+       dummy_client,
+       client("isp", "csw_ispwa"),
+       client("isp", "csw_ispwb"),
+       dummy_client,
+       dummy_client,
+       dummy_client,
+       dummy_client,
+       dummy_client,
+       dummy_client,
+       dummy_client,
+       dummy_client,
+       dummy_client,
+       dummy_client,
+       client("emucif", "csr_emucifr"),
+       client("emucif", "csw_emucifw"),
+       client("tsec", "csr_tsecsrd"),
+       client("tsec", "csw_tsecswr"),
+       client("vi", "csw_viw"),
+       client("bbmci", "csr_bbcr"),
+       client("bbmci", "csw_bbcw"),
+       client("bbmcill", "csr_bbcllr"),
+       client("dc", "csr_displayt"),
+       dummy_client,
+       client("dc", "csr_displayd"),
 };
-
 int mc_client_last = ARRAY_SIZE(mc_clients) - 1;
-
-static const char *mcerr_t14x_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_SECERR_SEC";
-       else if (stat & MC_INT_BBC_PRIVATE_MEM_VIOLATION)
-               return "MC_BBC_PRIVATE_MEM_VIOLATION";
-       else if (stat & MC_INT_DECERR_BBC)
-               return "MC_DECERR_BBC";
-
-       /* Otherwise we have an unknown type... */
-       snprintf(unknown_buf, 30, "unknown - 0x%04x", stat);
-       return unknown_buf;
-}
+/*** Done. ***/
 
 static void mcerr_t14x_info_update(struct mc_client *c, u32 stat)
 {
        if (stat & MC_INT_DECERR_EMEM)
                c->intr_counts[0]++;
-       else if (stat & MC_INT_SECURITY_VIOLATION)
+       if (stat & MC_INT_SECURITY_VIOLATION)
                c->intr_counts[1]++;
-       else if (stat & MC_INT_INVALID_SMMU_PAGE)
+       if (stat & MC_INT_INVALID_SMMU_PAGE)
                c->intr_counts[2]++;
-       else if (stat & MC_INT_DECERR_VPR)
+       if (stat & MC_INT_DECERR_VPR)
                c->intr_counts[3]++;
-       else if (stat & MC_INT_SECERR_SEC)
+       if (stat & MC_INT_SECERR_SEC)
                c->intr_counts[4]++;
-       else if (stat & MC_INT_BBC_PRIVATE_MEM_VIOLATION)
+       if (stat & MC_INT_BBC_PRIVATE_MEM_VIOLATION)
                c->intr_counts[5]++;
-       else if (stat & MC_INT_DECERR_BBC)
+       if (stat & MC_INT_DECERR_BBC)
                c->intr_counts[6]++;
-       else
+
+       if (stat & ~MC_INT_EN_MASK)
                c->intr_counts[7]++;
 }
 
+#define fmt_hdr "%-18s %-18s %-9s %-9s %-9s %-10s %-10s %-9s %-9s %-9s\n"
+#define fmt_cli "%-18s %-18s %-9u %-9u %-9u %-10u %-10u %-9u %-9u %-9u\n";
 static int mcerr_t14x_debugfs_show(struct seq_file *s, void *v)
 {
        int i, j;
        int do_print;
-       const char *fmt = "%-18s %-9u %-9u %-9u %-10u %-10u %-9u %-9u %-9u\n";
 
-       seq_printf(s, "%-18s %-9s %-9s %-9s %-10s %-10s %-9s %-9s %-9s\n",
-                  "client", "decerr", "secerr", "smmuerr",
+       seq_printf(s, fmt_hdr,
+                  "swgid", "client", "decerr", "secerr", "smmuerr",
                   "decerr-VPR", "secerr-SEC", "priv-bbc", "decerr-bbc",
                   "unknown");
        for (i = 0; i < ARRAY_SIZE(mc_clients); i++) {
@@ -150,7 +168,8 @@ static int mcerr_t14x_debugfs_show(struct seq_file *s, void *v)
                        }
                }
                if (do_print)
-                       seq_printf(s, fmt,
+                       seq_printf(s, fmt_cli,
+                                  mc_clients[i].swgid,
                                   mc_clients[i].name,
                                   mc_clients[i].intr_counts[0],
                                   mc_clients[i].intr_counts[1],
@@ -170,7 +189,6 @@ static int mcerr_t14x_debugfs_show(struct seq_file *s, void *v)
  */
 void mcerr_chip_specific_setup(struct mcerr_chip_specific *spec)
 {
-       spec->mcerr_info = mcerr_t14x_info;
        spec->mcerr_info_update = mcerr_t14x_info_update;
        spec->mcerr_debugfs_show = mcerr_t14x_debugfs_show;
        spec->nr_clients = ARRAY_SIZE(mc_clients);