wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2001 |
| 3 | * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch |
| 4 | * |
| 5 | * See file CREDITS for list of people who contributed to this |
| 6 | * project. |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or |
| 9 | * modify it under the terms of the GNU General Public License as |
| 10 | * published by the Free Software Foundation; either version 2 of |
| 11 | * the License, or (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
| 21 | * MA 02111-1307 USA |
| 22 | * |
| 23 | * hacked for MIP405 |
| 24 | */ |
| 25 | |
| 26 | #include <common.h> |
| 27 | #include <command.h> |
| 28 | #include "mip405.h" |
| 29 | #include "../common/common_util.h" |
| 30 | |
| 31 | |
| 32 | extern void print_mip405_info(void); |
| 33 | extern int do_mplcommon(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); |
| 34 | |
| 35 | |
| 36 | /* ------------------------------------------------------------------------- */ |
| 37 | |
| 38 | int do_mip405(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) |
| 39 | { |
| 40 | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 41 | ulong led_on; |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 42 | |
| 43 | if (strcmp(argv[1], "info") == 0) |
| 44 | { |
| 45 | print_mip405_info(); |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 46 | return 0; |
| 47 | } |
| 48 | if (strcmp(argv[1], "led") == 0) |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 49 | { |
| 50 | led_on = (ulong)simple_strtoul(argv[2], NULL, 10); |
| 51 | user_led0(led_on); |
| 52 | return 0; |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 53 | } |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 54 | return (do_mplcommon(cmdtp, flag, argc, argv)); |
| 55 | } |
wdenk | f287a24 | 2003-07-01 21:06:45 +0000 | [diff] [blame] | 56 | U_BOOT_CMD( |
wdenk | 2c9b05d | 2003-09-10 22:30:53 +0000 | [diff] [blame] | 57 | mip405, 8, 1, do_mip405, |
Peter Tyser | dfb72b8 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 58 | "MIP405 specific Cmds", |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 59 | "flash mem [SrcAddr] - updates U-Boot with image in memory\n" |
| 60 | "mip405 flash mps - updates U-Boot with image from MPS\n" |
wdenk | 2c9b05d | 2003-09-10 22:30:53 +0000 | [diff] [blame] | 61 | "mip405 info - displays board information\n" |
| 62 | "mip405 led <on> - switches LED on (on=1) or off (on=0)\n" |
Wolfgang Denk | c54781c | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 63 | "mip405 mem [cnt] - Memory Test <cnt>-times, <cnt> = -1 loop forever" |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 64 | ); |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 65 | |
| 66 | /* ------------------------------------------------------------------------- */ |