[FIX] repair MFSL commands

master
Michal Simek 18 years ago
parent b90c045f03
commit 481d432861
  1. 16
      common/cmd_mfsl.c

@ -355,19 +355,18 @@ int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
unsigned int reg = 0; unsigned int reg = 0;
unsigned int val = 0; unsigned int val = 0;
reg = (unsigned int)simple_strtoul (argv[1], NULL, 16); if (argc < 2) {
val = (unsigned int)simple_strtoul (argv[2], NULL, 16);
if (argc < 1) {
printf ("Usage:\n%s\n", cmdtp->usage); printf ("Usage:\n%s\n", cmdtp->usage);
return 1; return 1;
} }
reg = (unsigned int)simple_strtoul (argv[1], NULL, 16);
val = (unsigned int)simple_strtoul (argv[2], NULL, 16);
switch (reg) { switch (reg) {
case 0x1: case 0x1:
if (argc > 2) { if (argc > 2) {
MTS (val, rmsr); MTS (val, rmsr);
NOP; NOP;
MFS (val, rmsr); MFS (val, rmsr);
} else { } else {
MFS (val, rmsr); MFS (val, rmsr);
} }
@ -382,6 +381,7 @@ int do_rspr (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
puts ("ESR"); puts ("ESR");
break; break;
default: default:
puts ("Unsupported register\n");
return 1; return 1;
} }
printf (": 0x%08lx\n", val); printf (": 0x%08lx\n", val);
@ -408,10 +408,10 @@ U_BOOT_CMD (fwr, 4, 1, do_fwr,
" 3 - blocking control write\n"); " 3 - blocking control write\n");
U_BOOT_CMD (rspr, 3, 1, do_rspr, U_BOOT_CMD (rspr, 3, 1, do_rspr,
"rmsr - read/write special purpose register\n", "rspr - read/write special purpose register\n",
"- reg_num [write value] read/write special purpose register\n" "- reg_num [write value] read/write special purpose register\n"
" 0 - MSR - Machine status register\n" " 1 - MSR - Machine status register\n"
" 1 - EAR - Exception address register\n" " 3 - EAR - Exception address register\n"
" 2 - ESR - Exception status register\n"); " 5 - ESR - Exception status register\n");
#endif #endif

Loading…
Cancel
Save