3 * Murray Jensen, CSIRO-MIT, <Murray.Jensen@csiro.au>
5 * SPDX-License-Identifier: GPL-2.0+
13 hymod_get_serno (const char *prompt)
19 #ifdef CONFIG_BOOT_RETRY_TIME
23 n = cli_readline(prompt);
31 serno = (int) simple_strtol (console_buffer, &p, 10);
33 if (p > console_buffer && *p == '\0' && serno > 0)
36 printf ("Invalid number (%s) - please re-enter\n",
42 hymod_get_ethaddr (void)
47 #ifdef CONFIG_BOOT_RETRY_TIME
51 n = cli_readline("Enter board ethernet address: ");
63 /* see if it looks like an ethernet address */
67 for (i = 0; i < 6; i++) {
68 char term = (i == 5 ? '\0' : ':');
70 (void)simple_strtol (p, &q, 16);
72 if ((q - p) != 2 || *q++ != term)
79 /* it looks ok - set it */
80 printf ("Setting ethernet addr to %s\n",
83 setenv ("ethaddr", console_buffer);
85 puts ("Remember to do a 'saveenv' to "
86 "make it permanent\n");
92 printf ("Invalid ethernet addr (%s) - please re-enter\n",