]> Git Repo - J-u-boot.git/blobdiff - board/toradex/apalis-tk1/apalis-tk1.c
Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""
[J-u-boot.git] / board / toradex / apalis-tk1 / apalis-tk1.c
index 2769b54601099e5e6e4eb7bf8a256a10e3aa1896..ee87d9f4145f30162a56e5b4f2bb5cb9e8e4b8d7 100644 (file)
 #include <asm/arch/gpio.h>
 #include <asm/arch/pinmux.h>
 #include <env_internal.h>
+#include <fdt_support.h>
 #include <pci_tegra.h>
 #include <linux/delay.h>
+#include <linux/printk.h>
 #include <power/as3722.h>
 #include <power/pmic.h>
 
@@ -71,9 +73,6 @@ int arch_misc_init(void)
                        env_set("fdt_module", FDT_MODULE_V1_0);
                        printf("patching fdt_module to " FDT_MODULE_V1_0
                               " for older V1.0 and V1.1 HW\n");
-#ifndef CONFIG_ENV_IS_NOWHERE
-                       env_save();
-#endif
                }
 
                /* activate USB power enable GPIOs */
@@ -92,16 +91,27 @@ int arch_misc_init(void)
        return 0;
 }
 
-int checkboard(void)
-{
-       puts("Model: Toradex Apalis TK1 2GB\n");
-
-       return 0;
-}
-
 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
+       u8 enetaddr[6];
+
+       /* MAC addr */
+       if (eth_env_get_enetaddr("ethaddr", enetaddr)) {
+               int err = fdt_find_and_setprop(blob,
+                                              "/pcie@1003000/pci@2,0/ethernet@0,0",
+                                              "local-mac-address", enetaddr, 6, 0);
+
+               /* Older device trees might have used a different node name */
+               if (err < 0)
+                       err = fdt_find_and_setprop(blob,
+                                                  "/pcie@1003000/pci@2,0/pcie@0",
+                                                  "local-mac-address", enetaddr, 6, 0);
+
+               if (err >= 0)
+                       puts("   MAC address updated...\n");
+       }
+
        return ft_common_board_setup(blob, bd);
 }
 #endif
This page took 0.03077 seconds and 4 git commands to generate.