| // SPDX-License-Identifier: GPL-2.0 |
| * Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries |
| #include <asm/arch/hardware.h> |
| #include <asm/arch/at91_rstc.h> |
| #include <dm/device_compat.h> |
| #include <dm/device-internal.h> |
| static int at91_sysreset_request(struct udevice *dev, enum sysreset_t type) |
| at91_rstc_t *rstc = (at91_rstc_t *)dev_get_priv(dev); |
| | AT91_RSTC_CR_PROCRST /* Processor Reset */ |
| | AT91_RSTC_CR_PERRST /* Peripheral Reset */ |
| #ifdef CONFIG_AT91RESET_EXTRST |
| | AT91_RSTC_CR_EXTRST /* External Reset (assert nRST pin) */ |
| static int at91_sysreset_probe(struct udevice *dev) |
| priv = dev_remap_addr(dev); |
| ret = clk_get_by_index(dev, 0, &slck); |
| ret = clk_prepare_enable(&slck); |
| static struct sysreset_ops at91_sysreset = { |
| .request = at91_sysreset_request, |
| U_BOOT_DRIVER(sysreset_at91) = { |
| .probe = at91_sysreset_probe, |