arm64: dts: rk3399: Sync v5.7-rc1 from Linux
[oweals/u-boot.git] / arch / arm / mach-davinci / misc.c
index e18bdfc729b7ad3ae0b57a01f3b1f76edfd033cb..3e5185261c7611e753024d1203ef1afe4786c824 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Miscelaneous DaVinci functions.
  *
@@ -5,12 +6,12 @@
  * 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 <env.h>
 #include <i2c.h>
+#include <init.h>
 #include <net.h>
 #include <asm/arch/hardware.h>
 #include <asm/io.h>
@@ -28,10 +29,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 +52,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 */
@@ -66,7 +69,6 @@ err:
 /*
  * Set the mii mode as MII or RMII
  */
-#if defined(CONFIG_SOC_DA8XX)
 void davinci_emac_mii_mode_sel(int mode_sel)
 {
        int val;
@@ -78,7 +80,7 @@ void davinci_emac_mii_mode_sel(int mode_sel)
                val |= (1 << 8);
        writel(val, &davinci_syscfg_regs->cfgchip3);
 }
-#endif
+
 /*
  * If there is no MAC address in the environment, then it will be initialized
  * (silently) from the value in the EEPROM.
@@ -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,15 +99,13 @@ 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);
 }
 #endif /* CONFIG_DRIVER_TI_EMAC */
 
-#if defined(CONFIG_SOC_DA8XX)
-#ifndef CONFIG_USE_IRQ
 void irq_init(void)
 {
        /*
@@ -120,7 +120,6 @@ void irq_init(void)
        writel(0xffffffff, &davinci_aintc_regs->ecr2);
        writel(0xffffffff, &davinci_aintc_regs->ecr3);
 }
-#endif
 
 /*
  * Enable PSC for various peripherals.
@@ -135,4 +134,3 @@ int da8xx_configure_lpsc_items(const struct lpsc_resource *item,
 
        return 0;
 }
-#endif