Lines Matching +full:system +full:- +full:reboot +full:- +full:controller

1 // SPDX-License-Identifier: GPL-2.0
3 * LiteX SoC Controller Driver
17 #include <linux/reboot.h>
48 …panic("Scratch register read error - the system is probably broken! Expected: 0x%x but got: 0x%lx", in litex_check_csr_access()
50 return -EINVAL; in litex_check_csr_access()
57 …panic("Scratch register write error - the system is probably broken! Expected: 0x%x but got: 0x%lx… in litex_check_csr_access()
59 return -EINVAL; in litex_check_csr_access()
65 pr_info("LiteX SoC Controller driver initialized"); in litex_check_csr_access()
81 litex_write32(soc_ctrl_dev->base + RESET_REG_OFF, RESET_REG_VALUE); in litex_reset_handler()
87 {.compatible = "litex,soc-controller"},
98 soc_ctrl_dev = devm_kzalloc(&pdev->dev, sizeof(*soc_ctrl_dev), GFP_KERNEL); in litex_soc_ctrl_probe()
100 return -ENOMEM; in litex_soc_ctrl_probe()
102 soc_ctrl_dev->base = devm_platform_ioremap_resource(pdev, 0); in litex_soc_ctrl_probe()
103 if (IS_ERR(soc_ctrl_dev->base)) in litex_soc_ctrl_probe()
104 return PTR_ERR(soc_ctrl_dev->base); in litex_soc_ctrl_probe()
106 error = litex_check_csr_access(soc_ctrl_dev->base); in litex_soc_ctrl_probe()
112 soc_ctrl_dev->reset_nb.notifier_call = litex_reset_handler; in litex_soc_ctrl_probe()
113 soc_ctrl_dev->reset_nb.priority = 128; in litex_soc_ctrl_probe()
114 error = register_restart_handler(&soc_ctrl_dev->reset_nb); in litex_soc_ctrl_probe()
116 dev_warn(&pdev->dev, "cannot register restart handler: %d\n", in litex_soc_ctrl_probe()
127 unregister_restart_handler(&soc_ctrl_dev->reset_nb); in litex_soc_ctrl_remove()
133 .name = "litex-soc-controller",
141 MODULE_DESCRIPTION("LiteX SoC Controller driver");