wdenk | 591dda5 | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2002 |
| 3 | * Daniel Engström, Omicron Ceti AB, daniel@omicron.se. |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 4 | * |
wdenk | 591dda5 | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 5 | * (C) Copyright 2002 |
| 6 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 7 | * Marius Groeger <mgroeger@sysgo.de> |
| 8 | * |
| 9 | * (C) Copyright 2002 |
| 10 | * Sysgo Real-Time Solutions, GmbH <www.elinos.com> |
| 11 | * Alex Zuepke <azu@sysgo.de> |
| 12 | * |
| 13 | * See file CREDITS for list of people who contributed to this |
| 14 | * project. |
| 15 | * |
| 16 | * This program is free software; you can redistribute it and/or |
| 17 | * modify it under the terms of the GNU General Public License as |
| 18 | * published by the Free Software Foundation; either version 2 of |
| 19 | * the License, or (at your option) any later version. |
| 20 | * |
| 21 | * This program is distributed in the hope that it will be useful, |
| 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 24 | * GNU General Public License for more details. |
| 25 | * |
| 26 | * You should have received a copy of the GNU General Public License |
| 27 | * along with this program; if not, write to the Free Software |
| 28 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 29 | * MA 02111-1307 USA |
| 30 | */ |
| 31 | |
| 32 | /* |
| 33 | * CPU specific code |
| 34 | */ |
| 35 | |
| 36 | #include <common.h> |
| 37 | #include <command.h> |
| 38 | |
| 39 | int cpu_init(void) |
| 40 | { |
wdenk | abda5ca | 2003-05-31 18:35:21 +0000 | [diff] [blame] | 41 | /* initialize FPU, reset EM, set MP and NE */ |
| 42 | asm ("fninit\n" \ |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 43 | "movl %cr0, %eax\n" \ |
| 44 | "andl $~0x4, %eax\n" \ |
| 45 | "orl $0x22, %eax\n" \ |
| 46 | "movl %eax, %cr0\n" ); |
| 47 | |
wdenk | 591dda5 | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 48 | return 0; |
| 49 | } |
| 50 | |
| 51 | int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) |
| 52 | { |
| 53 | extern void reset_cpu(ulong addr); |
| 54 | |
| 55 | printf ("resetting ...\n"); |
| 56 | udelay(50000); /* wait 50 ms */ |
| 57 | disable_interrupts(); |
| 58 | reset_cpu(0); |
| 59 | |
| 60 | /*NOTREACHED*/ |
| 61 | return 0; |
| 62 | } |
| 63 | |
| 64 | void flush_cache (unsigned long dummy1, unsigned long dummy2) |
| 65 | { |
| 66 | asm("wbinvd\n"); |
| 67 | return; |
| 68 | } |