3 * Murray Jensen, CSIRO-MIT, <Murray.Jensen@csiro.au>
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,
27 hymod_get_serno (const char *prompt)
33 #ifdef CONFIG_BOOT_RETRY_TIME
37 n = readline (prompt);
45 serno = (int) simple_strtol (console_buffer, &p, 10);
47 if (p > console_buffer && *p == '\0' && serno > 0)
50 printf ("Invalid number (%s) - please re-enter\n",
56 hymod_get_ethaddr (void)
61 #ifdef CONFIG_BOOT_RETRY_TIME
65 n = readline ("Enter board ethernet address: ");
77 /* see if it looks like an ethernet address */
81 for (i = 0; i < 6; i++) {
82 char term = (i == 5 ? '\0' : ':');
84 (void)simple_strtol (p, &q, 16);
86 if ((q - p) != 2 || *q++ != term)
93 /* it looks ok - set it */
94 printf ("Setting ethernet addr to %s\n",
97 setenv ("ethaddr", console_buffer);
99 puts ("Remember to do a 'saveenv' to "
100 "make it permanent\n");
106 printf ("Invalid ethernet addr (%s) - please re-enter\n",