Lines Matching refs:cbb

123 static inline struct tegra234_cbb *to_tegra234_cbb(struct tegra_cbb *cbb)  in to_tegra234_cbb()  argument
125 return container_of(cbb, struct tegra234_cbb, base); in to_tegra234_cbb()
131 static void tegra234_cbb_fault_enable(struct tegra_cbb *cbb) in tegra234_cbb_fault_enable() argument
133 struct tegra234_cbb *priv = to_tegra234_cbb(cbb); in tegra234_cbb_fault_enable()
141 static void tegra234_cbb_error_clear(struct tegra_cbb *cbb) in tegra234_cbb_error_clear() argument
143 struct tegra234_cbb *priv = to_tegra234_cbb(cbb); in tegra234_cbb_error_clear()
149 static u32 tegra234_cbb_get_status(struct tegra_cbb *cbb) in tegra234_cbb_get_status() argument
151 struct tegra234_cbb *priv = to_tegra234_cbb(cbb); in tegra234_cbb_get_status()
162 static void tegra234_cbb_mask_serror(struct tegra234_cbb *cbb) in tegra234_cbb_mask_serror() argument
164 writel(0x1, cbb->regs + cbb->fabric->off_mask_erd); in tegra234_cbb_mask_serror()
222 static void tegra234_lookup_slave_timeout(struct seq_file *file, struct tegra234_cbb *cbb, in tegra234_lookup_slave_timeout() argument
225 const struct tegra234_slave_lookup *map = cbb->fabric->slave_map; in tegra234_lookup_slave_timeout()
245 addr = cbb->regs + map[slave_id].offset; in tegra234_lookup_slave_timeout()
265 static void tegra234_cbb_print_error(struct seq_file *file, struct tegra234_cbb *cbb, u32 status, in tegra234_cbb_print_error() argument
276 cbb->fabric->errors[type].code); in tegra234_cbb_print_error()
287 cbb->fabric->errors[type].code); in tegra234_cbb_print_error()
294 static void print_errlog_err(struct seq_file *file, struct tegra234_cbb *cbb) in print_errlog_err() argument
305 mstr_id = FIELD_GET(FAB_EM_EL_MSTRID, cbb->mn_user_bits); in print_errlog_err()
306 vqc = FIELD_GET(FAB_EM_EL_VQC, cbb->mn_user_bits); in print_errlog_err()
307 grpsec = FIELD_GET(FAB_EM_EL_GRPSEC, cbb->mn_user_bits); in print_errlog_err()
308 falconsec = FIELD_GET(FAB_EM_EL_FALCONSEC, cbb->mn_user_bits); in print_errlog_err()
316 requester_socket_id = FIELD_GET(REQ_SOCKET_ID, cbb->mn_attr2); in print_errlog_err()
324 fab_id = FIELD_GET(FAB_EM_EL_FABID, cbb->mn_attr2); in print_errlog_err()
325 slave_id = FIELD_GET(FAB_EM_EL_SLAVEID, cbb->mn_attr2); in print_errlog_err()
327 access_id = FIELD_GET(FAB_EM_EL_ACCESSID, cbb->mn_attr1); in print_errlog_err()
329 cache_type = FIELD_GET(FAB_EM_EL_AXCACHE, cbb->mn_attr0); in print_errlog_err()
330 prot_type = FIELD_GET(FAB_EM_EL_AXPROT, cbb->mn_attr0); in print_errlog_err()
331 burst_length = FIELD_GET(FAB_EM_EL_BURSTLENGTH, cbb->mn_attr0); in print_errlog_err()
332 burst_type = FIELD_GET(FAB_EM_EL_BURSTTYPE, cbb->mn_attr0); in print_errlog_err()
333 beat_size = FIELD_GET(FAB_EM_EL_BEATSIZE, cbb->mn_attr0); in print_errlog_err()
334 access_type = FIELD_GET(FAB_EM_EL_ACCESSTYPE, cbb->mn_attr0); in print_errlog_err()
338 cbb->fabric->errors[cbb->type].code); in print_errlog_err()
340 tegra_cbb_print_err(file, "\t MASTER_ID\t\t: %s\n", cbb->fabric->master_id[mstr_id]); in print_errlog_err()
341 tegra_cbb_print_err(file, "\t Address\t\t: %#llx\n", cbb->access); in print_errlog_err()
354 strcpy(fabric_name, cbb->fabric->name); in print_errlog_err()
377 if (!strcmp(cbb->fabric->errors[cbb->type].code, "TIMEOUT_ERR")) { in print_errlog_err()
378 tegra234_lookup_slave_timeout(file, cbb, slave_id, fab_id); in print_errlog_err()
382 tegra_cbb_print_err(file, "\t Slave\t\t\t: %s\n", cbb->fabric->slave_map[slave_id].name); in print_errlog_err()
385 static int print_errmonX_info(struct seq_file *file, struct tegra234_cbb *cbb) in print_errmonX_info() argument
389 status = readl(cbb->mon + FABRIC_MN_MASTER_ERR_STATUS_0); in print_errmonX_info()
400 overflow = readl(cbb->mon + FABRIC_MN_MASTER_ERR_OVERFLOW_STATUS_0); in print_errmonX_info()
402 tegra234_cbb_print_error(file, cbb, status, overflow); in print_errmonX_info()
404 error = readl(cbb->mon + FABRIC_MN_MASTER_LOG_ERR_STATUS_0); in print_errmonX_info()
410 cbb->type = 0; in print_errmonX_info()
416 hi = readl(cbb->mon + FABRIC_MN_MASTER_LOG_ADDR_HIGH_0); in print_errmonX_info()
417 lo = readl(cbb->mon + FABRIC_MN_MASTER_LOG_ADDR_LOW_0); in print_errmonX_info()
419 cbb->access = (u64)hi << 32 | lo; in print_errmonX_info()
421 cbb->mn_attr0 = readl(cbb->mon + FABRIC_MN_MASTER_LOG_ATTRIBUTES0_0); in print_errmonX_info()
422 cbb->mn_attr1 = readl(cbb->mon + FABRIC_MN_MASTER_LOG_ATTRIBUTES1_0); in print_errmonX_info()
423 cbb->mn_attr2 = readl(cbb->mon + FABRIC_MN_MASTER_LOG_ATTRIBUTES2_0); in print_errmonX_info()
424 cbb->mn_user_bits = readl(cbb->mon + FABRIC_MN_MASTER_LOG_USER_BITS0_0); in print_errmonX_info()
426 print_errlog_err(file, cbb); in print_errmonX_info()
429 cbb->type++; in print_errmonX_info()
436 static int print_err_notifier(struct seq_file *file, struct tegra234_cbb *cbb, u32 status) in print_err_notifier() argument
443 cbb->fabric->name, status); in print_err_notifier()
447 unsigned int notifier = cbb->fabric->notifier_offset; in print_err_notifier()
452 writel(mask, cbb->regs + notifier + FABRIC_EN_CFG_ADDR_INDEX_0_0); in print_err_notifier()
453 hi = readl(cbb->regs + notifier + FABRIC_EN_CFG_ADDR_HI_0); in print_err_notifier()
454 lo = readl(cbb->regs + notifier + FABRIC_EN_CFG_ADDR_LOW_0); in print_err_notifier()
458 offset = addr - cbb->res->start; in print_err_notifier()
459 cbb->mon = cbb->regs + offset; in print_err_notifier()
460 cbb->mask = BIT(index); in print_err_notifier()
462 err = print_errmonX_info(file, cbb); in print_err_notifier()
463 tegra234_cbb_error_clear(&cbb->base); in print_err_notifier()
479 static int tegra234_cbb_debugfs_show(struct tegra_cbb *cbb, struct seq_file *file, void *data) in tegra234_cbb_debugfs_show() argument
485 list_for_each_entry(cbb, &cbb_list, node) { in tegra234_cbb_debugfs_show()
486 struct tegra234_cbb *priv = to_tegra234_cbb(cbb); in tegra234_cbb_debugfs_show()
508 struct tegra_cbb *cbb; in tegra234_cbb_isr() local
515 list_for_each_entry(cbb, &cbb_list, node) { in tegra234_cbb_isr()
516 struct tegra234_cbb *priv = to_tegra234_cbb(cbb); in tegra234_cbb_isr()
517 u32 status = tegra_cbb_get_status(cbb); in tegra234_cbb_isr()
548 static int tegra234_cbb_interrupt_enable(struct tegra_cbb *cbb) in tegra234_cbb_interrupt_enable() argument
550 struct tegra234_cbb *priv = to_tegra234_cbb(cbb); in tegra234_cbb_interrupt_enable()
553 int err = devm_request_irq(cbb->dev, priv->sec_irq, tegra234_cbb_isr, 0, in tegra234_cbb_interrupt_enable()
554 dev_name(cbb->dev), priv); in tegra234_cbb_interrupt_enable()
556 dev_err(cbb->dev, "failed to register interrupt %u: %d\n", priv->sec_irq, in tegra234_cbb_interrupt_enable()
565 static void tegra234_cbb_error_enable(struct tegra_cbb *cbb) in tegra234_cbb_error_enable() argument
567 tegra_cbb_fault_enable(cbb); in tegra234_cbb_error_enable()
1021 struct tegra234_cbb *cbb; in tegra234_cbb_probe() local
1039 cbb = devm_kzalloc(&pdev->dev, sizeof(*cbb), GFP_KERNEL); in tegra234_cbb_probe()
1040 if (!cbb) in tegra234_cbb_probe()
1043 INIT_LIST_HEAD(&cbb->base.node); in tegra234_cbb_probe()
1044 cbb->base.ops = &tegra234_cbb_ops; in tegra234_cbb_probe()
1045 cbb->base.dev = &pdev->dev; in tegra234_cbb_probe()
1046 cbb->fabric = fabric; in tegra234_cbb_probe()
1048 cbb->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &cbb->res); in tegra234_cbb_probe()
1049 if (IS_ERR(cbb->regs)) in tegra234_cbb_probe()
1050 return PTR_ERR(cbb->regs); in tegra234_cbb_probe()
1052 err = tegra_cbb_get_irq(pdev, NULL, &cbb->sec_irq); in tegra234_cbb_probe()
1056 platform_set_drvdata(pdev, cbb); in tegra234_cbb_probe()
1059 list_add(&cbb->base.node, &cbb_list); in tegra234_cbb_probe()
1063 if (cbb->fabric->off_mask_erd) in tegra234_cbb_probe()
1064 tegra234_cbb_mask_serror(cbb); in tegra234_cbb_probe()
1066 return tegra_cbb_register(&cbb->base); in tegra234_cbb_probe()
1076 struct tegra234_cbb *cbb = dev_get_drvdata(dev); in tegra234_cbb_resume_noirq() local
1078 tegra234_cbb_error_enable(&cbb->base); in tegra234_cbb_resume_noirq()
1080 dev_dbg(dev, "%s resumed\n", cbb->fabric->name); in tegra234_cbb_resume_noirq()