blob: d044c3abc72fb592aa3a99ad1c6812bb48d0fbd9 [file] [log] [blame]
Daniel Hellstrom207e6952008-03-28 10:00:33 +01001/* CPU specific code for the LEON2 CPU
2 *
Francois Retiefe3051d92015-10-28 14:29:32 +02003 * (C) Copyright 2007, 2015
4 * Daniel Hellstrom, Cobham Gaisler, daniel@gaisler.com
Daniel Hellstrom207e6952008-03-28 10:00:33 +01005 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Daniel Hellstrom207e6952008-03-28 10:00:33 +01007 */
8
9#include <common.h>
10#include <watchdog.h>
11#include <command.h>
Ben Warren2f2b6b62008-08-31 22:22:04 -070012#include <netdev.h>
Daniel Hellstrom207e6952008-03-28 10:00:33 +010013
14DECLARE_GLOBAL_DATA_PTR;
15
16extern void _reset_reloc(void);
17
18int checkcpu(void)
19{
20 /* check LEON version here */
21 printf("CPU: LEON2\n");
22 return 0;
23}
24
Francois Retief703d0242015-10-28 16:49:02 +020025#ifdef CONFIG_DISPLAY_CPUINFO
26
27int print_cpuinfo(void)
28{
29 printf("CPU: LEON2\n");
30 return 0;
31}
32
33#endif
34
Daniel Hellstrom207e6952008-03-28 10:00:33 +010035/* ------------------------------------------------------------------------- */
36
37void cpu_reset(void)
38{
39 /* Interrupts off */
40 disable_interrupts();
41
42 /* jump to restart in flash */
43 _reset_reloc();
44}
45
Wolfgang Denk6262d0212010-06-28 22:00:46 +020046int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
Daniel Hellstrom207e6952008-03-28 10:00:33 +010047{
48 cpu_reset();
49
50 return 1;
51}
52
53/* ------------------------------------------------------------------------- */
Ben Warren8c042b62008-07-09 01:04:19 -070054
Ben Warren8c042b62008-07-09 01:04:19 -070055#ifdef CONFIG_GRETH
56int cpu_eth_init(bd_t *bis)
57{
58 return greth_initialize(bis);
59}
60#endif