2 * (C) Copyright 2008-2010 Freescale Semiconductor, Inc.
4 * Copyright 2007, Freescale Semiconductor, Inc
7 * Based vaguely on the pxa mmc code:
9 * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
11 * See file CREDITS for list of people who contributed to this
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of
17 * the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 #include <linux/types.h>
34 #include <asm/imx_iim.h>
36 int do_iimops(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
42 if (argc < 3 || argc > 5)
45 if (strcmp(argv[1], "read") == 0) {
46 if (strcmp(argv[2], "fecmac") == 0) {
48 iim_blow_func(argv[2], NULL);
53 bank = simple_strtoul(argv[2], NULL, 16);
54 row = simple_strtoul(argv[3], NULL, 16);
60 } else if (strcmp(argv[1], "blow") == 0) {
61 if (strcmp(argv[2], "fecmac") == 0) {
63 iim_blow_func(argv[2], argv[3]);
68 bank = simple_strtoul(argv[2], NULL, 16);
69 row = simple_strtoul(argv[3], NULL, 16);
70 val = simple_strtoul(argv[4], NULL, 16);
72 iim_blow(bank, row, val);
81 printf("Invalid parameters!\n");
82 printf("It is too dangeous for you to use iim command.\n");
89 "Warning: all numbers in parameter are in hex format!\n"
90 "iim read <bank> <row> - Read some fuses\n"
91 "iim read fecmac - Read FEC Mac address\n"
92 "iim blow <bank> <row> <value> - Blow some fuses\n"
93 "iim blow fecmac <0x##:0x##:0x##:0x##:0x##:0x##>"
94 "- Blow FEC Mac address");