Remove "locka" command.

This command is useless, because each programming tool configures the
flash control registers before flash operations.
This commit is contained in:
Daniel Beer 2013-03-10 15:32:19 +13:00
parent 5ccf2e35d2
commit 1217d244e6
4 changed files with 0 additions and 73 deletions

View File

@ -350,17 +350,6 @@ The CPU is reset and halted before and after programming.
Write the data contained in a raw binary file to the given memory address. Write the data contained in a raw binary file to the given memory address.
The CPU is reset and halted before and after programming. The CPU is reset and halted before and after programming.
.IP "\fBlocka\fR [\fBset\fR|\fBclear\fR]"
Show or change the status of the LOCKA bit in the chip's memory
controller. The LOCKA bit is set on POR and acts as a write-protect bit
for info segment A. This segment contains factory-configured calibration
data, and under normal circumstances, should not be changed.
If the LOCKA bit is cleared, erasing the info A segment is possible.
The LOCKA bit also affects the behaviour of the "erase all" command. If
LOCKA is set (the default), only main memory is erased. If LOCKA is
cleared, main and information memory are both erased.
.IP "\fBmd\fR \fIaddress\fR [\fIlength\fR]" .IP "\fBmd\fR \fIaddress\fR [\fIlength\fR]"
Read the specified section of device memory and display it as a Read the specified section of device memory and display it as a
canonical\-style hexdump. Both arguments may be address expressions. If canonical\-style hexdump. Both arguments may be address expressions. If

View File

@ -282,13 +282,6 @@ const struct cmddb_record commands[] = {
"cgraph <address> <length> [function]\n" "cgraph <address> <length> [function]\n"
" Analyse the range given and produce a call graph. Displays a summary\n" " Analyse the range given and produce a call graph. Displays a summary\n"
" of all functions if no function address is given.\n" " of all functions if no function address is given.\n"
},
{
.name = "locka",
.func = cmd_locka,
.help =
"locka [set|clear]\n"
" Show or change the status of the LOCKA flash write-protect bit.\n"
}, },
{ {
.name = "exit", .name = "exit",

View File

@ -706,60 +706,6 @@ int cmd_break(char **arg)
return 0; return 0;
} }
#define FCTL3 0x012c
#define FCTL3_LOCKA 0x40
#define FWKEY 0xa5
#define FRKEY 0x96
int cmd_locka(char **arg)
{
const char *status = get_arg(arg);
int value = 0;
uint8_t regval[2];
if (status) {
if (!strcasecmp(status, "set")) {
value = FCTL3_LOCKA;
} else if (!strcasecmp(status, "clear")) {
value = 0;
} else {
printc_err("locka: unknown action: %s\n", status);
return -1;
}
}
if (device_readmem(FCTL3, regval, 2) < 0) {
printc_err("locka: can't read FCTL3 register\n");
return -1;
}
if (regval[1] != FRKEY) {
printc_err("warning: locka: read key invalid (got 0x%02x)\n",
regval[1]);
return -1;
}
if (status && ((regval[0] & FCTL3_LOCKA) != value)) {
printc_dbg("Toggling LOCKA bit\n");
regval[0] |= FCTL3_LOCKA;
regval[1] = FWKEY;
if (device_writemem(FCTL3, regval, 2) < 0) {
printc_err("locka: can't write FCTL3 register\n");
return -1;
}
if (device_readmem(FCTL3, regval, 2) < 0) {
printc_err("locka: can't read FCTL3 register\n");
return -1;
}
}
printc("LOCKA is %s\n", (regval[0] & FCTL3_LOCKA) ? "set" : "clear");
return 0;
}
int cmd_fill(char **arg) int cmd_fill(char **arg)
{ {
char *addr_text = get_arg(arg); char *addr_text = get_arg(arg);

View File

@ -38,7 +38,6 @@ int cmd_setwatch_r(char **arg);
int cmd_setwatch_w(char **arg); int cmd_setwatch_w(char **arg);
int cmd_delbreak(char **arg); int cmd_delbreak(char **arg);
int cmd_break(char **arg); int cmd_break(char **arg);
int cmd_locka(char **arg);
int cmd_fill(char **arg); int cmd_fill(char **arg);
#endif #endif