| // SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| * Copyright (c) 2019 Amlogic, Inc. All rights reserved. |
| #include <asm/arch/romboot.h> |
| #include <asm/arch/cpu_reset.h> |
| #include <asm/arch/timer.h> |
| void set_pwm_to_input(void) |
| val = readl(AO_RTI_PINMUX_REG1); |
| writel(val, AO_RTI_PINMUX_REG1);/* clear pinmux */ |
| val = readl(AO_GPIO_O_EN_N); |
| writel(val, AO_GPIO_O_EN_N);/* set input mode */ |
| val = readl(AO_RTI_PULL_UP_EN_REG); |
| writel(val, AO_RTI_PULL_UP_EN_REG);/* disable pull up/down */ |
| struct udevice *watchdog_devp; |
| _udelay(10000); //wait print |
| ret = uclass_get_device_by_name(UCLASS_WDT, "watchdog", &watchdog_devp); |
| printf("failed to reset system because can't get wdt device\n"); |
| wdt_start(watchdog_devp, 0, 0); |
| /* uboot reset interface */ |
| void reset_cpu(unsigned long flag){ |