blob: 554c8d1d72193dbe623f07683605a07a31b98068 [file] [log] [blame]
wdenk858b1a62002-09-30 16:12:23 +00001/*
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 PIP405
24 */
25
26#include <common.h>
27#include <command.h>
28#include "pip405.h"
29#include "../common/common_util.h"
30
31
32extern void print_pip405_info(void);
Wolfgang Denk6262d0212010-06-28 22:00:46 +020033extern int do_mplcommon(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
wdenk858b1a62002-09-30 16:12:23 +000034
35
wdenk858b1a62002-09-30 16:12:23 +000036/* ------------------------------------------------------------------------- */
37
Wolfgang Denk6262d0212010-06-28 22:00:46 +020038int do_pip405(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
wdenk858b1a62002-09-30 16:12:23 +000039{
40
Wolfgang Denka1be4762008-05-20 16:00:29 +020041 ulong led_on,led_nr;
wdenk858b1a62002-09-30 16:12:23 +000042
43 if (strcmp(argv[1], "info") == 0)
44 {
45 print_pip405_info();
Wolfgang Denka1be4762008-05-20 16:00:29 +020046 return 0;
47 }
48 if (strcmp(argv[1], "led") == 0)
wdenk858b1a62002-09-30 16:12:23 +000049 {
50 led_nr = (ulong)simple_strtoul(argv[2], NULL, 10);
51 led_on = (ulong)simple_strtoul(argv[3], NULL, 10);
52 if(!led_nr)
53 user_led0(led_on);
54 else
55 user_led1(led_on);
56 return 0;
Wolfgang Denka1be4762008-05-20 16:00:29 +020057 }
wdenk858b1a62002-09-30 16:12:23 +000058
59 return (do_mplcommon(cmdtp, flag, argc, argv));
60}
wdenkf287a242003-07-01 21:06:45 +000061U_BOOT_CMD(
62 pip405, 6, 1, do_pip405,
Peter Tyserdfb72b82009-01-27 18:03:12 -060063 "PIP405 specific Cmds",
wdenk57b2d802003-06-27 21:31:46 +000064 "flash mem [SrcAddr] - updates U-Boot with image in memory\n"
65 "pip405 flash floppy [SrcAddr] - updates U-Boot with image from floppy\n"
Wolfgang Denkc54781c2009-05-24 17:06:54 +020066 "pip405 flash mps - updates U-Boot with image from MPS"
wdenk57b2d802003-06-27 21:31:46 +000067);
wdenk858b1a62002-09-30 16:12:23 +000068
69/* ------------------------------------------------------------------------- */