Lines Matching +full:slv +full:- +full:apb +full:- +full:base

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved
9 * registers of error logger which has ErrVld set. Currently, SLV, DEC,
25 #include <soc/tegra/tegra-cbb.h>
113 bool format; // [31] = 1 -> FlexNoC versions 2.7 & above
152 void __iomem *base; member
156 struct tegra_cbb base; member
178 return container_of(cbb, struct tegra194_cbb, base); in to_tegra194_cbb()
185 "RD - Read, Incrementing",
186 "RDW - Read, Wrap", /* Not Supported */
187 "RDX - Exclusive Read", /* Not Supported */
188 "RDL - Linked Read", /* Not Supported */
189 "WR - Write, Incrementing",
190 "WRW - Write, Wrap", /* Not Supported */
191 "WRC - Exclusive Write", /* Not Supported */
192 "PRE - Preamble Sequence for Fixed Accesses"
196 "SFIFONE - Status FIFO Not Empty interrupt",
197 "SFIFOF - Status FIFO Full interrupt",
198 "TIM - Timer(Timeout) interrupt",
199 "SLV - SLVERR interrupt",
201 "ERBF - Early response buffer Full interrupt",
203 "RDFIFOF - Read Response FIFO Full interrupt",
204 "WRFIFOF - Write Response FIFO Full interrupt",
205 "CH0DFIFOF - Ch0 Data FIFO Full interrupt",
206 "CH1DFIFOF - Ch1 Data FIFO Full interrupt",
207 "CH2DFIFOF - Ch2 Data FIFO Full interrupt",
208 "UAT - Unsupported alignment type error",
209 "UBS - Unsupported burst size error",
210 "UBE - Unsupported Byte Enable error",
211 "UBT - Unsupported burst type error",
212 "BFS - Block Firewall security error",
213 "ARFS - Address Range Firewall security error",
214 "CH0RFIFOF - Ch0 Request FIFO Full interrupt",
215 "CH1RFIFOF - Ch1 Request FIFO Full interrupt",
216 "CH2RFIFOF - Ch2 Request FIFO Full interrupt"
239 .code = "SLV",
265 .desc = "Target time-out error"
318 * ----------------------------------------------------------------------------
561 * ----------------------------------------------------------------------------
911 * ----------------------------------------------------------------------------
1247 * ----------------------------------------------------------------------------
1613 info->initflow = FIELD_GET(CBB_NOC_INITFLOW, routeid); in cbbcentralnoc_parse_routeid()
1614 info->targflow = FIELD_GET(CBB_NOC_TARGFLOW, routeid); in cbbcentralnoc_parse_routeid()
1615 info->targ_subrange = FIELD_GET(CBB_NOC_TARG_SUBRANGE, routeid); in cbbcentralnoc_parse_routeid()
1616 info->seqid = FIELD_GET(CBB_NOC_SEQID, routeid); in cbbcentralnoc_parse_routeid()
1621 info->initflow = FIELD_GET(BPMP_NOC_INITFLOW, routeid); in bpmpnoc_parse_routeid()
1622 info->targflow = FIELD_GET(BPMP_NOC_TARGFLOW, routeid); in bpmpnoc_parse_routeid()
1623 info->targ_subrange = FIELD_GET(BPMP_NOC_TARG_SUBRANGE, routeid); in bpmpnoc_parse_routeid()
1624 info->seqid = FIELD_GET(BPMP_NOC_SEQID, routeid); in bpmpnoc_parse_routeid()
1629 info->initflow = FIELD_GET(AON_NOC_INITFLOW, routeid); in aonnoc_parse_routeid()
1630 info->targflow = FIELD_GET(AON_NOC_TARGFLOW, routeid); in aonnoc_parse_routeid()
1631 info->targ_subrange = FIELD_GET(AON_NOC_TARG_SUBRANGE, routeid); in aonnoc_parse_routeid()
1632 info->seqid = FIELD_GET(AON_NOC_SEQID, routeid); in aonnoc_parse_routeid()
1637 info->initflow = FIELD_GET(SCE_NOC_INITFLOW, routeid); in scenoc_parse_routeid()
1638 info->targflow = FIELD_GET(SCE_NOC_TARGFLOW, routeid); in scenoc_parse_routeid()
1639 info->targ_subrange = FIELD_GET(SCE_NOC_TARG_SUBRANGE, routeid); in scenoc_parse_routeid()
1640 info->seqid = FIELD_GET(SCE_NOC_SEQID, routeid); in scenoc_parse_routeid()
1645 usrbits->axcache = FIELD_GET(CBB_NOC_AXCACHE, elog_5); in cbbcentralnoc_parse_userbits()
1646 usrbits->non_mod = FIELD_GET(CBB_NOC_NON_MOD, elog_5); in cbbcentralnoc_parse_userbits()
1647 usrbits->axprot = FIELD_GET(CBB_NOC_AXPROT, elog_5); in cbbcentralnoc_parse_userbits()
1648 usrbits->falconsec = FIELD_GET(CBB_NOC_FALCONSEC, elog_5); in cbbcentralnoc_parse_userbits()
1649 usrbits->grpsec = FIELD_GET(CBB_NOC_GRPSEC, elog_5); in cbbcentralnoc_parse_userbits()
1650 usrbits->vqc = FIELD_GET(CBB_NOC_VQC, elog_5); in cbbcentralnoc_parse_userbits()
1651 usrbits->mstr_id = FIELD_GET(CBB_NOC_MSTR_ID, elog_5) - 1; in cbbcentralnoc_parse_userbits()
1652 usrbits->axi_id = FIELD_GET(CBB_NOC_AXI_ID, elog_5); in cbbcentralnoc_parse_userbits()
1657 usrbits->axcache = FIELD_GET(CLUSTER_NOC_AXCACHE, elog_5); in clusternoc_parse_userbits()
1658 usrbits->axprot = FIELD_GET(CLUSTER_NOC_AXCACHE, elog_5); in clusternoc_parse_userbits()
1659 usrbits->falconsec = FIELD_GET(CLUSTER_NOC_FALCONSEC, elog_5); in clusternoc_parse_userbits()
1660 usrbits->grpsec = FIELD_GET(CLUSTER_NOC_GRPSEC, elog_5); in clusternoc_parse_userbits()
1661 usrbits->vqc = FIELD_GET(CLUSTER_NOC_VQC, elog_5); in clusternoc_parse_userbits()
1662 usrbits->mstr_id = FIELD_GET(CLUSTER_NOC_MSTR_ID, elog_5) - 1; in clusternoc_parse_userbits()
1669 writel(1, priv->regs + ERRLOGGER_0_FAULTEN_0); in tegra194_cbb_fault_enable()
1670 writel(1, priv->regs + ERRLOGGER_1_FAULTEN_0); in tegra194_cbb_fault_enable()
1671 writel(1, priv->regs + ERRLOGGER_2_FAULTEN_0); in tegra194_cbb_fault_enable()
1678 writel(1, priv->regs + ERRLOGGER_0_STALLEN_0); in tegra194_cbb_stall_enable()
1679 writel(1, priv->regs + ERRLOGGER_1_STALLEN_0); in tegra194_cbb_stall_enable()
1680 writel(1, priv->regs + ERRLOGGER_2_STALLEN_0); in tegra194_cbb_stall_enable()
1687 writel(1, priv->regs + ERRLOGGER_0_ERRCLR_0); in tegra194_cbb_error_clear()
1688 writel(1, priv->regs + ERRLOGGER_1_ERRCLR_0); in tegra194_cbb_error_clear()
1689 writel(1, priv->regs + ERRLOGGER_2_ERRCLR_0); in tegra194_cbb_error_clear()
1698 value = readl(priv->regs + ERRLOGGER_0_ERRVLD_0); in tegra194_cbb_get_status()
1699 value |= (readl(priv->regs + ERRLOGGER_1_ERRVLD_0) << 1); in tegra194_cbb_get_status()
1700 value |= (readl(priv->regs + ERRLOGGER_2_ERRVLD_0) << 2); in tegra194_cbb_get_status()
1744 if (aper[t_f].targflow == info->targflow) { in get_init_localaddress()
1748 if (aper[t_sr].targ_subrange == info->targ_subrange) { in get_init_localaddress()
1757 } while (aper[t_sr].targflow == aper[t_sr - 1].targflow); in get_init_localaddress()
1770 cbb->noc->parse_userbits(&userbits, cbb->errlog5); in print_errlog5()
1772 if (!strcmp(cbb->noc->name, "cbb-noc")) { in print_errlog5()
1773 tegra_cbb_print_err(file, "\t Non-Modify\t\t: %#x\n", userbits.non_mod); in print_errlog5()
1778 cbb->noc->master_id[userbits.mstr_id]); in print_errlog5()
1787 * Fetch Base Address/InitlocalAddress from NOC aperture lookup table using TargFlow &
1790 * Address = Base Address + (ErrLog3 + ErrLog4)
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()
1834 tegra_cbb_print_err(file, "\t TargSubRange\t\t: %d\n", info->targ_subrange); in print_errlog1_2()
1842 * APB slaves because for them:
1843 * - All errors are logged as SLV(slave) errors due to APB having only single
1845 * - Exact cause is printed by reading DMAAPB_X_RAW_INTERRUPT_STATUS register.
1846 * - The driver prints information showing AXI2APB bridge and exact error
1848 * - There is still no way to disambiguate a DEC error from SLV error type.
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()
1879 } else if (!strcmp(tegra194_cbb_errors[hdr.errcode].code, "SLV") && in print_errlog0()
1880 cbb->num_bridges > 0) { in print_errlog0()
1884 /* For all SLV errors, read DMAAPB_X_RAW_INTERRUPT_STATUS in print_errlog0()
1887 * status register due to error in a APB slave connected 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()
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()
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()
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()
1973 pr_crit("CPU:%d, Error:%s\n", smp_processor_id(), cbb->noc->name); in print_errlog()
1982 tegra_cbb_error_clear(&cbb->base); in print_errlog()
2031 if (status && ((irq == priv->sec_irq) || (irq == priv->nonsec_irq))) { in tegra194_cbb_err_isr()
2033 smp_processor_id(), priv->noc->name, priv->res->start, in tegra194_cbb_err_isr()
2042 if (priv->noc->erd_mask_inband_err) { in tegra194_cbb_err_isr()
2043 mstr_id = FIELD_GET(CBB_NOC_MSTR_ID, priv->errlog5); in tegra194_cbb_err_isr()
2069 struct device *dev = cbb->dev; in tegra194_cbb_interrupt_enable()
2072 if (priv->sec_irq) { in tegra194_cbb_interrupt_enable()
2073 err = devm_request_irq(dev, priv->sec_irq, tegra194_cbb_err_isr, 0, dev_name(dev), in tegra194_cbb_interrupt_enable()
2076 dev_err(dev, "failed to register interrupt %u: %d\n", priv->sec_irq, err); in tegra194_cbb_interrupt_enable()
2081 if (priv->nonsec_irq) { in tegra194_cbb_interrupt_enable()
2082 err = devm_request_irq(dev, priv->nonsec_irq, tegra194_cbb_err_isr, 0, in tegra194_cbb_interrupt_enable()
2085 dev_err(dev, "failed to register interrupt %u: %d\n", priv->nonsec_irq, in tegra194_cbb_interrupt_enable()
2119 .name = "cbb-noc",
2131 .name = "aon-noc",
2143 .name = "bpmp-noc",
2155 .name = "rce-noc",
2167 .name = "sce-noc",
2179 { .compatible = "nvidia,tegra194-cbb-noc", .data = &tegra194_cbb_central_noc_data },
2180 { .compatible = "nvidia,tegra194-aon-noc", .data = &tegra194_aon_noc_data },
2181 { .compatible = "nvidia,tegra194-bpmp-noc", .data = &tegra194_bpmp_noc_data },
2182 { .compatible = "nvidia,tegra194-rce-noc", .data = &tegra194_rce_noc_data },
2183 { .compatible = "nvidia,tegra194-sce-noc", .data = &tegra194_sce_noc_data },
2200 if (priv->bridges) { in tegra194_cbb_get_bridges()
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()
2215 return -ENOMEM; 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()
2247 noc = of_device_get_match_data(&pdev->dev); in tegra194_cbb_probe()
2249 if (noc->erd_mask_inband_err) { in tegra194_cbb_probe()
2257 dev_err(&pdev->dev, "couldn't mask inband errors\n"); in tegra194_cbb_probe()
2262 cbb = devm_kzalloc(&pdev->dev, sizeof(*cbb), GFP_KERNEL); in tegra194_cbb_probe()
2264 return -ENOMEM; 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()
2279 np = of_parse_phandle(pdev->dev.of_node, "nvidia,axi2apb", 0); 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()
2307 if (cbb->res->start == priv->res->start) { in tegra194_cbb_remove()
2308 list_del(&noc->node); in tegra194_cbb_remove()
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",