blob: d044c3abc72fb592aa3a99ad1c6812bb48d0fbd9 [file] [log] [blame]
Daniel Hellstromb3309902008-03-28 10:00:33 +01001/* CPU specific code for the LEON2 CPU
2 *
Francois Retiefe17c5202015-10-28 14:29:32 +02003 * (C) Copyright 2007, 2015
4 * Daniel Hellstrom, Cobham Gaisler, daniel@gaisler.com
Daniel Hellstromb3309902008-03-28 10:00:33 +01005 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Daniel Hellstromb3309902008-03-28 10:00:33 +01007 */
8
9#include <common.h>
10#include <watchdog.h>
11#include <command.h>
Ben Warren89973f82008-08-31 22:22:04 -070012#include <netdev.h>
Daniel Hellstromb3309902008-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 Retief4c547752015-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 Hellstromb3309902008-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 Denk54841ab2010-06-28 22:00:46 +020046int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
Daniel Hellstromb3309902008-03-28 10:00:33 +010047{
48 cpu_reset();
49
50 return 1;
51}
52
53/* ------------------------------------------------------------------------- */
Ben Warrenfc363ce2008-07-09 01:04:19 -070054
Ben Warrenfc363ce2008-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