]> git.sur5r.net Git - u-boot/blobdiff - board/buffalo/lsxl/lsxl.c
net: Move enetaddr env access code to env config instead of net config
[u-boot] / board / buffalo / lsxl / lsxl.c
index 659a124b22750fda1fb4b02df5d74defaf4012e6..8ae420740d1bab3055798e7459437cfe047b2bec 100644 (file)
@@ -9,15 +9,17 @@
  */
 
 #include <common.h>
+#include <environment.h>
 #include <net.h>
 #include <malloc.h>
 #include <netdev.h>
 #include <miiphy.h>
-#include <asm/arch/kirkwood.h>
+#include <spi.h>
+#include <spi_flash.h>
+#include <asm/arch/soc.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/mpp.h>
 #include <asm/arch/gpio.h>
-#include <spi_flash.h>
 
 #include "lsxl.h"
 
@@ -51,9 +53,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
@@ -167,7 +169,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);
 
@@ -202,7 +204,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);
        }
@@ -226,20 +228,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)