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 * Adapted for U-Boot version 2012-04-01 by Lothar Waßmann <LW@KARO-electronics.de>
13 * See file CREDITS for list of people who contributed to this
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License as
18 * published by the Free Software Foundation; either version 2 of
19 * the License, or (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
34 #include <linux/types.h>
36 #include <asm/arch/imx_iim.h>
38 int do_iimops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
44 if (argc < 3 || argc > 5)
47 if (strcmp(argv[1], "read") == 0) {
48 if (strcmp(argv[2], "fecmac") == 0) {
50 iim_blow_func(argv[2], NULL);
55 bank = simple_strtoul(argv[2], NULL, 16);
56 row = simple_strtoul(argv[3], NULL, 16);
62 } else if (strcmp(argv[1], "blow") == 0) {
63 if (strcmp(argv[2], "fecmac") == 0) {
65 iim_blow_func(argv[2], argv[3]);
70 bank = simple_strtoul(argv[2], NULL, 16);
71 row = simple_strtoul(argv[3], NULL, 16);
72 val = simple_strtoul(argv[4], NULL, 16);
74 iim_blow(bank, row, val);
83 printf("Invalid parameters!\n");
84 printf("It is too dangeous for you to use iim command.\n");
91 "Warning: all numbers in parameter are in hex format!\n"
92 "iim read <bank> <row> - Read some fuses\n"
93 "iim read fecmac - Read FEC Mac address\n"
94 "iim blow <bank> <row> <value> - Blow some fuses\n"
95 "iim blow fecmac <0x##:0x##:0x##:0x##:0x##:0x##>"
96 "- Blow FEC Mac address");