12345678910111213141516171819202122232425262728293031323334353637 |
- #include <common.h>
- #include <dm.h>
- #include <errno.h>
- #include <sysreset.h>
- #include <asm/io.h>
- static int xtfpga_reset_request(struct udevice *dev, enum sysreset_t type)
- {
- switch (type) {
- case SYSRESET_COLD:
- writel(CONFIG_SYS_FPGAREG_RESET_CODE,
- CONFIG_SYS_FPGAREG_RESET);
- break;
- default:
- return -EPROTONOSUPPORT;
- }
- return -EINPROGRESS;
- }
- static struct sysreset_ops xtfpga_sysreset_ops = {
- .request = xtfpga_reset_request,
- };
- U_BOOT_DRIVER(xtfpga_sysreset) = {
- .name = "xtfpga_sysreset",
- .id = UCLASS_SYSRESET,
- .ops = &xtfpga_sysreset_ops,
- };
|