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 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 6 | * |
| 7 | * hacked for MIP405 |
| 8 | */ |
| 9 | |
| 10 | #include <common.h> |
| 11 | #include <command.h> |
| 12 | #include "mip405.h" |
| 13 | #include "../common/common_util.h" |
| 14 | |
| 15 | |
| 16 | extern void print_mip405_info(void); |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 17 | extern int do_mplcommon(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]); |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 18 | |
| 19 | |
| 20 | /* ------------------------------------------------------------------------- */ |
| 21 | |
Wolfgang Denk | 6262d021 | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 22 | int do_mip405(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 23 | { |
| 24 | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 25 | ulong led_on; |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 26 | |
| 27 | if (strcmp(argv[1], "info") == 0) |
| 28 | { |
| 29 | print_mip405_info(); |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 30 | return 0; |
| 31 | } |
| 32 | if (strcmp(argv[1], "led") == 0) |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 33 | { |
| 34 | led_on = (ulong)simple_strtoul(argv[2], NULL, 10); |
| 35 | user_led0(led_on); |
| 36 | return 0; |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 37 | } |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 38 | return (do_mplcommon(cmdtp, flag, argc, argv)); |
| 39 | } |
wdenk | f287a24 | 2003-07-01 21:06:45 +0000 | [diff] [blame] | 40 | U_BOOT_CMD( |
wdenk | 2c9b05d | 2003-09-10 22:30:53 +0000 | [diff] [blame] | 41 | mip405, 8, 1, do_mip405, |
Peter Tyser | dfb72b8 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 42 | "MIP405 specific Cmds", |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 43 | "flash mem [SrcAddr] - updates U-Boot with image in memory\n" |
| 44 | "mip405 flash mps - updates U-Boot with image from MPS\n" |
wdenk | 2c9b05d | 2003-09-10 22:30:53 +0000 | [diff] [blame] | 45 | "mip405 info - displays board information\n" |
Peter Tyser | e9b1b49 | 2010-10-05 23:48:47 -0500 | [diff] [blame] | 46 | "mip405 led <on> - switches LED on (on=1) or off (on=0)" |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 47 | ); |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 48 | |
| 49 | /* ------------------------------------------------------------------------- */ |