]> Git Repo - J-u-boot.git/blobdiff - board/LaCie/netspace_v2/netspace_v2.c
arm: Finish migration of CONFIG_MACH_TYPE
[J-u-boot.git] / board / LaCie / netspace_v2 / netspace_v2.c
index 0aa5345ddcc8040ecff6e0948e0a2b3c93dc89a6..22bb008745e1f616fa9cbbd16684bcf95714d816 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2011 Simon Guinot <[email protected]>
  *
@@ -5,25 +6,17 @@
  * (C) Copyright 2009
  * Marvell Semiconductor <www.marvell.com>
  * Written-by: Prafulla Wadaskar <[email protected]>
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
  */
 
 #include <common.h>
 #include <command.h>
+#include <env.h>
+#include <init.h>
+#include <net.h>
+#include <asm/global_data.h>
+#include <asm/mach-types.h>
 #include <asm/arch/cpu.h>
-#include <asm/arch/kirkwood.h>
+#include <asm/arch/soc.h>
 #include <asm/arch/mpp.h>
 #include <asm/arch/gpio.h>
 
@@ -35,8 +28,8 @@ DECLARE_GLOBAL_DATA_PTR;
 int board_early_init_f(void)
 {
        /* Gpio configuration */
-       kw_config_gpio(NETSPACE_V2_OE_VAL_LOW, NETSPACE_V2_OE_VAL_HIGH,
-                       NETSPACE_V2_OE_LOW, NETSPACE_V2_OE_HIGH);
+       mvebu_config_gpio(NETSPACE_V2_OE_VAL_LOW, NETSPACE_V2_OE_VAL_HIGH,
+                         NETSPACE_V2_OE_LOW, NETSPACE_V2_OE_HIGH);
 
        /* Multi-Purpose Pins Functionality configuration */
        static const u32 kwmpp_config[] = {
@@ -80,11 +73,13 @@ int board_early_init_f(void)
 
 int board_init(void)
 {
+#ifdef CONFIG_MACH_TYPE
        /* Machine number */
        gd->bd->bi_arch_number = CONFIG_MACH_TYPE;
+#endif
 
        /* Boot parameters address */
-       gd->bd->bi_boot_params = kw_sdram_bar(0) + 0x100;
+       gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100;
 
        return 0;
 }
@@ -93,10 +88,10 @@ int board_init(void)
 int misc_init_r(void)
 {
 #if defined(CONFIG_CMD_I2C) && defined(CONFIG_SYS_I2C_EEPROM_ADDR)
-       if (!getenv("ethaddr")) {
+       if (!env_get("ethaddr")) {
                uchar mac[6];
                if (lacie_read_mac_address(mac) == 0)
-                       eth_setenv_enetaddr("ethaddr", mac);
+                       eth_env_set_enetaddr("ethaddr", mac);
        }
 #endif
        return 0;
@@ -108,9 +103,9 @@ int misc_init_r(void)
 void reset_phy(void)
 {
 #if defined(CONFIG_NETSPACE_LITE_V2) || defined(CONFIG_NETSPACE_MINI_V2)
-       mv_phy_88e1318_init("egiga0", 0);
+       mv_phy_88e1318_init("ethernet-controller@72000", 0);
 #else
-       mv_phy_88e1116_init("egiga0", 8);
+       mv_phy_88e1116_init("ethernet-controller@72000", 8);
 #endif
 }
 #endif
@@ -118,7 +113,7 @@ void reset_phy(void)
 #if defined(CONFIG_KIRKWOOD_GPIO)
 /* Return GPIO button status */
 static int
-do_read_button(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+do_read_button(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 {
        return kw_gpio_get_value(NETSPACE_V2_GPIO_BUTTON);
 }
This page took 0.030287 seconds and 4 git commands to generate.