Lines Matching full:cbb

5  * The driver handles Error's from Control Backbone(CBB) generated due to
6 * illegal accesses. When an error is reported from a NOC within CBB,
10 * TMO, SEC, UNS are the codes which are supported by CBB.
25 #include <soc/tegra/tegra-cbb.h>
176 static inline struct tegra194_cbb *to_tegra194_cbb(struct tegra_cbb *cbb) in to_tegra194_cbb() argument
178 return container_of(cbb, struct tegra194_cbb, base); in to_tegra194_cbb()
241 .desc = "Target error detected by CBB slave"
251 .code = "DISC", /* Not Supported by CBB */
259 .code = "HIDE", /* Not Supported by CBB */
274 * CBB NOC aperture lookup table as per file "cbb_central_noc_Structure.info".
315 * Fields of CBB NOC lookup table:
1665 static void tegra194_cbb_fault_enable(struct tegra_cbb *cbb) in tegra194_cbb_fault_enable() argument
1667 struct tegra194_cbb *priv = to_tegra194_cbb(cbb); in tegra194_cbb_fault_enable()
1674 static void tegra194_cbb_stall_enable(struct tegra_cbb *cbb) in tegra194_cbb_stall_enable() argument
1676 struct tegra194_cbb *priv = to_tegra194_cbb(cbb); in tegra194_cbb_stall_enable()
1683 static void tegra194_cbb_error_clear(struct tegra_cbb *cbb) in tegra194_cbb_error_clear() argument
1685 struct tegra194_cbb *priv = to_tegra194_cbb(cbb); in tegra194_cbb_error_clear()
1693 static u32 tegra194_cbb_get_status(struct tegra_cbb *cbb) in tegra194_cbb_get_status() argument
1695 struct tegra194_cbb *priv = to_tegra194_cbb(cbb); in tegra194_cbb_get_status()
1766 static void print_errlog5(struct seq_file *file, struct tegra194_cbb *cbb) in print_errlog5() argument
1770 cbb->noc->parse_userbits(&userbits, cbb->errlog5); in print_errlog5()
1772 if (!strcmp(cbb->noc->name, "cbb-noc")) { in print_errlog5()
1778 cbb->noc->master_id[userbits.mstr_id]); in print_errlog5()
1818 print_errlog1_2(struct seq_file *file, struct tegra194_cbb *cbb, in print_errlog1_2() argument
1821 u64 routeid = (u64)cbb->errlog2 << 32 | cbb->errlog1; in print_errlog1_2()
1826 cbb->noc->parse_routeid(info, routeid); in print_errlog1_2()
1829 cbb->noc->routeid_initflow[info->initflow]); in print_errlog1_2()
1832 cbb->noc->routeid_targflow[info->targflow]); in print_errlog1_2()
1850 static bool print_errlog0(struct seq_file *file, struct tegra194_cbb *cbb) in print_errlog0() argument
1855 hdr.lock = cbb->errlog0 & 0x1; in print_errlog0()
1856 hdr.opc = FIELD_GET(CBB_ERR_OPC, cbb->errlog0); in print_errlog0()
1857 hdr.errcode = FIELD_GET(CBB_ERR_ERRCODE, cbb->errlog0); in print_errlog0()
1858 hdr.len1 = FIELD_GET(CBB_ERR_LEN1, cbb->errlog0); in print_errlog0()
1859 hdr.format = (cbb->errlog0 >> 31); in print_errlog0()
1880 cbb->num_bridges > 0) { in print_errlog0()
1892 for (i = 0; i < cbb->num_bridges; i++) { in print_errlog0()
1893 status = tegra194_axi2apb_status(cbb->bridges[i].base); in print_errlog0()
1917 static bool print_errloggerX_info(struct seq_file *file, struct tegra194_cbb *cbb, in print_errloggerX_info() argument
1926 cbb->errlog0 = readl(cbb->regs + ERRLOGGER_0_ERRLOG0_0); in print_errloggerX_info()
1927 cbb->errlog1 = readl(cbb->regs + ERRLOGGER_0_ERRLOG1_0); in print_errloggerX_info()
1928 cbb->errlog2 = readl(cbb->regs + ERRLOGGER_0_RSVD_00_0); in print_errloggerX_info()
1929 cbb->errlog3 = readl(cbb->regs + ERRLOGGER_0_ERRLOG3_0); in print_errloggerX_info()
1930 cbb->errlog4 = readl(cbb->regs + ERRLOGGER_0_ERRLOG4_0); in print_errloggerX_info()
1931 cbb->errlog5 = readl(cbb->regs + ERRLOGGER_0_ERRLOG5_0); in print_errloggerX_info()
1933 cbb->errlog0 = readl(cbb->regs + ERRLOGGER_1_ERRLOG0_0); in print_errloggerX_info()
1934 cbb->errlog1 = readl(cbb->regs + ERRLOGGER_1_ERRLOG1_0); in print_errloggerX_info()
1935 cbb->errlog2 = readl(cbb->regs + ERRLOGGER_1_RSVD_00_0); in print_errloggerX_info()
1936 cbb->errlog3 = readl(cbb->regs + ERRLOGGER_1_ERRLOG3_0); in print_errloggerX_info()
1937 cbb->errlog4 = readl(cbb->regs + ERRLOGGER_1_ERRLOG4_0); in print_errloggerX_info()
1938 cbb->errlog5 = readl(cbb->regs + ERRLOGGER_1_ERRLOG5_0); in print_errloggerX_info()
1940 cbb->errlog0 = readl(cbb->regs + ERRLOGGER_2_ERRLOG0_0); in print_errloggerX_info()
1941 cbb->errlog1 = readl(cbb->regs + ERRLOGGER_2_ERRLOG1_0); in print_errloggerX_info()
1942 cbb->errlog2 = readl(cbb->regs + ERRLOGGER_2_RSVD_00_0); in print_errloggerX_info()
1943 cbb->errlog3 = readl(cbb->regs + ERRLOGGER_2_ERRLOG3_0); in print_errloggerX_info()
1944 cbb->errlog4 = readl(cbb->regs + ERRLOGGER_2_ERRLOG4_0); in print_errloggerX_info()
1945 cbb->errlog5 = readl(cbb->regs + ERRLOGGER_2_ERRLOG5_0); in print_errloggerX_info()
1948 tegra_cbb_print_err(file, "\tErrLog0\t\t\t: %#x\n", cbb->errlog0); in print_errloggerX_info()
1949 is_fatal = print_errlog0(file, cbb); in print_errloggerX_info()
1951 tegra_cbb_print_err(file, "\tErrLog1\t\t\t: %#x\n", cbb->errlog1); in print_errloggerX_info()
1952 tegra_cbb_print_err(file, "\tErrLog2\t\t\t: %#x\n", cbb->errlog2); in print_errloggerX_info()
1953 print_errlog1_2(file, cbb, &info); in print_errloggerX_info()
1955 tegra_cbb_print_err(file, "\tErrLog3\t\t\t: %#x\n", cbb->errlog3); in print_errloggerX_info()
1956 tegra_cbb_print_err(file, "\tErrLog4\t\t\t: %#x\n", cbb->errlog4); in print_errloggerX_info()
1957 print_errlog3_4(file, cbb->errlog3, cbb->errlog4, &info, cbb->noc->noc_aperture, in print_errloggerX_info()
1958 cbb->noc->max_aperture); in print_errloggerX_info()
1960 tegra_cbb_print_err(file, "\tErrLog5\t\t\t: %#x\n", cbb->errlog5); in print_errloggerX_info()
1962 if (cbb->errlog5) in print_errloggerX_info()
1963 print_errlog5(file, cbb); in print_errloggerX_info()
1968 static bool print_errlog(struct seq_file *file, struct tegra194_cbb *cbb, u32 errvld) in print_errlog() argument
1973 pr_crit("CPU:%d, Error:%s\n", smp_processor_id(), cbb->noc->name); in print_errlog()
1976 is_fatal = print_errloggerX_info(file, cbb, 0); in print_errlog()
1978 is_fatal = print_errloggerX_info(file, cbb, 1); in print_errlog()
1980 is_fatal = print_errloggerX_info(file, cbb, 2); in print_errlog()
1982 tegra_cbb_error_clear(&cbb->base); in print_errlog()
1990 static int tegra194_cbb_debugfs_show(struct tegra_cbb *cbb, struct seq_file *file, void *data) in tegra194_cbb_debugfs_show() argument
2012 * Handler for CBB errors from different initiators
2017 //struct tegra194_cbb *cbb = data; in tegra194_cbb_err_isr()
2024 /* XXX only process interrupts for "cbb" instead of iterating over all NOCs? */ in tegra194_cbb_err_isr()
2056 WARN(true, "Warning due to CBB Error\n"); in tegra194_cbb_err_isr()
2064 * for reporting CBB errors
2066 static int tegra194_cbb_interrupt_enable(struct tegra_cbb *cbb) in tegra194_cbb_interrupt_enable() argument
2068 struct tegra194_cbb *priv = to_tegra194_cbb(cbb); in tegra194_cbb_interrupt_enable()
2069 struct device *dev = cbb->dev; in tegra194_cbb_interrupt_enable()
2094 static void tegra194_cbb_error_enable(struct tegra_cbb *cbb) in tegra194_cbb_error_enable() argument
2100 tegra_cbb_stall_enable(cbb); in tegra194_cbb_error_enable()
2103 tegra_cbb_fault_enable(cbb); in tegra194_cbb_error_enable()
2119 .name = "cbb-noc",
2179 { .compatible = "nvidia,tegra194-cbb-noc", .data = &tegra194_cbb_central_noc_data },
2188 static int tegra194_cbb_get_bridges(struct tegra194_cbb *cbb, struct device_node *np) in tegra194_cbb_get_bridges() argument
2201 cbb->num_bridges = priv->num_bridges; in tegra194_cbb_get_bridges()
2202 cbb->bridges = priv->bridges; in tegra194_cbb_get_bridges()
2209 if (!cbb->bridges) { in tegra194_cbb_get_bridges()
2210 cbb->num_bridges = of_address_count(np); in tegra194_cbb_get_bridges()
2212 cbb->bridges = devm_kcalloc(cbb->base.dev, cbb->num_bridges, in tegra194_cbb_get_bridges()
2213 sizeof(*cbb->bridges), GFP_KERNEL); in tegra194_cbb_get_bridges()
2214 if (!cbb->bridges) in tegra194_cbb_get_bridges()
2217 for (i = 0; i < cbb->num_bridges; i++) { in tegra194_cbb_get_bridges()
2218 err = of_address_to_resource(np, i, &cbb->bridges[i].res); in tegra194_cbb_get_bridges()
2222 cbb->bridges[i].base = devm_ioremap_resource(cbb->base.dev, in tegra194_cbb_get_bridges()
2223 &cbb->bridges[i].res); in tegra194_cbb_get_bridges()
2224 if (IS_ERR(cbb->bridges[i].base)) in tegra194_cbb_get_bridges()
2225 return PTR_ERR(cbb->bridges[i].base); in tegra194_cbb_get_bridges()
2229 if (cbb->num_bridges > 0) { in tegra194_cbb_get_bridges()
2230 dev_dbg(cbb->base.dev, "AXI2APB bridge info present:\n"); in tegra194_cbb_get_bridges()
2232 for (i = 0; i < cbb->num_bridges; i++) in tegra194_cbb_get_bridges()
2233 dev_dbg(cbb->base.dev, " %u: %pR\n", i, &cbb->bridges[i].res); in tegra194_cbb_get_bridges()
2242 struct tegra194_cbb *cbb; in tegra194_cbb_probe() local
2262 cbb = devm_kzalloc(&pdev->dev, sizeof(*cbb), GFP_KERNEL); in tegra194_cbb_probe()
2263 if (!cbb) in tegra194_cbb_probe()
2266 INIT_LIST_HEAD(&cbb->base.node); in tegra194_cbb_probe()
2267 cbb->base.ops = &tegra194_cbb_ops; in tegra194_cbb_probe()
2268 cbb->base.dev = &pdev->dev; in tegra194_cbb_probe()
2269 cbb->noc = noc; in tegra194_cbb_probe()
2271 cbb->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &cbb->res); in tegra194_cbb_probe()
2272 if (IS_ERR(cbb->regs)) in tegra194_cbb_probe()
2273 return PTR_ERR(cbb->regs); in tegra194_cbb_probe()
2275 err = tegra_cbb_get_irq(pdev, &cbb->nonsec_irq, &cbb->sec_irq); in tegra194_cbb_probe()
2281 err = tegra194_cbb_get_bridges(cbb, np); in tegra194_cbb_probe()
2287 platform_set_drvdata(pdev, cbb); in tegra194_cbb_probe()
2290 list_add(&cbb->base.node, &cbb_list); in tegra194_cbb_probe()
2293 return tegra_cbb_register(&cbb->base); in tegra194_cbb_probe()
2298 struct tegra194_cbb *cbb = platform_get_drvdata(pdev); in tegra194_cbb_remove() local
2307 if (cbb->res->start == priv->res->start) { in tegra194_cbb_remove()
2320 struct tegra194_cbb *cbb = dev_get_drvdata(dev); in tegra194_cbb_resume_noirq() local
2322 tegra194_cbb_error_enable(&cbb->base); in tegra194_cbb_resume_noirq()
2325 dev_dbg(dev, "%s resumed\n", cbb->noc->name); in tegra194_cbb_resume_noirq()
2337 .name = "tegra194-cbb",