Lines Matching +full:gisb +full:- +full:arb

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2014-2021 Broadcom
60 [ARB_BP_CAP_HI_ADDR] = -1,
63 [ARB_BP_CAP_MASTER] = -1,
65 [ARB_ERR_CAP_HI_ADDR] = -1,
68 [ARB_ERR_CAP_MASTER] = -1,
74 [ARB_BP_CAP_HI_ADDR] = -1,
79 [ARB_ERR_CAP_HI_ADDR] = -1,
88 [ARB_BP_CAP_HI_ADDR] = -1,
93 [ARB_ERR_CAP_HI_ADDR] = -1,
102 [ARB_BP_CAP_HI_ADDR] = -1,
107 [ARB_ERR_CAP_HI_ADDR] = -1,
116 [ARB_BP_CAP_HI_ADDR] = -1,
121 [ARB_ERR_CAP_HI_ADDR] = -1,
130 [ARB_BP_CAP_HI_ADDR] = -1,
156 int offset = gdev->gisb_offsets[reg]; in gisb_read()
166 if (gdev->big_endian) in gisb_read()
167 return ioread32be(gdev->base + offset); in gisb_read()
169 return ioread32(gdev->base + offset); in gisb_read()
194 int offset = gdev->gisb_offsets[reg]; in gisb_write()
196 if (offset == -1) in gisb_write()
199 if (gdev->big_endian) in gisb_write()
200 iowrite32be(val, gdev->base + offset); in gisb_write()
202 iowrite32(val, gdev->base + offset); in gisb_write()
212 mutex_lock(&gdev->lock); in gisb_arb_get_timeout()
214 mutex_unlock(&gdev->lock); in gisb_arb_get_timeout()
231 return -EINVAL; in gisb_arb_set_timeout()
233 mutex_lock(&gdev->lock); in gisb_arb_set_timeout()
235 mutex_unlock(&gdev->lock); in gisb_arb_set_timeout()
244 u32 mask = gdev->valid_mask & masters; in brcmstb_gisb_master_to_str()
249 return gdev->master_names[ffs(mask) - 1]; in brcmstb_gisb_master_to_str()
277 pr_crit("GISB: %s at 0x%llx [%c %s], core: %s\n", in brcmstb_gisb_arb_decode_addr()
283 /* clear the GISB error */ in brcmstb_gisb_arb_decode_addr()
351 pr_crit("GISB: breakpoint at 0x%llx [%c], core: %s\n", in brcmstb_gisb_bp_handler()
355 /* clear the GISB error */ in brcmstb_gisb_bp_handler()
362 * Dump out gisb errors on die or panic.
384 /* iterate over each GISB arb registered handlers */ in dump_gisb_error()
404 { .compatible = "brcm,gisb-arb", .data = gisb_offsets_bcm7445 },
405 { .compatible = "brcm,bcm7445-gisb-arb", .data = gisb_offsets_bcm7445 },
406 { .compatible = "brcm,bcm7435-gisb-arb", .data = gisb_offsets_bcm7435 },
407 { .compatible = "brcm,bcm7400-gisb-arb", .data = gisb_offsets_bcm7400 },
408 { .compatible = "brcm,bcm7278-gisb-arb", .data = gisb_offsets_bcm7278 },
409 { .compatible = "brcm,bcm7038-gisb-arb", .data = gisb_offsets_bcm7038 },
410 { .compatible = "brcm,bcm74165-gisb-arb", .data = gisb_offsets_bcm74165 },
417 struct device_node *dn = pdev->dev.of_node; in brcmstb_gisb_arb_probe()
428 gdev = devm_kzalloc(&pdev->dev, sizeof(*gdev), GFP_KERNEL); in brcmstb_gisb_arb_probe()
430 return -ENOMEM; in brcmstb_gisb_arb_probe()
432 mutex_init(&gdev->lock); in brcmstb_gisb_arb_probe()
433 INIT_LIST_HEAD(&gdev->next); in brcmstb_gisb_arb_probe()
435 gdev->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); in brcmstb_gisb_arb_probe()
436 if (IS_ERR(gdev->base)) in brcmstb_gisb_arb_probe()
437 return PTR_ERR(gdev->base); in brcmstb_gisb_arb_probe()
442 return -EINVAL; in brcmstb_gisb_arb_probe()
444 gdev->gisb_offsets = of_id->data; in brcmstb_gisb_arb_probe()
445 gdev->big_endian = of_device_is_big_endian(dn); in brcmstb_gisb_arb_probe()
447 err = devm_request_irq(&pdev->dev, timeout_irq, in brcmstb_gisb_arb_probe()
448 brcmstb_gisb_timeout_handler, 0, pdev->name, in brcmstb_gisb_arb_probe()
453 err = devm_request_irq(&pdev->dev, tea_irq, in brcmstb_gisb_arb_probe()
454 brcmstb_gisb_tea_handler, 0, pdev->name, in brcmstb_gisb_arb_probe()
461 err = devm_request_irq(&pdev->dev, bp_irq, in brcmstb_gisb_arb_probe()
462 brcmstb_gisb_bp_handler, 0, pdev->name, in brcmstb_gisb_arb_probe()
469 if (of_property_read_u32(dn, "brcm,gisb-arb-master-mask", in brcmstb_gisb_arb_probe()
470 &gdev->valid_mask)) in brcmstb_gisb_arb_probe()
471 gdev->valid_mask = 0xffffffff; in brcmstb_gisb_arb_probe()
477 "brcm,gisb-arb-master-names"); in brcmstb_gisb_arb_probe()
478 if (hweight_long(gdev->valid_mask) == num_masters) { in brcmstb_gisb_arb_probe()
479 first = ffs(gdev->valid_mask) - 1; in brcmstb_gisb_arb_probe()
480 last = fls(gdev->valid_mask) - 1; in brcmstb_gisb_arb_probe()
483 if (!(gdev->valid_mask & BIT(i))) in brcmstb_gisb_arb_probe()
487 "brcm,gisb-arb-master-names", j, in brcmstb_gisb_arb_probe()
488 &gdev->master_names[i]); in brcmstb_gisb_arb_probe()
493 err = sysfs_create_group(&pdev->dev.kobj, &gisb_arb_sysfs_attr_group); in brcmstb_gisb_arb_probe()
499 list_add_tail(&gdev->next, &brcmstb_gisb_arb_device_list); in brcmstb_gisb_arb_probe()
511 dev_info(&pdev->dev, "registered irqs: %d, %d\n", in brcmstb_gisb_arb_probe()
522 gdev->saved_timeout = gisb_read(gdev, ARB_TIMER); in brcmstb_gisb_arb_suspend()
528 * do this before the GISB timeout interrupt handler has any chance to run.
534 gisb_write(gdev, gdev->saved_timeout, ARB_TIMER); in brcmstb_gisb_arb_resume_noirq()
550 .name = "brcm-gisb-arb",
565 MODULE_DESCRIPTION("Broadcom STB GISB arbiter driver");