]> git.sur5r.net Git - u-boot/commitdiff
drivers: fsl-mc: Return error for major version mismatch
authorPrabhakar Kushwaha <prabhakar@freescale.com>
Thu, 2 Jul 2015 05:59:01 +0000 (11:29 +0530)
committerYork Sun <yorksun@freescale.com>
Mon, 20 Jul 2015 18:44:37 +0000 (11:44 -0700)
Management complex major version should match to the firmware present in flash.

Return error during mismatch of major version.

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: York Sun <yorksun@freescale.com>
drivers/net/fsl-mc/mc.c

index 20945951bb79b23ac13550ebddeca2b9e22c8a91..b2babfbdc72bbd241b40f4d91bfc11eba9d513a0 100644 (file)
@@ -518,9 +518,14 @@ int mc_init(void)
                goto out;
        }
 
-       if (MC_VER_MAJOR != mc_ver_info.major)
+       if (MC_VER_MAJOR != mc_ver_info.major) {
                printf("fsl-mc: ERROR: Firmware major version mismatch (found: %d, expected: %d)\n",
                       mc_ver_info.major, MC_VER_MAJOR);
+               printf("fsl-mc: Update the Management Complex firmware\n");
+
+               error = -ENODEV;
+               goto out;
+       }
 
        if (MC_VER_MINOR != mc_ver_info.minor)
                printf("fsl-mc: WARNING: Firmware minor version mismatch (found: %d, expected: %d)\n",
@@ -541,7 +546,7 @@ int mc_init(void)
 
 out:
        if (error != 0)
-               mc_boot_status = -error;
+               mc_boot_status = error;
        else
                mc_boot_status = 0;