5 * See file CREDITS for list of people who contributed to this
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
25 * IBM 4XX DCR Functions
33 #if defined(CONFIG_4xx) && defined(CFG_CMD_SETGETDCR)
35 /* ======================================================================
36 * Interpreter command to retrieve an IBM PPC 4xx Device Control Register
37 * ======================================================================
39 int do_getdcr ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] )
41 unsigned short dcrn; /* Device Control Register Num */
42 unsigned long value; /* DCR's value */
44 /* Validate arguments */
46 printf("Usage:\n%s\n", cmdtp->usage);
51 dcrn = (unsigned short)simple_strtoul(argv[ 1 ], NULL, 16);
52 value = get_dcr(dcrn);
54 printf("%04x: %08lx\n", dcrn, value);
60 /* ======================================================================
61 * Interpreter command to set an IBM PPC 4xx Device Control Register
62 * ======================================================================
64 int do_setdcr ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
66 unsigned short dcrn; /* Device Control Register Num */
67 unsigned long value; /* DCR's value */
69 extern char console_buffer[];
71 /* Validate arguments */
73 printf("Usage:\n%s\n", cmdtp->usage);
78 dcrn = (unsigned short)simple_strtoul(argv[1], NULL, 16);
80 value = get_dcr(dcrn);
81 printf("%04x: %08lx", dcrn, value);
82 nbytes = readline(" ? ");
85 * <CR> pressed as only input, don't modify current
86 * location and exit command.
93 i = simple_strtoul(console_buffer, &endp, 16);
94 nbytes = endp - console_buffer;
103 #endif /* CONFIG_4xx & CFG_CMD_SETGETDCR */