blob: 8ab315016b689e44f1d539016790af94214fd218 [file] [log] [blame]
Daniel Hellstromb552dbe2008-03-26 22:51:29 +01001/* CPU specific code for the LEON3 CPU
2 *
3 * (C) Copyright 2007
4 * Daniel Hellstrom, Gaisler Research, daniel@gaisler.com
5 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Daniel Hellstromb552dbe2008-03-26 22:51:29 +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 Hellstromb552dbe2008-03-26 22:51:29 +010013
14#include <asm/io.h>
15#include <asm/processor.h>
16
17DECLARE_GLOBAL_DATA_PTR;
18
19extern void _reset_reloc(void);
20
21int checkcpu(void)
22{
23 /* check LEON version here */
24 printf("CPU: LEON3\n");
25 return 0;
26}
27
28/* ------------------------------------------------------------------------- */
29
30void cpu_reset(void)
31{
32 /* Interrupts off */
33 disable_interrupts();
34
35 /* jump to restart in flash */
36 _reset_reloc();
37}
38
Wolfgang Denk6262d0212010-06-28 22:00:46 +020039int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
Daniel Hellstromb552dbe2008-03-26 22:51:29 +010040{
41 cpu_reset();
42
43 return 1;
44
45}
46
47u64 flash_read64(void *addr)
48{
49 return __raw_readq(addr);
50}
51
52/* ------------------------------------------------------------------------- */
Ben Warren8c042b62008-07-09 01:04:19 -070053
54#ifdef CONFIG_GRETH
55int cpu_eth_init(bd_t *bis)
56{
57 return greth_initialize(bis);
58}
59#endif