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 | 1a45966 | 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 PIP405 |
| 8 | */ |
| 9 | |
| 10 | #include <common.h> |
| 11 | #include <command.h> |
| 12 | #include "pip405.h" |
| 13 | #include "../common/common_util.h" |
| 14 | |
| 15 | |
| 16 | extern void print_pip405_info(void); |
Wolfgang Denk | 54841ab | 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 | |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 20 | /* ------------------------------------------------------------------------- */ |
| 21 | |
Wolfgang Denk | 54841ab | 2010-06-28 22:00:46 +0200 | [diff] [blame] | 22 | int do_pip405(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 | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 25 | ulong led_on,led_nr; |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 26 | |
| 27 | if (strcmp(argv[1], "info") == 0) |
| 28 | { |
| 29 | print_pip405_info(); |
Wolfgang Denk | 53677ef | 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_nr = (ulong)simple_strtoul(argv[2], NULL, 10); |
| 35 | led_on = (ulong)simple_strtoul(argv[3], NULL, 10); |
| 36 | if(!led_nr) |
| 37 | user_led0(led_on); |
| 38 | else |
| 39 | user_led1(led_on); |
| 40 | return 0; |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 41 | } |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 42 | |
| 43 | return (do_mplcommon(cmdtp, flag, argc, argv)); |
| 44 | } |
wdenk | 0d49839 | 2003-07-01 21:06:45 +0000 | [diff] [blame] | 45 | U_BOOT_CMD( |
| 46 | pip405, 6, 1, do_pip405, |
Peter Tyser | 2fb2604 | 2009-01-27 18:03:12 -0600 | [diff] [blame] | 47 | "PIP405 specific Cmds", |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 48 | "flash mem [SrcAddr] - updates U-Boot with image in memory\n" |
| 49 | "pip405 flash floppy [SrcAddr] - updates U-Boot with image from floppy\n" |
Wolfgang Denk | a89c33d | 2009-05-24 17:06:54 +0200 | [diff] [blame] | 50 | "pip405 flash mps - updates U-Boot with image from MPS" |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 51 | ); |
wdenk | 858b1a6 | 2002-09-30 16:12:23 +0000 | [diff] [blame] | 52 | |
| 53 | /* ------------------------------------------------------------------------- */ |