Merge branch 'master' of git://git.denx.de/u-boot-sunxi
[oweals/u-boot.git] / arch / arm / mach-davinci / misc.c
index e18bdfc729b7ad3ae0b57a01f3b1f76edfd033cb..919041521b95cb619940dc929e4d4da9e31f8ed8 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Miscelaneous DaVinci functions.
  *
@@ -5,11 +6,10 @@
  * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
  * Copyright (C) 2008 Lyrtech <www.lyrtech.com>
  * Copyright (C) 2004 Texas Instruments.
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
+#include <environment.h>
 #include <i2c.h>
 #include <net.h>
 #include <asm/arch/hardware.h>
@@ -28,10 +28,12 @@ int dram_init(void)
        return 0;
 }
 
-void dram_init_banksize(void)
+int dram_init_banksize(void)
 {
        gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
        gd->bd->bi_dram[0].size = gd->ram_size;
+
+       return 0;
 }
 #endif
 
@@ -49,7 +51,7 @@ int dvevm_read_mac_address(uint8_t *buf)
                goto i2cerr;
 
        /* Check that MAC address is valid. */
-       if (!is_valid_ether_addr(buf))
+       if (!is_valid_ethaddr(buf))
                goto err;
 
        return 1; /* Found */
@@ -88,7 +90,7 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
        uint8_t env_enetaddr[6];
        int ret;
 
-       ret = eth_getenv_enetaddr_by_index("eth", 0, env_enetaddr);
+       ret = eth_env_get_enetaddr_by_index("eth", 0, env_enetaddr);
        if (!ret) {
                /*
                 * There is no MAC address in the environment, so we
@@ -97,7 +99,7 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
                debug("### Setting environment from EEPROM MAC address = "
                        "\"%pM\"\n",
                        env_enetaddr);
-               ret = !eth_setenv_enetaddr("ethaddr", rom_enetaddr);
+               ret = !eth_env_set_enetaddr("ethaddr", rom_enetaddr);
        }
        if (!ret)
                printf("Failed to set mac address from EEPROM: %d\n", ret);
@@ -105,7 +107,6 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
 #endif /* CONFIG_DRIVER_TI_EMAC */
 
 #if defined(CONFIG_SOC_DA8XX)
-#ifndef CONFIG_USE_IRQ
 void irq_init(void)
 {
        /*
@@ -120,7 +121,6 @@ void irq_init(void)
        writel(0xffffffff, &davinci_aintc_regs->ecr2);
        writel(0xffffffff, &davinci_aintc_regs->ecr3);
 }
-#endif
 
 /*
  * Enable PSC for various peripherals.