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