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,
26 /* imports from common/main.c */
27 extern char console_buffer[CONFIG_SYS_CBSIZE];
30 hymod_get_serno (const char *prompt)
36 #ifdef CONFIG_BOOT_RETRY_TIME
40 n = readline (prompt);
48 serno = (int) simple_strtol (console_buffer, &p, 10);
50 if (p > console_buffer && *p == '\0' && serno > 0)
53 printf ("Invalid number (%s) - please re-enter\n",
59 hymod_get_ethaddr (void)
64 #ifdef CONFIG_BOOT_RETRY_TIME
68 n = readline ("Enter board ethernet address: ");
81 /* see if it looks like an ethernet address */
85 for (i = 0; i < 6; i++) {
86 char term = (i == 5 ? '\0' : ':');
88 ea[i] = simple_strtol (p, &q, 16);
90 if ((q - p) != 2 || *q++ != term)
97 /* it looks ok - set it */
98 printf ("Setting ethernet addr to %s\n",
101 setenv ("ethaddr", console_buffer);
103 puts ("Remember to do a 'saveenv' to "
104 "make it permanent\n");
110 printf ("Invalid ethernet addr (%s) - please re-enter\n",