]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
driver: net: fsl-mc: Update fsl_mc_ldpaa_exit() path
authorYogesh Gaur <yogeshnarayan.gaur@nxp.com>
Thu, 27 Apr 2017 04:44:16 +0000 (10:14 +0530)
committerYork Sun <york.sun@nxp.com>
Tue, 23 May 2017 16:24:59 +0000 (09:24 -0700)
Earlier when MC is loaded but DPL is not deployed results in FDT
fix-up code execution hangs. For this case now print message on
console and return success instead of return -ENODEV. This update
allows fdt fixup to continue execution.

Signed-off-by: Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
Signed-off-by: Priyanka Jain <Priyanka.jain@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
drivers/net/fsl-mc/mc.c

index 9f69d75a89d0dbb40b5fa16deb92793909d0c73f..0a74e3e42e49f1110a0d53df7155d651484fac2f 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2017 NXP Semiconductors
  * Copyright (C) 2014 Freescale Semiconductor
  *
  * SPDX-License-Identifier:    GPL-2.0+
@@ -1201,6 +1202,7 @@ err:
 int fsl_mc_ldpaa_exit(bd_t *bd)
 {
        int err = 0;
+       bool is_dpl_apply_status = false;
 
        if (bd && mc_lazy_dpl_addr && !fsl_mc_ldpaa_exit(NULL)) {
                mc_apply_dpl(mc_lazy_dpl_addr);
@@ -1211,14 +1213,18 @@ int fsl_mc_ldpaa_exit(bd_t *bd)
        if (bd && get_mc_boot_status() != 0)
                return 0;
 
-       if (bd && !get_mc_boot_status() && get_dpl_apply_status() == -1) {
-               printf("ERROR: fsl-mc: DPL is not applied\n");
-               err = -ENODEV;
-               return err;
-       }
+       /* If DPL is deployed, set is_dpl_apply_status as TRUE. */
+       if (!get_dpl_apply_status())
+               is_dpl_apply_status = true;
 
-       if (bd && !get_mc_boot_status() && !get_dpl_apply_status())
-               return err;
+       /*
+        * For case MC is loaded but DPL is not deployed, return success and
+        * print message on console. Else FDT fix-up code execution hanged.
+        */
+       if (bd && !get_mc_boot_status() && !is_dpl_apply_status) {
+               printf("fsl-mc: DPL not deployed, DPAA2 ethernet not work\n");
+               return 0;
+       }
 
        err = dpbp_exit();
        if (err < 0) {