Lines Matching +full:tegra194 +full:- +full:gte +full:- +full:aon

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved
28 #include <soc/tegra/tegra-cbb.h>
118 bool format; // [31] = 1 -> FlexNoC versions 2.7 & above
190 "RD - Read, Incrementing",
191 "RDW - Read, Wrap", /* Not Supported */
192 "RDX - Exclusive Read", /* Not Supported */
193 "RDL - Linked Read", /* Not Supported */
194 "WR - Write, Incrementing",
195 "WRW - Write, Wrap", /* Not Supported */
196 "WRC - Exclusive Write", /* Not Supported */
197 "PRE - Preamble Sequence for Fixed Accesses"
201 "SFIFONE - Status FIFO Not Empty interrupt",
202 "SFIFOF - Status FIFO Full interrupt",
203 "TIM - Timer(Timeout) interrupt",
204 "SLV - SLVERR interrupt",
206 "ERBF - Early response buffer Full interrupt",
208 "RDFIFOF - Read Response FIFO Full interrupt",
209 "WRFIFOF - Write Response FIFO Full interrupt",
210 "CH0DFIFOF - Ch0 Data FIFO Full interrupt",
211 "CH1DFIFOF - Ch1 Data FIFO Full interrupt",
212 "CH2DFIFOF - Ch2 Data FIFO Full interrupt",
213 "UAT - Unsupported alignment type error",
214 "UBS - Unsupported burst size error",
215 "UBE - Unsupported Byte Enable error",
216 "UBT - Unsupported burst type error",
217 "BFS - Block Firewall security error",
218 "ARFS - Address Range Firewall security error",
219 "CH0RFIFOF - Ch0 Request FIFO Full interrupt",
220 "CH1RFIFOF - Ch1 Request FIFO Full interrupt",
221 "CH2RFIFOF - Ch2 Request FIFO Full interrupt"
228 [0x3] = "AON",
270 .desc = "Target time-out error"
282 [0x0] = "aon_p2ps/I/aon",
323 * ----------------------------------------------------------------------------
541 [0x0d] = "multiport0_t/T/gte",
566 * ----------------------------------------------------------------------------
836 * AON NOC aperture lookup table as per file "AON_NOC_Structure.info".
855 [0x09] = "multiport1_t/T/gte",
913 * Fields of AON NOC lookup table:
916 * ----------------------------------------------------------------------------
1224 [0x0a] = "multiport0_t/T/gte",
1252 * ----------------------------------------------------------------------------
1618 info->initflow = FIELD_GET(CBB_NOC_INITFLOW, routeid); in cbbcentralnoc_parse_routeid()
1619 info->targflow = FIELD_GET(CBB_NOC_TARGFLOW, routeid); in cbbcentralnoc_parse_routeid()
1620 info->targ_subrange = FIELD_GET(CBB_NOC_TARG_SUBRANGE, routeid); in cbbcentralnoc_parse_routeid()
1621 info->seqid = FIELD_GET(CBB_NOC_SEQID, routeid); in cbbcentralnoc_parse_routeid()
1626 info->initflow = FIELD_GET(BPMP_NOC_INITFLOW, routeid); in bpmpnoc_parse_routeid()
1627 info->targflow = FIELD_GET(BPMP_NOC_TARGFLOW, routeid); in bpmpnoc_parse_routeid()
1628 info->targ_subrange = FIELD_GET(BPMP_NOC_TARG_SUBRANGE, routeid); in bpmpnoc_parse_routeid()
1629 info->seqid = FIELD_GET(BPMP_NOC_SEQID, routeid); in bpmpnoc_parse_routeid()
1634 info->initflow = FIELD_GET(AON_NOC_INITFLOW, routeid); in aonnoc_parse_routeid()
1635 info->targflow = FIELD_GET(AON_NOC_TARGFLOW, routeid); in aonnoc_parse_routeid()
1636 info->targ_subrange = FIELD_GET(AON_NOC_TARG_SUBRANGE, routeid); in aonnoc_parse_routeid()
1637 info->seqid = FIELD_GET(AON_NOC_SEQID, routeid); in aonnoc_parse_routeid()
1642 info->initflow = FIELD_GET(SCE_NOC_INITFLOW, routeid); in scenoc_parse_routeid()
1643 info->targflow = FIELD_GET(SCE_NOC_TARGFLOW, routeid); in scenoc_parse_routeid()
1644 info->targ_subrange = FIELD_GET(SCE_NOC_TARG_SUBRANGE, routeid); in scenoc_parse_routeid()
1645 info->seqid = FIELD_GET(SCE_NOC_SEQID, routeid); in scenoc_parse_routeid()
1650 usrbits->axcache = FIELD_GET(CBB_NOC_AXCACHE, elog_5); in cbbcentralnoc_parse_userbits()
1651 usrbits->non_mod = FIELD_GET(CBB_NOC_NON_MOD, elog_5); in cbbcentralnoc_parse_userbits()
1652 usrbits->axprot = FIELD_GET(CBB_NOC_AXPROT, elog_5); in cbbcentralnoc_parse_userbits()
1653 usrbits->falconsec = FIELD_GET(CBB_NOC_FALCONSEC, elog_5); in cbbcentralnoc_parse_userbits()
1654 usrbits->grpsec = FIELD_GET(CBB_NOC_GRPSEC, elog_5); in cbbcentralnoc_parse_userbits()
1655 usrbits->vqc = FIELD_GET(CBB_NOC_VQC, elog_5); in cbbcentralnoc_parse_userbits()
1656 usrbits->mstr_id = FIELD_GET(CBB_NOC_MSTR_ID, elog_5) - 1; in cbbcentralnoc_parse_userbits()
1657 usrbits->axi_id = FIELD_GET(CBB_NOC_AXI_ID, elog_5); in cbbcentralnoc_parse_userbits()
1662 usrbits->axcache = FIELD_GET(CLUSTER_NOC_AXCACHE, elog_5); in clusternoc_parse_userbits()
1663 usrbits->axprot = FIELD_GET(CLUSTER_NOC_AXCACHE, elog_5); in clusternoc_parse_userbits()
1664 usrbits->falconsec = FIELD_GET(CLUSTER_NOC_FALCONSEC, elog_5); in clusternoc_parse_userbits()
1665 usrbits->grpsec = FIELD_GET(CLUSTER_NOC_GRPSEC, elog_5); in clusternoc_parse_userbits()
1666 usrbits->vqc = FIELD_GET(CLUSTER_NOC_VQC, elog_5); in clusternoc_parse_userbits()
1667 usrbits->mstr_id = FIELD_GET(CLUSTER_NOC_MSTR_ID, elog_5) - 1; in clusternoc_parse_userbits()
1674 writel(1, priv->regs + ERRLOGGER_0_FAULTEN_0); in tegra194_cbb_fault_enable()
1675 writel(1, priv->regs + ERRLOGGER_1_FAULTEN_0); in tegra194_cbb_fault_enable()
1676 writel(1, priv->regs + ERRLOGGER_2_FAULTEN_0); in tegra194_cbb_fault_enable()
1683 writel(1, priv->regs + ERRLOGGER_0_STALLEN_0); in tegra194_cbb_stall_enable()
1684 writel(1, priv->regs + ERRLOGGER_1_STALLEN_0); in tegra194_cbb_stall_enable()
1685 writel(1, priv->regs + ERRLOGGER_2_STALLEN_0); in tegra194_cbb_stall_enable()
1692 writel(1, priv->regs + ERRLOGGER_0_ERRCLR_0); in tegra194_cbb_error_clear()
1693 writel(1, priv->regs + ERRLOGGER_1_ERRCLR_0); in tegra194_cbb_error_clear()
1694 writel(1, priv->regs + ERRLOGGER_2_ERRCLR_0); in tegra194_cbb_error_clear()
1703 value = readl(priv->regs + ERRLOGGER_0_ERRVLD_0); in tegra194_cbb_get_status()
1704 value |= (readl(priv->regs + ERRLOGGER_1_ERRVLD_0) << 1); in tegra194_cbb_get_status()
1705 value |= (readl(priv->regs + ERRLOGGER_2_ERRVLD_0) << 2); in tegra194_cbb_get_status()
1749 if (aper[t_f].targflow == info->targflow) { in get_init_localaddress()
1753 if (aper[t_sr].targ_subrange == info->targ_subrange) { in get_init_localaddress()
1762 } while (aper[t_sr].targflow == aper[t_sr - 1].targflow); in get_init_localaddress()
1775 cbb->noc->parse_userbits(&userbits, cbb->errlog5); in print_errlog5()
1777 if (!strcmp(cbb->noc->name, "cbb-noc")) { in print_errlog5()
1778 tegra_cbb_print_err(file, "\t Non-Modify\t\t: %#x\n", userbits.non_mod); in print_errlog5()
1783 cbb->noc->master_id[userbits.mstr_id]); in print_errlog5()
1826 u64 routeid = (u64)cbb->errlog2 << 32 | cbb->errlog1; in print_errlog1_2()
1831 cbb->noc->parse_routeid(info, routeid); in print_errlog1_2()
1834 cbb->noc->routeid_initflow[info->initflow]); in print_errlog1_2()
1837 cbb->noc->routeid_targflow[info->targflow]); in print_errlog1_2()
1839 tegra_cbb_print_err(file, "\t TargSubRange\t\t: %d\n", info->targ_subrange); in print_errlog1_2()
1848 * - All errors are logged as SLV(slave) errors due to APB having only single
1850 * - Exact cause is printed by reading DMAAPB_X_RAW_INTERRUPT_STATUS register.
1851 * - The driver prints information showing AXI2APB bridge and exact error
1853 * - There is still no way to disambiguate a DEC error from SLV error type.
1860 hdr.lock = cbb->errlog0 & 0x1; in print_errlog0()
1861 hdr.opc = FIELD_GET(CBB_ERR_OPC, cbb->errlog0); in print_errlog0()
1862 hdr.errcode = FIELD_GET(CBB_ERR_ERRCODE, cbb->errlog0); in print_errlog0()
1863 hdr.len1 = FIELD_GET(CBB_ERR_LEN1, cbb->errlog0); in print_errlog0()
1864 hdr.format = (cbb->errlog0 >> 31); in print_errlog0()
1885 cbb->num_bridges > 0) { in print_errlog0()
1897 for (i = 0; i < cbb->num_bridges; i++) { in print_errlog0()
1898 status = tegra194_axi2apb_status(cbb->bridges[i].base); in print_errlog0()
1931 cbb->errlog0 = readl(cbb->regs + ERRLOGGER_0_ERRLOG0_0); in print_errloggerX_info()
1932 cbb->errlog1 = readl(cbb->regs + ERRLOGGER_0_ERRLOG1_0); in print_errloggerX_info()
1933 cbb->errlog2 = readl(cbb->regs + ERRLOGGER_0_RSVD_00_0); in print_errloggerX_info()
1934 cbb->errlog3 = readl(cbb->regs + ERRLOGGER_0_ERRLOG3_0); in print_errloggerX_info()
1935 cbb->errlog4 = readl(cbb->regs + ERRLOGGER_0_ERRLOG4_0); in print_errloggerX_info()
1936 cbb->errlog5 = readl(cbb->regs + ERRLOGGER_0_ERRLOG5_0); in print_errloggerX_info()
1938 cbb->errlog0 = readl(cbb->regs + ERRLOGGER_1_ERRLOG0_0); in print_errloggerX_info()
1939 cbb->errlog1 = readl(cbb->regs + ERRLOGGER_1_ERRLOG1_0); in print_errloggerX_info()
1940 cbb->errlog2 = readl(cbb->regs + ERRLOGGER_1_RSVD_00_0); in print_errloggerX_info()
1941 cbb->errlog3 = readl(cbb->regs + ERRLOGGER_1_ERRLOG3_0); in print_errloggerX_info()
1942 cbb->errlog4 = readl(cbb->regs + ERRLOGGER_1_ERRLOG4_0); in print_errloggerX_info()
1943 cbb->errlog5 = readl(cbb->regs + ERRLOGGER_1_ERRLOG5_0); in print_errloggerX_info()
1945 cbb->errlog0 = readl(cbb->regs + ERRLOGGER_2_ERRLOG0_0); in print_errloggerX_info()
1946 cbb->errlog1 = readl(cbb->regs + ERRLOGGER_2_ERRLOG1_0); in print_errloggerX_info()
1947 cbb->errlog2 = readl(cbb->regs + ERRLOGGER_2_RSVD_00_0); in print_errloggerX_info()
1948 cbb->errlog3 = readl(cbb->regs + ERRLOGGER_2_ERRLOG3_0); in print_errloggerX_info()
1949 cbb->errlog4 = readl(cbb->regs + ERRLOGGER_2_ERRLOG4_0); in print_errloggerX_info()
1950 cbb->errlog5 = readl(cbb->regs + ERRLOGGER_2_ERRLOG5_0); in print_errloggerX_info()
1953 tegra_cbb_print_err(file, "\tErrLog0\t\t\t: %#x\n", cbb->errlog0); in print_errloggerX_info()
1956 tegra_cbb_print_err(file, "\tErrLog1\t\t\t: %#x\n", cbb->errlog1); in print_errloggerX_info()
1957 tegra_cbb_print_err(file, "\tErrLog2\t\t\t: %#x\n", cbb->errlog2); in print_errloggerX_info()
1960 tegra_cbb_print_err(file, "\tErrLog3\t\t\t: %#x\n", cbb->errlog3); in print_errloggerX_info()
1961 tegra_cbb_print_err(file, "\tErrLog4\t\t\t: %#x\n", cbb->errlog4); in print_errloggerX_info()
1962 print_errlog3_4(file, cbb->errlog3, cbb->errlog4, &info, cbb->noc->noc_aperture, in print_errloggerX_info()
1963 cbb->noc->max_aperture); in print_errloggerX_info()
1965 tegra_cbb_print_err(file, "\tErrLog5\t\t\t: %#x\n", cbb->errlog5); in print_errloggerX_info()
1967 if (cbb->errlog5) in print_errloggerX_info()
1978 pr_crit("CPU:%d, Error:%s\n", smp_processor_id(), cbb->noc->name); in print_errlog()
1987 tegra_cbb_error_clear(&cbb->base); in print_errlog()
2036 if (status && ((irq == priv->sec_irq) || (irq == priv->nonsec_irq))) { in tegra194_cbb_err_isr()
2038 smp_processor_id(), priv->noc->name, priv->res->start, in tegra194_cbb_err_isr()
2041 mstr_id = FIELD_GET(USRBITS_MSTR_ID, priv->errlog5) - 1; in tegra194_cbb_err_isr()
2048 if ((mstr_id == 0x1) && priv->noc->erd_mask_inband_err) in tegra194_cbb_err_isr()
2072 struct device *dev = cbb->dev; in tegra194_cbb_interrupt_enable()
2075 if (priv->sec_irq) { in tegra194_cbb_interrupt_enable()
2076 err = devm_request_irq(dev, priv->sec_irq, tegra194_cbb_err_isr, 0, dev_name(dev), in tegra194_cbb_interrupt_enable()
2079 dev_err(dev, "failed to register interrupt %u: %d\n", priv->sec_irq, err); in tegra194_cbb_interrupt_enable()
2084 if (priv->nonsec_irq) { in tegra194_cbb_interrupt_enable()
2085 err = devm_request_irq(dev, priv->nonsec_irq, tegra194_cbb_err_isr, 0, in tegra194_cbb_interrupt_enable()
2088 dev_err(dev, "failed to register interrupt %u: %d\n", priv->nonsec_irq, in tegra194_cbb_interrupt_enable()
2122 .name = "cbb-noc",
2134 .name = "aon-noc",
2146 .name = "bpmp-noc",
2158 .name = "rce-noc",
2170 .name = "sce-noc",
2182 { .compatible = "nvidia,tegra194-cbb-noc", .data = &tegra194_cbb_central_noc_data },
2183 { .compatible = "nvidia,tegra194-aon-noc", .data = &tegra194_aon_noc_data },
2184 { .compatible = "nvidia,tegra194-bpmp-noc", .data = &tegra194_bpmp_noc_data },
2185 { .compatible = "nvidia,tegra194-rce-noc", .data = &tegra194_rce_noc_data },
2186 { .compatible = "nvidia,tegra194-sce-noc", .data = &tegra194_sce_noc_data },
2204 if (priv->bridges) { in tegra194_cbb_get_bridges()
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()
2220 return -ENOMEM; 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()
2254 noc = of_device_get_match_data(&pdev->dev); in tegra194_cbb_probe()
2256 if (noc->erd_mask_inband_err) { in tegra194_cbb_probe()
2264 dev_err(&pdev->dev, "couldn't mask inband errors\n"); in tegra194_cbb_probe()
2269 cbb = devm_kzalloc(&pdev->dev, sizeof(*cbb), GFP_KERNEL); in tegra194_cbb_probe()
2271 return -ENOMEM; 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()
2286 np = of_parse_phandle(pdev->dev.of_node, "nvidia,axi2apb", 0); 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()
2314 if (cbb->res->start == priv->res->start) { in tegra194_cbb_remove()
2315 list_del(&noc->node); in tegra194_cbb_remove()
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()
2344 .name = "tegra194-cbb",
2363 MODULE_DESCRIPTION("Control Backbone error handling driver for Tegra194");