blob: 43b182e57ebbf2417980651a7574a79902e0f997 [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 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenk858b1a62002-09-30 16:12:23 +00006 *
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
16extern void print_pip405_info(void);
Wolfgang Denk54841ab2010-06-28 22:00:46 +020017extern int do_mplcommon(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
wdenk858b1a62002-09-30 16:12:23 +000018
19
wdenk858b1a62002-09-30 16:12:23 +000020/* ------------------------------------------------------------------------- */
21
Wolfgang Denk54841ab2010-06-28 22:00:46 +020022int do_pip405(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
wdenk858b1a62002-09-30 16:12:23 +000023{
24
Wolfgang Denk53677ef2008-05-20 16:00:29 +020025 ulong led_on,led_nr;
wdenk858b1a62002-09-30 16:12:23 +000026
27 if (strcmp(argv[1], "info") == 0)
28 {
29 print_pip405_info();
Wolfgang Denk53677ef2008-05-20 16:00:29 +020030 return 0;
31 }
32 if (strcmp(argv[1], "led") == 0)
wdenk858b1a62002-09-30 16:12:23 +000033 {
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 Denk53677ef2008-05-20 16:00:29 +020041 }
wdenk858b1a62002-09-30 16:12:23 +000042
43 return (do_mplcommon(cmdtp, flag, argc, argv));
44}
wdenk0d498392003-07-01 21:06:45 +000045U_BOOT_CMD(
46 pip405, 6, 1, do_pip405,
Peter Tyser2fb26042009-01-27 18:03:12 -060047 "PIP405 specific Cmds",
wdenk8bde7f72003-06-27 21:31:46 +000048 "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 Denka89c33d2009-05-24 17:06:54 +020050 "pip405 flash mps - updates U-Boot with image from MPS"
wdenk8bde7f72003-06-27 21:31:46 +000051);
wdenk858b1a62002-09-30 16:12:23 +000052
53/* ------------------------------------------------------------------------- */