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,
142 int offset = gdev->gisb_offsets[reg]; in gisb_read()
152 if (gdev->big_endian) in gisb_read()
153 return ioread32be(gdev->base + offset); in gisb_read()
155 return ioread32(gdev->base + offset); in gisb_read()
180 int offset = gdev->gisb_offsets[reg]; in gisb_write()
182 if (offset == -1) in gisb_write()
185 if (gdev->big_endian) in gisb_write()
186 iowrite32be(val, gdev->base + offset); in gisb_write()
188 iowrite32(val, gdev->base + offset); in gisb_write()
198 mutex_lock(&gdev->lock); in gisb_arb_get_timeout()
200 mutex_unlock(&gdev->lock); in gisb_arb_get_timeout()
217 return -EINVAL; in gisb_arb_set_timeout()
219 mutex_lock(&gdev->lock); in gisb_arb_set_timeout()
221 mutex_unlock(&gdev->lock); in gisb_arb_set_timeout()
230 u32 mask = gdev->valid_mask & masters; in brcmstb_gisb_master_to_str()
235 return gdev->master_names[ffs(mask) - 1]; in brcmstb_gisb_master_to_str()
263 pr_crit("GISB: %s at 0x%llx [%c %s], core: %s\n", in brcmstb_gisb_arb_decode_addr()
269 /* clear the GISB error */ in brcmstb_gisb_arb_decode_addr()
337 pr_crit("GISB: breakpoint at 0x%llx [%c], core: %s\n", in brcmstb_gisb_bp_handler()
341 /* clear the GISB error */ in brcmstb_gisb_bp_handler()
348 * Dump out gisb errors on die or panic.
370 /* iterate over each GISB arb registered handlers */ in dump_gisb_error()
390 { .compatible = "brcm,gisb-arb", .data = gisb_offsets_bcm7445 },
391 { .compatible = "brcm,bcm7445-gisb-arb", .data = gisb_offsets_bcm7445 },
392 { .compatible = "brcm,bcm7435-gisb-arb", .data = gisb_offsets_bcm7435 },
393 { .compatible = "brcm,bcm7400-gisb-arb", .data = gisb_offsets_bcm7400 },
394 { .compatible = "brcm,bcm7278-gisb-arb", .data = gisb_offsets_bcm7278 },
395 { .compatible = "brcm,bcm7038-gisb-arb", .data = gisb_offsets_bcm7038 },
401 struct device_node *dn = pdev->dev.of_node; in brcmstb_gisb_arb_probe()
412 gdev = devm_kzalloc(&pdev->dev, sizeof(*gdev), GFP_KERNEL); in brcmstb_gisb_arb_probe()
414 return -ENOMEM; in brcmstb_gisb_arb_probe()
416 mutex_init(&gdev->lock); in brcmstb_gisb_arb_probe()
417 INIT_LIST_HEAD(&gdev->next); in brcmstb_gisb_arb_probe()
419 gdev->base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL); in brcmstb_gisb_arb_probe()
420 if (IS_ERR(gdev->base)) in brcmstb_gisb_arb_probe()
421 return PTR_ERR(gdev->base); in brcmstb_gisb_arb_probe()
426 return -EINVAL; in brcmstb_gisb_arb_probe()
428 gdev->gisb_offsets = of_id->data; in brcmstb_gisb_arb_probe()
429 gdev->big_endian = of_device_is_big_endian(dn); in brcmstb_gisb_arb_probe()
431 err = devm_request_irq(&pdev->dev, timeout_irq, in brcmstb_gisb_arb_probe()
432 brcmstb_gisb_timeout_handler, 0, pdev->name, in brcmstb_gisb_arb_probe()
437 err = devm_request_irq(&pdev->dev, tea_irq, in brcmstb_gisb_arb_probe()
438 brcmstb_gisb_tea_handler, 0, pdev->name, in brcmstb_gisb_arb_probe()
445 err = devm_request_irq(&pdev->dev, bp_irq, in brcmstb_gisb_arb_probe()
446 brcmstb_gisb_bp_handler, 0, pdev->name, in brcmstb_gisb_arb_probe()
453 if (of_property_read_u32(dn, "brcm,gisb-arb-master-mask", in brcmstb_gisb_arb_probe()
454 &gdev->valid_mask)) in brcmstb_gisb_arb_probe()
455 gdev->valid_mask = 0xffffffff; in brcmstb_gisb_arb_probe()
461 "brcm,gisb-arb-master-names"); in brcmstb_gisb_arb_probe()
462 if (hweight_long(gdev->valid_mask) == num_masters) { in brcmstb_gisb_arb_probe()
463 first = ffs(gdev->valid_mask) - 1; in brcmstb_gisb_arb_probe()
464 last = fls(gdev->valid_mask) - 1; in brcmstb_gisb_arb_probe()
467 if (!(gdev->valid_mask & BIT(i))) in brcmstb_gisb_arb_probe()
471 "brcm,gisb-arb-master-names", j, in brcmstb_gisb_arb_probe()
472 &gdev->master_names[i]); in brcmstb_gisb_arb_probe()
477 err = sysfs_create_group(&pdev->dev.kobj, &gisb_arb_sysfs_attr_group); in brcmstb_gisb_arb_probe()
483 list_add_tail(&gdev->next, &brcmstb_gisb_arb_device_list); in brcmstb_gisb_arb_probe()
495 dev_info(&pdev->dev, "registered irqs: %d, %d\n", in brcmstb_gisb_arb_probe()
506 gdev->saved_timeout = gisb_read(gdev, ARB_TIMER); in brcmstb_gisb_arb_suspend()
512 * do this before the GISB timeout interrupt handler has any chance to run.
518 gisb_write(gdev, gdev->saved_timeout, ARB_TIMER); in brcmstb_gisb_arb_resume_noirq()
534 .name = "brcm-gisb-arb",
549 MODULE_DESCRIPTION("Broadcom STB GISB arbiter driver");