3 * Murray Jensen, CSIRO-MIT, <Murray.Jensen@csiro.au>
5 * SPDX-License-Identifier: GPL-2.0+
12 hymod_get_serno (const char *prompt)
18 #ifdef CONFIG_BOOT_RETRY_TIME
22 n = readline (prompt);
30 serno = (int) simple_strtol (console_buffer, &p, 10);
32 if (p > console_buffer && *p == '\0' && serno > 0)
35 printf ("Invalid number (%s) - please re-enter\n",
41 hymod_get_ethaddr (void)
46 #ifdef CONFIG_BOOT_RETRY_TIME
50 n = readline ("Enter board ethernet address: ");
62 /* see if it looks like an ethernet address */
66 for (i = 0; i < 6; i++) {
67 char term = (i == 5 ? '\0' : ':');
69 (void)simple_strtol (p, &q, 16);
71 if ((q - p) != 2 || *q++ != term)
78 /* it looks ok - set it */
79 printf ("Setting ethernet addr to %s\n",
82 setenv ("ethaddr", console_buffer);
84 puts ("Remember to do a 'saveenv' to "
85 "make it permanent\n");
91 printf ("Invalid ethernet addr (%s) - please re-enter\n",