Merge tag 'tpm-030822' of https://source.denx.de/u-boot/custodians/u-boot-tpm
[platform/kernel/u-boot.git] / board / buffalo / lsxl / lsxl.c
index 487875c..31d532b 100644 (file)
@@ -1,14 +1,18 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (c) 2012 Michael Walle
  * Michael Walle <michael@walle.cc>
  *
  * Based on sheevaplug/sheevaplug.c by
  *   Marvell Semiconductor <www.marvell.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <bootstage.h>
+#include <command.h>
+#include <env.h>
+#include <env_internal.h>
+#include <init.h>
 #include <net.h>
 #include <malloc.h>
 #include <netdev.h>
@@ -19,6 +23,8 @@
 #include <asm/arch/cpu.h>
 #include <asm/arch/mpp.h>
 #include <asm/arch/gpio.h>
+#include <asm/global_data.h>
+#include <linux/delay.h>
 
 #include "lsxl.h"
 
@@ -203,7 +209,7 @@ void check_enetaddr(void)
 {
        uchar enetaddr[6];
 
-       if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
+       if (!eth_env_get_enetaddr("ethaddr", enetaddr)) {
                /* signal unset/invalid ethaddr to user */
                set_led(LED_INFO_BLINKING);
        }
@@ -227,20 +233,8 @@ static void erase_environment(void)
 
 static void rescue_mode(void)
 {
-       uchar enetaddr[6];
-
        printf("Entering rescue mode..\n");
-#ifdef CONFIG_RANDOM_MACADDR
-       if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
-               net_random_ethaddr(enetaddr);
-               if (eth_setenv_enetaddr("ethaddr", enetaddr)) {
-                       printf("Failed to set ethernet address\n");
-                               set_led(LED_ALARM_BLINKING);
-                       return;
-               }
-       }
-#endif
-       setenv("bootsource", "rescue");
+       env_set("bootsource", "rescue");
 }
 
 static void check_push_button(void)
@@ -276,7 +270,7 @@ int misc_init_r(void)
 }
 #endif
 
-#ifdef CONFIG_SHOW_BOOT_PROGRESS
+#if CONFIG_IS_ENABLED(BOOTSTAGE)
 void show_boot_progress(int progress)
 {
        if (progress > 0)