yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * (C) Copyright 2002 |
| 3 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 4 | * Marius Groeger <mgroeger@sysgo.de> |
| 5 | * |
| 6 | * (C) Copyright 2002 |
| 7 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 8 | * Alex Zuepke <azu@sysgo.de> |
| 9 | * |
| 10 | * (C) Copyright 2002 |
| 11 | * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de> |
| 12 | * |
| 13 | * (C) Copyright 2004 |
| 14 | * DAVE Srl |
| 15 | * http://www.dave-tech.it |
| 16 | * http://www.wawnet.biz |
| 17 | * mailto:info@wawnet.biz |
| 18 | * |
| 19 | * (C) Copyright 2004 Texas Insturments |
| 20 | * |
| 21 | * See file CREDITS for list of people who contributed to this |
| 22 | * project. |
| 23 | * |
| 24 | * This program is free software; you can redistribute it and/or |
| 25 | * modify it under the terms of the GNU General Public License as |
| 26 | * published by the Free Software Foundation; either version 2 of |
| 27 | * the License, or (at your option) any later version. |
| 28 | * |
| 29 | * This program is distributed in the hope that it will be useful, |
| 30 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 31 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 32 | * GNU General Public License for more details. |
| 33 | * |
| 34 | * You should have received a copy of the GNU General Public License |
| 35 | * along with this program; if not, write to the Free Software |
| 36 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 37 | * MA 02111-1307 USA |
| 38 | */ |
| 39 | |
| 40 | #include <common.h> |
| 41 | #include <asm/arch/lsp_crpm.h> |
| 42 | #include <asm/io.h> |
| 43 | |
| 44 | #if ZX_RM_WDT_RESTART |
| 45 | extern void wdt_restart(void); |
| 46 | #endif |
| 47 | |
| 48 | int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
| 49 | { |
| 50 | puts ("resetting ...\n"); |
| 51 | |
| 52 | udelay (20000); /* wait 600 ms */ |
| 53 | #if ZX_RM_WDT_RESTART |
| 54 | wdt_restart(); |
| 55 | #else |
| 56 | writel(0x1,TOP_SYSCLK_BASE); |
| 57 | #endif |
| 58 | |
| 59 | //disable_interrupts(); |
| 60 | //reset_cpu(0); |
| 61 | |
| 62 | /*NOTREACHED*/ |
| 63 | return 0; |
| 64 | } |
| 65 | |
| 66 | void system_reset(void) |
| 67 | { |
| 68 | udelay (600000); /* wait 600 ms */ |
| 69 | printf("resetting ...\n"); |
| 70 | //writel(0x1<<31,TOP_SYSCLK_BASE); |
| 71 | writel(0x1,TOP_SYSCLK_BASE); |
| 72 | } |