env: Move env_set() to env.h
[oweals/u-boot.git] / board / silica / pengwyn / board.c
index a553129d29df6fca89faee6e2501d4ba0c38f37f..dc10b76160afc4e45af0ef0197921ff4d866f2be 100644 (file)
@@ -1,12 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * board.c
  *
  * Copyright (C) 2013 Lothar Felten <lothar.felten@gmail.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <env.h>
+#include <environment.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/ddr_defs.h>
@@ -141,13 +142,7 @@ static struct cpsw_slave_data cpsw_slaves[] = {
        {
                .slave_reg_ofs  = 0x208,
                .sliver_reg_ofs = 0xd80,
-               .phy_id         = 0,
-               .phy_if         = PHY_INTERFACE_MODE_MII,
-       },
-       {
-               .slave_reg_ofs  = 0x308,
-               .sliver_reg_ofs = 0xdc0,
-               .phy_id         = 1,
+               .phy_addr       = 1,
                .phy_if         = PHY_INTERFACE_MODE_MII,
        },
 };
@@ -177,7 +172,7 @@ int board_eth_init(bd_t *bis)
        uint8_t mac_addr[6];
        uint32_t mac_hi, mac_lo;
 
-       if (!eth_getenv_enetaddr("ethaddr", mac_addr)) {
+       if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
                printf("<ethaddr> not set. Reading from E-fuse\n");
                /* try reading mac address from efuse */
                mac_lo = readl(&cdev->macid0l);
@@ -189,8 +184,8 @@ int board_eth_init(bd_t *bis)
                mac_addr[4] = mac_lo & 0xFF;
                mac_addr[5] = (mac_lo & 0xFF00) >> 8;
 
-               if (is_valid_ether_addr(mac_addr))
-                       eth_setenv_enetaddr("ethaddr", mac_addr);
+               if (is_valid_ethaddr(mac_addr))
+                       eth_env_set_enetaddr("ethaddr", mac_addr);
                else
                        return n;
        }