Daniel Hellstrom | 207e695 | 2008-03-28 10:00:33 +0100 | [diff] [blame] | 1 | /* CPU specific code for the LEON2 CPU |
| 2 | * |
Francois Retief | e3051d9 | 2015-10-28 14:29:32 +0200 | [diff] [blame] | 3 | * (C) Copyright 2007, 2015 |
| 4 | * Daniel Hellstrom, Cobham Gaisler, daniel@gaisler.com |
Daniel Hellstrom | 207e695 | 2008-03-28 10:00:33 +0100 | [diff] [blame] | 5 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 6 | * SPDX-License-Identifier: GPL-2.0+ |
Daniel Hellstrom | 207e695 | 2008-03-28 10:00:33 +0100 | [diff] [blame] | 7 | */ |
| 8 | |
| 9 | #include <common.h> |
| 10 | #include <watchdog.h> |
| 11 | #include <command.h> |
Ben Warren | 2f2b6b6 | 2008-08-31 22:22:04 -0700 | [diff] [blame] | 12 | #include <netdev.h> |
Daniel Hellstrom | 207e695 | 2008-03-28 10:00:33 +0100 | [diff] [blame] | 13 | |
| 14 | DECLARE_GLOBAL_DATA_PTR; |
| 15 | |
| 16 | extern void _reset_reloc(void); |
| 17 | |
| 18 | int checkcpu(void) |
| 19 | { |
| 20 | /* check LEON version here */ |
| 21 | printf("CPU: LEON2\n"); |
| 22 | return 0; |
| 23 | } |
| 24 | |
Francois Retief | 703d024 | 2015-10-28 16:49:02 +0200 | [diff] [blame] | 25 | #ifdef CONFIG_DISPLAY_CPUINFO |
| 26 | |
| 27 | int print_cpuinfo(void) |
| 28 | { |
| 29 | printf("CPU: LEON2\n"); |
| 30 | return 0; |
| 31 | } |
| 32 | |
| 33 | #endif |
| 34 | |
Daniel Hellstrom | 207e695 | 2008-03-28 10:00:33 +0100 | [diff] [blame] | 35 | /* ------------------------------------------------------------------------- */ |
| 36 | |
| 37 | void cpu_reset(void) |
| 38 | { |
| 39 | /* Interrupts off */ |
| 40 | disable_interrupts(); |
| 41 | |
| 42 | /* jump to restart in flash */ |
| 43 | _reset_reloc(); |
| 44 | } |
| 45 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 46 | int do_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) |
Daniel Hellstrom | 207e695 | 2008-03-28 10:00:33 +0100 | [diff] [blame] | 47 | { |
| 48 | cpu_reset(); |
| 49 | |
| 50 | return 1; |
| 51 | } |
| 52 | |
| 53 | /* ------------------------------------------------------------------------- */ |
Ben Warren | 8c042b6 | 2008-07-09 01:04:19 -0700 | [diff] [blame] | 54 | |
Ben Warren | 8c042b6 | 2008-07-09 01:04:19 -0700 | [diff] [blame] | 55 | #ifdef CONFIG_GRETH |
| 56 | int cpu_eth_init(bd_t *bis) |
| 57 | { |
| 58 | return greth_initialize(bis); |
| 59 | } |
| 60 | #endif |