// SPDX-License-Identifier: GPL-2.0 /* * Driver for Xilinx TMR Manager IP. * * Copyright (C) 2022 Advanced Micro Devices, Inc. * * Description: * This driver is developed for TMR Manager,The Triple Modular Redundancy(TMR) * Manager is responsible for handling the TMR subsystem state, including * fault detection and error recovery. The core is triplicated in each of * the sub-blocks in the TMR subsystem, and provides majority voting of * its internal state provides soft error detection, correction and * recovery.
*/
staticvoid xmb_manager_reset_handler(struct xtmr_manager_dev *xtmr_manager)
{ /* Clear the FFR Register contents as a part of recovery process. */
xtmr_manager_write(xtmr_manager, XTMR_MANAGER_FFR_OFFSET, 0);
}
staticvoid xtmr_manager_init(struct xtmr_manager_dev *xtmr_manager)
{ /* Clear the SEM interrupt mask register to disable the interrupt */
xtmr_manager_write(xtmr_manager, XTMR_MANAGER_SEMIMR_OFFSET, 0);
/* Allow recovery reset by default */
xtmr_manager->cr_val = (1 << XTMR_MANAGER_CR_RIR_SHIFT) |
xtmr_manager->magic1;
xtmr_manager_write(xtmr_manager, XTMR_MANAGER_CR_OFFSET,
xtmr_manager->cr_val); /* * Configure Break Delay Initialization Register to zero so that * break occurs immediately
*/
xtmr_manager_write(xtmr_manager, XTMR_MANAGER_BDIR_OFFSET, 0);
/* * To come out of break handler need to block the break signal * in the tmr manager, update the xtmr_manager cr_val for the same
*/
xtmr_manager->cr_val |= (1 << XTMR_MANAGER_CR_BB_SHIFT);
/* * When the break vector gets asserted because of error injection, * the break signal must be blocked before exiting from the * break handler, Below api updates the TMR manager address and * control register and error counter callback arguments, * which will be used by the break handler to block the * break and call the callback function.
*/
xmb_manager_register(xtmr_manager->phys_baseaddr, xtmr_manager->cr_val,
(void *)xmb_manager_update_errcnt,
xtmr_manager, (void *)xmb_manager_reset_handler);
}
/** * xtmr_manager_probe - Driver probe function * @pdev: Pointer to the platform_device structure * * This is the driver probe routine. It does all the memory * allocation for the device. * * Return: 0 on success and failure value on error
*/ staticint xtmr_manager_probe(struct platform_device *pdev)
{ struct xtmr_manager_dev *xtmr_manager; struct resource *res; int err;
xtmr_manager = devm_kzalloc(&pdev->dev, sizeof(*xtmr_manager),
GFP_KERNEL); if (!xtmr_manager) return -ENOMEM;
xtmr_manager->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res); if (IS_ERR(xtmr_manager->regs)) return PTR_ERR(xtmr_manager->regs);
xtmr_manager->phys_baseaddr = res->start;
err = of_property_read_u32(pdev->dev.of_node, "xlnx,magic1",
&xtmr_manager->magic1); if (err < 0) {
dev_err(&pdev->dev, "unable to read xlnx,magic1 property"); return err;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.