// SPDX-License-Identifier: GPL-2.0 /* * Copyright (C) 2020 ArtInChip Technology Co.,Ltd * Author: Dehuang Wu */ #include #include #include #include #include #include #include #include #include #include #include #include int arch_cpu_init(void) { if (!icache_status()) icache_enable(); return 0; } void enable_caches(void) { if (!icache_status()) icache_enable(); if (!dcache_status()) dcache_enable(); pr_info("Cache enabled.\n"); } int print_cpuinfo(void) { return 0; } #ifndef CONFIG_SPL_BUILD int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct udevice __maybe_unused *dev; int ret = 0; printf("resetting ...\n"); #ifdef CONFIG_WDT_ARTINCHIP ret = uclass_get_device(UCLASS_WDT, 0, &dev); if (ret) { pr_err("Failed to get watchdog.\n"); return ret; } ret = wdt_expire_now(dev, 0); if (ret) { printf("Expiring watchdog failed. ret = %d.\n", ret); ret = CMD_RET_FAILURE; } else { ret = CMD_RET_SUCCESS; } mdelay(1000); #endif hang(); return ret; } #endif