Lines Matching +full:fault +full:- +full:inject
1 // SPDX-License-Identifier: GPL-2.0
3 * Driver for Xilinx TMR Inject IP.
8 * This driver is developed for TMR Inject IP,The Triple Modular Redundancy(TMR)
9 * Inject provides fault injection.
17 #include <linux/fault-inject.h>
19 /* TMR Inject Register offsets */
34 * struct xtmr_inject_dev - Driver data for TMR Inject
46 MODULE_PARM_DESC(inject_request, "default fault injection attributes");
53 iowrite32(value, xtmr_inject->regs + addr); in xtmr_inject_write()
59 return ioread32(xtmr_inject->regs + addr); in xtmr_inject_read()
65 return -EINVAL; in xtmr_inject_set()
89 /* Allow fault injection */ in xtmr_inject_init()
90 cr_val = xtmr_inject->magic | in xtmr_inject_init()
95 /* Initialize the address inject and instruction inject registers */ in xtmr_inject_init()
103 * xtmr_inject_probe - Driver probe function
116 xtmr_inject = devm_kzalloc(&pdev->dev, sizeof(*xtmr_inject), in xtmr_inject_probe()
119 return -ENOMEM; in xtmr_inject_probe()
121 xtmr_inject->regs = devm_platform_ioremap_resource(pdev, 0); in xtmr_inject_probe()
122 if (IS_ERR(xtmr_inject->regs)) in xtmr_inject_probe()
123 return PTR_ERR(xtmr_inject->regs); in xtmr_inject_probe()
125 err = of_property_read_u32(pdev->dev.of_node, "xlnx,magic", in xtmr_inject_probe()
126 &xtmr_inject->magic); in xtmr_inject_probe()
128 dev_err(&pdev->dev, "unable to read xlnx,magic property"); in xtmr_inject_probe()
132 if (xtmr_inject->magic > XTMR_INJECT_MAGIC_MAX_VAL) { in xtmr_inject_probe()
133 dev_err(&pdev->dev, "invalid xlnx,magic property value"); in xtmr_inject_probe()
134 return -EINVAL; in xtmr_inject_probe()
137 /* Initialize TMR Inject */ in xtmr_inject_probe()
155 .compatible = "xlnx,tmr-inject-1.0",
163 .name = "xilinx-tmr_inject",
171 MODULE_DESCRIPTION("Xilinx TMR Inject Driver");