3 * Murray Jensen, CSIRO-MIT, <Murray.Jensen@csiro.au>
5 * SPDX-License-Identifier: GPL-2.0+
11 hymod_get_serno (const char *prompt)
17 #ifdef CONFIG_BOOT_RETRY_TIME
21 n = readline (prompt);
29 serno = (int) simple_strtol (console_buffer, &p, 10);
31 if (p > console_buffer && *p == '\0' && serno > 0)
34 printf ("Invalid number (%s) - please re-enter\n",
40 hymod_get_ethaddr (void)
45 #ifdef CONFIG_BOOT_RETRY_TIME
49 n = readline ("Enter board ethernet address: ");
61 /* see if it looks like an ethernet address */
65 for (i = 0; i < 6; i++) {
66 char term = (i == 5 ? '\0' : ':');
68 (void)simple_strtol (p, &q, 16);
70 if ((q - p) != 2 || *q++ != term)
77 /* it looks ok - set it */
78 printf ("Setting ethernet addr to %s\n",
81 setenv ("ethaddr", console_buffer);
83 puts ("Remember to do a 'saveenv' to "
84 "make it permanent\n");
90 printf ("Invalid ethernet addr (%s) - please re-enter\n",