Merge tag 'ti-v2020.07-rc3' of https://gitlab.denx.de/u-boot/custodians/u-boot-ti
[oweals/u-boot.git] / drivers / net / altera_tse.c
index 5692fe9d4a3b54cf7a7dd08d40eaea5aaf057f5a..93b26da39261093fbc7dfd7db9dffeb5d63f6fed 100644 (file)
@@ -9,14 +9,16 @@
  * published by the Free Software Foundation.
  */
 #include <common.h>
+#include <cpu_func.h>
 #include <dm.h>
 #include <errno.h>
 #include <fdt_support.h>
+#include <log.h>
 #include <memalign.h>
 #include <miiphy.h>
 #include <net.h>
 #include <asm/cache.h>
-#include <asm/dma-mapping.h>
+#include <linux/dma-mapping.h>
 #include <asm/io.h>
 #include "altera_tse.h"
 
@@ -417,7 +419,7 @@ static int tse_mdio_init(const char *name, struct altera_tse_priv *priv)
 
        bus->read = tse_mdio_read;
        bus->write = tse_mdio_write;
-       snprintf(bus->name, sizeof(bus->name), name);
+       snprintf(bus->name, sizeof(bus->name), "%s", name);
 
        bus->priv = (void *)priv;
 
@@ -576,7 +578,7 @@ static int altera_tse_probe(struct udevice *dev)
        struct eth_pdata *pdata = dev_get_platdata(dev);
        struct altera_tse_priv *priv = dev_get_priv(dev);
        void *blob = (void *)gd->fdt_blob;
-       int node = dev->of_offset;
+       int node = dev_of_offset(dev);
        const char *list, *end;
        const fdt32_t *cell;
        void *base, *desc_mem = NULL;
@@ -595,7 +597,7 @@ static int altera_tse_probe(struct udevice *dev)
         * match with reg-names.
         */
        parent = fdt_parent_offset(blob, node);
-       of_bus_default_count_cells(blob, parent, &addrc, &sizec);
+       fdt_support_default_count_cells(blob, parent, &addrc, &sizec);
        list = fdt_getprop(blob, node, "reg-names", &len);
        if (!list)
                return -ENOENT;
@@ -608,7 +610,7 @@ static int altera_tse_probe(struct udevice *dev)
                addr = fdt_translate_address((void *)blob,
                                             node, cell + idx);
                size = fdt_addr_to_cpu(cell[idx + addrc]);
-               base = ioremap(addr, size);
+               base = map_physmem(addr, size, MAP_NOCACHE);
                len = strlen(list);
                if (strcmp(list, "control_port") == 0)
                        priv->mac_dev = base;
@@ -676,7 +678,8 @@ static int altera_tse_ofdata_to_platdata(struct udevice *dev)
        const char *phy_mode;
 
        pdata->phy_interface = -1;
-       phy_mode = fdt_getprop(gd->fdt_blob, dev->of_offset, "phy-mode", NULL);
+       phy_mode = fdt_getprop(gd->fdt_blob, dev_of_offset(dev), "phy-mode",
+                              NULL);
        if (phy_mode)
                pdata->phy_interface = phy_get_interface_by_name(phy_mode);
        if (pdata->phy_interface == -1) {