]> git.sur5r.net Git - u-boot/blobdiff - arch/arm/cpu/armv7/ls102xa/fdt.c
libfdt: move headers to <linux/libfdt.h> and <linux/libfdt_env.h>
[u-boot] / arch / arm / cpu / armv7 / ls102xa / fdt.c
index 71a175392fd1c063e9149187694c0d7b8eb9f249..eb3e287b7de9f5da3ea145d83814f3b5a36010db 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #include <common.h>
-#include <libfdt.h>
+#include <linux/libfdt.h>
 #include <fdt_support.h>
 #include <asm/io.h>
 #include <asm/processor.h>
@@ -29,29 +29,26 @@ void ft_fixup_enet_phy_connect_type(void *fdt)
        char phy[16];
        int phy_node;
        int i = 0;
-       int enet_id = 0;
        uint32_t ph;
-
-       while ((dev = eth_get_dev_by_index(i++)) != NULL) {
-               if (strstr(dev->name, "eTSEC1"))
-                       enet_id = 0;
-               else if (strstr(dev->name, "eTSEC2"))
-                       enet_id = 1;
-               else if (strstr(dev->name, "eTSEC3"))
-                       enet_id = 2;
-               else
+       char *name[3] = { "eTSEC1", "eTSEC2", "eTSEC3" };
+
+       for (; i < ARRAY_SIZE(name); i++) {
+               dev = eth_get_dev_by_name(name[i]);
+               if (dev) {
+                       sprintf(enet, "ethernet%d", i);
+                       sprintf(phy, "enet%d_rgmii_phy", i);
+               } else {
                        continue;
+               }
 
                priv = dev->priv;
                if (priv->flags & TSEC_SGMII)
                        continue;
 
-               sprintf(enet, "ethernet%d", enet_id);
                enet_path = fdt_get_alias(fdt, enet);
                if (!enet_path)
                        continue;
 
-               sprintf(phy, "enet%d_rgmii_phy", enet_id);
                phy_path = fdt_get_alias(fdt, phy);
                if (!phy_path)
                        continue;
@@ -97,8 +94,6 @@ void ft_cpu_setup(void *blob, bd_t *bd)
        }
 #endif
 
-       fdt_fixup_ethernet(blob);
-
        off = fdt_node_offset_by_prop_value(blob, -1, "device_type", "cpu", 4);
        while (off != -FDT_ERR_NOTFOUND) {
                val = gd->cpu_clk;
@@ -170,7 +165,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
        do_fixup_by_compat_u32(blob, "fsl, ls1021a-flexcan",
                               "clock-frequency", busclk / 2, 1);
 
-#ifdef CONFIG_QSPI_BOOT
+#if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI)
        off = fdt_node_offset_by_compat_reg(blob, FSL_IFC_COMPAT,
                                            CONFIG_SYS_IFC_ADDR);
        fdt_set_node_status(blob, off, FDT_STATUS_DISABLED, 0);