Lines Matching refs:cbb
179 static inline struct tegra194_cbb *to_tegra194_cbb(struct tegra_cbb *cbb) in to_tegra194_cbb() argument
181 return container_of(cbb, struct tegra194_cbb, base); in to_tegra194_cbb()
1668 static void tegra194_cbb_fault_enable(struct tegra_cbb *cbb) in tegra194_cbb_fault_enable() argument
1670 struct tegra194_cbb *priv = to_tegra194_cbb(cbb); in tegra194_cbb_fault_enable()
1677 static void tegra194_cbb_stall_enable(struct tegra_cbb *cbb) in tegra194_cbb_stall_enable() argument
1679 struct tegra194_cbb *priv = to_tegra194_cbb(cbb); in tegra194_cbb_stall_enable()
1686 static void tegra194_cbb_error_clear(struct tegra_cbb *cbb) in tegra194_cbb_error_clear() argument
1688 struct tegra194_cbb *priv = to_tegra194_cbb(cbb); in tegra194_cbb_error_clear()
1696 static u32 tegra194_cbb_get_status(struct tegra_cbb *cbb) in tegra194_cbb_get_status() argument
1698 struct tegra194_cbb *priv = to_tegra194_cbb(cbb); in tegra194_cbb_get_status()
1769 static void print_errlog5(struct seq_file *file, struct tegra194_cbb *cbb) in print_errlog5() argument
1773 cbb->noc->parse_userbits(&userbits, cbb->errlog5); in print_errlog5()
1775 if (!strcmp(cbb->noc->name, "cbb-noc")) { in print_errlog5()
1781 cbb->noc->master_id[userbits.mstr_id]); in print_errlog5()
1821 print_errlog1_2(struct seq_file *file, struct tegra194_cbb *cbb, in print_errlog1_2() argument
1824 u64 routeid = (u64)cbb->errlog2 << 32 | cbb->errlog1; in print_errlog1_2()
1829 cbb->noc->parse_routeid(info, routeid); in print_errlog1_2()
1832 cbb->noc->routeid_initflow[info->initflow]); in print_errlog1_2()
1835 cbb->noc->routeid_targflow[info->targflow]); in print_errlog1_2()
1853 static bool print_errlog0(struct seq_file *file, struct tegra194_cbb *cbb) in print_errlog0() argument
1858 hdr.lock = cbb->errlog0 & 0x1; in print_errlog0()
1859 hdr.opc = FIELD_GET(CBB_ERR_OPC, cbb->errlog0); in print_errlog0()
1860 hdr.errcode = FIELD_GET(CBB_ERR_ERRCODE, cbb->errlog0); in print_errlog0()
1861 hdr.len1 = FIELD_GET(CBB_ERR_LEN1, cbb->errlog0); in print_errlog0()
1862 hdr.format = (cbb->errlog0 >> 31); in print_errlog0()
1883 cbb->num_bridges > 0) { in print_errlog0()
1895 for (i = 0; i < cbb->num_bridges; i++) { in print_errlog0()
1896 status = tegra194_axi2apb_status(cbb->bridges[i].base); in print_errlog0()
1920 static bool print_errloggerX_info(struct seq_file *file, struct tegra194_cbb *cbb, in print_errloggerX_info() argument
1929 cbb->errlog0 = readl(cbb->regs + ERRLOGGER_0_ERRLOG0_0); in print_errloggerX_info()
1930 cbb->errlog1 = readl(cbb->regs + ERRLOGGER_0_ERRLOG1_0); in print_errloggerX_info()
1931 cbb->errlog2 = readl(cbb->regs + ERRLOGGER_0_RSVD_00_0); in print_errloggerX_info()
1932 cbb->errlog3 = readl(cbb->regs + ERRLOGGER_0_ERRLOG3_0); in print_errloggerX_info()
1933 cbb->errlog4 = readl(cbb->regs + ERRLOGGER_0_ERRLOG4_0); in print_errloggerX_info()
1934 cbb->errlog5 = readl(cbb->regs + ERRLOGGER_0_ERRLOG5_0); in print_errloggerX_info()
1936 cbb->errlog0 = readl(cbb->regs + ERRLOGGER_1_ERRLOG0_0); in print_errloggerX_info()
1937 cbb->errlog1 = readl(cbb->regs + ERRLOGGER_1_ERRLOG1_0); in print_errloggerX_info()
1938 cbb->errlog2 = readl(cbb->regs + ERRLOGGER_1_RSVD_00_0); in print_errloggerX_info()
1939 cbb->errlog3 = readl(cbb->regs + ERRLOGGER_1_ERRLOG3_0); in print_errloggerX_info()
1940 cbb->errlog4 = readl(cbb->regs + ERRLOGGER_1_ERRLOG4_0); in print_errloggerX_info()
1941 cbb->errlog5 = readl(cbb->regs + ERRLOGGER_1_ERRLOG5_0); in print_errloggerX_info()
1943 cbb->errlog0 = readl(cbb->regs + ERRLOGGER_2_ERRLOG0_0); in print_errloggerX_info()
1944 cbb->errlog1 = readl(cbb->regs + ERRLOGGER_2_ERRLOG1_0); in print_errloggerX_info()
1945 cbb->errlog2 = readl(cbb->regs + ERRLOGGER_2_RSVD_00_0); in print_errloggerX_info()
1946 cbb->errlog3 = readl(cbb->regs + ERRLOGGER_2_ERRLOG3_0); in print_errloggerX_info()
1947 cbb->errlog4 = readl(cbb->regs + ERRLOGGER_2_ERRLOG4_0); in print_errloggerX_info()
1948 cbb->errlog5 = readl(cbb->regs + ERRLOGGER_2_ERRLOG5_0); in print_errloggerX_info()
1951 tegra_cbb_print_err(file, "\tErrLog0\t\t\t: %#x\n", cbb->errlog0); in print_errloggerX_info()
1952 is_fatal = print_errlog0(file, cbb); in print_errloggerX_info()
1954 tegra_cbb_print_err(file, "\tErrLog1\t\t\t: %#x\n", cbb->errlog1); in print_errloggerX_info()
1955 tegra_cbb_print_err(file, "\tErrLog2\t\t\t: %#x\n", cbb->errlog2); in print_errloggerX_info()
1956 print_errlog1_2(file, cbb, &info); in print_errloggerX_info()
1958 tegra_cbb_print_err(file, "\tErrLog3\t\t\t: %#x\n", cbb->errlog3); in print_errloggerX_info()
1959 tegra_cbb_print_err(file, "\tErrLog4\t\t\t: %#x\n", cbb->errlog4); in print_errloggerX_info()
1960 print_errlog3_4(file, cbb->errlog3, cbb->errlog4, &info, cbb->noc->noc_aperture, in print_errloggerX_info()
1961 cbb->noc->max_aperture); in print_errloggerX_info()
1963 tegra_cbb_print_err(file, "\tErrLog5\t\t\t: %#x\n", cbb->errlog5); in print_errloggerX_info()
1965 if (cbb->errlog5) in print_errloggerX_info()
1966 print_errlog5(file, cbb); in print_errloggerX_info()
1971 static bool print_errlog(struct seq_file *file, struct tegra194_cbb *cbb, u32 errvld) in print_errlog() argument
1976 pr_crit("CPU:%d, Error:%s\n", smp_processor_id(), cbb->noc->name); in print_errlog()
1979 is_fatal = print_errloggerX_info(file, cbb, 0); in print_errlog()
1981 is_fatal = print_errloggerX_info(file, cbb, 1); in print_errlog()
1983 is_fatal = print_errloggerX_info(file, cbb, 2); in print_errlog()
1985 tegra_cbb_error_clear(&cbb->base); in print_errlog()
1993 static int tegra194_cbb_debugfs_show(struct tegra_cbb *cbb, struct seq_file *file, void *data) in tegra194_cbb_debugfs_show() argument
2069 static int tegra194_cbb_interrupt_enable(struct tegra_cbb *cbb) in tegra194_cbb_interrupt_enable() argument
2071 struct tegra194_cbb *priv = to_tegra194_cbb(cbb); in tegra194_cbb_interrupt_enable()
2072 struct device *dev = cbb->dev; in tegra194_cbb_interrupt_enable()
2097 static void tegra194_cbb_error_enable(struct tegra_cbb *cbb) in tegra194_cbb_error_enable() argument
2103 tegra_cbb_stall_enable(cbb); in tegra194_cbb_error_enable()
2106 tegra_cbb_fault_enable(cbb); in tegra194_cbb_error_enable()
2191 static int tegra194_cbb_get_bridges(struct tegra194_cbb *cbb, struct device_node *np) in tegra194_cbb_get_bridges() argument
2205 cbb->num_bridges = priv->num_bridges; in tegra194_cbb_get_bridges()
2206 cbb->bridges = priv->bridges; in tegra194_cbb_get_bridges()
2213 if (!cbb->bridges) { in tegra194_cbb_get_bridges()
2214 while (of_address_to_resource(np, cbb->num_bridges, &res) == 0) in tegra194_cbb_get_bridges()
2215 cbb->num_bridges++; in tegra194_cbb_get_bridges()
2217 cbb->bridges = devm_kcalloc(cbb->base.dev, cbb->num_bridges, in tegra194_cbb_get_bridges()
2218 sizeof(*cbb->bridges), GFP_KERNEL); in tegra194_cbb_get_bridges()
2219 if (!cbb->bridges) in tegra194_cbb_get_bridges()
2222 for (i = 0; i < cbb->num_bridges; i++) { in tegra194_cbb_get_bridges()
2223 err = of_address_to_resource(np, i, &cbb->bridges[i].res); in tegra194_cbb_get_bridges()
2227 cbb->bridges[i].base = devm_ioremap_resource(cbb->base.dev, in tegra194_cbb_get_bridges()
2228 &cbb->bridges[i].res); in tegra194_cbb_get_bridges()
2229 if (IS_ERR(cbb->bridges[i].base)) { in tegra194_cbb_get_bridges()
2230 dev_err(cbb->base.dev, "failed to map AXI2APB range\n"); in tegra194_cbb_get_bridges()
2231 return PTR_ERR(cbb->bridges[i].base); in tegra194_cbb_get_bridges()
2236 if (cbb->num_bridges > 0) { in tegra194_cbb_get_bridges()
2237 dev_dbg(cbb->base.dev, "AXI2APB bridge info present:\n"); in tegra194_cbb_get_bridges()
2239 for (i = 0; i < cbb->num_bridges; i++) in tegra194_cbb_get_bridges()
2240 dev_dbg(cbb->base.dev, " %u: %pR\n", i, &cbb->bridges[i].res); in tegra194_cbb_get_bridges()
2249 struct tegra194_cbb *cbb; in tegra194_cbb_probe() local
2269 cbb = devm_kzalloc(&pdev->dev, sizeof(*cbb), GFP_KERNEL); in tegra194_cbb_probe()
2270 if (!cbb) in tegra194_cbb_probe()
2273 INIT_LIST_HEAD(&cbb->base.node); in tegra194_cbb_probe()
2274 cbb->base.ops = &tegra194_cbb_ops; in tegra194_cbb_probe()
2275 cbb->base.dev = &pdev->dev; in tegra194_cbb_probe()
2276 cbb->noc = noc; in tegra194_cbb_probe()
2278 cbb->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &cbb->res); in tegra194_cbb_probe()
2279 if (IS_ERR(cbb->regs)) in tegra194_cbb_probe()
2280 return PTR_ERR(cbb->regs); in tegra194_cbb_probe()
2282 err = tegra_cbb_get_irq(pdev, &cbb->nonsec_irq, &cbb->sec_irq); in tegra194_cbb_probe()
2288 err = tegra194_cbb_get_bridges(cbb, np); in tegra194_cbb_probe()
2294 platform_set_drvdata(pdev, cbb); in tegra194_cbb_probe()
2297 list_add(&cbb->base.node, &cbb_list); in tegra194_cbb_probe()
2300 return tegra_cbb_register(&cbb->base); in tegra194_cbb_probe()
2305 struct tegra194_cbb *cbb = platform_get_drvdata(pdev); in tegra194_cbb_remove() local
2314 if (cbb->res->start == priv->res->start) { in tegra194_cbb_remove()
2327 struct tegra194_cbb *cbb = dev_get_drvdata(dev); in tegra194_cbb_resume_noirq() local
2329 tegra194_cbb_error_enable(&cbb->base); in tegra194_cbb_resume_noirq()
2332 dev_dbg(dev, "%s resumed\n", cbb->noc->name); in tegra194_cbb_resume_noirq()