* Copyright 2008 Silicon Turnkey Express, Inc.
* Martha Marx <mmarx@silicontkx.com>
*
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
+ * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
"what you are doing!\n"
"\nReally perform this fuse programming? <y/N>\n");
- if (getc() == 'y') {
- int c;
-
- putc('y');
- c = getc();
- putc('\n');
- if (c == '\r')
- return 1;
- }
+ if (confirm_yesno())
+ return 1;
puts("Fuse programming aborted\n");
return 0;
printf("Reading bank %u:\n", bank);
for (i = 0; i < cnt; i++, word++) {
if (!(i % 4))
- printf("\nWord 0x%.8x:", word);
+ printf("\nWord 0x%08x:", word);
ret = fuse_read(bank, word, &val);
if (ret)
goto err;
- printf(" %.8x", val);
+ printf(" %08x", val);
}
putc('\n');
} else if (!strcmp(op, "sense")) {
printf("Sensing bank %u:\n", bank);
for (i = 0; i < cnt; i++, word++) {
if (!(i % 4))
- printf("\nWord 0x%.8x:", word);
+ printf("\nWord 0x%08x:", word);
ret = fuse_sense(bank, word, &val);
if (ret)
goto err;
- printf(" %.8x", val);
+ printf(" %08x", val);
}
putc('\n');
} else if (!strcmp(op, "prog")) {
if (strtou32(argv[i], 16, &val))
return CMD_RET_USAGE;
- printf("Programming bank %u word 0x%.8x to 0x%.8x...\n",
+ printf("Programming bank %u word 0x%08x to 0x%08x...\n",
bank, word, val);
if (!confirmed && !confirm_prog())
return CMD_RET_FAILURE;
if (strtou32(argv[i], 16, &val))
return CMD_RET_USAGE;
- printf("Overriding bank %u word 0x%.8x with "
- "0x%.8x...\n", bank, word, val);
+ printf("Overriding bank %u word 0x%08x with 0x%08x...\n",
+ bank, word, val);
ret = fuse_override(bank, word, val);
if (ret)
goto err;
err:
puts("ERROR\n");
- return ret;
+ return CMD_RET_FAILURE;
}
U_BOOT_CMD(