blob: 380c397be04224d4034a69a5dc07ba6cf5dc9183 [file] [log] [blame]
Daniel Hellstromb3309902008-03-28 10:00:33 +01001/* CPU specific code for the LEON2 CPU
2 *
3 * (C) Copyright 2007
4 * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com
5 *
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
25/* ------------------------------------------------------------------------- */
26
27void cpu_reset(void)
28{
29 /* Interrupts off */
30 disable_interrupts();
31
32 /* jump to restart in flash */
33 _reset_reloc();
34}
35
Wolfgang Denk54841ab2010-06-28 22:00:46 +020036int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
Daniel Hellstromb3309902008-03-28 10:00:33 +010037{
38 cpu_reset();
39
40 return 1;
41}
42
43/* ------------------------------------------------------------------------- */
Ben Warrenfc363ce2008-07-09 01:04:19 -070044
Ben Warrenfc363ce2008-07-09 01:04:19 -070045#ifdef CONFIG_GRETH
46int cpu_eth_init(bd_t *bis)
47{
48 return greth_initialize(bis);
49}
50#endif