common: Drop linux/delay.h from common header
[oweals/u-boot.git] / board / buffalo / lsxl / lsxl.c
index 6e648badd6a92c7ad5ea67290f5be1ecac99055e..64daa456b3c7d862124cf8dc341cc965b5e73a05 100644 (file)
@@ -1,14 +1,19 @@
+// 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 <flash.h>
+#include <init.h>
 #include <net.h>
 #include <malloc.h>
 #include <netdev.h>
@@ -19,6 +24,7 @@
 #include <asm/arch/cpu.h>
 #include <asm/arch/mpp.h>
 #include <asm/arch/gpio.h>
+#include <linux/delay.h>
 
 #include "lsxl.h"
 
@@ -52,9 +58,9 @@ int board_early_init_f(void)
         * There are maximum 64 gpios controlled through 2 sets of registers
         * the below configuration configures mainly initial LED status
         */
-       kw_config_gpio(LSXL_OE_VAL_LOW,
-                       LSXL_OE_VAL_HIGH,
-                       LSXL_OE_LOW, LSXL_OE_HIGH);
+       mvebu_config_gpio(LSXL_OE_VAL_LOW,
+                         LSXL_OE_VAL_HIGH,
+                         LSXL_OE_LOW, LSXL_OE_HIGH);
 
        /*
         * Multi-Purpose Pins Functionality configuration
@@ -168,7 +174,7 @@ static void set_led(int state)
 int board_init(void)
 {
        /* address of boot parameters */
-       gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
+       gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
 
        set_led(LED_POWER_BLINKING);
 
@@ -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)) {
-               eth_random_addr(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)