Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / u-boot / arch / sparc / cpu / leon3 / cpu.c
1 /* CPU specific code for the LEON3 CPU
2  *
3  * (C) Copyright 2007
4  * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com
5  *
6  * SPDX-License-Identifier:     GPL-2.0+
7  */
8
9 #include <common.h>
10 #include <watchdog.h>
11 #include <command.h>
12 #include <netdev.h>
13
14 #include <asm/io.h>
15 #include <asm/processor.h>
16
17 DECLARE_GLOBAL_DATA_PTR;
18
19 extern void _reset_reloc(void);
20
21 int checkcpu(void)
22 {
23         /* check LEON version here */
24         printf("CPU: LEON3\n");
25         return 0;
26 }
27
28 /* ------------------------------------------------------------------------- */
29
30 void cpu_reset(void)
31 {
32         /* Interrupts off */
33         disable_interrupts();
34
35         /* jump to restart in flash */
36         _reset_reloc();
37 }
38
39 int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
40 {
41         cpu_reset();
42
43         return 1;
44
45 }
46
47 u64 flash_read64(void *addr)
48 {
49         return __raw_readq(addr);
50 }
51
52 /* ------------------------------------------------------------------------- */
53
54 #ifdef CONFIG_GRETH
55 int cpu_eth_init(bd_t *bis)
56 {
57         return greth_initialize(bis);
58 }
59 #endif