]> Git Repo - J-u-boot.git/blame - arch/nds32/cpu/n1213/ag101/cpu.c
command: Remove the cmd_tbl_t typedef
[J-u-boot.git] / arch / nds32 / cpu / n1213 / ag101 / cpu.c
CommitLineData
83d290c5 1// SPDX-License-Identifier: GPL-2.0+
445a886d
ML
2/*
3 * (C) Copyright 2002
4 * Sysgo Real-Time Solutions, GmbH <www.elinos.com>
5 * Marius Groeger <[email protected]>
6 *
7 * (C) Copyright 2002
8 * Gary Jennejohn, DENX Software Engineering, <[email protected]>
9 *
10 * Copyright (C) 2011 Andes Technology Corporation
11 * Shawn Lin, Andes Technology Corporation <[email protected]>
12 * Macpaul Lin, Andes Technology Corporation <[email protected]>
445a886d
ML
13 */
14
15/* CPU specific code */
16#include <common.h>
17#include <command.h>
9edefc27 18#include <cpu_func.h>
36bf446b 19#include <irq_func.h>
445a886d
ML
20#include <watchdog.h>
21#include <asm/cache.h>
22
23#include <faraday/ftwdt010_wdt.h>
24
25/*
26 * cleanup_before_linux() is called just before we call linux
27 * it prepares the processor for linux
28 *
29 * we disable interrupt and caches.
30 */
31int cleanup_before_linux(void)
32{
445a886d
ML
33 disable_interrupts();
34
445a886d 35 /* turn off I/D-cache */
b841b6e9 36 cache_flush();
445a886d
ML
37 icache_disable();
38 dcache_disable();
445a886d
ML
39 return 0;
40}
41
09140113 42int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
445a886d
ML
43{
44 disable_interrupts();
45
46 /*
47 * reset to the base addr of andesboot.
48 * currently no ROM loader at addr 0.
49 * do not use reset_cpu(0);
50 */
51#ifdef CONFIG_FTWDT010_WATCHDOG
52 /*
53 * workaround: if we use CONFIG_HW_WATCHDOG with ftwdt010, will lead
54 * automatic hardware reset when booting Linux.
55 * Please do not use CONFIG_HW_WATCHDOG and WATCHDOG_RESET() here.
56 */
57 ftwdt010_wdt_reset();
58 while (1)
59 ;
60#endif /* CONFIG_FTWDT010_WATCHDOG */
61
62 /*NOTREACHED*/
63}
This page took 0.360188 seconds and 4 git commands to generate.